@titaui/pc 1.5.82 → 1.5.83

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 (319) hide show
  1. package/lib/components/avatar/icon-avatar/index.css +15 -0
  2. package/lib/components/avatar/icon-avatar/index.js +50 -0
  3. package/lib/components/avatar/index.js +9 -1
  4. package/lib/components/avatar/num-avatar/index.css +12 -0
  5. package/lib/components/avatar/num-avatar/index.js +34 -0
  6. package/lib/components/button/admin-button/default.js +35 -0
  7. package/lib/components/button/admin-button/drop-down-arrow.js +93 -0
  8. package/lib/components/button/admin-button/index.css +86 -0
  9. package/lib/components/button/admin-button/index.js +40 -0
  10. package/lib/components/button/admin-button/primary.js +33 -0
  11. package/lib/components/button/admin-button/secondary.js +35 -0
  12. package/lib/components/button/default-button/index.css +49 -0
  13. package/lib/components/button/default-button/index.js +51 -0
  14. package/lib/components/button/export-button/index.css +51 -0
  15. package/lib/components/button/export-button/index.js +81 -0
  16. package/lib/components/button/images/daoru.svg +18 -0
  17. package/lib/components/button/index.js +23 -0
  18. package/lib/components/button/interface.js +5 -0
  19. package/lib/components/change-okr/Filter.js +133 -65
  20. package/lib/components/change-okr/Item.js +6 -0
  21. package/lib/components/change-okr/filterTab.js +2 -0
  22. package/lib/components/change-okr/index.js +2 -2
  23. package/lib/components/checkbox/index.js +4 -3
  24. package/lib/components/communication/CommunicationRecord.js +116 -161
  25. package/lib/components/communication/ConvertUserName.js +1 -1
  26. package/lib/components/communication/index.css +63 -0
  27. package/lib/components/communication/index.js +53 -28
  28. package/lib/components/communication/style.js +21 -25
  29. package/lib/components/create-okr/animation/check-animation.js +2746 -0
  30. package/lib/components/create-okr/constant.js +27 -0
  31. package/lib/components/create-okr/createCycle.js +193 -0
  32. package/lib/components/create-okr/createSuccessCmp.js +233 -0
  33. package/lib/components/create-okr/createSuccessCmpWrapper.js +20 -0
  34. package/lib/components/create-okr/fields/date-cycle.js +98 -0
  35. package/lib/components/create-okr/fields/index.css +346 -0
  36. package/lib/components/create-okr/fields/index.js +17 -0
  37. package/lib/components/create-okr/fields/input-with-err-popup.js +57 -0
  38. package/lib/components/create-okr/fields/o-new-name.js +197 -0
  39. package/lib/components/create-okr/fields/okr-case.js +98 -0
  40. package/lib/components/create-okr/fields/okr-classify.js +51 -0
  41. package/lib/components/create-okr/fields/okr-create-suggest.js +147 -0
  42. package/lib/components/create-okr/fields/okr-new-user-selector.js +106 -0
  43. package/lib/components/create-okr/fields/okr-parent.js +157 -0
  44. package/lib/components/create-okr/fields/okr-type-detail.js +196 -0
  45. package/lib/components/create-okr/fields/okr-type.js +131 -0
  46. package/lib/components/create-okr/fields/okr-visibility-detail.js +224 -0
  47. package/lib/components/create-okr/fields/okr-visibility.js +169 -0
  48. package/lib/components/create-okr/img/check-normal.svg +29 -0
  49. package/lib/components/create-okr/img/check-right.svg +16 -0
  50. package/lib/components/create-okr/img/check-wrong.svg +29 -0
  51. package/lib/components/create-okr/img/create-success-head.png +0 -0
  52. package/lib/components/create-okr/img/create-success-left-quotation.svg +14 -0
  53. package/lib/components/create-okr/img/create-success-message.svg +1 -0
  54. package/lib/components/create-okr/img/create-success-right-quotation.svg +14 -0
  55. package/lib/components/create-okr/img/create-success-shadow.svg +23 -0
  56. package/lib/components/create-okr/img/example.svg +11 -0
  57. package/lib/components/create-okr/img/hand.svg +12 -0
  58. package/lib/components/create-okr/img/kr-add.svg +12 -0
  59. package/lib/components/create-okr/img/left-quotation.svg +12 -0
  60. package/lib/components/create-okr/img/light.svg +1 -0
  61. package/lib/components/create-okr/img/pack-up.js +28 -0
  62. package/lib/components/create-okr/img/qr-code.png +0 -0
  63. package/lib/components/create-okr/img/right-quotation.svg +12 -0
  64. package/lib/components/create-okr/img/shower.png +0 -0
  65. package/lib/components/create-okr/img/target.svg +19 -0
  66. package/lib/components/create-okr/img/teach-okr.svg +17 -0
  67. package/lib/components/create-okr/img/wave.png +0 -0
  68. package/lib/components/create-okr/img/weight.svg +12 -0
  69. package/lib/components/create-okr/index.css +446 -0
  70. package/lib/components/create-okr/index.js +911 -0
  71. package/lib/components/create-okr/interface.js +5 -0
  72. package/lib/components/create-okr/kr-items/index.css +180 -0
  73. package/lib/components/create-okr/kr-items/kr-item-weight.js +194 -0
  74. package/lib/components/create-okr/kr-items/krDatas.js +299 -0
  75. package/lib/components/create-okr/kr-items/krItem.js +167 -0
  76. package/lib/components/create-okr/objectType.js +273 -0
  77. package/lib/components/create-okr/request-api.js +220 -0
  78. package/lib/components/create-okr/style.js +100 -0
  79. package/lib/components/create-okr/utils/getCreateOkrSurpassPercent.js +124 -0
  80. package/lib/components/create-okr/utils/helper.js +99 -0
  81. package/lib/components/create-okr/utils/index.js +23 -0
  82. package/lib/components/dropdown-layer/icon-item.js +5 -3
  83. package/lib/components/dropdown-layer/index.css +16 -0
  84. package/lib/components/dropdown-layer/index.js +21 -14
  85. package/lib/components/dynamic/components/condition-render/index.js +20 -0
  86. package/lib/components/dynamic/components/dangerous-html/index.js +22 -0
  87. package/lib/components/dynamic/components/dynamic-search-input/index.css +78 -0
  88. package/lib/components/dynamic/components/dynamic-search-input/index.js +192 -0
  89. package/lib/components/dynamic/components/obj-status/index.css +22 -0
  90. package/lib/components/dynamic/components/obj-status/index.js +38 -0
  91. package/lib/components/dynamic/components/percent/index.css +21 -0
  92. package/lib/components/dynamic/components/percent/index.js +38 -0
  93. package/lib/components/dynamic/components/title/index.css +35 -0
  94. package/lib/components/dynamic/components/title/index.js +59 -0
  95. package/lib/components/dynamic/constant.js +97 -0
  96. package/lib/components/dynamic/context/index.js +13 -0
  97. package/lib/components/dynamic/dynamic-item/components/header/index.css +101 -0
  98. package/lib/components/dynamic/dynamic-item/components/header/index.js +299 -0
  99. package/lib/components/dynamic/dynamic-item/components/icon/index.css +10 -0
  100. package/lib/components/dynamic/dynamic-item/components/icon/index.js +35 -0
  101. package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align.svg +22 -0
  102. package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-relative.svg +22 -0
  103. package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +95 -0
  104. package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +173 -0
  105. package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +59 -0
  106. package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +107 -0
  107. package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +48 -0
  108. package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +89 -0
  109. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +96 -0
  110. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +171 -0
  111. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +67 -0
  112. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +110 -0
  113. package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +16 -0
  114. package/lib/components/dynamic/dynamic-item/dynamic-milestone/img/milestone.png +0 -0
  115. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +111 -0
  116. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +158 -0
  117. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +95 -0
  118. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +215 -0
  119. package/lib/components/dynamic/dynamic-item/dynamic-project/constant.js +16 -0
  120. package/lib/components/dynamic/dynamic-item/dynamic-project/img/project.png +0 -0
  121. package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +91 -0
  122. package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +125 -0
  123. package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-relative.svg +22 -0
  124. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +95 -0
  125. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +192 -0
  126. package/lib/components/dynamic/dynamic-item/dynamic-replay/index.css +138 -0
  127. package/lib/components/dynamic/dynamic-item/dynamic-replay/index.js +183 -0
  128. package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +153 -0
  129. package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +138 -0
  130. package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +97 -0
  131. package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +207 -0
  132. package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +59 -0
  133. package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +107 -0
  134. package/lib/components/dynamic/dynamic-item/dynamic-task/constant.js +50 -0
  135. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-cancel.png +0 -0
  136. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-delay.png +0 -0
  137. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-done.png +0 -0
  138. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-pause.png +0 -0
  139. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-progress.png +0 -0
  140. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unaccept.png +0 -0
  141. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unstart.png +0 -0
  142. package/lib/components/dynamic/dynamic-item/dynamic-task/index.css +111 -0
  143. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +164 -0
  144. package/lib/components/dynamic/dynamic-item/index.css +128 -0
  145. package/lib/components/dynamic/dynamic-item/index.js +352 -0
  146. package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +23 -0
  147. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
  148. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
  149. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
  150. package/lib/components/dynamic/dynamic-like-ranking/index.css +126 -0
  151. package/lib/components/dynamic/dynamic-like-ranking/index.js +157 -0
  152. package/lib/components/dynamic/dynamic-like-ranking/item.js +107 -0
  153. package/lib/components/dynamic/dynamic-like-ranking/mock.js +84 -0
  154. package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +30 -0
  155. package/lib/components/dynamic/dynamic-liking/index.css +81 -0
  156. package/lib/components/dynamic/dynamic-liking/index.js +76 -0
  157. package/lib/components/dynamic/dynamic-liking/item.js +91 -0
  158. package/lib/components/dynamic/dynamic-liking/mock.js +83 -0
  159. package/lib/components/dynamic/dynamic-list/index.css +36 -0
  160. package/lib/components/dynamic/dynamic-list/index.js +61 -0
  161. package/lib/components/dynamic/dynamic-topping/image/quotationMark.svg +16 -0
  162. package/lib/components/dynamic/dynamic-topping/image/topIcon.svg +30 -0
  163. package/lib/components/dynamic/dynamic-topping/index.css +148 -0
  164. package/lib/components/dynamic/dynamic-topping/index.js +80 -0
  165. package/lib/components/dynamic/dynamic-topping/interface.js +5 -0
  166. package/lib/components/dynamic/dynamic-topping/item.js +140 -0
  167. package/lib/components/dynamic/dynamic-topping/request-api.js +36 -0
  168. package/lib/components/dynamic/dynamic.css +204 -0
  169. package/lib/components/dynamic/dynamic.js +391 -0
  170. package/lib/components/dynamic/export-module/index.js +33 -0
  171. package/lib/components/dynamic/img/dynamic-P1.svg +15 -0
  172. package/lib/components/dynamic/img/dynamic-P2.svg +15 -0
  173. package/lib/components/dynamic/img/dynamic-P3.svg +15 -0
  174. package/lib/components/dynamic/img/dynamic-P4.svg +15 -0
  175. package/lib/components/dynamic/img/dynamic-P5.svg +15 -0
  176. package/lib/components/dynamic/img/dynamic-delay.svg +17 -0
  177. package/lib/components/dynamic/img/dynamic-desire.svg +61 -0
  178. package/lib/components/dynamic/img/dynamic-empty.png +0 -0
  179. package/lib/components/dynamic/img/dynamic-end.svg +17 -0
  180. package/lib/components/dynamic/img/dynamic-left-quoto.svg +13 -0
  181. package/lib/components/dynamic/img/dynamic-loading.gif +0 -0
  182. package/lib/components/dynamic/img/dynamic-normal.svg +17 -0
  183. package/lib/components/dynamic/img/dynamic-promise.svg +61 -0
  184. package/lib/components/dynamic/img/dynamic-reword.svg +24 -0
  185. package/lib/components/dynamic/img/dynamic-right-quoto.svg +13 -0
  186. package/lib/components/dynamic/img/dynamic-risk.svg +17 -0
  187. package/lib/components/dynamic/img/dynamic-submit-delay.svg +16 -0
  188. package/lib/components/dynamic/img/dynamic-submit-normal.svg +18 -0
  189. package/lib/components/dynamic/img/dynamic-top.svg +14 -0
  190. package/lib/components/dynamic/index.js +27 -0
  191. package/lib/components/dynamic/interface.js +5 -0
  192. package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +25 -0
  193. package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +37 -0
  194. package/lib/components/dynamic/quick-operation/components/create-okr/index.css +25 -0
  195. package/lib/components/dynamic/quick-operation/components/create-okr/index.js +37 -0
  196. package/lib/components/dynamic/quick-operation/components/create-share/index.css +25 -0
  197. package/lib/components/dynamic/quick-operation/components/create-share/index.js +37 -0
  198. package/lib/components/dynamic/quick-operation/components/create-task/index.css +25 -0
  199. package/lib/components/dynamic/quick-operation/components/create-task/index.js +42 -0
  200. package/lib/components/dynamic/quick-operation/img/create-announcement.png +0 -0
  201. package/lib/components/dynamic/quick-operation/img/create-okr.png +0 -0
  202. package/lib/components/dynamic/quick-operation/img/create-share.png +0 -0
  203. package/lib/components/dynamic/quick-operation/img/create-task.png +0 -0
  204. package/lib/components/dynamic/quick-operation/index.css +51 -0
  205. package/lib/components/dynamic/quick-operation/index.js +112 -0
  206. package/lib/components/dynamic/request-api.js +92 -0
  207. package/lib/components/dynamic/util.js +140 -0
  208. package/lib/components/emotionsSelector/style.js +1 -1
  209. package/lib/components/file-list/components/single-file/index.css +84 -0
  210. package/lib/components/file-list/components/single-file/index.js +115 -0
  211. package/lib/components/file-list/img/new-file-list-doc.svg +1 -0
  212. package/lib/components/file-list/img/new-file-list-other.svg +1 -0
  213. package/lib/components/file-list/img/new-file-list-pdf.svg +1 -0
  214. package/lib/components/file-list/img/new-file-list-ppt.svg +1 -0
  215. package/lib/components/file-list/img/new-file-list-radio.svg +1 -0
  216. package/lib/components/file-list/img/new-file-list-video.svg +1 -0
  217. package/lib/components/file-list/img/new-file-list-xls.svg +1 -0
  218. package/lib/components/file-list/index.css +5 -0
  219. package/lib/components/file-list/index.js +61 -0
  220. package/lib/components/file-list/interface.js +5 -0
  221. package/lib/components/file-list/util.js +78 -0
  222. package/lib/components/form/form-fields/input/index.css +11 -0
  223. package/lib/components/form/form-fields/input/index.js +3 -1
  224. package/lib/components/grid-page/image/{Assistant.svg → assistant.svg} +0 -0
  225. package/lib/components/grid-page/image/{Boss.svg → boss.svg} +0 -0
  226. package/lib/components/grid-page/image/{Default-background.png → default-background.png} +0 -0
  227. package/lib/components/grid-page/image/{UserManager.svg → userManager.svg} +0 -0
  228. package/lib/components/grid-page/personal-info/index.js +5 -5
  229. package/lib/components/img-viewer/icon/enlarge.js +30 -0
  230. package/lib/components/img-viewer/icon/left-rotate.js +46 -0
  231. package/lib/components/img-viewer/icon/right-rotate.js +44 -0
  232. package/lib/components/img-viewer/icon/shrink.js +37 -0
  233. package/lib/components/img-viewer/image/loading.gif +0 -0
  234. package/lib/components/img-viewer/index.css +155 -0
  235. package/lib/components/img-viewer/index.js +228 -0
  236. package/lib/components/img-viewer/interface.js +5 -0
  237. package/lib/components/img-viewer/util.js +16 -0
  238. package/lib/components/mblog/components/MblogAction.js +10 -6
  239. package/lib/components/mblog/index.js +24 -11
  240. package/lib/components/mblog/style.js +8 -8
  241. package/lib/components/okr-detail/components/header/index.css +4 -0
  242. package/lib/components/okr-detail/components/header/o-cycle.js +2 -2
  243. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +15 -8
  244. package/lib/components/okr-flow/child-node/work-node.js +7 -1
  245. package/lib/components/okr-period-selector/select-cycle.js +139 -151
  246. package/lib/components/okr-progress-detail/index.css +1 -0
  247. package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +5 -5
  248. package/lib/components/okr-review/ReviewPop/index.js +4 -4
  249. package/lib/components/period-selector/common.js +168 -17
  250. package/lib/components/period-selector/components/selector/index.js +103 -38
  251. package/lib/components/period-selector/components/selector/style.js +23 -9
  252. package/lib/components/period-selector/index.js +29 -28
  253. package/lib/components/popup/index.js +3 -1
  254. package/lib/components/publish-dynamic-modal/index.js +13 -0
  255. package/lib/components/publish-dynamic-modal/interface.js +5 -0
  256. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.css +3 -0
  257. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +191 -0
  258. package/lib/components/publish-dynamic-modal/requist-api.js +48 -0
  259. package/lib/components/radio/index.css +5 -0
  260. package/lib/components/radio/radio.js +12 -4
  261. package/lib/components/search-key-handle/index.js +39 -0
  262. package/lib/components/table/index.css +0 -1
  263. package/lib/components/upload/components/uploadedPreview.js +62 -54
  264. package/lib/components/upload/img/doc.svg +1 -0
  265. package/lib/components/upload/img/other.svg +1 -0
  266. package/lib/components/upload/img/pdf.svg +1 -0
  267. package/lib/components/upload/img/ppt.svg +1 -0
  268. package/lib/components/upload/img/radio.svg +1 -0
  269. package/lib/components/upload/img/video.svg +1 -0
  270. package/lib/components/upload/img/xls.svg +1 -0
  271. package/lib/components/upload/index.css +26 -0
  272. package/lib/components/upload/index.js +89 -57
  273. package/lib/components/upload/style.js +7 -7
  274. package/lib/components/upload/type.js +15 -15
  275. package/lib/components/upload/util.js +102 -0
  276. package/lib/components/upvote/index.js +37 -14
  277. package/lib/components/user-selector/export-modules/field-tree-selector/index.css +4 -0
  278. package/lib/components/user-selector/export-modules/field-tree-selector/index.js +50 -24
  279. package/lib/components/user-selector/export-modules/field-tree-selector/single-selector/index.js +11 -2
  280. package/lib/components/user-selector/layout/index.css +1 -1
  281. package/lib/components-v1/buttonv2/ButtonLinked.js +35 -0
  282. package/lib/components-v1/buttonv2/ButtonOutlined.js +64 -0
  283. package/lib/components-v1/buttonv2/ButtonRounded.js +101 -0
  284. package/lib/components-v1/buttonv2/DefaultButton.js +86 -0
  285. package/lib/components-v1/buttonv2/index.js +37 -0
  286. package/lib/components-v1/buttonv2/style/style.js +53 -0
  287. package/lib/components-v1/buttonv2/style/theme.css +3 -0
  288. package/lib/components-v1/confirm/index.js +158 -0
  289. package/lib/index.js +49 -5
  290. package/lib/pages/dynamic/index.css +5 -0
  291. package/lib/pages/dynamic/index.js +25 -0
  292. package/lib/pages/home-page/components/data-list/nav-selector/index.js +18 -0
  293. package/lib/pages/home-page/components/data-list/table/utils-function.js +6 -3
  294. package/lib/pages/like-ranking/column.js +141 -0
  295. package/lib/pages/like-ranking/filter-buttons/department.js +44 -0
  296. package/lib/pages/like-ranking/filter-buttons/group.js +34 -0
  297. package/lib/pages/like-ranking/filter-buttons/index.css +19 -0
  298. package/lib/pages/like-ranking/filter-buttons/index.js +40 -0
  299. package/lib/pages/like-ranking/filter-buttons/modular.js +110 -0
  300. package/lib/pages/like-ranking/filter-buttons/name.js +73 -0
  301. package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.css +27 -0
  302. package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.js +38 -0
  303. package/lib/pages/like-ranking/filter-buttons/timer.js +56 -0
  304. package/lib/pages/like-ranking/image/dynamic-empty.png +0 -0
  305. package/lib/pages/like-ranking/image/loading.gif +0 -0
  306. package/lib/pages/like-ranking/image/ranking-1.png +0 -0
  307. package/lib/pages/like-ranking/image/ranking-2.png +0 -0
  308. package/lib/pages/like-ranking/image/ranking-3.png +0 -0
  309. package/lib/pages/like-ranking/index.css +185 -0
  310. package/lib/pages/like-ranking/index.js +252 -0
  311. package/lib/pages/like-ranking/mock.js +366 -0
  312. package/lib/pages/like-ranking/request-api.js +15 -0
  313. package/lib/utils/auth.js +46 -5
  314. package/lib/utils/bs-global.js +26 -2
  315. package/lib/utils/format-time.js +161 -0
  316. package/lib/utils/helpers.js +41 -0
  317. package/lib/utils/roundWeight.js +105 -0
  318. package/lib/utils/tools.js +140 -20
  319. package/package.json +2 -2
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _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 _titaUi = require("tita-ui");
13
+
14
+ var _confirm = _interopRequireDefault(require("../../../components-v1/confirm"));
15
+
16
+ var _objectType = _interopRequireDefault(require("../objectType"));
17
+
18
+ var _requestApi = require("../request-api");
19
+
20
+ require("./index.css");
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
+
24
+ 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); }
25
+
26
+ 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; }
27
+
28
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
29
+
30
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
31
+
32
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
33
+
34
+ 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."); }
35
+
36
+ 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); }
37
+
38
+ 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; }
39
+
40
+ 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; }
41
+
42
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
+
44
+ var _default = function _default(props) {
45
+ var _props$canEdit = props.canEdit,
46
+ canEdit = _props$canEdit === void 0 ? false : _props$canEdit,
47
+ workId = props.workId,
48
+ typeProp = props.typeProp,
49
+ departIdProp = props.departIdProp,
50
+ departNameProp = props.departNameProp,
51
+ groupIdProp = props.groupIdProp,
52
+ groupNameProp = props.groupNameProp;
53
+
54
+ var getType = function getType(okrType, departName, groupName) {
55
+ var typeId = 1,
56
+ typeName = "个人";
57
+
58
+ switch (okrType) {
59
+ case 1:
60
+ typeId = okrType;
61
+ typeName = "个人";
62
+ break;
63
+
64
+ case 2:
65
+ typeName = departName;
66
+ typeId = 2;
67
+ break;
68
+
69
+ case 3:
70
+ typeName = "公司";
71
+ typeId = 3;
72
+ break;
73
+
74
+ case 4:
75
+ typeName = groupName || "团队";
76
+ typeId = 4;
77
+ break;
78
+ }
79
+
80
+ return {
81
+ typeId: typeId,
82
+ typeName: typeName
83
+ };
84
+ };
85
+
86
+ var _useState = (0, _react.useState)(getType(typeProp, departNameProp, groupNameProp)),
87
+ _useState2 = _slicedToArray(_useState, 2),
88
+ type = _useState2[0],
89
+ setType = _useState2[1];
90
+
91
+ var _useState3 = (0, _react.useState)({
92
+ departId: departIdProp,
93
+ departName: departNameProp
94
+ }),
95
+ _useState4 = _slicedToArray(_useState3, 2),
96
+ depart = _useState4[0],
97
+ setDepart = _useState4[1];
98
+
99
+ var _useState5 = (0, _react.useState)({
100
+ groupId: groupIdProp,
101
+ groupName: groupNameProp
102
+ }),
103
+ _useState6 = _slicedToArray(_useState5, 2),
104
+ group = _useState6[0],
105
+ setGroup = _useState6[1];
106
+
107
+ var typeRef = (0, _react.useRef)();
108
+ var objTypeRef = (0, _react.useRef)();
109
+
110
+ var updateType = /*#__PURE__*/function () {
111
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
112
+ return regeneratorRuntime.wrap(function _callee$(_context) {
113
+ while (1) {
114
+ switch (_context.prev = _context.next) {
115
+ case 0:
116
+ _context.next = 2;
117
+ return (0, _requestApi.updateOCommitType)({
118
+ okrId: workId,
119
+ okrType: type.typeId,
120
+ departmentId: depart.departId,
121
+ groupId: group.groupId
122
+ });
123
+
124
+ case 2:
125
+ case "end":
126
+ return _context.stop();
127
+ }
128
+ }
129
+ }, _callee);
130
+ }));
131
+
132
+ return function updateType() {
133
+ return _ref.apply(this, arguments);
134
+ };
135
+ }();
136
+
137
+ (0, _react.useEffect)(function () {
138
+ if (type.typeId !== typeProp || depart.departId !== departIdProp || group.groupId !== groupIdProp) {
139
+ updateType();
140
+ }
141
+ }, [type, group, depart]);
142
+
143
+ function objTypeConfirm() {
144
+ // 把值拿出来 放到 project-time 上
145
+ if (!objTypeRef.current) return;
146
+ var data = objTypeRef.current.state;
147
+ var okrType = data.okrType,
148
+ departmentId = data.departmentId,
149
+ departmentName = data.departmentName,
150
+ groupName = data.groupName,
151
+ groupId = data.groupId;
152
+ var type = getType(okrType, departmentName, groupName);
153
+ setType(type);
154
+ setDepart({
155
+ departId: departmentId,
156
+ departName: departmentName
157
+ });
158
+ setGroup({
159
+ groupName: groupName,
160
+ groupId: groupId
161
+ });
162
+ }
163
+
164
+ var onCancelHanderl = function onCancelHanderl() {
165
+ typeRef.current && typeRef.current.hide();
166
+ };
167
+
168
+ var onOkHandler = function onOkHandler() {
169
+ objTypeConfirm();
170
+ typeRef.current && typeRef.current.hide();
171
+ };
172
+
173
+ return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, canEdit && /*#__PURE__*/_react["default"].createElement(_confirm["default"], {
174
+ ref: typeRef,
175
+ innerContent: /*#__PURE__*/_react["default"].createElement("div", {
176
+ className: "okr-type"
177
+ }, /*#__PURE__*/_react["default"].createElement("span", null, type.typeName), canEdit && /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
178
+ content: "\u7F16\u8F91"
179
+ }, /*#__PURE__*/_react["default"].createElement("span", {
180
+ className: "tu-icon-edit edit-icon tu-ml-10"
181
+ }))),
182
+ onCancel: onCancelHanderl,
183
+ onOk: onOkHandler,
184
+ blurToHide: true
185
+ }, /*#__PURE__*/_react["default"].createElement(_objectType["default"], {
186
+ ref: objTypeRef,
187
+ okrType: type.typeId,
188
+ okrTypeName: type.typeName,
189
+ departmentId: depart.departId,
190
+ departmentName: depart.departName,
191
+ groupId: group.groupId,
192
+ groupName: group.groupName
193
+ })), !canEdit && type.typeName);
194
+ };
195
+
196
+ exports["default"] = _default;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _bsGlobal = require("../../../utils/bs-global");
11
+
12
+ var _react = _interopRequireWildcard(require("react"));
13
+
14
+ var _style = require("../style");
15
+
16
+ var _objectType = _interopRequireDefault(require("../objectType"));
17
+
18
+ var _confirm = _interopRequireDefault(require("../../../components-v1/confirm"));
19
+
20
+ var _openData = require("../../../utils/open-data");
21
+
22
+ require("./index.css");
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ 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); }
27
+
28
+ 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; }
29
+
30
+ var _default = function _default(_ref) {
31
+ var dept = _ref.dept,
32
+ setDept = _ref.setDept,
33
+ type = _ref.type,
34
+ setType = _ref.setType,
35
+ setTeam = _ref.setTeam,
36
+ team = _ref.team,
37
+ isCreateModal = _ref.isCreateModal;
38
+ var setting = (0, _bsGlobal.getBSGlobal)("OkrAdvancedSetting").KRSetting;
39
+ var openClassify = setting.OkrClassify;
40
+ var typeRef = (0, _react.useRef)();
41
+ var objTypeRef = (0, _react.useRef)();
42
+
43
+ function objTypeConfirm() {
44
+ // 把值拿出来 放到 project-time 上
45
+ if (!objTypeRef.current) return;
46
+ var data = objTypeRef.current.state;
47
+ var okrType = data.okrType,
48
+ departmentId = data.departmentId,
49
+ departmentName = data.departmentName,
50
+ groupName = data.groupName,
51
+ groupId = data.groupId;
52
+
53
+ switch (okrType) {
54
+ case 1:
55
+ setType({
56
+ typeId: okrType,
57
+ typeName: "个人"
58
+ });
59
+ break;
60
+
61
+ case 2:
62
+ setType({
63
+ typeName: departmentName,
64
+ typeId: 2
65
+ });
66
+ break;
67
+
68
+ case 3:
69
+ setType({
70
+ typeName: "公司",
71
+ typeId: 3
72
+ });
73
+ break;
74
+
75
+ case 4:
76
+ setType({
77
+ typeName: groupName || "团队",
78
+ typeId: 4
79
+ });
80
+ break;
81
+ }
82
+
83
+ setDept({
84
+ departmentId: departmentId,
85
+ departmentName: departmentName
86
+ });
87
+ setTeam({
88
+ groupName: groupName,
89
+ groupId: groupId
90
+ });
91
+ }
92
+
93
+ var onCancelHanderl = function onCancelHanderl() {
94
+ typeRef.current && typeRef.current.hide();
95
+ };
96
+
97
+ var onOkHandler = function onOkHandler() {
98
+ objTypeConfirm();
99
+ typeRef.current && typeRef.current.hide();
100
+ };
101
+
102
+ return /*#__PURE__*/_react["default"].createElement("div", {
103
+ className: "create-modal__sub-block",
104
+ style: {
105
+ flex: openClassify ? 1 : 2
106
+ }
107
+ }, isCreateModal ? /*#__PURE__*/_react["default"].createElement("div", {
108
+ className: "create-modal__sub-title"
109
+ }, "\u7C7B\u578B") : /*#__PURE__*/_react["default"].createElement(_style.TitleLine, null, "\u7C7B\u578B"), /*#__PURE__*/_react["default"].createElement(_confirm["default"], {
110
+ ref: typeRef,
111
+ innerContent: /*#__PURE__*/_react["default"].createElement(_style.SelectBtn, null, /*#__PURE__*/_react["default"].createElement("span", null, type.typeId == 2 ? /*#__PURE__*/_react["default"].createElement(_openData.OpenDepartmentName, {
112
+ id: dept.departmentId,
113
+ name: dept.departmentName
114
+ }) : type.typeName), /*#__PURE__*/_react["default"].createElement("i", {
115
+ className: "tu-icon-sort-down"
116
+ })),
117
+ onCancel: onCancelHanderl,
118
+ onOk: onOkHandler,
119
+ blurToHide: true
120
+ }, /*#__PURE__*/_react["default"].createElement(_objectType["default"], {
121
+ ref: objTypeRef,
122
+ okrType: type.typeId,
123
+ okrTypeName: type.typeName,
124
+ departmentId: dept.departmentId,
125
+ departmentName: dept.departmentName,
126
+ groupId: team.groupId,
127
+ groupName: team.groupName
128
+ })));
129
+ };
130
+
131
+ exports["default"] = _default;
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _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 _titaUi = require("tita-ui");
13
+
14
+ var _userSelector = require("../../user-selector");
15
+
16
+ var _openData = require("../../../utils/open-data");
17
+
18
+ var _requestApi = require("../request-api");
19
+
20
+ require("./index.css");
21
+
22
+ 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); }
23
+
24
+ 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; }
25
+
26
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
27
+
28
+ 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."); }
29
+
30
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
31
+
32
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
33
+
34
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
35
+
36
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
37
+
38
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
39
+
40
+ 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."); }
41
+
42
+ 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); }
43
+
44
+ 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; }
45
+
46
+ 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; }
47
+
48
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
49
+
50
+ var visibilityList = [{
51
+ value: 1,
52
+ lable: "全公司"
53
+ }, {
54
+ value: 2,
55
+ lable: "仅相关成员"
56
+ }, {
57
+ value: 3,
58
+ lable: "仅直接下属"
59
+ }, {
60
+ value: 4,
61
+ lable: "指定范围"
62
+ }];
63
+
64
+ var _default = function _default(_ref) {
65
+ var _ref$canEdit = _ref.canEdit,
66
+ canEdit = _ref$canEdit === void 0 ? false : _ref$canEdit,
67
+ workId = _ref.workId,
68
+ _ref$visibilityProp = _ref.visibilityProp,
69
+ visibilityProp = _ref$visibilityProp === void 0 ? 1 : _ref$visibilityProp,
70
+ _ref$visiableScopePro = _ref.visiableScopeProp,
71
+ visiableScopeProp = _ref$visiableScopePro === void 0 ? {} : _ref$visiableScopePro,
72
+ onSave = _ref.onSave;
73
+ var selectorRef = (0, _react.useRef)();
74
+
75
+ var _useState = (0, _react.useState)(visiableScopeProp),
76
+ _useState2 = _slicedToArray(_useState, 2),
77
+ visibilityArea = _useState2[0],
78
+ setVisibilityArea = _useState2[1];
79
+
80
+ var _useState3 = (0, _react.useState)(visibilityProp),
81
+ _useState4 = _slicedToArray(_useState3, 2),
82
+ visibility = _useState4[0],
83
+ setVisibility = _useState4[1];
84
+
85
+ var updateVisibility = /*#__PURE__*/function () {
86
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
87
+ var _visibilityArea$users, users, _visibilityArea$depar, departments, _visibilityArea$group, groups, areaUserIds, areaOrgIds, areaGroupIds;
88
+
89
+ return regeneratorRuntime.wrap(function _callee$(_context) {
90
+ while (1) {
91
+ switch (_context.prev = _context.next) {
92
+ case 0:
93
+ _visibilityArea$users = visibilityArea.users, users = _visibilityArea$users === void 0 ? [] : _visibilityArea$users, _visibilityArea$depar = visibilityArea.departments, departments = _visibilityArea$depar === void 0 ? [] : _visibilityArea$depar, _visibilityArea$group = visibilityArea.groups, groups = _visibilityArea$group === void 0 ? [] : _visibilityArea$group;
94
+ areaUserIds = (users || []).reduce(function (res, cur) {
95
+ return [].concat(_toConsumableArray(res), [cur.userId]);
96
+ }, []);
97
+ areaOrgIds = (departments || []).reduce(function (res, cur) {
98
+ return [].concat(_toConsumableArray(res), [cur.id]);
99
+ }, []);
100
+ areaGroupIds = (groups || []).reduce(function (res, cur) {
101
+ return [].concat(_toConsumableArray(res), [cur.id]);
102
+ }, []);
103
+ _context.next = 6;
104
+ return (0, _requestApi.updateOkrVisibility)({
105
+ workId: workId,
106
+ visibility: visibility,
107
+ areaUserIds: areaUserIds,
108
+ areaOrgIds: areaOrgIds,
109
+ areaGroupIds: areaGroupIds
110
+ });
111
+
112
+ case 6:
113
+ onSave && onSave();
114
+
115
+ case 7:
116
+ case "end":
117
+ return _context.stop();
118
+ }
119
+ }
120
+ }, _callee);
121
+ }));
122
+
123
+ return function updateVisibility() {
124
+ return _ref2.apply(this, arguments);
125
+ };
126
+ }();
127
+
128
+ (0, _react.useEffect)(function () {
129
+ if (!visibility) return;
130
+ updateVisibility();
131
+ }, [visibility, visibilityArea]);
132
+
133
+ var onOptionChange = function onOptionChange(v) {
134
+ if (v === 4) {
135
+ selectorRef.current && selectorRef.current.open();
136
+ } else {
137
+ setVisibility(v);
138
+ }
139
+ };
140
+
141
+ var onOk = function onOk(selectNodes) {
142
+ setVisibility(4);
143
+ setVisibilityArea(selectNodes);
144
+ selectorRef.current && selectorRef.current.close();
145
+ };
146
+
147
+ var renderLabel = function renderLabel() {
148
+ if (visibility === 4) {
149
+ var _visibilityArea$group2 = visibilityArea.groups,
150
+ groups = _visibilityArea$group2 === void 0 ? [] : _visibilityArea$group2,
151
+ _visibilityArea$depar2 = visibilityArea.departments,
152
+ departments = _visibilityArea$depar2 === void 0 ? [] : _visibilityArea$depar2,
153
+ _visibilityArea$users2 = visibilityArea.users,
154
+ users = _visibilityArea$users2 === void 0 ? [] : _visibilityArea$users2;
155
+ var text = [],
156
+ jsxDom = [];
157
+ (departments || []).forEach(function (item) {
158
+ jsxDom.push( /*#__PURE__*/_react["default"].createElement(_openData.OpenDepartmentName, {
159
+ id: item.id,
160
+ name: item.name
161
+ }));
162
+ jsxDom.push( /*#__PURE__*/_react["default"].createElement("span", null, "\u3001"));
163
+ text.push(item.name);
164
+ });
165
+ (users || []).forEach(function (item) {
166
+ jsxDom.push( /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
167
+ id: item.userId,
168
+ name: item.name
169
+ }));
170
+ jsxDom.push( /*#__PURE__*/_react["default"].createElement("span", null, "\u3001"));
171
+ text.push(item.name);
172
+ });
173
+ (groups || []).forEach(function (item) {
174
+ jsxDom.push( /*#__PURE__*/_react["default"].createElement("span", null, item.name, "\u3001"));
175
+ text.push(item.name);
176
+ });
177
+ if (!text.length) return "仅相关成员可见";
178
+ return (0, _openData.isWechat)() ? jsxDom : text.join("、");
179
+ } // @ts-ignore
180
+
181
+
182
+ return visibilityList.find(function (i) {
183
+ return i.value === visibility;
184
+ }).lable;
185
+ };
186
+
187
+ var renderSelect = function renderSelect() {
188
+ return /*#__PURE__*/_react["default"].createElement("div", {
189
+ className: "visibility"
190
+ }, /*#__PURE__*/_react["default"].createElement("span", null, renderLabel()), canEdit && /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
191
+ content: "\u7F16\u8F91"
192
+ }, /*#__PURE__*/_react["default"].createElement("span", {
193
+ className: "tu-icon-edit visibility-edit-icon tu-ml-10"
194
+ })));
195
+ };
196
+
197
+ return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, canEdit && /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_userSelector.FieldPersonSelector, {
198
+ ref: selectorRef // @ts-ignore
199
+ ,
200
+ multiple: true,
201
+ onOk: onOk,
202
+ position: "center",
203
+ selectNodes: visibilityArea,
204
+ trigger: /*#__PURE__*/_react["default"].createElement("div", {
205
+ style: {
206
+ visibility: "hidden",
207
+ position: "absolute",
208
+ zIndex: -1,
209
+ height: 36
210
+ }
211
+ }, "empty select")
212
+ }), /*#__PURE__*/_react["default"].createElement(_titaUi.Select, {
213
+ value: visibility,
214
+ onChange: onOptionChange,
215
+ options: visibilityList // @ts-ignore
216
+ ,
217
+ onClick: function onClick(e) {
218
+ return e.stopPropagation();
219
+ },
220
+ renderSelect: renderSelect
221
+ })), !canEdit && renderSelect());
222
+ };
223
+
224
+ exports["default"] = _default;