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
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
//
//  PBCheckTaskViewController.m
//  IphoneBIMe
//
//  Created by zjf on 2020/8/18.
//  Copyright © 2020 ProBIM. All rights reserved.
//
 
#import "PBCheckTaskViewController.h"
#import "PBExamineAddModel.h"
#import "PBExamineListModel.h"
#import "PBExamineInputTableViewCell.h"
#import "PBEditTimeTableViewCell.h"
#import "PBListTableViewCell.h"
#import "PBCheckViewController.h"
#import "PBRoleModel.h"
#import "PBEditTextController.h"
#import "PBEditPersonView.h"
#import "PBEditTimeView.h"
#import "PBProjectModel.h"
#import "PBPersonModel.h"
#import "PBArtifactsViewController.h"
#import "PBComponentHierarchyView.h"
#import "PBTextInputTableViewCell.h"
#import "PBTopTitleTableViewCell.h"
#import "PBTimeChooseTableViewCell.h"
#import "PBPersonChooseTableViewCell.h"
#import "PBArtifactsListTableViewCell.h"
#import "MSSAutoresizeLabelFlow.h"
#import "PBRecordViewController.h"
#import "PBPersonListViewController.h"
#import "PBSelectedPersonController.h"
#import "PBEAddImageView.h"
#import "PBCheckHeaderView.h"
#import "PBVideoPlayViewController.h"
static NSString *const inputCellID = @"InputCellID";
static NSString *const titleCellID = @"titleCellID";
static NSString *const timeChooseCellID = @"timeChooseCellID";
static NSString *const personCellID = @"personCellID";
static NSString *const listCellID = @"listCellID";
 
@interface PBCheckTaskViewController ()<UITableViewDelegate, UITableViewDataSource, UIGestureRecognizerDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray<PBExamineAddModel *> *dataListM;
@property (nonatomic, strong) NSDictionary *examinDetailDic;
@property (nonatomic, strong) PBRoleModel *roleModel;
@property (nonatomic, assign) BOOL isEdit;
@property (nonatomic, strong) PBEditPersonView *editPersonView;
@property (nonatomic, strong) PBEditTimeView *editTimeView;;
@property (nonatomic, weak) UIButton *typeListBtn;
@property (nonatomic, strong) NSDictionary *typeDict;
@property (nonatomic, strong) PBComponentHierarchyView *componentHierarchyView;
@property (nonatomic, strong) UIView *backgroundView;
@property (nonatomic, strong) UIView *typeBackView;
@property (nonatomic, strong) MSSAutoresizeLabelFlow *typeListRecordV;
@property (nonatomic, assign) BOOL isCheck;
@property (nonatomic, strong) PBCheckHeaderView *tableheaderView1;
@end
 
@implementation PBCheckTaskViewController
 
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.isCheck = NO;
//    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.f) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.navigationController.interactivePopGestureRecognizer.enabled = NO;    //让rootView禁止滑动
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [PBNoteCenter addObserver:self selector:@selector(updateArtifacts:) name:PBNoteCenterUpdateArtifacts object:nil];
    [PBNoteCenter addObserver:self selector:@selector(updatePerson:) name:PBNoteCenterUpdatePerson object:nil];
    [self setupNav];
    [self loadData];
    [self loadRelevantData];
}
 
- (void)updateArtifacts:(NSNotification *)noti {
    PBExamineAddModel *examineAddModel = self.dataListM[6];
    examineAddModel.dataArr = noti.object;
    NSIndexPath *path = [NSIndexPath indexPathForRow:6 inSection:0];
    [self.tableView reloadRowsAtIndexPaths:@[path] withRowAnimation:UITableViewRowAnimationFade];
}
- (void)updatePerson:(NSNotification *)noti {
    if (self.isCheck) {
        return;
    }
    PBExamineAddModel *examineAddModel = self.dataListM[4];
    PBPersonModel *originalPersonModel = examineAddModel.personArr[0];
    examineAddModel.personArr = noti.object;
    NSIndexPath *path = [NSIndexPath indexPathForRow:4 inSection:0];
    if (examineAddModel.personArr.count > 0) {
        PBPersonModel *personModel = examineAddModel.personArr[0];
        if ([personModel.UserId isEqualToString:originalPersonModel.UserId]) {
            return;
        }
        [self ModifyMissionCheckerWithUserId:personModel.UserId andIndexPath:path andPersonModel:originalPersonModel];
    }
}
- (void)setupNav {
    self.view.backgroundColor = [UIColor whiteColor];
    NSString *btnTitle = @"-";
    if (self.typeArr.count > 0) {
        self.typeDict = self.typeArr[0];
        btnTitle = [NSString stringWithFormat:@"%@ ⋁",[self.typeDict valueForKey:@"aedt_name"]];
    }
    UIButton *typeListBtn = [[UIButton alloc] init];
    [typeListBtn setTitle:btnTitle forState:UIControlStateNormal];
    [typeListBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [typeListBtn setTitleColor:PBColor(169, 176, 185) forState:UIControlStateDisabled];
    [typeListBtn addTarget:self action:@selector(typeListShow) forControlEvents:UIControlEventTouchUpInside];
    self.typeListBtn = typeListBtn;
    self.navigationItem.titleView = typeListBtn;
    UIBarButtonItem *backNavItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Doc_preview_back"] style:UIBarButtonItemStylePlain target:self action:@selector(backItemAction)];
    self.navigationItem.leftBarButtonItem = backNavItem;
    UIBarButtonItem *stateNavItem = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:self action:nil];
    [stateNavItem setImage:[[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [stateNavItem setImageInsets:UIEdgeInsetsMake(0, 20, 0, -20)];
    self.navigationItem.rightBarButtonItem = stateNavItem;
}
- (void)backItemAction {
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)loadData {
    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"examineAdd3" ofType:@"plist"];
    NSArray *list = [NSArray arrayWithContentsOfFile:plistPath];
    NSMutableArray *listM = [[NSMutableArray alloc] init];
    for (NSInteger i = 0; i < list.count; i++) {
        NSDictionary *dict = list[i];
        PBExamineAddModel *model = [PBExamineAddModel yy_modelWithDictionary:dict];
        model.isAddExamine = YES;
//        model.isIssueManage = self.isIssueManage;
       
        [listM addObject:model];
    }
    self.dataListM = listM;
}
#pragma mark - 加载检查相关数据
- (void)loadRelevantData {
    [YJProgressHUD showProgress:@"" inView:self.view];
    [[PBNetworkTools sharedTools] RequestGetItemWithExamineID:self.examineListModel.ExamineID andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
            [YJProgressHUD showMessage:@"加载详情失败" inView:self.view];
            return;
        }
        NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        NSLog(@"%@",str);
        PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
        if (networkModel.Ret == 1) {
            self.examinDetailDic = networkModel.Data;
            self.roleModel = [PBRoleModel yy_modelWithDictionary:networkModel.Data];
            [self collatingDetailedData];
        }else {
            [YJProgressHUD showMessage:networkModel.Msg inView:self.view];
        }
    }];
}
- (void)collatingDetailedData {
    for (PBExamineAddModel *examineAddModel in self.dataListM) {
        if ([examineAddModel.cellType isEqualToString:@"time"] || [examineAddModel.cellType isEqualToString:@"input"]){
            NSString *dataStr = [self.examinDetailDic valueForKey:examineAddModel.key];
            if ([dataStr isKindOfClass:[NSNull class]]) {
                examineAddModel.dataStr = nil;
            }else {
                if ([examineAddModel.cellType isEqualToString:@"time"]) {
                    NSRange range = [dataStr rangeOfString:@"T"];
                    dataStr = [dataStr substringToIndex:range.location];
 
                    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
                    //需要设置为和字符串相同的格式
                    [dateFormatter setDateFormat:@"yyyy-MM-dd"];
                    NSDate *localDate = [dateFormatter dateFromString:dataStr];
                    NSDateFormatter *dateFormat1 = [[NSDateFormatter alloc] init];
                    [dateFormat1 setDateFormat:@"yyyy年M月d日"];
                    NSString *timeStr = [dateFormat1 stringFromDate:localDate];
                    examineAddModel.dataStr = timeStr;
                }else {
                    examineAddModel.dataStr = dataStr;
                }
            }
        }else if ([examineAddModel.cellType isEqualToString:@"list"]) {
            examineAddModel.dataArr = [self.examinDetailDic valueForKey:examineAddModel.key];
        }else if ([examineAddModel.cellType isEqualToString:@"person"]) {
            PBPersonModel *personModel = [[PBPersonModel alloc] init];
            personModel.RealName = [self.examinDetailDic valueForKey:examineAddModel.key];
            examineAddModel.personArr = @[personModel];
        }else if ([examineAddModel.cellType isEqualToString:@"choose"]) {
            NSDictionary *dict = @{@"aedt_name" : [self.examinDetailDic valueForKey:examineAddModel.key], @"aedt_guid" : @""};
            examineAddModel.dataDict = dict;
            self.typeDict = dict;
        }
    }
    [self setupUI];
}
- (void)setupUI {
    __weak typeof(self) weakSelf = self;
    NSString *btnTitle = [NSString stringWithFormat:@"%@ ⋁",[self.typeDict valueForKey:@"aedt_name"]];
    [self.typeListBtn setTitle:btnTitle forState:UIControlStateNormal];
    NSString *result = [self.examinDetailDic valueForKey:@"ExamineResult"];
    NSString *flagStr = [result substringToIndex:1];
    UIImage *image;
    if ([flagStr isEqualToString:@"A"]) {
        image = [UIImage imageNamed:@"Rectify_ check"];
    }else if ([flagStr isEqualToString:@"B"]) {
        image = [UIImage imageNamed:@"Rectify_ rectification"];
    }else if ([flagStr isEqualToString:@"C"]) {
        image = [UIImage imageNamed:@"Rectify_ acceptance"];
    }else if ([flagStr isEqualToString:@"D"]) {
        image = [UIImage imageNamed:@"Rectify_ qualified"];
    }else {
        image = [UIImage imageNamed:@""];
    }
    [self.navigationItem.rightBarButtonItem setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    self.view.backgroundColor = PBColor(244, 245, 246);
//    UIView *bgView = [[UIView alloc] init];
//    bgView.backgroundColor = PBColor(244, 245, 246);
//    [self.view addSubview:bgView];
//    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self.view).offset(70);
//        make.left.right.bottom.equalTo(self.view);
//    }];
//    __weak typeof(self) weakSelf = self;
    self.tableView = [[UITableView alloc] init];
    self.tableView.backgroundColor = PBColor(244, 245, 246);
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    self.tableView.bounces = NO;
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.estimatedRowHeight = 100.f;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
    [self.tableView registerClass:[PBTextInputTableViewCell class] forCellReuseIdentifier:inputCellID];
    [self.tableView registerClass:[PBTopTitleTableViewCell class] forCellReuseIdentifier:titleCellID];
    [self.tableView registerClass:[PBTimeChooseTableViewCell class] forCellReuseIdentifier:timeChooseCellID];
    [self.tableView registerClass:[PBPersonChooseTableViewCell class] forCellReuseIdentifier:personCellID];
    [self.tableView registerClass:[PBArtifactsListTableViewCell class] forCellReuseIdentifier:listCellID];
    [self.view addSubview:self.tableView];
    CGFloat bottomH = 64.f;
    if (IS_IPHONE_X) {
        bottomH = 64.f + IPHONE_X_BOTTOM;
    }
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.bottom.equalTo(self.view).offset(-(bottomH));
    }];
    //设置图片 如有有图片 显
    NSArray *imageArr = [self.examinDetailDic valueForKey:@"imges"];
    if (imageArr.count > 0) {
//        self.tableheaderView = [[PBEAddImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 100)];
////        self.tableheaderView.ChooseImageBlock = ^{
////            [weakSelf.view endEditing:YES];
////            [weakSelf takePhotoLibrary];
////        };
////        self.tableheaderView.DeleteImageBlock = ^(NSInteger index) {
////            [weakSelf.selectedPhotos removeObjectAtIndex:index];
////            [weakSelf.selectAssetArr removeObjectAtIndex:index];
////            [weakSelf setTableHeaderViewImage];
////        };
//
//        self.tableheaderView.projectModel = self.projectModel;
//        self.tableheaderView.isAddExamine = NO;
//        self.tableheaderView.detailsImageArr = imageArr;
        self.tableheaderView1 = [[PBCheckHeaderView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 100)];
        self.tableheaderView1.PlayVideoUrlBlock = ^(NSString * _Nonnull url) {
            [weakSelf.view endEditing:YES];
            NSLog(@"打开视频");
            PBVideoPlayViewController *playVC = [[PBVideoPlayViewController alloc] init];
            playVC.url = url;
            [weakSelf.navigationController pushViewController:playVC animated:YES];
        };
        self.tableheaderView1.projectModel = self.projectModel;
        self.tableheaderView1.isAddExamine = NO;
        self.tableheaderView1.detailsImageArr = imageArr;
        self.tableView.tableHeaderView = self.tableheaderView1;
    }
    
 
    UIButton *recordBtn = [UIButton z_bgImageButton:[UIImage imageNamed:@"recording"]];
    [recordBtn addTarget:self action:@selector(recordAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:recordBtn];
    [recordBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.tableView.mas_bottom).offset(15);
        make.left.equalTo(self.view).offset(20);
        make.size.mas_equalTo(CGSizeMake(93, 24));
    }];
    
    UIButton *checkBtn = [[UIButton alloc] init];
    [checkBtn setImage:[UIImage imageNamed:@"inspect_disable"] forState:UIControlStateDisabled];
    [checkBtn setImage:[UIImage imageNamed:@"inspect"] forState:UIControlStateNormal];
    [checkBtn addTarget:self action:@selector(checkAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:checkBtn];
    [checkBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.tableView.mas_bottom).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.size.mas_equalTo(CGSizeMake(100, 34));
    }];
    if (self.roleModel.User_IsChecker) {
        checkBtn.enabled = YES;
    }else {
        checkBtn.enabled = NO;
    }
}
#pragma mark - 流转记录
- (void)recordAction {
    PBRecordViewController *recordVC = [[PBRecordViewController alloc] init];
    recordVC.examineListModel = self.examineListModel;
    recordVC.examineDetailDic = self.examinDetailDic;
    recordVC.projectModel = self.projectModel;
    recordVC.roleModel = self.roleModel;
//    recordVC.recordListM = [[self.examinDetailDic valueForKey:@"RecordWithAttachments"] mutableCopy];
    [self.navigationController pushViewController:recordVC animated:YES];
}
#pragma mark - 检查方法
- (void)checkAction {
    self.isCheck = YES;
    PBCheckViewController *checkVC = [[PBCheckViewController alloc] init];
    checkVC.examineListModel = self.examineListModel;
    checkVC.projectModel = self.projectModel;
    checkVC.levelArr = self.levelArr;
    checkVC.stateArr = self.stateArr;
//    checkVC.CkeckCompleteBlock = ^{
//        [self.navigationController popViewControllerAnimated:NO];
//    };
    [self.navigationController pushViewController:checkVC animated:YES];
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 8;
}
 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    __weak typeof(self) weakSelf = self;
    if (indexPath.row == 0) {
        PBTextInputTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:inputCellID forIndexPath:indexPath];
                PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
        NSString *originalStr = examineAddModel.dataStr;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.endEditBlock = ^(NSString * _Nonnull text) {
            if ([text isEqualToString:originalStr]) {
                return;
            }
            NSMutableDictionary *dictM = [[NSMutableDictionary alloc] init];
            [dictM setValue:text forKey:@"Title"];
            [dictM setValue:@"1" forKey:@"modify_flag"];
            [self ModifyMissionInfoWithData:dictM andIndexPath:indexPath andOriginalData:originalStr];
        };
        return cell;
    } else if (indexPath.row == 1 || indexPath.row == 5) {
        PBTopTitleTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:titleCellID forIndexPath:indexPath];
        PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }else if (indexPath.row == 2 || indexPath.row == 3) {
        PBTimeChooseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:timeChooseCellID forIndexPath:indexPath];
        PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
        NSString *originalStr = examineAddModel.dataStr;
//        cell.ChooseBlock = ^{
//            [self.view endEditing:YES];
//            [PBKeyWindow addSubview:self.editTimeView];
//            self.editTimeView.examineAddModel = self.dataListM[indexPath.row];
//            self.editTimeView.ChooseCompleteBlock = ^(BOOL isSelsected){
//                if (isSelsected) {
//                    if ([examineAddModel.dataStr isEqualToString:originalStr]) {
//                        return;
//                    }
//                    NSMutableDictionary *dictM = [[NSMutableDictionary alloc] init];
//                    if (indexPath.row == 2) {
//                        [dictM setValue:examineAddModel.dataStr forKey:@"BeginTimeStr"];
//                    }else {
//                        [dictM setValue:examineAddModel.dataStr forKey:@"EndTimeStr"];
//                    }
//                    [dictM setValue:@"2" forKey:@"modify_flag"];
//                    [weakSelf ModifyMissionInfoWithData:dictM andIndexPath:indexPath andOriginalData:originalStr];
//                }
//            };
//            [self.editTimeView show];
//        };
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }else if (indexPath.row == 4) {
        PBPersonChooseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:personCellID forIndexPath:indexPath];
        PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
//        cell.ChooseBlock = ^{
//            [self.view endEditing:YES];
//            PBPersonListViewController *personListVC = [[PBPersonListViewController alloc] init];
//            personListVC.projectModel = self.projectModel;
//            personListVC.isMultiSelect = NO;
//            personListVC.selectList = examineAddModel.personArr.mutableCopy;
//            [self.navigationController pushViewController:personListVC animated:YES];
//        };
        cell.LookAllBlock = ^{
            PBSelectedPersonController *selectedPersonVC = [[PBSelectedPersonController alloc] init];
            selectedPersonVC.selectList = examineAddModel.personArr.mutableCopy;
            [self.navigationController pushViewController:selectedPersonVC animated:YES];
        };
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }else if (indexPath.row == 6 || indexPath.row == 7) {
        PBArtifactsListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:listCellID forIndexPath:indexPath];
        PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.ChooseBlock = ^{
            [self.view endEditing:YES];
            if (indexPath.row == 6 || indexPath.row == 7) {
                return;
            }
            PBArtifactsViewController *artifactsVC = [[PBArtifactsViewController alloc] init];
            artifactsVC.examineAddModel = examineAddModel;
            artifactsVC.projectModel = self.projectModel;
            [self.navigationController pushViewController:artifactsVC animated:YES];
        };
        if (indexPath.row == 6) {
            [self.view endEditing:YES];
            cell.ToViewBlock = ^(NSInteger index) {
                NSLog(@"查看模型========");
                NSDictionary *dict = examineAddModel.dataArr[index];
                [self getCategoryArrayByBmGuidWithGuid:[dict valueForKey:@"bm_guid"]];
            };
        }
        return cell;
    }else {
        return nil;
    }
}
 
- (void)getCategoryArrayByBmGuidWithGuid:(NSString *)guid {
    [YJProgressHUD showProgress:@"" inView:self.view];
    [[PBNetworkTools sharedTools] GetCategoryArrayByBmGuidWithGuid:guid andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
            NSLog(@"%@",error);
            [YJProgressHUD showMessage:@"修改失败" inView:self.view];
            return;
        }
        NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        NSLog(@"%@",str);
        PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
        if (networkModel.Ret == 1) {
            [YJProgressHUD hide];
            [PBKeyWindow addSubview:self.componentHierarchyView];
            self.componentHierarchyView.dataArr = networkModel.Data;
            [self.componentHierarchyView show];
        }else {
            [YJProgressHUD showMessage:networkModel.Msg inView:self.view];
        }
        
    }];
}
- (void)ModifyMissionInfoWithData:(NSMutableDictionary *)dictM andIndexPath:(NSIndexPath *)indexPath andOriginalData:(NSString *)data {
    [dictM setValue:self.examineListModel.ExamineID forKey:@"ExamineID"];
    [dictM setValue:self.projectModel.organizeid forKey:@"OrganizeId"];
    [YJProgressHUD showProgress:@"" inView:self.view];
    [[PBNetworkTools sharedTools] ModifyMissionInfoWithDictM:dictM andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
            [YJProgressHUD showMessage:@"保存失败" inView:self.view];
            NSLog(@"%@",error);
        }
        NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        NSLog(@"%@",str);
        PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
        if (networkModel.Ret == 1) {
            [YJProgressHUD showMessage:@"修改成功" inView:self.view];
            if (indexPath) {
                [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];
            }else {
                PBExamineAddModel *examineAddModel = self.dataListM[8];
                self.typeDict = examineAddModel.dataDict;
                NSString *btnTitle = [NSString stringWithFormat:@"%@ ⋁",[self.typeDict valueForKey:@"aedt_name"]];
                [self.typeListBtn setTitle:btnTitle forState:UIControlStateNormal];
            }
        }else {
            [YJProgressHUD showMessage:networkModel.Msg inView:self.view];
            if (indexPath.row == 0 || indexPath.row == 2 || indexPath.row == 3) {
                PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
                examineAddModel.dataStr = data;
                [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];
            }
        }
    }];
}
- (void)ModifyMissionCheckerWithUserId:(NSString *)userId andIndexPath:(NSIndexPath *)indexPath andPersonModel:(PBPersonModel *)personModel {
    [YJProgressHUD showProgress:@"" inView:self.view];
    [[PBNetworkTools sharedTools] ModifyMissionCheckerWithExamineID:self.examineListModel.ExamineID andOrganizeId:self.projectModel.organizeid andCheckerUserId:userId andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
            [YJProgressHUD showMessage:@"保存失败" inView:self.view];
            NSLog(@"%@",error);
        }
        NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        NSLog(@"%@",str);
        PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
        if (networkModel.Ret == 1) {
            [YJProgressHUD showMessage:@"修改成功" inView:self.view];
            [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];
        }else {
            [YJProgressHUD showMessage:networkModel.Msg inView:self.view];
            PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
            examineAddModel.personArr = @[personModel];
        }
    }];
}
 
- (void)setProjectModel:(PBProjectModel *)projectModel {
    _projectModel = projectModel;
}
- (void)setIsAddExamine:(BOOL)isAddExamine {
    _isAddExamine = isAddExamine;
}
 
- (void)setExamineListModel:(PBExamineListModel *)examineListModel {
    _examineListModel = examineListModel;
    if ([examineListModel.ExaminerID isEqualToString:UserID]) {
        self.isEdit = YES;
    }else {
        self.isEdit = NO;
    }
}
- (PBEditTimeView *)editTimeView {
    if (_editTimeView == nil) {
        _editTimeView = [[PBEditTimeView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _editTimeView.visualViewHeight = 300;
    }
    return _editTimeView;
}
- (PBEditPersonView *)editPersonView {
    if (_editPersonView == nil) {
        _editPersonView = [[PBEditPersonView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _editPersonView.isChooseOne = YES;
        CGFloat bottomH = 0.f;
        if (IS_IPHONE_X) {
            bottomH = 34.f;
        }
        _editPersonView.visualViewHeight = 468.f + bottomH;
        _editPersonView.isExamineChoose = YES;
    }
    return _editPersonView;
}
- (void)dealloc {
    [PBNoteCenter removeObserver:self];
}
 
- (void)setStateArr:(NSArray *)stateArr {
    _stateArr = stateArr;
}
- (void)setLevelArr:(NSArray *)levelArr {
    _levelArr = levelArr;
}
- (void)setTypeArr:(NSArray *)typeArr {
    _typeArr = typeArr;
}
- (PBComponentHierarchyView *)componentHierarchyView {
    if (_componentHierarchyView == nil) {
        _componentHierarchyView = [[PBComponentHierarchyView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        CGFloat bottomH = 0.f;
        if (IS_IPHONE_X) {
            bottomH = 34.f;
        }
        _componentHierarchyView.visualViewHeight = 214.f + bottomH;
    }
    return _componentHierarchyView;
}
- (void)backTapped:(UITapGestureRecognizer *)sender {
    [self hideDropDown];
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
//    if ([NSStringFromClass([touch.view class]) isEqualToString:@"MSSAutoresizeLabelFlow"]) {
//        return NO;
//    } else {
//        return YES;
//    }
    if (touch.view == self.backgroundView) {
        return YES;
    } else {
        return NO;
    }
}
- (void)typeListShow {
    if (self.typeArr.count <=  0) {
        [YJProgressHUD showMessage:@"没有类型相关数据" inView:self.view];
        return;
    }
    [self.view addSubview:self.backgroundView];
    [self.backgroundView addSubview:self.typeBackView];
    [self.typeBackView circleViewWithRadius:6];
    [self.typeBackView addSubview:self.typeListRecordV];
    [UIView animateWithDuration:0.5 animations:^{
        self.typeBackView.frame = CGRectMake(0, 0, PBScreenWidth, 176);
        self.backgroundView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.3];
    }completion:^(BOOL finished) {
//        self->_isShow = YES;
        
    }];
    self.typeListBtn.enabled = NO;
    self.navigationItem.leftBarButtonItem.enabled = NO;
}
- (void)hideDropDown{
    [UIView animateWithDuration:0.5 animations:^{
        self.typeBackView.frame = CGRectMake(0, -176, PBScreenWidth, 176);
        self.backgroundView.backgroundColor = [UIColor colorWithWhite:0 alpha:0];
    }completion:^(BOOL finished) {
        [self.backgroundView removeFromSuperview];
        [self.typeBackView removeFromSuperview];
        [self.typeListRecordV removeFromSuperview];
//        self->_isShow = NO;
    }];
    self.typeListBtn.enabled = YES;
    self.navigationItem.leftBarButtonItem.enabled = YES;
}
- (UIView *)backgroundView {
    if (_backgroundView == nil) {
        _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0 , 0, PBScreenWidth, self.view.height)];
        _backgroundView.backgroundColor = [UIColor colorWithWhite:0 alpha:0];
        [_backgroundView setOpaque:NO];
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(backTapped:)];
        tap.delegate = self;
        [_backgroundView addGestureRecognizer:tap];
    }
    return _backgroundView;
}
- (MSSAutoresizeLabelFlow *)typeListRecordV {
    NSMutableArray *arrM = [[NSMutableArray alloc] init];
    for (NSInteger i = 0; i < self.typeArr.count; i++) {
        NSString *str = [self.typeArr[i] valueForKey:@"aedt_name"];
        [arrM addObject:str];
    }
    NSArray *array = arrM.copy;
    if (_typeListRecordV == nil) {
        _typeListRecordV = [[MSSAutoresizeLabelFlow alloc] initWithFrame:CGRectMake(0, 25, PBScreenWidth, 126) titles:array selectedHandler:^(NSUInteger index, NSString *title) {
            __weak typeof(self) weakSelf = self;
            NSDictionary *typeDic = self.typeArr[index];
            NSString *guidStr = [typeDic valueForKey:@"aedt_guid"];
            NSMutableDictionary *dictM = [[NSMutableDictionary alloc] init];
            [dictM setValue:guidStr forKey:@"aedt_guid"];
            [dictM setValue:@"3" forKey:@"modify_flag"];
            PBExamineAddModel *examineAddModel = self.dataListM[8];
            examineAddModel.dataDict = typeDic;
            [weakSelf ModifyMissionInfoWithData:dictM andIndexPath:nil andOriginalData:nil];
            [self hideDropDown];
        }];
    }
    return _typeListRecordV;
}
- (UIView *)typeBackView {
    if (_typeBackView == nil) {
        _typeBackView = [[UIView alloc] initWithFrame:CGRectMake(0, -176, PBScreenWidth, 176)];
        _typeBackView.backgroundColor = [UIColor whiteColor];
    }
    return _typeBackView;
}
/*
#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