TodoTaskTableViewCell.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // TodoTaskTableViewCell.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 16/8/3.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class TodoTaskTableViewCell: UITableViewCell {
  10. @IBOutlet weak var todoIconImageView: UIImageView!
  11. @IBOutlet weak var titleLabel: UILabel!
  12. @IBOutlet weak var statusLabel: UILabel!
  13. @IBOutlet weak var timeLabel: UILabel!
  14. override func awakeFromNib() {
  15. super.awakeFromNib()
  16. // Initialization code
  17. }
  18. override func setSelected(_ selected: Bool, animated: Bool) {
  19. super.setSelected(selected, animated: animated)
  20. // Configure the view for the selected state
  21. }
  22. func setData(cellModel:TodoCellModel<TodoTaskData>) {
  23. if let applicationId = cellModel.sourceObj?.application {
  24. ImageUtil.shared.getProcessApplicationIcon(id: applicationId)
  25. .then { (image) in
  26. self.todoIconImageView?.image = image
  27. }.catch { (err) in
  28. self.todoIconImageView?.image = UIImage(named: "todo_8")
  29. }
  30. }
  31. self.titleLabel.text = "[\((cellModel.sourceObj?.processName) ?? "")] \((cellModel.title) ?? "")"
  32. self.statusLabel.text = cellModel.status
  33. self.timeLabel.text = cellModel.time
  34. }
  35. }