// // AveragePriceMonitorTableViewCell.m // IBOSS // // Created by guan hong hou on 2017/9/7. // Copyright © 2017年 elongtian. All rights reserved. // // 功能描述:业务部门cell #import "BusinessDepartmentTreeTableViewCell.h" #define kTextFont [UIFont systemFontOfSize:13] @implementation BusinessDepartmentTreeTableViewCell #pragma 公共函数 - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { } return self; } #pragma 私有函数 /** 设置cell的UI @param model <#model description#> */ - (void)setUIWithModel:(BusinessDepartmentFrame *)frame{ if(frame!=nil){ _checkBT=[UIButton buttonWithType:UIButtonTypeCustom]; _checkBT.frame=frame.checkBtF; self.achievementFrame =frame; self.achievementModel=frame.departmentModel; [self.checkBT setImage:frame.departmentModel.isSelect?[UIImage imageNamed:@"order_checked"]:[UIImage imageNamed:@"order_unchecked"] forState:UIControlStateNormal]; [self.contentView addSubview:self.checkBT]; _departmentNameLbl=[[UILabel alloc]init]; _departmentNameLbl.frame=frame.departmentF; _departmentNameLbl.font=kTextFont; _departmentNameLbl.text = frame.departmentModel.organizationName; [self addSubview:_departmentNameLbl]; if(frame.departmentModel!=nil){ self.rightArrowImg=[[UIImageView alloc]init]; self.rightArrowImg.frame=frame.rightArrowF; if (frame.departmentModel.isExpand) { self.rightArrowImg.image = [UIImage imageNamed:@"All_downState"]; }else{ if (frame.departmentModel.childArray!=nil&&frame.departmentModel.childArray.count>0) { self.rightArrowImg.image = [UIImage imageNamed:@"All_rightState"]; } else{ self.rightArrowImg.image = nil; } } [self.contentView addSubview:self.rightArrowImg]; } UIView *bottomSeparator=[UIView new]; bottomSeparator.frame=frame.separatorF; [bottomSeparator setBackgroundColor:LineBackgroundColor]; [self.contentView addSubview:bottomSeparator]; } } -(void)selectButtonClick{ if ([self.delegate respondsToSelector:@selector(selectBtnClick:)]) { [self.delegate selectBtnClick:_achievementFrame]; } } @end