123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- //
- // MyWordCell.m
- // smartRhino
- //
- // Created by tederen on 2019/11/23.
- // Copyright © 2019 tederen. All rights reserved.
- //
- #import "MyWordCell.h"
- @implementation MyWordCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- }
- - (void)looadDataHiden:(Boolean)hiden{
- self.deleteButton.hidden = hiden;
- }
- - (void)loadImageImageModel:(SelectImageModel *)selectModel{
- NSString * imageStr = [ZYCTool getFileNameImage:selectModel.FileUrl];
- if (imageStr.length > 0) {
- self.iconImage.image = IMG(imageStr);
- }else{
- [self.iconImage sd_setImageWithURL:[NSURL URLWithString:selectModel.FileUrl]];
- }
- self.nameLbl.text = [self fromatFileName:selectModel.FileName];
- }
- - (void)loadImageImageFlowModel:(FlowAttachmentsModel *)model
- {
- NSString * imageStr = [ZYCTool getFileNameImage:model.Title];
- switch (model.SoureTypeId) {
- case CollectModel_Aritle:
- {
- self.iconImage.image = IMG(@"文章");
- }
- break;
- case CollectModel_Toipc:
- {
- self.iconImage.image = IMG(@"话题");
- }
- break;
- case CollectModel_NewTopic:
- {
- self.iconImage.image = IMG(@"话题");
- }
- break;
- case CollectModel_Collect:
- {
- self.iconImage.image = IMG(@"收藏");
- }
- break;
- case CollectModel_NoteBook:
- {
- self.iconImage.image = IMG(@"noteBook_icon");
- }
- break;
- case CollectModel_Notice:
- {
- self.iconImage.image = IMG(@"通知图标");
- }
- break;
- case CollectModel_InterMail:
- {
- self.iconImage.image = IMG(@"站内信");
- }
- break;
- case CollectModel_Group:
- {
- self.iconImage.image = IMG(@"笔记小组");
- }
- break;
- case CollectModel_meetDetail:
- {
- self.iconImage.image = IMG(@"会议");
- }
- break;
- case CollectModel_meetMian:
- {
- self.iconImage.image = IMG(@"会议");
- }
- break;
- case CollectModel_work:
- {
- self.iconImage.image = IMG(@"审批");
- }
- break;
- case CollectModel_financeCount:
- {
- self.iconImage.image = IMG(@"报表");
- }
- break;
- case CollectModel_affairsCount:
- {
- self.iconImage.image = IMG(@"报表");
- }
- break;
- case CollectModel_publishCount:
- {
- self.iconImage.image = IMG(@"报表");
- }
- break;
- default:
- {
- if (imageStr.length > 0) {
- self.iconImage.image = IMG(imageStr);
- }else{
- [self.iconImage sd_setImageWithURL:[NSURL URLWithString:model.MinUrl]];
- }
- }
- break;
- }
- self.nameLbl.text = model.Title;
- }
- - (void)loadImageUrl:(NSString *)img{
- [self.iconImage setImageURL:[NSURL URLWithString:img]];
- }
- - (void)loadImageUrl:(NSString *)img withName:(NSString *)name {
- [self loadImageUrl:img];
- self.nameLbl.text = [self fromatFileName:name];
- }
- - (NSString *)fromatFileName:(NSString *)fileName {
- if (fileName.length > 5) {
- return [fileName substringWithRange:NSMakeRange(0, 5)];
- }
- return fileName;
- }
- @end
|