MyTDGroupViewController.m 41 KB

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