MyTDGroupViewController.m 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. //
  2. // MyTDGroupViewController.m
  3. // smartRhino
  4. //
  5. // Created by tederen on 2019/10/31.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "MyTDGroupViewController.h"
  9. #import "YCMenuView.h"
  10. #import "ShowNewGroupAlert.h"
  11. #import "NoticeListModel.h"
  12. #import "ChatNewRowVC.h"
  13. #import "ChatNewRowCell.h"
  14. #import "MoveViewController.h"
  15. #import "TDGroupSearchResultVC.h"
  16. #import "TDGroupInfoListVC.h"
  17. #import "MyTDGroupView.h"
  18. @interface MyTDGroupViewController ()<UITableViewDelegate,UITableViewDataSource>
  19. @property (nonatomic, strong) TDTableView *tableView;
  20. @property (nonatomic, strong) UIView *CusNavBar;
  21. @property (nonatomic, strong) UIView *HeadView;
  22. @property (strong, nonatomic) MyTDGroupView *SearchView;
  23. @property (nonatomic, strong) UILabel *titleL;
  24. @property (nonatomic, strong) UIButton *addBtn;
  25. @property (nonatomic, strong) NSMutableArray <NoticeModel*>*dataArray;
  26. @property (nonatomic, copy) NSArray *addListArray;
  27. @property (assign,nonatomic) OperationStateEnum operationStateEnum;
  28. @property (strong,nonatomic) UIView *operationBottomBgView;
  29. @property (strong, nonatomic) UIButton *operationAllSelectButton;
  30. @property (nonatomic, strong) UIButton *leftCloseBtn;
  31. @property (nonatomic, strong) UIButton *rightMoveBtn;
  32. @property (nonatomic, assign) NSUInteger currentPage;
  33. @property (nonatomic, assign) NSUInteger totalPage;
  34. @property (nonatomic, assign) NSUInteger totalRecord;
  35. @property (nonatomic, assign) BOOL isFresh;
  36. @property (nonatomic, assign) BOOL isAllSelect;
  37. @property (nonatomic, assign) Boolean iSViewEditor;
  38. @end
  39. @implementation MyTDGroupViewController
  40. - (void)viewWillDisappear:(BOOL)animated
  41. {
  42. [super viewWillDisappear:animated];
  43. }
  44. - (void)viewDidLoad {
  45. [super viewDidLoad];
  46. self.fd_prefersNavigationBarHidden = YES;
  47. [self addNavbarView];
  48. [self initBottomBgView];
  49. [self changeToOperation:NO];
  50. self.iSViewEditor = NO;
  51. if (self.isPush) {
  52. [self pushListVC];
  53. }
  54. }
  55. - (void)viewWillAppear:(BOOL)animated{
  56. [super viewWillAppear:animated];
  57. [self setTableViewRefresh];
  58. [self headRefresh];
  59. }
  60. - (void)addNavbarView
  61. {
  62. if (self.isSubVC) {
  63. self.addListArray = @[@"新建小组",@"批量编辑"];
  64. }else{
  65. self.addListArray = @[@"新建小组",@"建文件夹",@"批量编辑"];
  66. }
  67. [self.view addSubview:self.CusNavBar];
  68. [self.CusNavBar mas_makeConstraints:^(MASConstraintMaker *make) {
  69. make.top.left.right.mas_equalTo(self.view);
  70. make.height.mas_offset(kNavigationHeight);
  71. }];
  72. // UILabel * lineL = [UILabel new];
  73. // lineL.backgroundColor = LINEBGCOLOR;
  74. // [self.CusNavBar addSubview:lineL];
  75. // [lineL mas_makeConstraints:^(MASConstraintMaker *make) {
  76. // make.left.bottom.right.mas_equalTo(self.CusNavBar);
  77. // make.height.offset(0.5);
  78. // }];
  79. UIButton * backBtn = [UIButton new];
  80. [backBtn setImage:[UIImage imageNamed:@"back_black_icon"] forState:UIControlStateNormal];
  81. [self.CusNavBar addSubview:backBtn];
  82. self.operationAllSelectButton = [UIButton new];
  83. [self.operationAllSelectButton setImage:[UIImage imageNamed:@"menu_black_icon"] forState:UIControlStateNormal];
  84. [self.CusNavBar addSubview:self.operationAllSelectButton];
  85. self.addBtn = [UIButton new];
  86. [self.addBtn setImage:[UIImage imageNamed:@"chatmsg_right_add_icon"] forState:UIControlStateNormal];
  87. [self.CusNavBar addSubview:self.addBtn];
  88. [backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  89. make.left.mas_equalTo(self.CusNavBar);
  90. make.bottom.mas_equalTo(self.CusNavBar);
  91. make.width.offset(50);
  92. make.height.offset(44);
  93. }];
  94. [self.operationAllSelectButton mas_makeConstraints:^(MASConstraintMaker *make) {
  95. make.left.mas_equalTo(backBtn.mas_right);
  96. make.width.mas_greaterThanOrEqualTo(@35);
  97. make.height.offset(44);
  98. make.bottom.mas_equalTo(self.CusNavBar);
  99. }];
  100. [self.addBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  101. make.right.mas_equalTo(self.CusNavBar);
  102. make.bottom.mas_equalTo(self.CusNavBar);
  103. make.width.offset(50);
  104. make.height.offset(44);
  105. }];
  106. [backBtn addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
  107. [self.operationAllSelectButton addTarget:self action:@selector(menuAction:) forControlEvents:UIControlEventTouchUpInside];
  108. WS(weakSelf);
  109. [self.addBtn setAction:^{
  110. NSMutableArray *menuDataSourceArray = [weakSelf getMenuDataSource:weakSelf.addListArray];
  111. YCMenuView *view = [YCMenuView menuWithActions:menuDataSourceArray width:106 relyonView:weakSelf.addBtn];
  112. view.menuColor = RGB(255, 255, 255);
  113. view.separatorColor = RGB(234, 234, 234);
  114. view.textColor = RGB(102, 102, 102);
  115. view.textFont = [UIFont systemFontOfSize:16.0];
  116. view.menuCellHeight = 43.5;
  117. view.maxDisplayCount = 10;
  118. view.offset = -6;
  119. [view show];
  120. }];
  121. [self.CusNavBar addSubview:self.titleL];
  122. [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  123. make.centerX.mas_equalTo(self.CusNavBar);
  124. make.centerY.mas_equalTo(backBtn);
  125. make.height.offset(44);
  126. make.width.mas_greaterThanOrEqualTo(10);
  127. }];
  128. if (self.titleStr.length == 0) {
  129. self.titleL.attributedText = [self stringToAttribuedString:@"小组"];
  130. }else{
  131. self.titleL.attributedText = [self stringToAttribuedString:self.titleStr];
  132. }
  133. [self.view addSubview:self.HeadView];
  134. [self.HeadView mas_makeConstraints:^(MASConstraintMaker *make) {
  135. make.left.right.mas_equalTo(self.view);
  136. make.height.mas_offset(40);
  137. make.top.mas_equalTo(self.CusNavBar.mas_bottom);
  138. }];
  139. [self.HeadView addSubview:self.SearchView];
  140. [self.SearchView mas_makeConstraints:^(MASConstraintMaker *make) {
  141. make.left.top.right.mas_equalTo(self.HeadView);
  142. make.height.mas_offset(36);
  143. }];
  144. [self.SearchView.button setAction:^{
  145. TDGroupSearchResultVC *vc = [[TDGroupSearchResultVC alloc] init];
  146. vc.ParentId = weakSelf.ParentId;
  147. [weakSelf.navigationController pushViewController:vc animated:YES];
  148. }];
  149. [self.view addSubview:self.tableView];
  150. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  151. make.top.mas_equalTo(self.HeadView.mas_bottom);
  152. make.left.right.mas_equalTo(self.view);
  153. if (@available(iOS 11.0, *)) {
  154. make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
  155. } else {
  156. make.bottom.equalTo(self.view.mas_bottom);
  157. }
  158. }];
  159. if (@available(iOS 11.0, *)) {
  160. self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  161. } else {
  162. self.automaticallyAdjustsScrollViewInsets = NO;
  163. }
  164. }
  165. -(NSMutableArray *)getMenuDataSource:(NSArray *)titleArray{
  166. NSMutableArray *menuDataSourceArray = [[NSMutableArray alloc] init];
  167. for(int i=0;i<titleArray.count;i++){
  168. NSString *titleStr = [titleArray objectAtIndex:i];
  169. WS(weakSelf);
  170. YCMenuAction *actionMenu = [YCMenuAction actionWithTitle:titleStr image:nil handler:^(YCMenuAction *action) {
  171. if([@"新建小组" isEqualToString:action.title]){
  172. ChatNewRowVC * vc = [ChatNewRowVC initChatNewRowVC];
  173. vc.GroupFolderId = self.ParentId;
  174. vc.upDateBlock = ^{
  175. [weakSelf getData];
  176. };
  177. [weakSelf.navigationController pushViewController:vc animated:YES];
  178. }else if ([@"建文件夹" isEqualToString:action.title]){
  179. [[ShowNewGroupAlert initShowNewGroupAlertWithTitle:@"建文件夹" placeholder:@"请输入文件夹名称" confirm:^(NSString * _Nonnull groupName) {
  180. NSLog(@"%@",groupName);
  181. NSDictionary * paraDict = @{@"FolderName":groupName,
  182. @"UserId":@([AppUserModel sharedAppUserModel].Id),
  183. @"ParentId":@(weakSelf.ParentId),
  184. @"TypeId":@(CreateGroupType)
  185. };
  186. [[HttpManager sharedHttpManager] PUTUrl:Host(APP_Middle_Add_Folder) parameters:paraDict success:^(id _Nonnull responseObject) {
  187. dispatch_async(dispatch_get_main_queue(), ^{
  188. [weakSelf headRefresh];
  189. });
  190. } failure:^(NSError * _Nonnull error) {
  191. NSLog(@"%@",error);
  192. SHOWERROR([ZYCTool handerResultData:error])
  193. }];
  194. } cancle:^{
  195. }] show];
  196. }
  197. else if ([@"批量编辑" isEqualToString:action.title]){
  198. [weakSelf changeToOperation:YES];
  199. }
  200. }];
  201. [menuDataSourceArray addObject:actionMenu];
  202. }
  203. return menuDataSourceArray;
  204. }
  205. - (UIView *)CusNavBar
  206. {
  207. if (!_CusNavBar) {
  208. _CusNavBar = [UIView new];
  209. _CusNavBar.backgroundColor = [UIColor whiteColor];
  210. }
  211. return _CusNavBar;
  212. }
  213. - (UIView *)HeadView
  214. {
  215. if (!_HeadView) {
  216. _HeadView = [UIView new];
  217. _HeadView.backgroundColor = [UIColor whiteColor];
  218. }
  219. return _HeadView;
  220. }
  221. - (UILabel *)titleL
  222. {
  223. if (!_titleL) {
  224. _titleL = [UILabel new];
  225. _titleL.textAlignment = NSTextAlignmentCenter;
  226. }
  227. return _titleL;
  228. }
  229. - (NSAttributedString *)stringToAttribuedString:(NSString *)title;
  230. {
  231. NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName: [UIFont fontWithName:@"PingFang SC" size: 18],NSForegroundColorAttributeName: [UIColor colorWithRed:10/255.0 green:10/255.0 blue:10/255.0 alpha:1.0]}];
  232. return string;
  233. }
  234. - (void)getData{
  235. WS(weakSelf);
  236. NSDictionary * paraDict = @{@"GroupFolderId":@(self.ParentId),
  237. @"UserId":@([AppUserModel sharedAppUserModel].Id),
  238. @"Key":@"",
  239. @"Page":@(self.currentPage),
  240. @"PerPage":@(20),
  241. @"Sort":@""
  242. };
  243. [[HttpManager sharedHttpManager] POSTUrl:Host(APP_Group_Find) parameters:paraDict responseStyle:JOSN success:^(id _Nonnull responseObject) {
  244. NSLog(@"%@",responseObject);
  245. NoticeListModel *listModel = [[NoticeListModel alloc] initWithDictionary:responseObject error:nil];
  246. weakSelf.totalRecord = listModel.Total;
  247. [weakSelf.dataArray addObjectsFromArray:listModel.Items];
  248. dispatch_async(dispatch_get_main_queue(), ^{
  249. [weakSelf.tableView reloadData];
  250. });
  251. [weakSelf.tableView.mj_header endRefreshing];
  252. [weakSelf.tableView.mj_footer endRefreshing];
  253. } failure:^(NSError * _Nonnull error) {
  254. [weakSelf.tableView.mj_header endRefreshing];
  255. [weakSelf.tableView.mj_footer endRefreshing];
  256. }];
  257. }
  258. #pragma mark - UItableView刷新
  259. - (void)setTableViewRefresh{
  260. WeakSelf(self)
  261. self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
  262. [weakself headRefresh];
  263. }];
  264. self.tableView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
  265. [weakself footerRefresh];
  266. }];
  267. }
  268. - (void)headRefresh{
  269. self.isFresh = YES;
  270. self.currentPage = 1;
  271. self.totalPage = 1;
  272. [self.dataArray removeAllObjects];
  273. [self getData];
  274. }
  275. - (void)footerRefresh{
  276. self.isFresh = NO;
  277. self.currentPage += 1;
  278. if (self.totalRecord == self.dataArray.count) {
  279. self.currentPage --;
  280. [self.tableView.mj_footer resetNoMoreData];
  281. return ;
  282. }
  283. [self getData];
  284. }
  285. #pragma mark - 批量编辑
  286. /// 创建文件夹
  287. - (void)addFind:(NSString *)groupname{
  288. SHOWLOADING
  289. WEAKSELF
  290. [[HttpManager sharedHttpManager] PUTUrl:Host(API_NOTICE_ADDFind) parameters:@{@"FolderName":groupname,@"ParentId":@(self.ParentId)} success:^(id _Nonnull responseObject) {
  291. STRONGSELF
  292. REMOVESHOW
  293. [strongSelf getData];
  294. } failure:^(NSError * _Nonnull error) {
  295. SHOWERROR([ZYCTool handerResultData:error]);
  296. }];
  297. }
  298. /// 修改文件夹名称
  299. - (void)reNameFind:(NoticeModel*)findModel withReNameString:(NSString *)renameString{
  300. SHOWLOADING
  301. WEAKSELF
  302. [[HttpManager sharedHttpManager] POSTUrl:Host(API_Find_ReName) parameters:@{@"FolderName":renameString,@"Id":@(findModel.Id)} responseStyle:DATA success:^(id _Nonnull responseObject) {
  303. STRONGSELF
  304. REMOVESHOW
  305. [strongSelf getData];
  306. } failure:^(NSError * _Nonnull error) {
  307. SHOWERROR([ZYCTool handerResultData:error]);
  308. }];
  309. }
  310. /// 文件夹 置顶 和 取消置顶
  311. - (void)topFind:(NoticeModel*)findModel{
  312. NSLog(@"文件夹---%@%@",findModel.IsTop ? @"置顶":@"取消置顶",findModel.FolderName);
  313. SHOWLOADING
  314. WEAKSELF
  315. [[HttpManager sharedHttpManager] PUTUrl:[NSString stringWithFormat:@"%@%@%ld",BaseUrl,API_Find_Top,(long)findModel.Id] parameters:@{} success:^(id _Nonnull responseObject) {
  316. REMOVESHOW
  317. [weakSelf reCreateTable];
  318. } failure:^(NSError * _Nonnull error) {
  319. SHOWERROR([ZYCTool handerResultData:error]);
  320. }];
  321. }
  322. - (void)reCreateTable
  323. {
  324. self.currentPage = 1;
  325. self.totalPage = 1;
  326. [self.dataArray removeAllObjects];
  327. WS(weakSelf);
  328. NSDictionary * paraDict = @{@"GroupFolderId":@(self.ParentId),
  329. @"UserId":@([AppUserModel sharedAppUserModel].Id),
  330. @"Key":@"",
  331. @"Page":@(self.currentPage),
  332. @"PerPage":@(20),
  333. @"Sort":@""
  334. };
  335. [[HttpManager sharedHttpManager] POSTUrl:Host(APP_Group_Find) parameters:paraDict responseStyle:JOSN success:^(id _Nonnull responseObject) {
  336. NSLog(@"%@",responseObject);
  337. NoticeListModel *listModel = [[NoticeListModel alloc] initWithDictionary:responseObject error:nil];
  338. weakSelf.totalRecord = listModel.Total;
  339. [weakSelf.dataArray addObjectsFromArray:listModel.Items];
  340. dispatch_async(dispatch_get_main_queue(), ^{
  341. [weakSelf.tableView removeFromSuperview];
  342. weakSelf.tableView = nil;
  343. weakSelf.tableView.delegate = weakSelf;
  344. weakSelf.tableView.dataSource = weakSelf;
  345. [weakSelf.view addSubview:self.tableView];
  346. [weakSelf.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  347. make.top.mas_equalTo(weakSelf.CusNavBar.mas_bottom);
  348. make.left.right.mas_equalTo(weakSelf.view);
  349. if (@available(iOS 11.0, *)) {
  350. make.bottom.equalTo(weakSelf.view.mas_safeAreaLayoutGuideBottom);
  351. } else {
  352. make.bottom.equalTo(weakSelf.view.mas_bottom);
  353. }
  354. }];
  355. [weakSelf.tableView.mj_header endRefreshing];
  356. [weakSelf.tableView.mj_footer endRefreshing];
  357. [weakSelf.tableView reloadData];
  358. });
  359. } failure:^(NSError * _Nonnull error) {
  360. [weakSelf.tableView.mj_header endRefreshing];
  361. [weakSelf.tableView.mj_footer endRefreshing];
  362. }];
  363. }
  364. /// 删除文件夹
  365. - (void)deleteFind:(NSMutableArray<NoticeModel *>*)findModelArray{
  366. NSMutableArray *MiddleIds = [NSMutableArray array];
  367. for (NoticeModel *model in findModelArray) {
  368. [MiddleIds addObject:@(model.Id)];
  369. }
  370. NSMutableDictionary *dic = [[NSMutableDictionary alloc]init];
  371. [dic setValue:MiddleIds forKey:@"MiddleIds"];
  372. [dic setValue:@(CreateGroupType) forKey:@"FolderType"];
  373. SHOWLOADING
  374. WEAKSELF
  375. [[HttpManager sharedHttpManager] POSTUrl:Host(API_Find_DeleteRecord) parameters:dic responseStyle:DATA success:^(id _Nonnull responseObject) {
  376. STRONGSELF
  377. REMOVESHOW
  378. [strongSelf headRefresh];
  379. } failure:^(NSError * _Nonnull error) {
  380. SHOWERROR([ZYCTool handerResultData:error]);
  381. }];
  382. }
  383. /// 移动文件夹
  384. - (void)moveFind:(NSMutableArray<NoticeModel *>*)findModelArray withSuperModel:(NoticeModel *)supermodel{
  385. NSMutableArray *MiddleIds = [NSMutableArray array];
  386. for (NoticeModel *model in findModelArray) {
  387. [MiddleIds addObject:@(model.Id)];
  388. }
  389. NSMutableDictionary *dic = [[NSMutableDictionary alloc]init];
  390. [dic setValue:MiddleIds forKey:@"Ids"];
  391. [dic setValue:@(self.ParentId) forKey:@"ParentId"];
  392. SHOWLOADING
  393. WEAKSELF
  394. [[HttpManager sharedHttpManager] POSTUrl:Host(API_Find_Move) parameters:dic responseStyle:DATA success:^(id _Nonnull responseObject) {
  395. STRONGSELF
  396. REMOVESHOW
  397. [strongSelf headRefresh];
  398. } failure:^(NSError * _Nonnull error) {
  399. SHOWERROR([ZYCTool handerResultData:error]);
  400. }];
  401. }
  402. -(void)initBottomBgView{
  403. self.leftCloseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  404. [self.leftCloseBtn setTitle:@"删除" forState:UIControlStateNormal];
  405. [self.leftCloseBtn setTitleColor:RGB(255, 82, 82) forState:UIControlStateNormal];
  406. self.leftCloseBtn.titleLabel.font = [UIFont systemFontOfSize:15];
  407. [self.operationBottomBgView addSubview:self.leftCloseBtn];
  408. self.leftCloseBtn.frame = CGRectMake(0, 10, SCREEN_WIDTH/2, self.operationBottomBgView.height - 10);
  409. self.self.rightMoveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  410. [self.rightMoveBtn setTitle:@"移动" forState:UIControlStateNormal];
  411. [self.rightMoveBtn setTitleColor:RGB(57, 121, 211) forState:UIControlStateNormal];
  412. [self.rightMoveBtn setTitleColor:UIColorHex(#BBBBBB) forState:UIControlStateDisabled];
  413. self.rightMoveBtn.enabled = NO;
  414. self.rightMoveBtn.titleLabel.font = [UIFont systemFontOfSize:15];
  415. [self.operationBottomBgView addSubview:self.rightMoveBtn];
  416. self.rightMoveBtn.frame = CGRectMake(SCREEN_WIDTH/2, 10, SCREEN_WIDTH/2, self.operationBottomBgView.height - 10);
  417. UIView *line = [[UIView alloc] init];
  418. line.backgroundColor = RGB(240, 239, 244);
  419. [self.operationBottomBgView addSubview:line];
  420. line.frame = CGRectMake(SCREEN_WIDTH/2, 0, .5, self.operationBottomBgView.height);
  421. UIView *topLine = [[UIView alloc] init];
  422. topLine.backgroundColor = RGB(240, 239, 244);
  423. [self.operationBottomBgView addSubview:topLine];
  424. topLine.frame = CGRectMake(0, 0, SCREEN_WIDTH, 10);
  425. WS(weakSelf);
  426. [self.leftCloseBtn setAction:^{
  427. NSMutableArray *selectIDArray = [NSMutableArray array];
  428. for (NoticeModel * model in weakSelf.dataArray) {
  429. if (model.IsSelect) {
  430. [selectIDArray addObject:model];
  431. }
  432. }
  433. if (selectIDArray.count == 0) {
  434. SHOWERROR(@"请选择要删除的通知");
  435. return ;
  436. }else{
  437. [weakSelf deleteFind:selectIDArray];
  438. }
  439. }];
  440. [self.rightMoveBtn setAction:^{
  441. NSMutableArray *selectIDArray = [NSMutableArray array];
  442. for (NoticeModel * model in weakSelf.dataArray) {
  443. if (model.IsSelect) {
  444. [selectIDArray addObject:@(model.Id)];
  445. }
  446. }
  447. if (selectIDArray.count == 0) {
  448. SHOWERROR(@"请选择要移动的通知或者文件夹");
  449. return ;
  450. }
  451. [weakSelf launchMoveVC:selectIDArray];
  452. }];
  453. [[UtilsTools getWindow] addSubview:self.operationBottomBgView];
  454. }
  455. - (void)launchMoveVC:(NSMutableArray<NSNumber*>*)selectIDArray{
  456. MoveViewController * vc = [MoveViewController initMoveViewController];
  457. vc.TypeId = CreateGroupType;
  458. vc.collectType = CollectHanderType_Move;
  459. vc.ParentId = 0;
  460. vc.titleStr = self.titleL.text;
  461. vc.FolderIds = selectIDArray;
  462. [self.navigationController pushViewController:vc animated:YES];
  463. [self changeToOperation:NO];
  464. }
  465. -(UIView *)operationBottomBgView{
  466. if(!_operationBottomBgView){
  467. _operationBottomBgView = [[UIView alloc] init];
  468. CGFloat bottomBgViewH = self.tabBarController.tabBar.height + 10;
  469. _operationBottomBgView.frame = CGRectMake(0, SCREEN_HEIGHT - bottomBgViewH, SCREEN_WIDTH, bottomBgViewH);
  470. _operationBottomBgView.backgroundColor = RGB(255, 255, 255);
  471. _operationBottomBgView.hidden = YES;
  472. }
  473. return _operationBottomBgView;
  474. }
  475. #pragma mark 批量操作与正常操作界面切换
  476. -(void)changeToOperation:(BOOL)operation{
  477. if(operation){
  478. self.titleL.attributedText = [self stringToAttribuedString:@"批量操作"];
  479. self.iSViewEditor = YES;
  480. [self.HeadView mas_updateConstraints:^(MASConstraintMaker *make) {
  481. make.height.mas_offset(0);
  482. }];
  483. self.SearchView.hidden = YES;
  484. self.addBtn.hidden = YES;
  485. //默认操作状态为批量编辑状态
  486. self.operationStateEnum = OperationStateEnum1;
  487. // self.operationBackButton.hidden = NO;
  488. self.operationAllSelectButton.hidden = NO;
  489. [self.operationAllSelectButton setTitle:@"全选" forState:UIControlStateNormal];
  490. [self.operationAllSelectButton setTitleColor:UIColorHex(#0F88EB) forState:UIControlStateNormal];
  491. [self.operationAllSelectButton setImage:nil forState:UIControlStateNormal];
  492. self.tabBarController.tabBar.hidden = YES;
  493. self.operationBottomBgView.hidden = NO;
  494. self.view.height -= self.tabBarController.tabBar.height;
  495. self.tableView.height -= self.tabBarController.tabBar.height;
  496. [self.view layoutIfNeeded];
  497. [self.tableView layoutIfNeeded];
  498. }else{
  499. if (self.titleStr.length == 0) {
  500. self.titleL.attributedText = [self stringToAttribuedString:@"小组"];
  501. }else{
  502. self.titleL.attributedText = [self stringToAttribuedString:self.titleStr];
  503. }
  504. self.addBtn.hidden = NO;
  505. self.iSViewEditor = NO;
  506. [self.HeadView mas_updateConstraints:^(MASConstraintMaker *make) {
  507. make.height.mas_offset(40);
  508. }];
  509. self.SearchView.hidden = NO;
  510. //默认操作状态为无状态
  511. self.operationStateEnum = OperationStateEnum0;
  512. self.operationAllSelectButton.hidden = NO;
  513. [self.operationAllSelectButton setImage:IMG(@"menu_black_icon") forState:UIControlStateNormal];
  514. [self.operationAllSelectButton setTitleColor:[UIColor clearColor] forState:UIControlStateNormal];
  515. self.tabBarController.tabBar.hidden = YES;
  516. self.tableView.height += self.tabBarController.tabBar.height;
  517. self.view.height += self.tabBarController.tabBar.height;
  518. [self.view layoutIfNeeded];
  519. [self.tableView layoutIfNeeded];
  520. self.operationBottomBgView.hidden = YES;
  521. }
  522. [self.tableView reloadData];
  523. }
  524. #pragma mark 移动 isEdit:当前是否为编辑状态
  525. -(void)userDidMove:(BOOL)move isEdit:(BOOL)isEdit{
  526. //移动
  527. if(move){
  528. //默认操作状态为移动状态
  529. self.operationStateEnum = OperationStateEnum2;
  530. self.addBtn.hidden = NO;
  531. [self resetRightBtnAction:NO];
  532. //隐藏tabBar - 并将TableView至底端
  533. self.tabBarController.tabBar.hidden = YES;
  534. self.view.height += self.tabBarController.tabBar.height;
  535. self.tableView.height += self.tabBarController.tabBar.height;
  536. [self.view layoutIfNeeded];
  537. [self.tableView layoutIfNeeded];
  538. //隐藏operationBottomBgView
  539. self.operationBottomBgView.hidden = YES;
  540. }
  541. else{
  542. //隐藏tabBar - 并将TableView至底端有tabBar.height的高
  543. self.tabBarController.tabBar.hidden = YES;
  544. self.view.height -= self.tabBarController.tabBar.height;
  545. self.tableView.height -= self.tabBarController.tabBar.height;
  546. [self.view layoutIfNeeded];
  547. [self.tableView layoutIfNeeded];
  548. //显示operationBottomBgView
  549. self.operationBottomBgView.hidden = NO;
  550. if(isEdit){
  551. self.operationStateEnum = OperationStateEnum1;
  552. self.addBtn.hidden = YES;
  553. [self resetRightBtnAction:YES];
  554. }else{
  555. [self changeToOperation:NO];
  556. }
  557. }
  558. [self.tableView reloadData];
  559. }
  560. -(void)resetRightBtnAction:(BOOL)isShowMenu{
  561. WS(weakSelf);
  562. if(isShowMenu){
  563. [self.addBtn setImage:[UIImage imageNamed:@"chatmsg_right_add_icon"] forState:UIControlStateNormal];
  564. [self.addBtn setAction:^{
  565. NSMutableArray *menuDataSourceArray = [weakSelf getMenuDataSource:weakSelf.addListArray];
  566. YCMenuView *view = [YCMenuView menuWithActions:menuDataSourceArray width:106 relyonView:weakSelf.addBtn];
  567. view.menuColor = RGB(255, 255, 255);
  568. view.separatorColor = RGB(234, 234, 234);
  569. view.textColor = RGB(102, 102, 102);
  570. view.textFont = [UIFont systemFontOfSize:16.0];
  571. view.menuCellHeight = 43.5;
  572. view.maxDisplayCount = 10;
  573. view.offset = -6;
  574. [view show];
  575. }];
  576. }else{
  577. [self.addBtn setImage:[UIImage imageNamed:@"chatmsg_right_fileadd_icon"] forState:UIControlStateNormal];
  578. [self.addBtn setAction:^{
  579. [ShowtipTool showErrorWithStatus:@"未做"];
  580. }];
  581. }
  582. }
  583. - (void)backAction:(id)sender{
  584. if (self.iSViewEditor) {
  585. [self changeToOperation:NO];
  586. }else{
  587. [self.navigationController popViewControllerAnimated:true];
  588. }
  589. }
  590. - (BOOL)checkChatListArray
  591. {
  592. for (NoticeModel * model in self.dataArray) {
  593. if (!model.IsSelect) {
  594. return NO;
  595. }
  596. }
  597. return YES;
  598. }
  599. - (void)menuAction:(id)sender{
  600. switch (self.operationStateEnum) {
  601. case OperationStateEnum1:
  602. for (NoticeModel *model in self.dataArray) {
  603. model.IsSelect = !self.isAllSelect;
  604. }
  605. [self.tableView reloadData];
  606. break;
  607. default:
  608. [super menuAction:sender];
  609. break;
  610. }
  611. }
  612. #pragma mark - setter
  613. - (TDTableView *)tableView{
  614. if (!_tableView) {
  615. _tableView = [[TDTableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
  616. _tableView.delegate = self;
  617. _tableView.dataSource = self;
  618. }
  619. return _tableView;
  620. }
  621. - (NSMutableArray<NoticeModel *> *)dataArray{
  622. if (!_dataArray) {
  623. _dataArray = [NSMutableArray new];
  624. }
  625. return _dataArray;
  626. }
  627. - (MyTDGroupView *)SearchView
  628. {
  629. if (!_SearchView) {
  630. _SearchView = [[MyTDGroupView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)];
  631. }
  632. return _SearchView;
  633. }
  634. #pragma Mark 左滑按钮 iOS8以上
  635. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0
  636. - (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(tvos){// delete action
  637. WS(weakSelf);
  638. NoticeModel *model = [self.dataArray objectAtIndex:indexPath.row];
  639. switch (model.AttributeValue) {
  640. case 2:{
  641. UIContextualAction *action1 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"删除" handler:^(UIContextualAction * _Nonnull action,__kindof UIView * _Nonnull sourceView,void (^ _Nonnull completionHandler)(BOOL)) {
  642. UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:(UIAlertControllerStyleAlert)];
  643. UIAlertAction * sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
  644. [weakSelf deleteFind:@[model].mutableCopy];
  645. }];
  646. UIAlertAction * cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
  647. }];
  648. [alert addAction:sureAction];
  649. [alert addAction:cancelAction];
  650. [weakSelf presentViewController:alert animated:YES completion:^{
  651. }];
  652. }];
  653. action1.backgroundColor = RGB(255, 59, 47);
  654. UIContextualAction *action2 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"重命名" handler:^(UIContextualAction * _Nonnull action,__kindof UIView * _Nonnull sourceView,void (^ _Nonnull completionHandler)(BOOL)) {
  655. [[ShowNewGroupAlert initShowNewGroupAlertWithTitle:@"修改文件夹名称" changeStr:model.FolderName confirm:^(NSString * _Nonnull groupName) {
  656. NSLog(@"%@",groupName);
  657. [weakSelf reNameFind:model withReNameString:groupName];
  658. } cancle:^{
  659. }] show];
  660. }];
  661. action2.backgroundColor = RGB(255, 149, 3);
  662. UIContextualAction *action3 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:model.IsTop?@"取消置顶" :@"置顶" handler:^(UIContextualAction * _Nonnull action,__kindof UIView * _Nonnull sourceView,void (^ _Nonnull completionHandler)(BOOL)) {
  663. [weakSelf topFind:model];
  664. }];
  665. action3.backgroundColor = RGB(197, 201, 204);
  666. UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[action1, action2, action3]];
  667. actions.performsFirstActionWithFullSwipe = NO;
  668. return actions;
  669. }break;
  670. default:{
  671. UIContextualAction *action1 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"退出" handler:^(UIContextualAction * _Nonnull action,__kindof UIView * _Nonnull sourceView,void (^ _Nonnull completionHandler)(BOOL)) {
  672. [weakSelf deleteFind:@[model].mutableCopy];
  673. }];
  674. action1.backgroundColor = RGB(255, 59, 47);
  675. UIContextualAction *action2 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"移动" handler:^(UIContextualAction * _Nonnull action,__kindof UIView * _Nonnull sourceView,void (^ _Nonnull completionHandler)(BOOL)) {
  676. [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
  677. }];
  678. action2.backgroundColor = UIColorHex(#589AF1);
  679. UIContextualAction *action3 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:model.IsTop ?@"取消置顶" :@"置顶" handler:^(UIContextualAction * _Nonnull action,__kindof UIView * _Nonnull sourceView,void (^ _Nonnull completionHandler)(BOOL)) {
  680. [weakSelf topFind:model];
  681. }];
  682. action3.backgroundColor = RGB(197, 201, 204);
  683. UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[action1, action2, action3]];
  684. actions.performsFirstActionWithFullSwipe = NO;
  685. return actions;
  686. }
  687. break;
  688. }
  689. }
  690. #else
  691. - (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
  692. NoticeModel *model = [self.dataArray objectAtIndex:indexPath.row];
  693. WEAKSELF
  694. switch (model.AttributeValue) {
  695. case 2:{
  696. UITableViewRowAction *action1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  697. [weakSelf deleteFind:@[model].mutableCopy];
  698. }];
  699. action1.backgroundColor = RGB(255, 59, 47);
  700. UITableViewRowAction *action2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"重命名" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  701. [[ShowNewGroupAlert initShowNewGroupAlertWithTitle:@"修改文件夹名称" changeStr:model.FolderName confirm:^(NSString * _Nonnull groupName) {
  702. NSLog(@"%@",groupName);
  703. [weakSelf reNameFind:model withReNameString:groupName];
  704. } cancle:^{
  705. }] show];
  706. }];
  707. action2.backgroundColor = RGB(255, 149, 3);
  708. // NSLog(@"")
  709. UITableViewRowAction *action3 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title: model.IsTop?@"取消置顶" :@"置顶" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  710. [weakSelf topFind:model];
  711. }];
  712. action3.backgroundColor = RGB(197, 201, 204);
  713. return @[action1, action2, action3];
  714. }break;
  715. default:{
  716. UITableViewRowAction *action1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"退出" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  717. [weakSelf deleteFind:@[model].mutableCopy];
  718. }];
  719. action1.backgroundColor = RGB(255, 59, 47);
  720. UITableViewRowAction *action2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"移动" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  721. [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
  722. }];
  723. action2.backgroundColor = UIColorHex(#589AF1);
  724. UITableViewRowAction *action3 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:model.IsTop ?@"取消置顶" :@"置顶" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  725. [weakSelf topFind:model];
  726. }];
  727. action3.backgroundColor = RGB(197, 201, 204);
  728. return @[action1, action2, action3];
  729. }
  730. break;
  731. }
  732. }
  733. #endif
  734. #pragma mark - UITableViewDelegate,UITableViewDataSource
  735. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  736. return 1;
  737. }
  738. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  739. return self.dataArray.count;
  740. }
  741. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  742. return [ChatNewRowCell configCell2Height];
  743. }
  744. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  745. WS(weakSelf);
  746. switch (self.operationStateEnum) {
  747. case OperationStateEnum0:{
  748. NoticeModel *model = [self.dataArray objectAtIndex:indexPath.row];
  749. switch (model.AttributeValue) {
  750. case 2:{
  751. ChatNewRowCell *cell = [ChatNewRowCell configCell1:tableView indexPath:indexPath];
  752. cell.cell1TitleLabel.text = model.FolderName;
  753. cell.IsTopImgV.hidden = !model.IsTop;
  754. cell.cell1TimeLabel.text = [NSString stringWithFormat:@"%ld",(long)model.FileCount];
  755. cell.cell1TimeLabel.hidden = model.FileCount == 0 ? YES : NO;
  756. return cell;
  757. }break;
  758. default:{
  759. ChatNewRowCell *cell = [ChatNewRowCell configCell2:tableView indexPath:indexPath];
  760. [cell.cell2UserImgView sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage];
  761. cell.cell2TitleLabel.text = model.GroupName;
  762. cell.IsTopImgV.hidden = !model.IsTop;
  763. cell.cell2IntroLabel.text = [NSString stringWithFormat:@"共享给%ld人",(long)model.TopicSharingCount];
  764. cell.cell2TimeLabel.text = [NSString stringWithFormat:@"%ld",(long)model.TopicAllCount];
  765. cell.cell2TimeLabel.hidden = model.TopicAllCount == 0 ? YES : NO;
  766. cell.cell2RedNumLabel.text = model.UReadTopicCount > 0 ? [NSString stringWithFormat:@"[%ld条新话题]",(long)model.UReadTopicCount] : @"";
  767. return cell;
  768. }break;
  769. }
  770. }break;
  771. default:{
  772. NoticeModel *model = [self.dataArray objectAtIndex:indexPath.row];
  773. self.isAllSelect = [self checkChatListArray];
  774. if (self.isAllSelect) {
  775. [self.operationAllSelectButton setTitle:@"取消全选" forState:UIControlStateNormal];
  776. }else{
  777. [self.operationAllSelectButton setTitle:@"全选" forState:UIControlStateNormal];
  778. }
  779. switch (model.AttributeValue) {
  780. case 2:{///文件
  781. ChatNewRowCell *cell = [ChatNewRowCell configCell10:tableView indexPath:indexPath];
  782. cell.cell1TitleLabel.text = model.FolderName;
  783. cell.cell1TimeLabel.text = [NSString stringWithFormat:@"%ld",(long)model.FileCount];
  784. cell.cell1TimeLabel.hidden = model.FileCount == 0 ? YES : NO;
  785. cell.cell1SelectButton.selected = model.IsSelect;
  786. [cell.cell1SelectButton setAction:^{
  787. model.IsSelect = !model.IsSelect;
  788. [weakSelf.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
  789. }];
  790. return cell;
  791. }break;
  792. default:{///小组
  793. ChatNewRowCell *cell = [ChatNewRowCell configCell20:tableView indexPath:indexPath];
  794. [cell.cell2UserImgView sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage];
  795. cell.cell2TitleLabel.text = model.GroupName;
  796. cell.cell2IntroLabel.text = @"用户名";
  797. cell.cell2TimeLabel.text = [NSString stringWithFormat:@"%ld",(long)model.TopicAllCount];
  798. cell.cell2TimeLabel.hidden = model.TopicAllCount == 0 ? YES : NO;
  799. cell.cell2RedNumLabel.text = model.UReadTopicCount > 0 ? [NSString stringWithFormat:@"[%ld条新话题]",(long)model.UReadTopicCount] : @"";
  800. cell.cell2SelectButton.selected = model.IsSelect;
  801. [cell.cell2SelectButton setAction:^{
  802. model.IsSelect = !model.IsSelect;
  803. [weakSelf.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
  804. }];
  805. return cell;
  806. }break;
  807. }
  808. }break;
  809. }
  810. }
  811. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath
  812. {
  813. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  814. switch (self.operationStateEnum) {
  815. case OperationStateEnum1:{
  816. NSLog(@"编辑状态的cell");
  817. self.dataArray[indexPath.row].IsSelect = !self.dataArray[indexPath.row].IsSelect;
  818. [tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
  819. self.rightMoveBtn.enabled = [self isMoveCheckData];
  820. }break;
  821. default:{
  822. NSLog(@"正常状态的cell");
  823. NoticeModel *model = [self.dataArray objectAtIndex:indexPath.row];
  824. if(model && model != nil)
  825. {
  826. switch (model.AttributeValue) {
  827. case 2:{
  828. MyTDGroupViewController *vc = [[MyTDGroupViewController alloc] init];
  829. vc.ParentId = model.Id;
  830. vc.isSubVC = YES;
  831. vc.titleStr = model.FolderName;
  832. [self.navigationController pushViewController:vc animated:YES];
  833. }break;
  834. default:{
  835. if (self.isReturn) {
  836. MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
  837. vc.Id = model.GroupId;
  838. vc.type = self.type == 0 ? CollectModel_Group : self.type;
  839. vc.isReturn = self.isReturn;
  840. vc.sendModel = self.sendModel;
  841. [self.navigationController pushViewController:vc animated:YES];
  842. }else{
  843. TDGroupInfoListVC * vc = [TDGroupInfoListVC initTDGroupInfoListVC];
  844. vc.titleStr = model.GroupName;
  845. vc.GroupId = model.GroupId;
  846. vc.type = self.type;
  847. vc.sendModel = self.sendModel;
  848. [self.navigationController pushViewController:vc animated:YES];
  849. }
  850. }break;
  851. }
  852. }
  853. }break;
  854. }
  855. }
  856. - (void)pushListVC
  857. {
  858. TDGroupInfoListVC * vc = [TDGroupInfoListVC initTDGroupInfoListVC];
  859. vc.titleStr = self.pushDict[@"Name"];
  860. vc.GroupId = [self.pushDict[@"Id"] integerValue];
  861. [self.navigationController pushViewController:vc animated:NO];
  862. }
  863. - (BOOL)isMoveCheckData
  864. {
  865. BOOL isSelect = NO;
  866. for (NoticeModel * model in self.dataArray) {
  867. if (model.AttributeValue == 2 && model.IsSelect) {
  868. return NO;
  869. }
  870. if (model.IsSelect) {
  871. isSelect = YES;
  872. }
  873. }
  874. if (!isSelect) {
  875. return NO;
  876. }
  877. return YES;
  878. }
  879. @end