@@ -46,10 +46,10 @@ - (void)viewDidLoad {
4646 self.title = @" 标签管理" ;
4747 self.navigationController .title = @" 标签管理" ;
4848
49- if (!_isSaveChange) {
49+ // if (!_isSaveChange) {
5050 self.navigationItem .rightBarButtonItem = [UIBarButtonItem itemWithBtnTitle: @" 完成" target: self action: @selector (okBtnClick )];
5151 self.navigationItem .rightBarButtonItem .enabled = FALSE ;
52- }
52+ // }
5353
5454 self.view .backgroundColor = kColorTableSectionBg ;
5555
@@ -146,26 +146,27 @@ - (void)okBtnClick
146146 // _curProTopic.mdTitle = _tempArray;
147147 // _curProTopic.mdContent = _tempArray;
148148
149- // self.navigationItem.rightBarButtonItem.enabled = NO;
150- // if (_isSaveChange) {
151- // @weakify(self);
152- // [[Coding_NetAPIManager sharedManager] request_ModifyProjectTpoic:self.curProTopic andBlock:^(id data, NSError *error) {
153- // @strongify(self);
154- // self.navigationItem.rightBarButtonItem.enabled = YES;
155- // if (data) {
156- // _curProTopic.labels = [NSMutableArray arrayWithArray:_curProTopic.mdLabels];
157- // if (self.topicChangedBlock) {
158- // self.topicChangedBlock();
159- // }
160- // [self.navigationController popViewControllerAnimated:YES];
161- // }
162- // }];
163- // } else {
149+ self.navigationItem .rightBarButtonItem .enabled = NO ;
150+ if (_isSaveChange) {
151+
152+ @weakify (self);
153+ [[Coding_NetAPIManager sharedManager ] request_ModifyProjectTpoicLabel: self .curProTopic andBlock: ^(id data, NSError *error) {
154+ @strongify (self);
155+ self.navigationItem .rightBarButtonItem .enabled = YES ;
156+ if (data) {
157+ _curProTopic.labels = [NSMutableArray arrayWithArray: _curProTopic.mdLabels];
158+ if (self.topicChangedBlock ) {
159+ self.topicChangedBlock ();
160+ }
161+ [self .navigationController popViewControllerAnimated: YES ];
162+ }
163+ }];
164+ } else {
164165 if (self.topicChangedBlock ) {
165166 self.topicChangedBlock ();
166167 }
167168 [self .navigationController popViewControllerAnimated: YES ];
168- // }
169+ }
169170}
170171
171172- (void )addBtnClick : (UIButton *)sender
@@ -274,40 +275,40 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
274275 }
275276 }
276277 if (add) {
277- if (_isSaveChange) {
278- __weak typeof (self) weakSelf = self;
279- [[Coding_NetAPIManager sharedManager ] request_ProjectTopic_AddLabel_WithPath: [self toMedifyPath: lbl.id ] andBlock: ^(id data, NSError *error) {
280- if (!error) {
281- [_tempArray addObject: lbl];
282- weakSelf.navigationItem .rightBarButtonItem .enabled = YES ;
283- } else {
284- cell.selectBtn .selected = FALSE ;
285- }
286- }];
287- [_tempArray addObject: lbl];
288- self.navigationItem .rightBarButtonItem .enabled = YES ;
289- } else {
278+ // if (_isSaveChange) {
279+ // __weak typeof(self) weakSelf = self;
280+ // [[Coding_NetAPIManager sharedManager] request_ProjectTopic_AddLabel_WithPath:[self toMedifyPath:lbl.id] andBlock:^(id data, NSError *error) {
281+ // if (!error) {
282+ // [_tempArray addObject:lbl];
283+ // weakSelf.navigationItem.rightBarButtonItem.enabled = YES;
284+ // } else {
285+ // cell.selectBtn.selected = FALSE;
286+ // }
287+ // }];
288+ // [_tempArray addObject:lbl];
289+ // self.navigationItem.rightBarButtonItem.enabled = YES;
290+ // } else {
290291 [_tempArray addObject: lbl];
291292 self.navigationItem .rightBarButtonItem .enabled = YES ;
292- }
293+ // }
293294 }
294295 } else {
295296 for (ProjectTopicLabel *tempLbl in _tempArray) {
296297 if ([tempLbl.id integerValue ] == [lbl.id integerValue ]) {
297- if (_isSaveChange) {
298- __weak typeof (self) weakSelf = self;
299- [[Coding_NetAPIManager sharedManager ] request_ProjectTopic_DelLabel_WithPath: [self toMedifyPath: lbl.id ] andBlock: ^(id data, NSError *error) {
300- if (!error) {
301- [_tempArray removeObject: tempLbl];
302- weakSelf.navigationItem .rightBarButtonItem .enabled = YES ;
303- } else {
304- cell.selectBtn .selected = TRUE ;
305- }
306- }];
307- } else {
298+ // if (_isSaveChange) {
299+ // __weak typeof(self) weakSelf = self;
300+ // [[Coding_NetAPIManager sharedManager] request_ProjectTopic_DelLabel_WithPath:[self toMedifyPath:lbl.id] andBlock:^(id data, NSError *error) {
301+ // if (!error) {
302+ // [_tempArray removeObject:tempLbl];
303+ // weakSelf.navigationItem.rightBarButtonItem.enabled = YES;
304+ // } else {
305+ // cell.selectBtn.selected = TRUE;
306+ // }
307+ // }];
308+ // } else {
308309 [_tempArray removeObject: tempLbl];
309310 self.navigationItem .rightBarButtonItem .enabled = YES ;
310- }
311+ // }
311312 break ;
312313 }
313314 }
0 commit comments