O2App.swift 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. //
  2. // App.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 16/6/17.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import Foundation
  9. import UIKit
  10. import ObjectMapper
  11. class O2App:Mappable {
  12. var title:String?
  13. var appId:String?
  14. var storyBoard:String?
  15. var vcName:String?
  16. var segueIdentifier:String?
  17. var normalIcon:String?
  18. var selectedIcon:String?
  19. var customParameter:[String:AnyObject]?
  20. var order = 0
  21. var mainOrder = 0
  22. init(title:String?,appId:String?,storyBoard:String?,vcName:String?,segueIdentifier:String?,normalIcon:String?,selectedIcon:String?,customParameter:[String:AnyObject]?=nil,order:Int,mainOrder:Int){
  23. self.title = title
  24. self.appId = appId
  25. self.storyBoard = storyBoard
  26. self.vcName = vcName
  27. self.segueIdentifier = segueIdentifier
  28. self.normalIcon = normalIcon
  29. self.selectedIcon = selectedIcon
  30. self.customParameter = customParameter
  31. self.order = order
  32. self.mainOrder = mainOrder
  33. }
  34. init() {
  35. }
  36. required init?(map: Map) {
  37. }
  38. func mapping(map: Map) {
  39. title <- map["title"]
  40. appId <- map["appId"]
  41. storyBoard <- map["storyBoard"]
  42. vcName <- map["vcName"]
  43. segueIdentifier <- map["segueIdentifier"]
  44. normalIcon <- map["normalIcon"]
  45. selectedIcon <- map["selectedIcon"]
  46. customParameter <- map["customParameter"]
  47. order <- map["order"]
  48. mainOrder <- map["mainOrder"]
  49. }
  50. }
  51. class O2App2:Mappable {
  52. var enable : Bool?
  53. var id : Int?
  54. var key : String?
  55. var name : String?
  56. required init?(map: Map){}
  57. func mapping(map: Map)
  58. {
  59. enable <- map["enable"]
  60. id <- map["id"]
  61. key <- map["key"]
  62. name <- map["name"]
  63. }
  64. }
  65. class O2PortalApp : Mappable{
  66. var alias : String?
  67. var createTime : String?
  68. var creatorPerson : String?
  69. var descriptionField : String?
  70. var firstPage : String?
  71. var id : String?
  72. var lastUpdatePerson : String?
  73. var lastUpdateTime : String?
  74. var name : String?
  75. var portalCategory : String?
  76. var updateTime : String?
  77. required init?(map: Map){}
  78. func mapping(map: Map)
  79. {
  80. alias <- map["alias"]
  81. createTime <- map["createTime"]
  82. creatorPerson <- map["creatorPerson"]
  83. descriptionField <- map["description"]
  84. firstPage <- map["firstPage"]
  85. id <- map["id"]
  86. lastUpdatePerson <- map["lastUpdatePerson"]
  87. lastUpdateTime <- map["lastUpdateTime"]
  88. name <- map["name"]
  89. portalCategory <- map["portalCategory"]
  90. updateTime <- map["updateTime"]
  91. }
  92. }
  93. class O2AppUtil {
  94. static var apps:[O2App] {
  95. get {
  96. let app1 = O2App(title: "云盘", appId:"yunpan", storyBoard: "cloudStorage", vcName: nil, segueIdentifier: "showFileCloudSegue", normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  97. let app2 = O2App(title: "会议管理", appId:"meeting", storyBoard: "meeting", vcName: nil, segueIdentifier: "showMeetingSegue", normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  98. let app3 = O2App(title: "考勤管理", appId:"attendance", storyBoard: "checkin", vcName: nil, segueIdentifier: "showIcSegue", normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  99. let app4 = O2App(title: "BBS", appId:"bbs", storyBoard: "bbs", vcName: nil, segueIdentifier: "showBBSSegue", normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  100. let app5 = O2App(title: "内容管理", appId:"cms", storyBoard: "information", vcName: nil, segueIdentifier: "showCMSSegue", normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  101. let app6 = O2App(title: "待办", appId:"task", storyBoard: "task", vcName: "todoTask", segueIdentifier: nil, normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  102. let app10 = O2App(title: "已办", appId:"taskcompleted", storyBoard: "task", vcName: "todoTask", segueIdentifier: nil, normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  103. let app7 = O2App(title: "待阅", appId:"read", storyBoard: "task", vcName: "todoTask", segueIdentifier: nil, normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  104. let app11 = O2App(title: "已阅", appId:"readcompleted", storyBoard: "task", vcName: "todoTask", segueIdentifier: nil, normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  105. let app8 = O2App(title: "语音助手", appId: "o2ai", storyBoard: "ai", vcName: nil, segueIdentifier: "", normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  106. let app9 = O2App(title: "日程安排", appId: "calendar", storyBoard: "calendar", vcName: nil, segueIdentifier: "", normalIcon: "", selectedIcon: "", order: 0, mainOrder: 0)
  107. return [app1,app2,app3,app4,app5,app6, app10, app7, app11, app8, app9]
  108. }
  109. }
  110. static var defaultMainApps = [
  111. O2App(title: "待办", appId:"task", storyBoard: "task", vcName: "todoTask", segueIdentifier: nil, normalIcon: "icon_task", selectedIcon: "icon_task", order: 0, mainOrder: 0),
  112. O2App(title: "已办", appId:"taskcompleted", storyBoard: "task", vcName: "todoTask", segueIdentifier: nil, normalIcon: "icon_taskcompleted", selectedIcon: "icon_taskcompleted", order: 0, mainOrder: 0),
  113. O2App(title: "待阅", appId:"read", storyBoard: "task", vcName: "todoTask", segueIdentifier: nil, normalIcon: "icon_read", selectedIcon: "icon_read", order: 0, mainOrder: 0),
  114. O2App(title: "已阅", appId:"readcompleted", storyBoard: "task", vcName: "todoTask", segueIdentifier: nil, normalIcon: "icon_readcompleted", selectedIcon: "icon_readcompleted", order: 0, mainOrder: 0)
  115. ]
  116. }