@titaui/pc 1.12.7-beta.4 → 1.12.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/lib/components/change-okr-modal/Item.js +19 -18
  2. package/lib/components/change-okr-modal/styledComponents.js +9 -9
  3. package/lib/components/create-okr-modal/createSuccessCmp.js +47 -19
  4. package/lib/components/create-okr-modal/fields/index.css +14 -3
  5. package/lib/components/create-okr-modal/fields/o-new-name.js +31 -20
  6. package/lib/components/create-okr-modal/fields/okr-case.js +7 -5
  7. package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
  8. package/lib/components/create-okr-modal/index.js +215 -142
  9. package/lib/components/create-okr-modal/kr-items/index.css +23 -13
  10. package/lib/components/create-okr-modal/kr-items/krDatas.js +96 -76
  11. package/lib/components/create-okr-modal/kr-items/krItem.js +54 -57
  12. package/lib/components/create-okr-modal/style.js +5 -5
  13. package/lib/components/dynamic/components/title/index.js +1 -1
  14. package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +7 -7
  15. package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +7 -7
  16. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +17 -17
  17. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +3 -1
  18. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +9 -9
  19. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +3 -1
  20. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +3 -1
  21. package/lib/components/dynamic/dynamic-item/index.js +4 -15
  22. package/lib/components/eReport/eReportLists/reportList.js +29 -30
  23. package/lib/components/eReport/eReportShare/style.js +1 -1
  24. package/lib/components/edit-kr-wight/EditKrWightModal.js +11 -9
  25. package/lib/components/menus/components/menu-tree/tree-node/index.css +0 -120
  26. package/lib/components/menus/components/menu-tree/tree-node/index.js +2 -22
  27. package/lib/components/menus/i18n.js +0 -8
  28. package/lib/components/menus/index.js +0 -6
  29. package/lib/components/nav-top/components/menu/index.js +4 -4
  30. package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -1
  31. package/lib/components/nav-top/components/user-message/components/todos/todo-item.js +3 -3
  32. package/lib/components/okr-detail/components/ao-nice/index.css +0 -1
  33. package/lib/components/okr-detail/components/header/edit-name.js +76 -39
  34. package/lib/components/okr-detail/components/header/index.css +122 -41
  35. package/lib/components/okr-detail/components/header/index.js +45 -48
  36. package/lib/components/{dynamic/dynamic-item/components/progress/components/okr-progress/index.js → okr-detail/components/header/o-classify.js} +84 -152
  37. package/lib/components/okr-detail/components/header/o-name.js +7 -5
  38. package/lib/components/okr-detail/components/o-progress-update/index.js +2 -2
  39. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +3 -1
  40. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +66 -4
  41. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +174 -64
  42. package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +9 -9
  43. package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +15 -13
  44. package/lib/components/okr-detail/components/tab-panel-content/index.css +1 -0
  45. package/lib/components/okr-detail/detail-header/index.js +11 -5
  46. package/lib/components/okr-detail/okr-list/create-kr-item/index.css +17 -0
  47. package/lib/components/okr-detail/okr-list/create-kr-item/index.js +75 -53
  48. package/lib/components/okr-detail/okr-list/index.css +9 -0
  49. package/lib/components/okr-detail/okr-list/index.js +25 -25
  50. package/lib/components/okr-detail/request-apis.js +73 -69
  51. package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
  52. package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
  53. package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
  54. package/lib/components/okr-flow/child-node/kr-node.js +3 -1
  55. package/lib/components/okr-flow/child-node/work-node.js +3 -1
  56. package/lib/components/okr-flow/export-modal/color.png +0 -0
  57. package/lib/components/okr-flow/export-modal/index.css +28 -13
  58. package/lib/components/okr-flow/export-modal/index.js +57 -14
  59. package/lib/components/okr-flow/export-modal/trans1.png +0 -0
  60. package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
  61. package/lib/components/okr-progress/components/o-progress/index.js +3 -1
  62. package/lib/components/okr-progress/components/o-progress-update/index.js +2 -2
  63. package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
  64. package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +3 -3
  65. package/lib/components/okr-share/common-painter/openDataPainter.js +9 -6
  66. package/lib/components/okr-share/common-painter/utils.js +187 -36
  67. package/lib/components/okr-share/index.css +5 -4
  68. package/lib/components/okr-share/pink-card/card.js +3 -3
  69. package/lib/components/okr-share/pink-card/drawKrs.js +97 -18
  70. package/lib/components/okr-share/pink-card/index.js +20 -12
  71. package/lib/components/open-data-painter/index.js +6 -5
  72. package/lib/components/period-selector/components/button/style.js +1 -1
  73. package/lib/components/period-selector/index.css +1 -0
  74. package/lib/components/period-selector/index.js +7 -2
  75. package/lib/components/picker/components/picker-trigger/index.js +2 -47
  76. package/lib/components/picker/picker-panels.js +4 -45
  77. package/lib/components/picker/picker.js +3 -7
  78. package/lib/components/search-input/index.js +0 -5
  79. package/lib/components/search-key-handle/index.js +12 -10
  80. package/lib/components/select-layer/index.js +22 -8
  81. package/lib/components/task-relation-modal/helper.js +1 -56
  82. package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +1 -4
  83. package/lib/components/task-relation-modal/okr-relation/request-api.js +2 -6
  84. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +2 -2
  85. package/lib/components/task-relation-modal/request-api.js +5 -2
  86. package/lib/components/task-relation-modal/tree/work-tree/index.js +27 -31
  87. package/lib/components/task-relation-modal/tree/work-tree/search-form.js +22 -3
  88. package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -4
  89. package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
  90. package/lib/components/task-relation-modal/tree-node/work-node/index.js +11 -11
  91. package/lib/components/textarea/index.js +5 -7
  92. package/lib/components/tooltip/tooltip.js +9 -4
  93. package/lib/components/upload/components/uploadedPreview.js +17 -17
  94. package/lib/components/upload/index.js +23 -23
  95. package/lib/components/user-selector/category-selector-panel/depart-tree.js +3 -1
  96. package/lib/components/user-selector/export-modules/field-tree-selector/index.css +2 -1
  97. package/lib/components/user-selector/export-modules/field-tree-selector/index.js +31 -17
  98. package/lib/components/user-selector/export-modules/multiple-user-selector--bak/index.css +1 -1
  99. package/lib/components/user-selector/searched-panel/index.js +4 -4
  100. package/lib/components/wechat-btn/index.css +5 -1
  101. package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
  102. package/lib/index.js +0 -48
  103. package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
  104. package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
  105. package/lib/pages/new-okr-list/header/index.js +15 -15
  106. package/lib/utils/bs-global.js +1 -1
  107. package/lib/utils/constant.js +2 -8
  108. package/lib/utils/helpers.js +11 -56
  109. package/lib/utils/hooks.js +5 -5
  110. package/lib/utils/open-data.js +216 -66
  111. package/lib/utils/tita-okr-cycle.js +3 -3
  112. package/package.json +2 -2
  113. package/lib/components/attachments-preview/index.css +0 -11
  114. package/lib/components/attachments-preview/index.js +0 -112
  115. package/lib/components/auto-save/img/failed.svg +0 -17
  116. package/lib/components/auto-save/img/success.svg +0 -16
  117. package/lib/components/auto-save/index.css +0 -39
  118. package/lib/components/auto-save/index.js +0 -78
  119. package/lib/components/auto-save/interface.js +0 -5
  120. package/lib/components/color-date-picker/index.css +0 -65
  121. package/lib/components/color-date-picker/index.js +0 -123
  122. package/lib/components/color-date-picker/interface.js +0 -14
  123. package/lib/components/dialog-upload/img/doc.svg +0 -1
  124. package/lib/components/dialog-upload/img/other.svg +0 -1
  125. package/lib/components/dialog-upload/img/pdf.svg +0 -1
  126. package/lib/components/dialog-upload/img/ppt.svg +0 -1
  127. package/lib/components/dialog-upload/img/radio.svg +0 -1
  128. package/lib/components/dialog-upload/img/video.svg +0 -1
  129. package/lib/components/dialog-upload/img/xls.svg +0 -1
  130. package/lib/components/dialog-upload/index.css +0 -77
  131. package/lib/components/dialog-upload/index.js +0 -332
  132. package/lib/components/dialog-upload/type.js +0 -35
  133. package/lib/components/dialog-upload/uploaded-preview.css +0 -77
  134. package/lib/components/dialog-upload/uploaded-preview.js +0 -132
  135. package/lib/components/dialog-upload/util.js +0 -131
  136. package/lib/components/dynamic/dynamic-item/components/comments-dialog/encourage.js +0 -119
  137. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/APP-shoucang-m.png +0 -0
  138. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/ascore.png +0 -0
  139. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/curEfforts.png +0 -0
  140. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/curGood.png +0 -0
  141. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/curGreat.png +0 -0
  142. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/efforts.png +0 -0
  143. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/good.png +0 -0
  144. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/great.png +0 -0
  145. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/halfscore.png +0 -0
  146. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/loading.gif +0 -0
  147. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/score.png +0 -0
  148. package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/top.svg +0 -14
  149. package/lib/components/dynamic/dynamic-item/components/comments-dialog/index.css +0 -68
  150. package/lib/components/dynamic/dynamic-item/components/comments-dialog/index.js +0 -118
  151. package/lib/components/dynamic/dynamic-item/components/comments-dialog/rate.js +0 -143
  152. package/lib/components/dynamic/dynamic-item/components/header/img/evalute.png +0 -0
  153. package/lib/components/dynamic/dynamic-item/components/header/img/fighting.png +0 -0
  154. package/lib/components/dynamic/dynamic-item/components/header/img/happy.png +0 -0
  155. package/lib/components/dynamic/dynamic-item/components/header/img/long-story.png +0 -0
  156. package/lib/components/dynamic/dynamic-item/components/header/img/pressure.png +0 -0
  157. package/lib/components/dynamic/dynamic-item/components/okr-progress/index.css +0 -170
  158. package/lib/components/dynamic/dynamic-item/components/okr-progress/index.js +0 -120
  159. package/lib/components/dynamic/dynamic-item/components/okr-progress/interface.js +0 -5
  160. package/lib/components/dynamic/dynamic-item/components/okr-progress/request-api.js +0 -10
  161. package/lib/components/dynamic/dynamic-item/components/okr-progress/utils.js +0 -10
  162. package/lib/components/dynamic/dynamic-item/components/progress/components/kr-progress/index.css +0 -8
  163. package/lib/components/dynamic/dynamic-item/components/progress/components/kr-progress/index.js +0 -26
  164. package/lib/components/dynamic/dynamic-item/components/progress/components/o-progress/index.css +0 -8
  165. package/lib/components/dynamic/dynamic-item/components/progress/components/o-progress/index.js +0 -26
  166. package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/index.css +0 -197
  167. package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/request-api.js +0 -20
  168. package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/util.js +0 -134
  169. package/lib/components/dynamic/dynamic-item/components/progress/components/task-progress/index.css +0 -10
  170. package/lib/components/dynamic/dynamic-item/components/progress/components/task-progress/index.js +0 -60
  171. package/lib/components/dynamic/dynamic-item/components/progress/index.css +0 -25
  172. package/lib/components/dynamic/dynamic-item/components/progress/index.js +0 -71
  173. package/lib/components/dynamic/dynamic-item/components/progress/interface.js +0 -5
  174. package/lib/components/dynamic/dynamic-item/components/schedule/index.css +0 -31
  175. package/lib/components/dynamic/dynamic-item/components/schedule/index.js +0 -59
  176. package/lib/components/dynamic/dynamic-item/components/schedule/interface.js +0 -5
  177. package/lib/components/dynamic/dynamic-item/components/summary-header/img/evalute.png +0 -0
  178. package/lib/components/dynamic/dynamic-item/components/summary-header/img/fighting.png +0 -0
  179. package/lib/components/dynamic/dynamic-item/components/summary-header/img/happy.png +0 -0
  180. package/lib/components/dynamic/dynamic-item/components/summary-header/img/long-story.png +0 -0
  181. package/lib/components/dynamic/dynamic-item/components/summary-header/img/pressure.png +0 -0
  182. package/lib/components/dynamic/dynamic-item/components/summary-header/index.css +0 -136
  183. package/lib/components/dynamic/dynamic-item/components/summary-header/index.js +0 -364
  184. package/lib/components/dynamic/dynamic-item/components/table-row-o-project/index.css +0 -24
  185. package/lib/components/dynamic/dynamic-item/components/table-row-o-project/index.js +0 -52
  186. package/lib/components/dynamic/dynamic-item/components/table-row-o-project/interface.js +0 -5
  187. package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.css +0 -50
  188. package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.js +0 -65
  189. package/lib/components/dynamic/dynamic-item/components/table-row-okr/interface.js +0 -5
  190. package/lib/components/dynamic/dynamic-item/components/task-progress/index.css +0 -201
  191. package/lib/components/dynamic/dynamic-item/components/task-progress/index.js +0 -95
  192. package/lib/components/dynamic/dynamic-item/components/task-progress/interface.js +0 -5
  193. package/lib/components/dynamic/dynamic-item/components/task-progress/utils.js +0 -10
  194. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/come-on-big.png +0 -0
  195. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/come-on-small.png +0 -0
  196. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/evaluate-big.png +0 -0
  197. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/nice-big.png +0 -0
  198. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/nice-small.png +0 -0
  199. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/very-good-big.png +0 -0
  200. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/very-good-small.png +0 -0
  201. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.css +0 -32
  202. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.js +0 -43
  203. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.css +0 -37
  204. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.js +0 -79
  205. package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/evalute.png +0 -0
  206. package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/fighting.png +0 -0
  207. package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/happy.png +0 -0
  208. package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/long-story.png +0 -0
  209. package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/pressure.png +0 -0
  210. package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.css +0 -155
  211. package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.js +0 -155
  212. package/lib/components/import-modal/helper.js +0 -179
  213. package/lib/components/import-modal/image/loading.gif +0 -0
  214. package/lib/components/import-modal/import-okr-modal/index.css +0 -18
  215. package/lib/components/import-modal/import-okr-modal/index.js +0 -132
  216. package/lib/components/import-modal/import-task-modal/index.css +0 -18
  217. package/lib/components/import-modal/import-task-modal/index.js +0 -240
  218. package/lib/components/import-modal/import-task-modal/search-form.js +0 -135
  219. package/lib/components/import-modal/index.css +0 -30
  220. package/lib/components/import-modal/index.js +0 -20
  221. package/lib/components/import-modal/radio.js +0 -62
  222. package/lib/components/import-modal/request-api.js +0 -204
  223. package/lib/components/import-modal/search/category-select.js +0 -74
  224. package/lib/components/import-modal/search/okr-classify-select.js +0 -74
  225. package/lib/components/import-modal/search/okr-status-select.js +0 -74
  226. package/lib/components/import-modal/search/okr-type-select.js +0 -87
  227. package/lib/components/import-modal/search/principal.js +0 -135
  228. package/lib/components/import-modal/search/relation.js +0 -77
  229. package/lib/components/import-modal/search/search-dropdown/index.css +0 -50
  230. package/lib/components/import-modal/search/search-dropdown/index.js +0 -32
  231. package/lib/components/import-modal/search/task-relation.js +0 -83
  232. package/lib/components/import-modal/search/task-status-select.js +0 -87
  233. package/lib/components/import-modal/search/work-relation.js +0 -83
  234. package/lib/components/import-modal/search/work-status-select.js +0 -74
  235. package/lib/components/import-modal/tree/okr-tree/index.css +0 -61
  236. package/lib/components/import-modal/tree/okr-tree/index.js +0 -267
  237. package/lib/components/import-modal/tree/okr-tree/search-form.js +0 -161
  238. package/lib/components/import-modal/tree/task-work-tree/index.css +0 -123
  239. package/lib/components/import-modal/tree/task-work-tree/index.js +0 -187
  240. package/lib/components/import-modal/tree-node/index.css +0 -0
  241. package/lib/components/import-modal/tree-node/index.js +0 -51
  242. package/lib/components/import-modal/tree-node/kr-node/index.css +0 -58
  243. package/lib/components/import-modal/tree-node/kr-node/index.js +0 -108
  244. package/lib/components/import-modal/tree-node/milestone-node/index.css +0 -61
  245. package/lib/components/import-modal/tree-node/milestone-node/index.js +0 -118
  246. package/lib/components/import-modal/tree-node/o-node/index.css +0 -46
  247. package/lib/components/import-modal/tree-node/o-node/index.js +0 -138
  248. package/lib/components/import-modal/tree-node/work-node/index.css +0 -51
  249. package/lib/components/import-modal/tree-node/work-node/index.js +0 -108
  250. package/lib/components/menus/components/menu-tree/images/summary-menu/caidan-enjoy.svg +0 -14
  251. package/lib/components/menus/components/menu-tree/images/summary-menu/my-setup.svg +0 -18
  252. package/lib/components/menus/components/menu-tree/images/summary-menu/my-zongjie.svg +0 -15
  253. package/lib/components/menus/components/menu-tree/images/summary-menu/zongjie-s.svg +0 -15
  254. package/lib/components/menus/components/menu-tree/tree-node/subordinates.js +0 -74
  255. package/lib/components/menus/components/menu-tree/tree-node/summary-share.js +0 -74
  256. package/lib/components/menus/export-modules/summary-menus/depart-menus/helper.js +0 -56
  257. package/lib/components/menus/export-modules/summary-menus/depart-menus/index.css +0 -32
  258. package/lib/components/menus/export-modules/summary-menus/depart-menus/index.js +0 -201
  259. package/lib/components/menus/export-modules/summary-menus/index.css +0 -9
  260. package/lib/components/menus/export-modules/summary-menus/index.js +0 -134
  261. package/lib/components/menus/export-modules/summary-menus/menu-highlight.js +0 -76
  262. package/lib/components/menus/export-modules/summary-menus/menus.js +0 -199
  263. package/lib/components/menus/export-modules/summary-menus/summary-front-menus.js +0 -199
  264. package/lib/components/new-confidence/constant.js +0 -53
  265. package/lib/components/new-confidence/img/1.svg +0 -40
  266. package/lib/components/new-confidence/img/10.svg +0 -33
  267. package/lib/components/new-confidence/img/2.svg +0 -40
  268. package/lib/components/new-confidence/img/3.svg +0 -40
  269. package/lib/components/new-confidence/img/4.svg +0 -40
  270. package/lib/components/new-confidence/img/5.svg +0 -40
  271. package/lib/components/new-confidence/img/6.svg +0 -40
  272. package/lib/components/new-confidence/img/7.svg +0 -40
  273. package/lib/components/new-confidence/img/8.svg +0 -40
  274. package/lib/components/new-confidence/img/9.svg +0 -40
  275. package/lib/components/new-confidence/index.css +0 -62
  276. package/lib/components/new-confidence/index.js +0 -115
  277. package/lib/components/new-confidence/interface.js +0 -5
  278. package/lib/components/picker/components/panels/week-panel/index.css +0 -42
  279. package/lib/components/picker/components/panels/week-panel/index.js +0 -49
  280. package/lib/components/picker/components/panels/week-panel/utils.js +0 -45
  281. package/lib/components/picker/components/panels/week-panel/week-body.js +0 -79
  282. package/lib/components/picker/components/panels/week-panel/week-head.js +0 -80
  283. package/lib/components/rate/index.js +0 -50
  284. package/lib/components/regulation-setting-item/index.css +0 -33
  285. package/lib/components/regulation-setting-item/index.js +0 -37
  286. package/lib/components/rich-editor-at/components/index.css +0 -66
  287. package/lib/components/rich-editor-at/components/index.js +0 -188
  288. package/lib/components/rich-editor-at/index.css +0 -40
  289. package/lib/components/rich-editor-at/index.js +0 -108
  290. package/lib/components/rich-editor-upload/index.css +0 -11
  291. package/lib/components/rich-editor-upload/index.js +0 -84
  292. package/lib/utils/planDataJson.js +0 -11115
@@ -1,201 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = _default;
9
-
10
- var _react = _interopRequireWildcard(require("react"));
11
-
12
- var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
- var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
15
-
16
- var _i18n = require("../../../i18n");
17
-
18
- var _menuTree = _interopRequireDefault(require("../../../components/menu-tree"));
19
-
20
- var _requestApis = require("../../../request-apis");
21
-
22
- var _index = require("../../../components/menu-tree/tree-node/index");
23
-
24
- var _utils = require("../../../utils");
25
-
26
- var _precls = _interopRequireDefault(require("../../../precls"));
27
-
28
- var _scrollbar = _interopRequireDefault(require("../../../../scrollbar"));
29
-
30
- require("../../../index.css");
31
-
32
- require("./index.css");
33
-
34
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
-
36
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
-
38
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
-
40
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
41
-
42
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
43
-
44
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
45
-
46
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
47
-
48
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
49
-
50
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
51
-
52
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
53
-
54
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
55
-
56
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
57
-
58
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
59
-
60
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
61
-
62
- function _default() {
63
- var loadedNode = (0, _react.useRef)([]);
64
-
65
- var _useState = (0, _react.useState)([]),
66
- _useState2 = _slicedToArray(_useState, 2),
67
- treeData = _useState2[0],
68
- setTreeData = _useState2[1];
69
-
70
- var _useState3 = (0, _react.useState)([]),
71
- _useState4 = _slicedToArray(_useState3, 2),
72
- rawTreeData = _useState4[0],
73
- setRawTreeData = _useState4[1];
74
-
75
- var _useState5 = (0, _react.useState)(["0"]),
76
- _useState6 = _slicedToArray(_useState5, 2),
77
- selectedMenuKeys = _useState6[0],
78
- setSelectedMenuKeys = _useState6[1];
79
-
80
- var _useState7 = (0, _react.useState)(true),
81
- _useState8 = _slicedToArray(_useState7, 2),
82
- loading = _useState8[0],
83
- setLoading = _useState8[1]; // 部门虚拟列表高度配置
84
-
85
-
86
- var _useState9 = (0, _react.useState)(0),
87
- _useState10 = _slicedToArray(_useState9, 2),
88
- height = _useState10[0],
89
- setHeight = _useState10[1];
90
-
91
- var _useState11 = (0, _react.useState)(40),
92
- _useState12 = _slicedToArray(_useState11, 1),
93
- itemHeight = _useState12[0];
94
-
95
- var _useState13 = (0, _react.useState)(window.BSGlobal.OkrAdvancedSetting.KRSetting.OkrDepsShowUser),
96
- _useState14 = _slicedToArray(_useState13, 1),
97
- isGetUser = _useState14[0];
98
-
99
- (0, _react.useEffect)(function () {
100
- var allDepartmentText = window.getLocale && window.getLocale(_i18n.locale.menu_alldeparment) || _i18n.locale.menu_alldeparment;
101
-
102
- (0, _requestApis.getDepsAndUsers)(-1, isGetUser).then(function (rawTreeData) {
103
- var rootNode = {
104
- async: true,
105
- data: {
106
- id: 0,
107
- name: allDepartmentText
108
- },
109
- pid: -1,
110
- id: "0",
111
- key: "0",
112
- isLeaf: true,
113
- nodeType: _index.DEPART_NODE,
114
- title: allDepartmentText
115
- };
116
- setRawTreeData([rootNode].concat(_toConsumableArray(rawTreeData)));
117
- setTreeData((0, _utils.toTree)([rootNode].concat(_toConsumableArray(rawTreeData))));
118
- setLoading(false);
119
- });
120
- }, []); // 因为要实现虚拟列表的功能,所有要动态的计算出一个菜单的高度
121
-
122
- (0, _react.useEffect)(function () {
123
- setHeight(document.body.offsetHeight - 164);
124
- }, []); // useEffect(() => {
125
- // location.href = "#/okr/manage?departmentName=公司全部&departmentId=0";
126
- // }, []);
127
- // 动态加载子节点数据集
128
-
129
- var onLoadTreeNodeDataHandler = function onLoadTreeNodeDataHandler(treeNode) {
130
- if (loadedNode.current.includes(treeNode.id)) return null;
131
- return new Promise(function (resolve) {
132
- (0, _requestApis.getDepsAndUsers)(treeNode.id, isGetUser).then(function (nodes) {
133
- if (!nodes.length) {
134
- resolve(true);
135
- return;
136
- }
137
-
138
- nodes.forEach(function (it) {
139
- return rawTreeData.push(it);
140
- });
141
- setRawTreeData(rawTreeData);
142
- setTreeData((0, _utils.toTree)(rawTreeData));
143
- resolve(true);
144
- });
145
- });
146
- };
147
-
148
- var onSelectHandler = function onSelectHandler(selectedKyes, _ref) {
149
- var node = _ref.node;
150
- // 处理菜单选中
151
- if (!selectedKyes.length) return;
152
- var nodeType = node.nodeType,
153
- data = node.data;
154
-
155
- if (nodeType == _index.USER_NODE) {// location.href = `#/okr/manage?toUserId=${data.userId}`;
156
- } else if (nodeType == _index.DEPART_NODE) {// location.href = `#/okr/manage?departmentName=${data.name}&departmentId=${data.id}`;
157
- }
158
-
159
- setSelectedMenuKeys(selectedKyes);
160
- };
161
-
162
- (0, _react.useEffect)(function () {
163
- var obs = new _resizeObserverPolyfill["default"](function (entries) {
164
- var _iterator = _createForOfIteratorHelper(entries),
165
- _step;
166
-
167
- try {
168
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
169
- var entry = _step.value;
170
- var cr = entry.contentRect;
171
- setHeight(cr.height - 164);
172
- }
173
- } catch (err) {
174
- _iterator.e(err);
175
- } finally {
176
- _iterator.f();
177
- }
178
- });
179
- obs.observe(document.body);
180
- return function () {
181
- obs.unobserve(document.body);
182
- };
183
- }, []);
184
- return /*#__PURE__*/_react["default"].createElement("div", {
185
- className: (0, _classnames["default"])("".concat(_precls["default"], "__depart-menus"))
186
- }, loading ? /*#__PURE__*/_react["default"].createElement("div", {
187
- className: (0, _classnames["default"])("".concat(_precls["default"], "__depart-menus--loading"))
188
- }, /*#__PURE__*/_react["default"].createElement("span", null)) : /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], {
189
- style: {
190
- maxHeight: height
191
- }
192
- }, /*#__PURE__*/_react["default"].createElement(_menuTree["default"], {
193
- data: treeData,
194
- itemHeight: itemHeight,
195
- virtual: true,
196
- onSelect: onSelectHandler,
197
- defaultExpandedKeys: ["0"],
198
- selectedKeys: selectedMenuKeys,
199
- loadData: onLoadTreeNodeDataHandler
200
- })));
201
- }
@@ -1,9 +0,0 @@
1
- .titaui-menus-summary-menus {
2
- position: relative;
3
- box-sizing: border-box;
4
- }
5
-
6
- .titaui-menus-summary-menus-back {
7
- height: 100%;
8
- overflow: hidden;
9
- }
@@ -1,134 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _react = _interopRequireWildcard(require("react"));
11
-
12
- var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
- var _reactRouter = require("react-router");
15
-
16
- var _departMenus = _interopRequireDefault(require("./depart-menus"));
17
-
18
- var _flipMenuCard = _interopRequireDefault(require("../../components/flip-menu-card"));
19
-
20
- var _searchColleague = _interopRequireDefault(require("../../components/search-colleague"));
21
-
22
- var _summaryFrontMenus = _interopRequireDefault(require("./summary-front-menus"));
23
-
24
- var _context = require("../../context");
25
-
26
- var _precls = _interopRequireDefault(require("../../precls"));
27
-
28
- var _getLocale = require("../../../../utils/getLocale");
29
-
30
- require("../../index.css");
31
-
32
- require("./index.css");
33
-
34
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
-
36
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
-
38
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
-
40
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
41
-
42
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
43
-
44
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
45
-
46
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
47
-
48
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
49
-
50
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
51
-
52
- function SummaryMenus(props) {
53
- var _props$onSelect = props.onSelect,
54
- onSelect = _props$onSelect === void 0 ? function () {} : _props$onSelect,
55
- history = props.history;
56
-
57
- var _useState = (0, _react.useState)({}),
58
- _useState2 = _slicedToArray(_useState, 2),
59
- flipOptions = _useState2[0],
60
- setFlipOptions = _useState2[1];
61
-
62
- var _useState3 = (0, _react.useState)(""),
63
- _useState4 = _slicedToArray(_useState3, 2),
64
- flipBackType = _useState4[0],
65
- setFlipBackType = _useState4[1];
66
-
67
- var summmaryFrontMenu = (0, _react.useRef)();
68
- var menuRef = (0, _react.useRef)();
69
- var flipRef = (0, _react.useRef)({
70
- next: function next() {},
71
- goback: function goback() {}
72
- });
73
-
74
- var onUserSelectHandler = function onUserSelectHandler(user) {
75
- location.href = "#/summary/manage?toUserId=".concat(user.id);
76
- };
77
-
78
- var flipGoNext = function flipGoNext(opt) {
79
- setFlipBackType(opt.type);
80
- setFlipOptions(opt.options);
81
- flipRef.current.next();
82
- };
83
-
84
- var collapseMenu = function collapseMenu(isHide) {
85
- if (isHide) {
86
- menuRef.current.style.width = "0px";
87
- } else {
88
- menuRef.current.style.width = "";
89
- }
90
- };
91
-
92
- var onFlipChangeHandler = function onFlipChangeHandler(isBack) {
93
- if (!isBack) {
94
- // 返回,取消菜单的高亮
95
- summmaryFrontMenu.current.setSelectedMenuKeys([]);
96
- setTimeout(function () {
97
- return (// 正面时销毁背面
98
- setFlipBackType("")
99
- );
100
- }, 600);
101
- }
102
- };
103
-
104
- return /*#__PURE__*/_react["default"].createElement(_context.FlipContext.Provider, {
105
- value: {
106
- flipGoNext: flipGoNext
107
- }
108
- }, /*#__PURE__*/_react["default"].createElement("div", {
109
- ref: menuRef,
110
- className: (0, _classnames["default"])("".concat(_precls["default"], "-summary-menus"))
111
- }, /*#__PURE__*/_react["default"].createElement(_flipMenuCard["default"], {
112
- ref: flipRef,
113
- collapseMenu: collapseMenu,
114
- defaultWidth: _getLocale.isEn ? 210 : 180,
115
- onChange: onFlipChangeHandler
116
- }, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
117
- style: {
118
- marginBottom: 12
119
- }
120
- }, /*#__PURE__*/_react["default"].createElement(_searchColleague["default"], {
121
- onSelect: onUserSelectHandler
122
- })), /*#__PURE__*/_react["default"].createElement(_summaryFrontMenus["default"], {
123
- ref: summmaryFrontMenu,
124
- onSelect: onSelect,
125
- history: history
126
- })), /*#__PURE__*/_react["default"].createElement("div", {
127
- className: (0, _classnames["default"])("".concat(_precls["default"], "-summary-menus-back"), "tita-bootstrap__scrollbar")
128
- }, flipBackType == "depart" && /*#__PURE__*/_react["default"].createElement(_departMenus["default"], null)))));
129
- } // @ts-ignore
130
-
131
-
132
- var _default = (0, _reactRouter.withRouter)(SummaryMenus);
133
-
134
- exports["default"] = _default;
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _menus = require("./menus");
9
-
10
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
-
12
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
13
-
14
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15
-
16
- var _default = /*#__PURE__*/function () {
17
- function _default(history) {
18
- _classCallCheck(this, _default);
19
-
20
- this.history = null;
21
- this.history = history;
22
- }
23
-
24
- _createClass(_default, [{
25
- key: "highlight",
26
- value: function highlight(cb) {
27
- if (this.isALLSummary()) {
28
- cb(_menus.PAGE_SUMMARY_ALl);
29
- } else if (this.isMySummary()) {
30
- cb(_menus.PAGE_SUMMARY_MY);
31
- } else if (this.isSummaryChart()) {
32
- cb(_menus.PAGE_SUMMARY_CHART);
33
- } else if (this.isShare()) {
34
- cb(_menus.PAGE_SUMMARY_SHARE);
35
- } else if (this.isSubordinatesSummary()) {
36
- cb(_menus.PAGE_SUMMARY_SUBORDINATE);
37
- }
38
-
39
- return null;
40
- }
41
- }, {
42
- key: "isALLSummary",
43
- value: function isALLSummary() {
44
- var pathname = this.history.location.pathname;
45
- return pathname.match(/summary\/all/);
46
- }
47
- }, {
48
- key: "isMySummary",
49
- value: function isMySummary() {
50
- var pathname = this.history.location.pathname;
51
- return pathname.match(/summary\/my/);
52
- }
53
- }, {
54
- key: "isSubordinatesSummary",
55
- value: function isSubordinatesSummary() {
56
- var pathname = this.history.location.pathname;
57
- return pathname.match(/summary\/subordinates/);
58
- }
59
- }, {
60
- key: "isShare",
61
- value: function isShare() {
62
- var pathname = this.history.location.pathname;
63
- return pathname.match(/summary\/share/);
64
- }
65
- }, {
66
- key: "isSummaryChart",
67
- value: function isSummaryChart() {
68
- var pathname = this.history.location.pathname;
69
- return pathname.match(/summary\/chart/);
70
- }
71
- }]);
72
-
73
- return _default;
74
- }();
75
-
76
- exports["default"] = _default;
@@ -1,199 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.defaultRefObject = exports["default"] = exports.PAGE_SUMMARY_SUBORDINATE = exports.PAGE_SUMMARY_SHARE = exports.PAGE_SUMMARY_ROLE = exports.PAGE_SUMMARY_MY = exports.PAGE_SUMMARY_DEPART = exports.PAGE_SUMMARY_CHART = exports.PAGE_SUMMARY_ALl = void 0;
7
-
8
- var _auth = require("../../../../utils/auth");
9
-
10
- var _i18n = require("../../i18n");
11
-
12
- var _index = require("../../components/menu-tree/tree-node/index");
13
-
14
- var _getLocale = require("../../../../utils/getLocale");
15
-
16
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
-
18
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
19
-
20
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
-
22
- var defaultRefObject = {
23
- menus: [],
24
- insertSubordinates: function insertSubordinates() {},
25
- getMenus: function getMenus() {},
26
- setSubordinatesLoading: function setSubordinatesLoading() {},
27
- SUBORDINATES: ""
28
- };
29
- exports.defaultRefObject = defaultRefObject;
30
- var PAGE_SUMMARY_ALl = "summaryall";
31
- exports.PAGE_SUMMARY_ALl = PAGE_SUMMARY_ALl;
32
- var PAGE_SUMMARY_MY = "summarymy";
33
- exports.PAGE_SUMMARY_MY = PAGE_SUMMARY_MY;
34
- var PAGE_SUMMARY_SUBORDINATE = "subordinates";
35
- exports.PAGE_SUMMARY_SUBORDINATE = PAGE_SUMMARY_SUBORDINATE;
36
- var PAGE_SUMMARY_SHARE = "share";
37
- exports.PAGE_SUMMARY_SHARE = PAGE_SUMMARY_SHARE;
38
- var PAGE_SUMMARY_DEPART = "depart";
39
- exports.PAGE_SUMMARY_DEPART = PAGE_SUMMARY_DEPART;
40
- var PAGE_SUMMARY_ROLE = "role";
41
- exports.PAGE_SUMMARY_ROLE = PAGE_SUMMARY_ROLE;
42
- var PAGE_SUMMARY_CHART = "chart";
43
- exports.PAGE_SUMMARY_CHART = PAGE_SUMMARY_CHART;
44
-
45
- var summaryMenus = /*#__PURE__*/function () {
46
- function summaryMenus() {
47
- _classCallCheck(this, summaryMenus);
48
-
49
- this.COMPANYALL = _index.COMPANY_ALL_NODE;
50
- this.SHARE = _index.SHARE_NODE;
51
- this.SUBORDINATES = 'subordinates';
52
- var hasDashboardAuth = false;
53
- var baseAuth = new _auth.BaseAuth();
54
-
55
- if (baseAuth.isBoss() || baseAuth.isManager() || baseAuth.isDepartmentLeader()) {
56
- hasDashboardAuth = true;
57
- }
58
-
59
- this.menus = [{
60
- icon: "all-zongjie",
61
- label: _i18n.locale.menu_all_summary,
62
- key: PAGE_SUMMARY_ALl,
63
- type: _index.MENU_ITEM_NOE,
64
- href: "#/summary/all"
65
- }, {
66
- icon: "caidan-my",
67
- label: _i18n.locale.menu_my_summary,
68
- key: PAGE_SUMMARY_MY,
69
- type: _index.MENU_ITEM_NOE,
70
- href: "#/summary/my"
71
- }, {
72
- icon: "caidan-xiashu",
73
- label: _i18n.locale.menu_my_subordinates,
74
- key: this.SUBORDINATES,
75
- type: _index.SUBORDINATES_NODE,
76
- isLeaf: false,
77
- children: [],
78
- href: "#/summary/subordinates",
79
- isShow: window.BSGlobal.loginUserInfo.HasSub
80
- }, {
81
- icon: "caidan-enjoy",
82
- label: _i18n.locale.menu_my_share,
83
- key: PAGE_SUMMARY_SHARE,
84
- type: _index.MENU_ITEM_NOE,
85
- href: "#/summary/share"
86
- }, {
87
- icon: "bumen",
88
- label: _i18n.locale.menu_department,
89
- key: this.COMPANYALL,
90
- type: this.COMPANYALL,
91
- href: ""
92
- }, {
93
- icon: "",
94
- label: _i18n.locale.menu_summary,
95
- key: "other",
96
- type: _index.GROUP_NAME_NODE,
97
- href: ""
98
- }, {
99
- icon: "my-setup",
100
- label: _i18n.locale.menu_summary_role,
101
- key: PAGE_SUMMARY_ROLE,
102
- type: _index.MENU_ITEM_NOE,
103
- href: "#/enterprise/manage?reactRouterName=daily"
104
- }, {
105
- icon: "yibiao",
106
- label: _i18n.locale.menu_summary_count,
107
- key: PAGE_SUMMARY_CHART,
108
- type: _index.MENU_ITEM_NOE,
109
- href: "#/summary/chart",
110
- isShow: hasDashboardAuth
111
- }];
112
- }
113
-
114
- _createClass(summaryMenus, [{
115
- key: "setSubordinatesLoading",
116
- value: function setSubordinatesLoading(loading) {
117
- this.menus[1].children = [];
118
-
119
- if (loading) {
120
- this.menus[1].children.push({
121
- icon: "",
122
- label: "loading",
123
- key: "loading-subordinates",
124
- type: _index.LOADING_NODE,
125
- href: "",
126
- data: {}
127
- });
128
- }
129
- }
130
- }, {
131
- key: "insertSubordinates",
132
- value: function insertSubordinates(users) {
133
- if (!users || !users.length) {
134
- this.menus[2].children = [{
135
- icon: "",
136
- label: "empty-subordinates",
137
- key: "empty-subordinates",
138
- type: _index.NO_SUBORDINATES_NODE,
139
- href: "",
140
- data: {}
141
- }];
142
- return;
143
- }
144
-
145
- var treeNodeUsers = [];
146
-
147
- for (var i = 0; i < users.length; i++) {
148
- var user = users[i];
149
- treeNodeUsers.push({
150
- icon: "",
151
- label: user.name,
152
- key: "".concat(user.userId),
153
- type: _index.USER_NODE,
154
- href: "",
155
- data: user
156
- });
157
- }
158
-
159
- this.menus[2].children = treeNodeUsers;
160
- }
161
- }, {
162
- key: "getMenus",
163
- value: function getMenus() {
164
- var menus = this.formateToTreeNodeData(this.menus.filter(function (it) {
165
- return it.isShow === undefined || it.isShow == true;
166
- }));
167
- return menus;
168
- }
169
- }, {
170
- key: "formateToTreeNodeData",
171
- value: function formateToTreeNodeData(menus) {
172
- var pid = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
173
- var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
174
- var treeNodes = [];
175
-
176
- for (var i = 0; i < menus.length; i++) {
177
- var menu = menus[i];
178
- var hasChildren = !!(menu.children && menu.children.length);
179
- var isLeaf = menu.isLeaf !== undefined ? menu.isLeaf : !hasChildren;
180
- var nodeType = menu.type;
181
- if (!nodeType) nodeType = !isLeaf ? _index.PARENT_MENU_NODE : _index.SUB_MENU_ITEM_NOE;
182
- treeNodes.push({
183
- key: "".concat(menu.key),
184
- title: (0, _getLocale.getLocale)(menu.label) ? (0, _getLocale.getLocale)(menu.label) : menu.label,
185
- data: menu.data || menu,
186
- isLeaf: isLeaf,
187
- children: this.formateToTreeNodeData(menu.children || [], level + 1, menu.key),
188
- nodeType: nodeType
189
- });
190
- }
191
-
192
- return treeNodes;
193
- }
194
- }]);
195
-
196
- return summaryMenus;
197
- }();
198
-
199
- exports["default"] = summaryMenus;