zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
//  PBSchedulesElementTableViewCell.m
//  IphoneBIMe
//
//  Created by ZhangJF on 2022/9/5.
//  Copyright © 2022 ProBIM. All rights reserved.
//
 
#import "PBSchedulesElementTableViewCell.h"
#import "PBArtifactsInfoModel.h"
 
@interface PBSchedulesElementTableViewCell()
@property (nonatomic, weak) UILabel *nameL;
@end
@implementation PBSchedulesElementTableViewCell
 
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    UILabel *nameL = [UILabel z_labelWithText:@"构件名称构件名称" Color:PBColor(108, 108, 108) isBold:NO Font:14];
    [self.contentView addSubview:nameL];
    [nameL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(12);
        make.right.equalTo(self.contentView).offset(-40);
    }];
    UIButton *deleteBtn = [UIButton z_bgImageButton:[UIImage imageNamed:@"delete_task"]];
    [deleteBtn addTarget:self action:@selector(delete) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:deleteBtn];
    [deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(-12);
        make.centerY.equalTo(self.contentView);
        make.size.mas_equalTo(CGSizeMake(20, 20));
    }];
    self.nameL = nameL;
}
 
- (void)setArtifactsModel:(PBArtifactsInfoModel *)artifactsModel {
    _artifactsModel = artifactsModel;
    self.nameL.text = artifactsModel.bm_materialname;
}
- (void)delete{
    if (self.DeleteBlock){
        self.DeleteBlock();
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
 
    // Configure the view for the selected state
}
 
@end