MyWordCell.m 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. //
  2. // MyWordCell.m
  3. // smartRhino
  4. //
  5. // Created by tederen on 2019/11/23.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "MyWordCell.h"
  9. @implementation MyWordCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. }
  13. - (void)looadDataHiden:(Boolean)hiden{
  14. self.deleteButton.hidden = hiden;
  15. }
  16. - (void)loadImageImageModel:(SelectImageModel *)selectModel{
  17. NSString * imageStr = [ZYCTool getFileNameImage:selectModel.FileUrl];
  18. if (imageStr.length > 0) {
  19. self.iconImage.image = IMG(imageStr);
  20. }else{
  21. [self.iconImage sd_setImageWithURL:[NSURL URLWithString:selectModel.FileUrl]];
  22. }
  23. self.nameLbl.text = [self fromatFileName:selectModel.FileName];
  24. }
  25. - (void)loadImageImageFlowModel:(FlowAttachmentsModel *)model
  26. {
  27. NSString * imageStr = [ZYCTool getFileNameImage:model.Title];
  28. switch (model.SoureTypeId) {
  29. case CollectModel_Aritle:
  30. {
  31. self.iconImage.image = IMG(@"文章");
  32. }
  33. break;
  34. case CollectModel_Toipc:
  35. {
  36. self.iconImage.image = IMG(@"话题");
  37. }
  38. break;
  39. case CollectModel_NewTopic:
  40. {
  41. self.iconImage.image = IMG(@"话题");
  42. }
  43. break;
  44. case CollectModel_Collect:
  45. {
  46. self.iconImage.image = IMG(@"收藏");
  47. }
  48. break;
  49. case CollectModel_NoteBook:
  50. {
  51. self.iconImage.image = IMG(@"noteBook_icon");
  52. }
  53. break;
  54. case CollectModel_Notice:
  55. {
  56. self.iconImage.image = IMG(@"通知图标");
  57. }
  58. break;
  59. case CollectModel_InterMail:
  60. {
  61. self.iconImage.image = IMG(@"站内信");
  62. }
  63. break;
  64. case CollectModel_Group:
  65. {
  66. self.iconImage.image = IMG(@"笔记小组");
  67. }
  68. break;
  69. case CollectModel_meetDetail:
  70. {
  71. self.iconImage.image = IMG(@"会议");
  72. }
  73. break;
  74. case CollectModel_meetMian:
  75. {
  76. self.iconImage.image = IMG(@"会议");
  77. }
  78. break;
  79. case CollectModel_work:
  80. {
  81. self.iconImage.image = IMG(@"审批");
  82. }
  83. break;
  84. case CollectModel_financeCount:
  85. {
  86. self.iconImage.image = IMG(@"报表");
  87. }
  88. break;
  89. case CollectModel_affairsCount:
  90. {
  91. self.iconImage.image = IMG(@"报表");
  92. }
  93. break;
  94. case CollectModel_publishCount:
  95. {
  96. self.iconImage.image = IMG(@"报表");
  97. }
  98. break;
  99. default:
  100. {
  101. if (imageStr.length > 0) {
  102. self.iconImage.image = IMG(imageStr);
  103. }else{
  104. [self.iconImage sd_setImageWithURL:[NSURL URLWithString:model.MinUrl]];
  105. }
  106. }
  107. break;
  108. }
  109. self.nameLbl.text = model.Title;
  110. }
  111. - (void)loadImageUrl:(NSString *)img{
  112. [self.iconImage setImageURL:[NSURL URLWithString:img]];
  113. }
  114. - (void)loadImageUrl:(NSString *)img withName:(NSString *)name {
  115. [self loadImageUrl:img];
  116. self.nameLbl.text = [self fromatFileName:name];
  117. }
  118. - (NSString *)fromatFileName:(NSString *)fileName {
  119. if (fileName.length > 5) {
  120. return [fileName substringWithRange:NSMakeRange(0, 5)];
  121. }
  122. return fileName;
  123. }
  124. @end