zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
//
//  PBModelCategoryViewController.m
//  IphoneBIMe
//
//  Created by zjf on 2018/7/23.
//  Copyright © 2018年 ProBIM. All rights reserved.
//
 
#import "PBModelCategoryViewController.h"
#import "PBModelsModel.h"
#import "PBPhaseLabel.h"
#import "PBViewsModel.h"
#import "PBDrawingsModel.h"
#import "PBViewPointModel.h"
#import "PBTextTableViewCell.h"
#import "PBImageTableViewCell.h"
#import "PBLoadModelDisplayController.h"
#import "PBDrawingsShowController.h"
#import "PBViewPointDetailsController.h"
#import "PBMoreTabViewController.h"
#import "PBAlertController.h"
#import "PBMoreFunctionView.h"
#import "PBAddIssueController.h"
#import "PBNavigationController.h"
#import "PBPromptView.h"
#import "PBShareView.h"
#import "PBProjectModel.h"
static NSString *const TextCellID = @"TextCellID";
static NSString *const ImageCellID = @"ImageCellID";
 
@interface PBModelCategoryViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UIScrollView *phaseScrollView;
@property (nonatomic, strong) NSArray *phaseArr;
@property (nonatomic, strong) NSMutableArray *labelM;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *dataList;
@property (nonatomic, assign) NSInteger index;
@property (nonatomic, strong) PBMoreFunctionView *moreFunctionView;
@property (nonatomic, strong) PBPromptView *promptView;
@property (nonatomic, strong) PBShareView *shareView;
@end
 
@implementation PBModelCategoryViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.f) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }
    [self setupNav];
    [self setupUI];
    [self loadData:0];
}
/// 创建频道标签
- (void)createChannelLabel{
    CGFloat labelW = self.view.width / 4;
    CGFloat labelH = self.phaseScrollView.bounds.size.height;
    for (int i = 0; i < self.phaseArr.count; i++) {
        PBPhaseLabel *label = [[PBPhaseLabel alloc] init];
        [self.phaseScrollView addSubview:label];
        CGFloat labelX = labelW * i;
        label.frame = CGRectMake(labelX, 0, labelW, labelH);
        self.phaseScrollView.contentSize = CGSizeMake(labelW * self.phaseArr.count, 0);
        label.text = self.phaseArr[i];
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(labelTapClick:)];
        [label addGestureRecognizer:tap];
        label.tag = i;
        label.userInteractionEnabled = YES;
        [self.labelM addObject:label];
        if (i == 0) {
            //            label.scale = 1.0;
            label.isSelectLabel = YES;
        }else {
            label.isSelectLabel = NO;
        }
    }
}
 
#pragma mark - 频道标签的点击事件
- (void)labelTapClick:(UITapGestureRecognizer *)tap {
    PBPhaseLabel *selected_label = (PBPhaseLabel *)tap.view;
    CGFloat labelOffsetX = selected_label.center.x - (self.view.bounds.size.width * 0.5);
    CGFloat minOffsetX = 0;
    CGFloat maxOffsetX = self.phaseScrollView.contentSize.width - self.view.bounds.size.width;
    if (maxOffsetX > minOffsetX) {
        if (labelOffsetX < minOffsetX) {
            labelOffsetX = 0;
        } else if (labelOffsetX > maxOffsetX) {
            labelOffsetX = maxOffsetX;
        }
        [self.phaseScrollView setContentOffset:CGPointMake(labelOffsetX, 0) animated:YES];
    }
#pragma mark - 点击频道标签剧中时,更新模型
    self.index = selected_label.tag;
    [self loadData:selected_label.tag];
#pragma mark - 点击label时选中的缩放比例最大,其余的保持
    NSInteger index = selected_label.tag;
    for (int i = 0; i < self.labelM.count; ++i) {
        PBPhaseLabel *label = self.labelM[i];
        if (index == i) {
            //            label.scale = 1.0;
            label.isSelectLabel = YES;
        } else {
            //            label.scale = 0;
            label.isSelectLabel = NO;
        }
    }
}
- (void)loadData:(NSInteger)index {
    self.dataList = nil;
    [self.tableView reloadData];
    self.promptView.hidden = YES;
//    [YJProgressHUD showCustomAnimation:@"" inview:self.view];
    [YJProgressHUD showProgress:@"" inView:self.view];
    if (index == 0) {
        [[PBNetworkTools sharedTools] RequestGetAllViewsWithProjectID:_modelsModel.ProjectID andModelID:_modelsModel.ID andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
            if (error) {
                NSLog(@"%@",error);
                [YJProgressHUD showMessage:@"加载失败" inView:self.view];
                return;
            }
            [YJProgressHUD hide];
            NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
            NSArray *arr = [NSArray yy_modelArrayWithClass:[PBViewsModel class] json:str];
            self.dataList = arr.mutableCopy;
            if (self.dataList.count == 0) {
                self.promptView.hidden = NO;
            }else {
                [self.tableView reloadData];
            }
        }];
    }else if (index == 1) {
        [[PBNetworkTools sharedTools] RequestGetFIleWithProjectID:_modelsModel.ProjectID andModelID:_modelsModel.ID andVersionNO:@"" andFileType:@"PlanView" andFileName:@"sheets" andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
            if (error) {
                NSLog(@"%@",error);
                [YJProgressHUD showMessage:@"加载失败" inView:self.view];
                return;
            }
            [YJProgressHUD hide];
            NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
            NSDictionary *dict = [NSString convertTodictionaryOrArr:str];
            NSMutableArray *arrM = [[NSMutableArray alloc] init];
            for (NSDictionary *obj in [dict valueForKey:@"sheets"]) {
                PBDrawingsModel *model = [PBDrawingsModel yy_modelWithDictionary:obj];
                [arrM addObject:model];
            }
            self.dataList = arrM;
            if (self.dataList.count == 0) {
                self.promptView.hidden = NO;
            }else {
                [self.tableView reloadData];
            }
        }];
    }else if (index == 2) {
        [[PBNetworkTools sharedTools] RequestGetAllViewpointWithProjectId:_modelsModel.ProjectID andModelId:_modelsModel.ID andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
            if (error) {
                NSLog(@"%@",error);
                [YJProgressHUD showMessage:@"加载失败" inView:self.view];
                return;
            }
            [YJProgressHUD hide];
            NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
            NSArray *arr = [NSArray yy_modelArrayWithClass:[PBViewPointModel class] json:str];
            NSMutableArray *arrM = [[NSMutableArray alloc] init];
            for (PBViewPointModel *viewPointModel in arr) {
                if ([viewPointModel.Type isEqualToString:@"0"]) {
                    [arrM addObject:viewPointModel];
                }
            }
            self.dataList =arrM;
            if (self.dataList.count == 0) {
                self.promptView.hidden = NO;
            }else {
                [self.tableView reloadData];
            }
        }];
    }else {
        [[PBNetworkTools sharedTools] RequestGetAllViewpointWithProjectId:_modelsModel.ProjectID andModelId:_modelsModel.ID andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
            if (error) {
                NSLog(@"%@",error);
                [YJProgressHUD showMessage:@"加载失败" inView:self.view];
                return;
            }
            [YJProgressHUD hide];
            NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
            NSArray *arr = [NSArray yy_modelArrayWithClass:[PBViewPointModel class] json:str];
            NSMutableArray *arrM = [[NSMutableArray alloc] init];
            for (PBViewPointModel *viewPointModel in arr) {
                if ([viewPointModel.Type isEqualToString:@"1"]) {
                    [arrM addObject:viewPointModel];
                }
            }
            self.dataList = arrM;
            if (self.dataList.count == 0) {
                self.promptView.hidden = NO;
            }else {
                [self.tableView reloadData];
            }
        }];
    }
}
 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.dataList.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    id model = self.dataList[indexPath.row];
    if (self.index == 0) {
        PBTextTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:TextCellID forIndexPath:indexPath];
        cell.viewsModel = (PBViewsModel *)model;
        return cell;
    }else {
        PBImageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ImageCellID forIndexPath:indexPath];
        if (self.index == 1) {
            cell.drawingsModel = (PBDrawingsModel *)model;
        }else {
            cell.viewPointModel = (PBViewPointModel *)model;
        }
        return cell;
    }
}
 
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    id model = self.dataList[indexPath.row];
    if (self.index == 0) {
        PBLoadModelDisplayController *modelDisplayVC = [[PBLoadModelDisplayController alloc] init];
        modelDisplayVC.projectModel = _projectModel;
        modelDisplayVC.modelID = _modelsModel.ID;
        PBViewsModel *viewsModel = (PBViewsModel *)model;
        modelDisplayVC.viewID = viewsModel.ID;
        [self.navigationController pushViewController:modelDisplayVC animated:YES];
    }else if (self.index == 1) {
        PBDrawingsShowController *drawingsShowVC = [[PBDrawingsShowController alloc] init];
        drawingsShowVC.modelsModel = _modelsModel;
        drawingsShowVC.drawingsModel = (PBDrawingsModel *)model;
        [self.navigationController pushViewController:drawingsShowVC animated:YES];
    }else {
        PBViewPointDetailsController *viewPointDetailsVC = [[PBViewPointDetailsController alloc] init];
        viewPointDetailsVC.updataDefaultViewPointBlock = ^{
            [self loadData:self.index];
        };
        viewPointDetailsVC.projectModel = _projectModel;
        viewPointDetailsVC.modelsModel = _modelsModel;
        viewPointDetailsVC.viewPointModel = (PBViewPointModel *)model;
        [self.navigationController pushViewController:viewPointDetailsVC animated:YES];                                                                     
    }
}
 
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    id model = self.dataList[indexPath.row];
    UITableViewRowAction *shareAction = [UITableViewRowAction rowActionWithStyle:(UITableViewRowActionStyleDestructive) title:@"分享" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
        [self shareWithModel:self.dataList[indexPath.row]];
    }];
    shareAction.backgroundColor = WarningColor;
    UITableViewRowAction *setDefaultAction =[UITableViewRowAction rowActionWithStyle:(UITableViewRowActionStyleDestructive) title:@"设为默认" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
        [self creatAlertControllerWithIsDelete:NO andIsViews:YES andData:model andIndex:indexPath];
    }];
    setDefaultAction.backgroundColor = DisableColor;
    
    UITableViewRowAction *deleteAction =[UITableViewRowAction rowActionWithStyle:(UITableViewRowActionStyleDestructive) title:@"删除" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
        [self creatAlertControllerWithIsDelete:YES andIsViews:NO andData:model andIndex:indexPath];
    }];
    deleteAction.backgroundColor = ErrorColor;
    
    UITableViewRowAction *moreAction =[UITableViewRowAction rowActionWithStyle:(UITableViewRowActionStyleDestructive) title:@"更多" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
        [self moreWith:(PBViewPointModel *)model andIndexPath:indexPath];
    }];
    moreAction.backgroundColor = DisableColor;
    switch (self.index) {
        case 0:{
            PBViewsModel *viewsModel = (PBViewsModel *)model;
            if (viewsModel.IsDefault) {
                return @[shareAction];
            }else {
                return @[shareAction, setDefaultAction];
            }
            break;
        }
        case 2:{
            return @[shareAction, moreAction];
            break;
        }
        default:
            return @[deleteAction, shareAction];
            break;
    }
}
//分享
- (void)shareWithModel:(id)model {
    NSString *title; NSString *modelID; NSString *viewID; NSString *viewPointID; NSString *desc; UIImage *image;
    if (self.index == 0) {
        title = @"视图";
        PBViewsModel *viewsModel = (PBViewsModel *)model;
        desc = viewsModel.Name;
        modelID = viewsModel.ModelID;
        viewID = viewsModel.ID;
        viewPointID = @"";
        image = nil;
    }else {
        if (self.index == 2) {
            title = @"视点";
        }else {
            title = @"批注";
        }
        PBViewPointModel *viewPointModel = (PBViewPointModel *)model;
        desc = viewPointModel.Name;
        modelID = viewPointModel.ModelID;
        viewID = @"";
        viewPointID = viewPointModel.ID;
        NSRange range = [viewPointModel.Snapshot rangeOfString:@"base64,"];
        NSString *base64 = [viewPointModel.Snapshot substringFromIndex:range.location + range.length];
        image = [NSString imageDecoding:base64];
    }
    [PBKeyWindow addSubview:self.shareView];
    self.shareView.modelID = modelID;
    self.shareView.desc = desc;
    self.shareView.viewID = viewID;
    self.shareView.viewPointID = viewPointID;
    self.shareView.title = title;
    self.shareView.image = image;
    [self.shareView show];
}
 
- (PBMoreFunctionView *)moreFunctionView {
    if (_moreFunctionView == nil) {
        _moreFunctionView = [[PBMoreFunctionView alloc]initWithFrame:[UIScreen mainScreen].bounds];
        _moreFunctionView.visualViewHeight = 204;
        _moreFunctionView.dataArr = @[@"删除", @"设为默认"];
        _moreFunctionView.title = @"模型名称";
    }
    return _moreFunctionView;
}
- (void)moreWith:(PBViewPointModel *)viewPointModel andIndexPath:(NSIndexPath *)indexPath {
    [PBKeyWindow addSubview:self.moreFunctionView];
    [self.moreFunctionView show];
    __weak typeof(self) weakSelf = self;
    self.moreFunctionView.seletedIndexBlock = ^(NSInteger index) {
        if (index == 0) {
            [weakSelf creatAlertControllerWithIsDelete:YES andIsViews:NO andData:viewPointModel andIndex:indexPath];
        }else {
            [weakSelf creatAlertControllerWithIsDelete:NO andIsViews:NO andData:viewPointModel andIndex:indexPath];
        }
    };
}
 
- (void)creatAlertControllerWithIsDelete:(BOOL)isDelete andIsViews:(BOOL)isViews andData:(id)model andIndex:(NSIndexPath *)indexPath {
    NSString *message;
    if (isDelete) {
        PBViewPointModel *viewPointModel = (PBViewPointModel *)model;
        NSString * str = [viewPointModel.Type isEqualToString:@"0"] ? @"视点" : @"批注";
        message = [NSString stringWithFormat:@"您确定要删除此%@",str];
    }else {
        NSString *str = isViews == YES ? @"视图" : @"视点";
        message = [NSString stringWithFormat:@"您确定把此%@设为默认%@",str, str];
    }
    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:message preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *cancelAction  = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
    UIAlertAction *determineAction  = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
        if (isDelete) {
            [self deleteViewPointWith:(PBViewPointModel *)model andIndexPath:indexPath];
        }else {
            if (isViews) {
                [self setDefaultViewsWith:(PBViewsModel *)model];
            }else {
                [self setDefaultViewPointWith:(PBViewPointModel *)model];
            }
        }
    }];
    [alertVC addAction:cancelAction];
    [alertVC addAction:determineAction];
    [self presentViewController:alertVC animated:YES completion:nil];
}
 
- (void)deleteViewPointWith:(PBViewPointModel *)viewPointModel andIndexPath:(NSIndexPath *)indexPath {
    [YJProgressHUD showProgress:@"" inView:self.view];
    [[PBNetworkTools sharedTools] RequestDeleteViewpointWithProjectID:_modelsModel.ProjectID andViewpointID:viewPointModel.ID andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
            NSLog(@"%@",error);
            [YJProgressHUD showFailed:@"删除失败" inview:self.view];
            return;
        }
        NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        NSLog(@"%@",str);
        if ([str isEqualToString:@"true"]) {
            [YJProgressHUD hide];
            [self.dataList removeObjectAtIndex:indexPath.row];
            [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
            [self.tableView reloadData];
        }else {
            [YJProgressHUD showFailed:@"删除失败" inview:self.view];
        }
    }];
}
- (void)setDefaultViewsWith:(PBViewsModel *)viewsModel {
    [YJProgressHUD showProgress:@"" inView:self.view];
    [[PBNetworkTools sharedTools] RequestSetDefaultViewsWithProjectID:_modelsModel.ProjectID andModelId:_modelsModel.ID andViewID:viewsModel.ID andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
            NSLog(@"%@",error);
            [YJProgressHUD showFailed:@"设置默认视图失败" inview:self.view];
            return;
        }
        [YJProgressHUD hide];
        NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        NSLog(@"%@",str);
        if ([str isEqualToString:@"\"\""]) {
            [self loadData:self.index];
        }else {
            [YJProgressHUD showFailed:@"设置默认视图失败" inview:self.view];
        }
    }];
}
- (void)setDefaultViewPointWith:(PBViewPointModel *)viewPointModel {
    [YJProgressHUD showProgress:@"" inView:self.view];
    [[PBNetworkTools sharedTools] RequestSetDefaultViewpointWithProjectID:_modelsModel.ProjectID andModelId:_modelsModel.ID andViewpointID:viewPointModel.ID andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
            NSLog(@"%@",error);
            [YJProgressHUD showFailed:@"设置默认视点失败" inview:self.view];
            return;
        }
        [YJProgressHUD hide];
        NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        NSLog(@"%@",str);
        if ([str isEqualToString:@"\"\""]) {
            [self loadData:self.index];
        }else {
            [YJProgressHUD showFailed:@"设置默认视点失败" inview:self.view];
        }
    }];
}
 
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    if (self.index == 1) {
        return NO;
    }else {
        return YES;
    }
}
 
- (void)setupNav {
    self.title = _modelsModel.Name;
    PBBackNavItem *backNav = [PBBackNavItem backNacItem];
    backNav.title = @"模型";
    [backNav addTarget:self action:@selector(backItemAction) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *backNavItem = [[UIBarButtonItem alloc] initWithCustomView:backNav];
    self.navigationItem.leftBarButtonItem = backNavItem;
}
 
- (void)backItemAction {
    [self.navigationController popViewControllerAnimated:YES];
}
 
- (void)setupUI {
    self.view.backgroundColor = [UIColor z_colorWithR:239 G:239 B:239];
    self.phaseScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 43)];
    self.phaseScrollView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.phaseScrollView];
    self.tableView = [[UITableView alloc] init];
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    self.tableView.rowHeight = 70;
    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    [self.tableView registerClass:[PBTextTableViewCell class] forCellReuseIdentifier:TextCellID];
    [self.tableView registerClass:[PBImageTableViewCell class] forCellReuseIdentifier:ImageCellID];
    [self.view addSubview:self.tableView];
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.phaseScrollView.mas_bottom).offset(1);
        make.left.right.bottom.equalTo(self.view);
    }];
    [self.view addSubview:self.promptView];
    [self.promptView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.tableView);
        make.bottom.left.right.equalTo(self.view);
    }];
    self.promptView.hidden = YES;
    [self createChannelLabel];
}
 
- (void)setModelsModel:(PBModelsModel *)modelsModel {
    _modelsModel = modelsModel;
}
- (NSMutableArray *)labelM {
    if (_labelM == nil) {
        _labelM = [NSMutableArray array];
    }
    return _labelM;
}
- (NSArray *)phaseArr {
    if (_phaseArr == nil) {
        _phaseArr = @[@"视图", @"二维图纸",@"视点", @"批注"];
    }
    return _phaseArr;
}
 
- (PBPromptView *)promptView {
    if (_promptView == nil) {
        _promptView = [[PBPromptView alloc] init];
        _promptView.imageV.image = [UIImage imageNamed:@"Model_category_empty"];
        _promptView.textL.text = @"暂无数据";
        _promptView.hidden = YES;
    }
    return _promptView;
}
 
- (PBShareView *)shareView {
    if (_shareView == nil) {
        _shareView  = [[PBShareView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        CGFloat height;
        if (IS_IPHONE_X) {
            height = 290.f + 34.f;
        }else {
            height = 290.f;
        }
        _shareView.visualViewHeight = height;
        _shareView.viewController = self;
        _shareView.projectID = self.projectModel.organizeid;
    }
    return _shareView;
}
 
 
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
 
/*
#pragma mark - Navigation
 
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
 
@end