// // LogSearchTableViewCell.m // IBOSSmini // // Created by guan hong hou on 2017/5/12. // Copyright © 2017年 elongtian. All rights reserved. // #import "LogSearchTableViewCell.h" #import "LogShareVC.h" @implementation LogSearchTableViewCell static LogSearchTableViewCell* logSearchCell; #pragma mark -公有方法 //加载xib - (void)awakeFromNib { [super awakeFromNib]; } #pragma mark -委托方法 //创建人选择完成回调方法 -(void)selectListItem: (NSArray*)shareArr{ NSMutableArray* ids=[NSMutableArray new]; NSMutableArray* names=[NSMutableArray new]; for (int i=0; i0){ _sShareId=[ ids componentsJoinedByString:@","]; _sShareName=[names componentsJoinedByString:@","]; [_createrBtn setTitle:_sShareName forState:UIControlStateNormal]; } [_searchModel setCreateUserId:_sShareId]; [_mutDict setValue:_searchModel forKey:SEARCH_RANGE_MODEL]; _slideModel.customDict = _mutDict; } #pragma mark -私有方法 //创建人点击事件 - (IBAction)createrClickAction:(id)sender { LogShareVC *tc=[LogShareVC new]; tc.isPresentViewFlg = YES; tc.shareDelegate=self; tc.tag=@"logList"; if ([self.delegate respondsToSelector:@selector(sideSlipTableViewCellNeedsDismissViewController:animated:)]) { [self.delegate sideSlipTableViewCellNeedsDismissViewController:tc animated:YES]; } } //开始日期点击事件 - (IBAction)selectStartDateAction:(id)sender { _brDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_brDatePicker configureSelectionBlock:^(NSString *date){ _startDate=date; } andCompletionBlock:^(void){ [_searchModel setStartDate:_startDate]; [_mutDict setValue:_searchModel forKey:SEARCH_RANGE_MODEL]; _slideModel.customDict =_mutDict; [sender setTitle:_startDate forState:UIControlStateNormal]; } andCancelBlock:^(void){ _startDate=_startDateBtn.titleLabel.text; }]; [_brDatePicker show]; } //结束日期点击事件 - (IBAction)selectEndDate:(id)sender { _brDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_brDatePicker configureSelectionBlock:^(NSString *date){ _endDate=date; } andCompletionBlock:^(void){ [_searchModel setEndDate:_endDate]; [_mutDict setValue:_searchModel forKey:SEARCH_RANGE_MODEL]; _slideModel.customDict = _mutDict; [sender setTitle:_endDate forState:UIControlStateNormal]; } andCancelBlock:^(void){ _endDate=_endDateBtn.titleLabel.text; }]; [_brDatePicker show]; } //单元格高度 - (CGFloat)cellHeight { return 280.0f; } //加载tableviewcell + (instancetype)createCellWithIndexPath:(NSIndexPath *)indexPath { LogSearchTableViewCell *cell = [[NSBundle mainBundle] loadNibNamed:@"LogSearchTableViewCell" owner:nil options:nil][0]; logSearchCell=cell; return cell; } //初始化cell数据 - (void)updateCellWithModel:(SideSlipModel *__autoreleasing *)model indexPath:(NSIndexPath *)indexPath { _slideModel=*model; _mutDict = [NSMutableDictionary dictionaryWithDictionary:_slideModel.customDict]; _searchModel=[LogSearchModel new]; [_mutDict setValue:_searchModel forKey:SEARCH_RANGE_MODEL]; _slideModel.customDict = _mutDict; } //返回tableviewcell标识 + (NSString *)cellReuseIdentifier { return @"SearchTableViewCell"; } @end