@titaui/pc 1.5.78 → 1.5.82

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 (316) hide show
  1. package/lib/components/avatar/index.js +1 -9
  2. package/lib/components/change-okr/Filter.js +65 -133
  3. package/lib/components/change-okr/Item.js +0 -6
  4. package/lib/components/change-okr/filterTab.js +0 -2
  5. package/lib/components/change-okr/index.js +2 -2
  6. package/lib/components/checkbox/index.js +3 -4
  7. package/lib/components/communication/CommunicationRecord.js +161 -116
  8. package/lib/components/communication/ConvertUserName.js +1 -1
  9. package/lib/components/communication/index.js +28 -53
  10. package/lib/components/communication/style.js +25 -21
  11. package/lib/components/dropdown-layer/icon-item.js +3 -5
  12. package/lib/components/dropdown-layer/index.css +0 -16
  13. package/lib/components/dropdown-layer/index.js +14 -21
  14. package/lib/components/emotionsSelector/style.js +1 -1
  15. package/lib/components/form/form-fields/input/index.css +0 -11
  16. package/lib/components/form/form-fields/input/index.js +1 -3
  17. package/lib/components/grid-page/personal-info/index.js +4 -4
  18. package/lib/components/mblog/components/MblogAction.js +6 -10
  19. package/lib/components/mblog/index.js +11 -24
  20. package/lib/components/mblog/style.js +8 -8
  21. package/lib/components/okr-detail/components/header/index.css +0 -4
  22. package/lib/components/okr-detail/components/header/o-cycle.js +2 -2
  23. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +8 -15
  24. package/lib/components/okr-flow/child-node/work-node.js +1 -7
  25. package/lib/components/okr-period-selector/select-cycle.js +151 -139
  26. package/lib/components/okr-progress-detail/index.css +0 -1
  27. package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +5 -5
  28. package/lib/components/okr-review/ReviewPop/index.js +4 -4
  29. package/lib/components/period-selector/common.js +4 -149
  30. package/lib/components/period-selector/components/selector/index.js +38 -103
  31. package/lib/components/period-selector/components/selector/style.js +9 -23
  32. package/lib/components/period-selector/index.js +28 -29
  33. package/lib/components/popup/index.js +1 -3
  34. package/lib/components/radio/index.css +0 -5
  35. package/lib/components/radio/radio.js +4 -12
  36. package/lib/components/table/index.css +1 -0
  37. package/lib/components/upload/components/uploadedPreview.js +54 -62
  38. package/lib/components/upload/index.js +57 -89
  39. package/lib/components/upload/style.js +7 -7
  40. package/lib/components/upload/type.js +15 -15
  41. package/lib/components/upvote/index.js +14 -37
  42. package/lib/components/user-selector/export-modules/field-tree-selector/index.css +0 -4
  43. package/lib/components/user-selector/export-modules/field-tree-selector/index.js +24 -50
  44. package/lib/components/user-selector/export-modules/field-tree-selector/single-selector/index.js +2 -11
  45. package/lib/components/user-selector/layout/index.css +1 -1
  46. package/lib/index.js +5 -49
  47. package/lib/pages/home-page/components/data-list/nav-selector/index.js +0 -18
  48. package/lib/pages/home-page/components/data-list/table/utils-function.js +3 -6
  49. package/lib/utils/auth.js +5 -46
  50. package/lib/utils/bs-global.js +2 -26
  51. package/lib/utils/tools.js +20 -140
  52. package/package.json +2 -2
  53. package/lib/components/avatar/icon-avatar/index.css +0 -15
  54. package/lib/components/avatar/icon-avatar/index.js +0 -50
  55. package/lib/components/avatar/num-avatar/index.css +0 -12
  56. package/lib/components/avatar/num-avatar/index.js +0 -34
  57. package/lib/components/button/admin-button/default.js +0 -35
  58. package/lib/components/button/admin-button/drop-down-arrow.js +0 -93
  59. package/lib/components/button/admin-button/index.css +0 -86
  60. package/lib/components/button/admin-button/index.js +0 -40
  61. package/lib/components/button/admin-button/primary.js +0 -33
  62. package/lib/components/button/admin-button/secondary.js +0 -35
  63. package/lib/components/button/default-button/index.css +0 -49
  64. package/lib/components/button/default-button/index.js +0 -51
  65. package/lib/components/button/export-button/index.css +0 -51
  66. package/lib/components/button/export-button/index.js +0 -81
  67. package/lib/components/button/images/daoru.svg +0 -18
  68. package/lib/components/button/index.js +0 -23
  69. package/lib/components/button/interface.js +0 -5
  70. package/lib/components/communication/index.css +0 -63
  71. package/lib/components/create-okr/animation/check-animation.js +0 -2746
  72. package/lib/components/create-okr/constant.js +0 -27
  73. package/lib/components/create-okr/createCycle.js +0 -171
  74. package/lib/components/create-okr/createSuccessCmp.js +0 -233
  75. package/lib/components/create-okr/createSuccessCmpWrapper.js +0 -20
  76. package/lib/components/create-okr/fields/date-cycle.js +0 -98
  77. package/lib/components/create-okr/fields/index.css +0 -346
  78. package/lib/components/create-okr/fields/index.js +0 -17
  79. package/lib/components/create-okr/fields/input-with-err-popup.js +0 -57
  80. package/lib/components/create-okr/fields/o-new-name.js +0 -197
  81. package/lib/components/create-okr/fields/okr-case.js +0 -98
  82. package/lib/components/create-okr/fields/okr-classify.js +0 -51
  83. package/lib/components/create-okr/fields/okr-create-suggest.js +0 -147
  84. package/lib/components/create-okr/fields/okr-new-user-selector.js +0 -106
  85. package/lib/components/create-okr/fields/okr-parent.js +0 -157
  86. package/lib/components/create-okr/fields/okr-type-detail.js +0 -196
  87. package/lib/components/create-okr/fields/okr-type.js +0 -131
  88. package/lib/components/create-okr/fields/okr-visibility-detail.js +0 -224
  89. package/lib/components/create-okr/fields/okr-visibility.js +0 -169
  90. package/lib/components/create-okr/img/check-normal.svg +0 -29
  91. package/lib/components/create-okr/img/check-right.svg +0 -16
  92. package/lib/components/create-okr/img/check-wrong.svg +0 -29
  93. package/lib/components/create-okr/img/create-success-head.png +0 -0
  94. package/lib/components/create-okr/img/create-success-left-quotation.svg +0 -14
  95. package/lib/components/create-okr/img/create-success-message.svg +0 -1
  96. package/lib/components/create-okr/img/create-success-right-quotation.svg +0 -14
  97. package/lib/components/create-okr/img/create-success-shadow.svg +0 -23
  98. package/lib/components/create-okr/img/example.svg +0 -11
  99. package/lib/components/create-okr/img/hand.svg +0 -12
  100. package/lib/components/create-okr/img/kr-add.svg +0 -12
  101. package/lib/components/create-okr/img/left-quotation.svg +0 -12
  102. package/lib/components/create-okr/img/light.svg +0 -1
  103. package/lib/components/create-okr/img/pack-up.js +0 -28
  104. package/lib/components/create-okr/img/qr-code.png +0 -0
  105. package/lib/components/create-okr/img/right-quotation.svg +0 -12
  106. package/lib/components/create-okr/img/shower.png +0 -0
  107. package/lib/components/create-okr/img/target.svg +0 -19
  108. package/lib/components/create-okr/img/teach-okr.svg +0 -17
  109. package/lib/components/create-okr/img/wave.png +0 -0
  110. package/lib/components/create-okr/img/weight.svg +0 -12
  111. package/lib/components/create-okr/index.css +0 -446
  112. package/lib/components/create-okr/index.js +0 -911
  113. package/lib/components/create-okr/interface.js +0 -5
  114. package/lib/components/create-okr/kr-items/index.css +0 -180
  115. package/lib/components/create-okr/kr-items/kr-item-weight.js +0 -194
  116. package/lib/components/create-okr/kr-items/krDatas.js +0 -299
  117. package/lib/components/create-okr/kr-items/krItem.js +0 -167
  118. package/lib/components/create-okr/objectType.js +0 -273
  119. package/lib/components/create-okr/request-api.js +0 -220
  120. package/lib/components/create-okr/style.js +0 -100
  121. package/lib/components/create-okr/utils/getCreateOkrSurpassPercent.js +0 -124
  122. package/lib/components/create-okr/utils/helper.js +0 -99
  123. package/lib/components/create-okr/utils/index.js +0 -23
  124. package/lib/components/dynamic/components/condition-render/index.js +0 -20
  125. package/lib/components/dynamic/components/dangerous-html/index.js +0 -22
  126. package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -78
  127. package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -192
  128. package/lib/components/dynamic/components/obj-status/index.css +0 -22
  129. package/lib/components/dynamic/components/obj-status/index.js +0 -38
  130. package/lib/components/dynamic/components/percent/index.css +0 -21
  131. package/lib/components/dynamic/components/percent/index.js +0 -38
  132. package/lib/components/dynamic/components/title/index.css +0 -35
  133. package/lib/components/dynamic/components/title/index.js +0 -59
  134. package/lib/components/dynamic/constant.js +0 -96
  135. package/lib/components/dynamic/context/index.js +0 -13
  136. package/lib/components/dynamic/dynamic-item/components/header/index.css +0 -101
  137. package/lib/components/dynamic/dynamic-item/components/header/index.js +0 -294
  138. package/lib/components/dynamic/dynamic-item/components/icon/index.css +0 -10
  139. package/lib/components/dynamic/dynamic-item/components/icon/index.js +0 -35
  140. package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align.svg +0 -22
  141. package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-relative.svg +0 -22
  142. package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +0 -95
  143. package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +0 -173
  144. package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +0 -54
  145. package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +0 -107
  146. package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +0 -48
  147. package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +0 -89
  148. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +0 -96
  149. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +0 -171
  150. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +0 -67
  151. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +0 -110
  152. package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +0 -16
  153. package/lib/components/dynamic/dynamic-item/dynamic-milestone/img/milestone.png +0 -0
  154. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +0 -111
  155. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +0 -158
  156. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +0 -95
  157. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +0 -215
  158. package/lib/components/dynamic/dynamic-item/dynamic-project/constant.js +0 -16
  159. package/lib/components/dynamic/dynamic-item/dynamic-project/img/project.png +0 -0
  160. package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +0 -91
  161. package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +0 -125
  162. package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-relative.svg +0 -22
  163. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +0 -95
  164. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +0 -192
  165. package/lib/components/dynamic/dynamic-item/dynamic-replay/index.css +0 -138
  166. package/lib/components/dynamic/dynamic-item/dynamic-replay/index.js +0 -183
  167. package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +0 -153
  168. package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +0 -138
  169. package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +0 -97
  170. package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +0 -207
  171. package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +0 -54
  172. package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +0 -107
  173. package/lib/components/dynamic/dynamic-item/dynamic-task/constant.js +0 -50
  174. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-cancel.png +0 -0
  175. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-delay.png +0 -0
  176. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-done.png +0 -0
  177. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-pause.png +0 -0
  178. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-progress.png +0 -0
  179. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unaccept.png +0 -0
  180. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unstart.png +0 -0
  181. package/lib/components/dynamic/dynamic-item/dynamic-task/index.css +0 -111
  182. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +0 -164
  183. package/lib/components/dynamic/dynamic-item/index.css +0 -128
  184. package/lib/components/dynamic/dynamic-item/index.js +0 -352
  185. package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
  186. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
  187. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
  188. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
  189. package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -126
  190. package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -157
  191. package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -107
  192. package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
  193. package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
  194. package/lib/components/dynamic/dynamic-liking/index.css +0 -81
  195. package/lib/components/dynamic/dynamic-liking/index.js +0 -76
  196. package/lib/components/dynamic/dynamic-liking/item.js +0 -90
  197. package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
  198. package/lib/components/dynamic/dynamic-list/index.css +0 -36
  199. package/lib/components/dynamic/dynamic-list/index.js +0 -61
  200. package/lib/components/dynamic/dynamic-topping/image/quotationMark.svg +0 -16
  201. package/lib/components/dynamic/dynamic-topping/image/topIcon.svg +0 -30
  202. package/lib/components/dynamic/dynamic-topping/index.css +0 -130
  203. package/lib/components/dynamic/dynamic-topping/index.js +0 -78
  204. package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
  205. package/lib/components/dynamic/dynamic-topping/item.js +0 -138
  206. package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
  207. package/lib/components/dynamic/dynamic.css +0 -204
  208. package/lib/components/dynamic/dynamic.js +0 -391
  209. package/lib/components/dynamic/export-module/index.js +0 -33
  210. package/lib/components/dynamic/img/dynamic-P1.svg +0 -15
  211. package/lib/components/dynamic/img/dynamic-P2.svg +0 -15
  212. package/lib/components/dynamic/img/dynamic-P3.svg +0 -15
  213. package/lib/components/dynamic/img/dynamic-P4.svg +0 -15
  214. package/lib/components/dynamic/img/dynamic-P5.svg +0 -15
  215. package/lib/components/dynamic/img/dynamic-delay.svg +0 -17
  216. package/lib/components/dynamic/img/dynamic-desire.svg +0 -61
  217. package/lib/components/dynamic/img/dynamic-empty.png +0 -0
  218. package/lib/components/dynamic/img/dynamic-end.svg +0 -17
  219. package/lib/components/dynamic/img/dynamic-left-quoto.svg +0 -13
  220. package/lib/components/dynamic/img/dynamic-loading.gif +0 -0
  221. package/lib/components/dynamic/img/dynamic-normal.svg +0 -17
  222. package/lib/components/dynamic/img/dynamic-promise.svg +0 -61
  223. package/lib/components/dynamic/img/dynamic-reword.svg +0 -24
  224. package/lib/components/dynamic/img/dynamic-right-quoto.svg +0 -13
  225. package/lib/components/dynamic/img/dynamic-risk.svg +0 -17
  226. package/lib/components/dynamic/img/dynamic-submit-delay.svg +0 -16
  227. package/lib/components/dynamic/img/dynamic-submit-normal.svg +0 -18
  228. package/lib/components/dynamic/img/dynamic-top.svg +0 -14
  229. package/lib/components/dynamic/index.js +0 -27
  230. package/lib/components/dynamic/interface.js +0 -5
  231. package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
  232. package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -37
  233. package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
  234. package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -37
  235. package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
  236. package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -37
  237. package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
  238. package/lib/components/dynamic/quick-operation/components/create-task/index.js +0 -42
  239. package/lib/components/dynamic/quick-operation/img/create-announcement.png +0 -0
  240. package/lib/components/dynamic/quick-operation/img/create-okr.png +0 -0
  241. package/lib/components/dynamic/quick-operation/img/create-share.png +0 -0
  242. package/lib/components/dynamic/quick-operation/img/create-task.png +0 -0
  243. package/lib/components/dynamic/quick-operation/index.css +0 -51
  244. package/lib/components/dynamic/quick-operation/index.js +0 -112
  245. package/lib/components/dynamic/request-api.js +0 -92
  246. package/lib/components/dynamic/util.js +0 -140
  247. package/lib/components/file-list/components/single-file/index.css +0 -84
  248. package/lib/components/file-list/components/single-file/index.js +0 -115
  249. package/lib/components/file-list/img/new-file-list-doc.svg +0 -1
  250. package/lib/components/file-list/img/new-file-list-other.svg +0 -1
  251. package/lib/components/file-list/img/new-file-list-pdf.svg +0 -1
  252. package/lib/components/file-list/img/new-file-list-ppt.svg +0 -1
  253. package/lib/components/file-list/img/new-file-list-radio.svg +0 -1
  254. package/lib/components/file-list/img/new-file-list-video.svg +0 -1
  255. package/lib/components/file-list/img/new-file-list-xls.svg +0 -1
  256. package/lib/components/file-list/index.css +0 -5
  257. package/lib/components/file-list/index.js +0 -61
  258. package/lib/components/file-list/interface.js +0 -5
  259. package/lib/components/file-list/util.js +0 -78
  260. package/lib/components/img-viewer/icon/enlarge.js +0 -30
  261. package/lib/components/img-viewer/icon/left-rotate.js +0 -46
  262. package/lib/components/img-viewer/icon/right-rotate.js +0 -44
  263. package/lib/components/img-viewer/icon/shrink.js +0 -37
  264. package/lib/components/img-viewer/image/loading.gif +0 -0
  265. package/lib/components/img-viewer/index.css +0 -155
  266. package/lib/components/img-viewer/index.js +0 -228
  267. package/lib/components/img-viewer/interface.js +0 -5
  268. package/lib/components/img-viewer/util.js +0 -16
  269. package/lib/components/publish-dynamic-modal/index.js +0 -13
  270. package/lib/components/publish-dynamic-modal/interface.js +0 -5
  271. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.css +0 -3
  272. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +0 -191
  273. package/lib/components/publish-dynamic-modal/requist-api.js +0 -48
  274. package/lib/components/search-key-handle/index.js +0 -39
  275. package/lib/components/upload/img/doc.svg +0 -1
  276. package/lib/components/upload/img/other.svg +0 -1
  277. package/lib/components/upload/img/pdf.svg +0 -1
  278. package/lib/components/upload/img/ppt.svg +0 -1
  279. package/lib/components/upload/img/radio.svg +0 -1
  280. package/lib/components/upload/img/video.svg +0 -1
  281. package/lib/components/upload/img/xls.svg +0 -1
  282. package/lib/components/upload/index.css +0 -26
  283. package/lib/components/upload/util.js +0 -102
  284. package/lib/components-v1/buttonv2/ButtonLinked.js +0 -35
  285. package/lib/components-v1/buttonv2/ButtonOutlined.js +0 -64
  286. package/lib/components-v1/buttonv2/ButtonRounded.js +0 -101
  287. package/lib/components-v1/buttonv2/DefaultButton.js +0 -86
  288. package/lib/components-v1/buttonv2/index.js +0 -37
  289. package/lib/components-v1/buttonv2/style/style.js +0 -53
  290. package/lib/components-v1/buttonv2/style/theme.css +0 -3
  291. package/lib/components-v1/confirm/index.js +0 -158
  292. package/lib/pages/dynamic/index.css +0 -5
  293. package/lib/pages/dynamic/index.js +0 -25
  294. package/lib/pages/like-ranking/column.js +0 -141
  295. package/lib/pages/like-ranking/filter-buttons/department.js +0 -44
  296. package/lib/pages/like-ranking/filter-buttons/group.js +0 -34
  297. package/lib/pages/like-ranking/filter-buttons/index.css +0 -19
  298. package/lib/pages/like-ranking/filter-buttons/index.js +0 -44
  299. package/lib/pages/like-ranking/filter-buttons/modular.js +0 -110
  300. package/lib/pages/like-ranking/filter-buttons/name.js +0 -73
  301. package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.css +0 -27
  302. package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.js +0 -38
  303. package/lib/pages/like-ranking/filter-buttons/timer.js +0 -56
  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 +0 -185
  310. package/lib/pages/like-ranking/index.js +0 -252
  311. package/lib/pages/like-ranking/mock.js +0 -366
  312. package/lib/pages/like-ranking/request-api.js +0 -15
  313. package/lib/utils/format-time.js +0 -161
  314. package/lib/utils/helpers.js +0 -41
  315. package/lib/utils/roundWeight.js +0 -105
  316. package/yarn-error.log +0 -15894
@@ -1,167 +0,0 @@
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 _bsGlobal = require("../../../utils/bs-global");
13
-
14
- var _krItemWeight = _interopRequireDefault(require("./kr-item-weight"));
15
-
16
- var _okrNewUserSelector = _interopRequireDefault(require("../fields/okr-new-user-selector"));
17
-
18
- var _inputWithErrPopup = _interopRequireDefault(require("../fields/input-with-err-popup"));
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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
29
-
30
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
31
-
32
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
-
34
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
35
-
36
- 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."); }
37
-
38
- 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); }
39
-
40
- 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; }
41
-
42
- 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; }
43
-
44
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
45
-
46
- function KrItem(_ref) {
47
- var krData = _ref.krData,
48
- changeKr = _ref.changeKr,
49
- deleteKr = _ref.deleteKr,
50
- container = _ref.container,
51
- index = _ref.index,
52
- onKrInputStateChange = _ref.onKrInputStateChange,
53
- onAddKr = _ref.onAddKr,
54
- setIsInputContent = _ref.setIsInputContent,
55
- domRef = _ref.domRef,
56
- krIsValidate = _ref.krIsValidate;
57
- var setting = (0, _bsGlobal.getBSGlobal)("OkrAdvancedSetting").KRSetting;
58
- var openKrWeight = setting.KrWeight;
59
-
60
- var _useState = (0, _react.useState)(false),
61
- _useState2 = _slicedToArray(_useState, 2),
62
- showDelIcon = _useState2[0],
63
- setShowDelIcon = _useState2[1];
64
-
65
- var oldKrNameRef = (0, _react.useRef)("");
66
-
67
- var onUserSelectorSubmitHandler = function onUserSelectorSubmitHandler(users) {
68
- changeKr(_objectSpread(_objectSpread({}, krData), {}, {
69
- principalId: users[0].Id,
70
- principalName: users[0].Name,
71
- userAvatar: users[0].UserAvatar
72
- }));
73
- };
74
-
75
- var onKrNameInputChangeHandler = function onKrNameInputChangeHandler(e) {
76
- changeKr(_objectSpread(_objectSpread({}, krData), {}, {
77
- mileStoneName: e.target.value
78
- }));
79
- };
80
-
81
- var onDeleteKrClickHandler = function onDeleteKrClickHandler() {
82
- deleteKr(krData.uuid);
83
- };
84
-
85
- var formatUser = (0, _react.useMemo)(function () {
86
- return {
87
- Medium: krData.userAvatar.Medium,
88
- Color: krData.userAvatar.Color,
89
- Name: krData.principalName,
90
- Id: krData.principalId
91
- };
92
- }, [krData.userAvatar.Medium, krData.principalName, krData.principalName, krData.principalId]);
93
- var handleMouseEnter = (0, _react.useCallback)(function () {
94
- setShowDelIcon(true);
95
- }, []);
96
- var handleMouseLeave = (0, _react.useCallback)(function () {
97
- setShowDelIcon(false);
98
- }, []);
99
- var handleInputFocus = (0, _react.useCallback)(function () {
100
- onKrInputStateChange && onKrInputStateChange(true, krData);
101
- }, [krData]);
102
- var handleInputBlur = (0, _react.useCallback)(function () {
103
- onKrInputStateChange && onKrInputStateChange(false, krData);
104
- }, [krData]); // TODO 回车创建下一个kr并且自动聚焦到下一个kr
105
- // const handleKeyUp = useCallback((e) => {
106
- // e.persist()
107
- // if (13 === e.keyCode) {
108
- // onAddKr && onAddKr();
109
- // }
110
- // }, [onAddKr])
111
-
112
- var handleOnKeyDown = (0, _react.useCallback)(function () {
113
- setIsInputContent(true);
114
- }, [setIsInputContent]);
115
- var handleOnKeyUp = (0, _react.useCallback)(function (e) {
116
- e.persist(); // 解决按功能按钮的时候一直显示检测中
117
-
118
- if (e.target.value === oldKrNameRef.current) {
119
- setIsInputContent(false);
120
- } else {
121
- oldKrNameRef.current = e.target.value;
122
- }
123
- }, []);
124
- return /*#__PURE__*/_react["default"].createElement("div", {
125
- className: "create-kr-item-wrapper",
126
- onMouseEnter: handleMouseEnter,
127
- onMouseLeave: handleMouseLeave
128
- }, /*#__PURE__*/_react["default"].createElement("a", {
129
- className: "kr-item__delete-icon tu-icon-del ".concat(showDelIcon ? "kr-item__delete-icon--show" : ""),
130
- onClick: onDeleteKrClickHandler
131
- }), /*#__PURE__*/_react["default"].createElement("div", {
132
- className: "kr-item__right-block ".concat(krIsValidate ? krData.mileStoneName && krData.mileStoneName.length <= 500 ? "" : "kr-item__right-block--error" : "")
133
- }, /*#__PURE__*/_react["default"].createElement("span", {
134
- className: "kr-item__order"
135
- }, "KR", index), /*#__PURE__*/_react["default"].createElement("div", {
136
- className: "kr-item__input-wrapper"
137
- }, /*#__PURE__*/_react["default"].createElement(_inputWithErrPopup["default"], {
138
- strLength: krData.mileStoneName ? krData.mileStoneName.length : 0,
139
- maxLength: 500,
140
- position: "top"
141
- }, /*#__PURE__*/_react["default"].createElement("input", {
142
- className: "kr-item__input",
143
- type: "text",
144
- placeholder: "\u8BF7\u8F93\u5165\u53EF\u8861\u91CF\u7684\u5173\u952E\u6210\u679C",
145
- value: krData.mileStoneName,
146
- onChange: onKrNameInputChangeHandler,
147
- onFocus: handleInputFocus,
148
- onBlur: handleInputBlur,
149
- onKeyDown: handleOnKeyDown,
150
- onKeyUp: handleOnKeyUp,
151
- ref: domRef
152
- })), /*#__PURE__*/_react["default"].createElement("div", {
153
- className: "kr-item-right-block__white-block"
154
- }), /*#__PURE__*/_react["default"].createElement("div", {
155
- className: "kr-item-right-block__text-mask"
156
- })), openKrWeight && /*#__PURE__*/_react["default"].createElement(_krItemWeight["default"], {
157
- krData: krData,
158
- changeKr: changeKr
159
- }), /*#__PURE__*/_react["default"].createElement(_okrNewUserSelector["default"], {
160
- user: formatUser,
161
- container: container,
162
- changeUser: onUserSelectorSubmitHandler
163
- })));
164
- }
165
-
166
- var _default = KrItem;
167
- exports["default"] = _default;
@@ -1,273 +0,0 @@
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 _radio = require("../../components-v1/radio");
13
-
14
- var _style = require("./style");
15
-
16
- var _StatelessDropdown = _interopRequireDefault(require("../../components-v1/dropDownSelector/StatelessDropdown"));
17
-
18
- var _auth = require("../../utils/auth");
19
-
20
- var _userSelector = require("../user-selector");
21
-
22
- var _openData = require("../../utils/open-data");
23
-
24
- var _bsGlobal = require("../../utils/bs-global");
25
-
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
-
28
- 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); }
29
-
30
- 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; }
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
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
45
-
46
- 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); } }
47
-
48
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
49
-
50
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
51
-
52
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
53
-
54
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
55
-
56
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
57
-
58
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
59
-
60
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
61
-
62
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
63
-
64
- var radios = [{
65
- label: "公司",
66
- value: 3
67
- }, {
68
- label: "部门",
69
- value: 2
70
- }, {
71
- label: "团队",
72
- value: 4
73
- }, {
74
- label: "个人",
75
- value: 1
76
- }];
77
-
78
- var ObjectType = /*#__PURE__*/function (_Component) {
79
- _inherits(ObjectType, _Component);
80
-
81
- var _super = _createSuper(ObjectType);
82
-
83
- function ObjectType(props) {
84
- var _this;
85
-
86
- _classCallCheck(this, ObjectType);
87
-
88
- _this = _super.call(this, props);
89
-
90
- _this.onTeamSelect = function (_ref) {
91
- var _ref2 = _slicedToArray(_ref, 1),
92
- info = _ref2[0];
93
-
94
- _this.setState({
95
- groupName: info.data.name,
96
- groupId: info.data.id
97
- }); //@ts-ignore
98
-
99
-
100
- _this.popup.current.close();
101
- };
102
-
103
- _this.onDepartSelect = function (_nodeKey, _ref3) {
104
- var node = _ref3.node;
105
- var data = node.data;
106
-
107
- _this.setState({
108
- departmentName: data.name,
109
- departmentId: data.id,
110
- okrType: 2,
111
- label: ""
112
- }); //@ts-ignore
113
-
114
-
115
- _this.departPopup.current.close();
116
- };
117
-
118
- _this.renderTeamType = function () {
119
- return /*#__PURE__*/_react["default"].createElement(_userSelector.GroupSelector // @ts-ignore
120
- , {
121
- ref: _this.popup // @ts-ignore
122
- ,
123
- onSelect: _this.onTeamSelect,
124
- position: "center",
125
- trigger:
126
- /*#__PURE__*/
127
- // @ts-ignore
128
- _react["default"].createElement("div", {
129
- onClick: function onClick() {
130
- return _this.popup.current.open();
131
- },
132
- style: {
133
- width: "100%"
134
- }
135
- }, /*#__PURE__*/_react["default"].createElement(_StatelessDropdown["default"], {
136
- className: "mx-w-240",
137
- overlayClassName: "has-underline",
138
- labelText: "\u56E2\u961F"
139
- }, _this.state.groupName || "团队"))
140
- });
141
- };
142
-
143
- _this.renderType = function () {
144
- // 只有存在选择部门的情况
145
- if (_this.state.okrType === 2) {
146
- return /*#__PURE__*/_react["default"].createElement(_userSelector.DepartSearchSelector // @ts-ignore
147
- , {
148
- onSelect: _this.onDepartSelect // @ts-ignore
149
- ,
150
- ref: _this.departPopup,
151
- position: "center",
152
- trigger:
153
- /*#__PURE__*/
154
- // @ts-ignore
155
- _react["default"].createElement("div", {
156
- onClick: function onClick() {
157
- return _this.departPopup.current.open();
158
- },
159
- style: {
160
- width: "100%"
161
- }
162
- }, /*#__PURE__*/_react["default"].createElement(_StatelessDropdown["default"], {
163
- className: "mx-w-240",
164
- overlayClassName: "has-underline",
165
- labelText: "\u90E8\u95E8"
166
- }, /*#__PURE__*/_react["default"].createElement(_openData.OpenDepartmentName, {
167
- id: _this.state.departmentId,
168
- name: _this.state.departmentName
169
- })))
170
- });
171
- }
172
-
173
- if (_this.state.okrType === 4) {
174
- return _this.renderTeamType();
175
- }
176
-
177
- return /*#__PURE__*/_react["default"].createElement("div", {
178
- style: {
179
- height: 10
180
- }
181
- });
182
- };
183
-
184
- _this.handleChange = function (okrType, label) {
185
- var _getUserInfo = (0, _bsGlobal.getUserInfo)(),
186
- Department = _getUserInfo.Department,
187
- DepartmentId = _getUserInfo.DepartmentId;
188
-
189
- if (okrType === 2) {
190
- _this.setState({
191
- okrType: okrType,
192
- label: "",
193
- departmentId: DepartmentId,
194
- departmentName: Department
195
- });
196
- } else {
197
- _this.setState({
198
- okrType: okrType,
199
- label: label,
200
- departmentId: _this.props.departmentId,
201
- departmentName: _this.props.departmentName
202
- });
203
- }
204
- };
205
-
206
- _this.state = {
207
- okrType: 0,
208
- departmentName: "",
209
- departmentId: 0,
210
- depth: [],
211
- label: "",
212
- groupId: 0,
213
- groupName: "",
214
- auth: false
215
- }; //@ts-ignore
216
-
217
- _this.popup = /*#__PURE__*/_react["default"].createRef(); //@ts-ignore
218
-
219
- _this.departPopup = /*#__PURE__*/_react["default"].createRef();
220
- return _this;
221
- }
222
-
223
- _createClass(ObjectType, [{
224
- key: "componentWillMount",
225
- value: function componentWillMount() {
226
- var _this$props = this.props,
227
- okrType = _this$props.okrType,
228
- okrTypeName = _this$props.okrTypeName,
229
- departmentName = _this$props.departmentName,
230
- departmentId = _this$props.departmentId,
231
- groupId = _this$props.groupId,
232
- groupName = _this$props.groupName;
233
- var baseAuth = new _auth.BaseAuth();
234
- var auth = baseAuth.isBoss() || baseAuth.isManager();
235
- this.setState({
236
- departmentName: okrType == 2 ? departmentName : "",
237
- departmentId: okrType == 2 ? departmentId : 0,
238
- okrType: okrType,
239
- label: okrTypeName,
240
- groupName: okrType == 4 ? groupName : "",
241
- groupId: okrType == 4 ? groupId : 0,
242
- auth: auth
243
- });
244
- }
245
- }, {
246
- key: "render",
247
- value: function render() {
248
- var _this2 = this;
249
-
250
- return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_radio.RadioGroup, {
251
- name: "okrType",
252
- labelText: "\u7C7B\u578B",
253
- style: {
254
- marginBottom: 8
255
- }
256
- }, radios.map(function (_ref4) {
257
- var label = _ref4.label,
258
- value = _ref4.value;
259
- return /*#__PURE__*/_react["default"].createElement(_radio.Radio, {
260
- key: value,
261
- value: value,
262
- onChange: _this2.handleChange,
263
- checked: value === _this2.state.okrType ? true : false
264
- }, label) // Radio 切换的时候就直接把默认值带上
265
- ;
266
- })), /*#__PURE__*/_react["default"].createElement(_style.DropDownContent, null, this.renderType()));
267
- }
268
- }]);
269
-
270
- return ObjectType;
271
- }(_react.Component);
272
-
273
- exports["default"] = ObjectType;
@@ -1,220 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getCycleSetting = exports.getOAnalysisInfos = exports.updateOCommitType = exports.updateOkrVisibility = exports.getKrAnalysisInfos = exports.createWidthKr = exports.getImageBase64ByUrl = void 0;
7
-
8
- var _axios = _interopRequireDefault(require("axios"));
9
-
10
- var _qs = _interopRequireDefault(require("qs"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
-
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
15
-
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
-
18
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
-
20
- 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); } }
21
-
22
- 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); }); }; }
23
-
24
- // @ts-ignore
25
- var tenantId = BSGlobal && BSGlobal.tenantInfo.Id || 0; // @ts-ignore
26
-
27
- var userId = BSGlobal && BSGlobal.loginUserInfo.Id || 0;
28
-
29
- var requestDomain = function requestDomain() {
30
- if (!window.location.hostname.match(/dev/)) return "";
31
- return "http://www.tita.gift";
32
- };
33
-
34
- var getImageBase64ByUrl = function getImageBase64ByUrl(toUserId) {
35
- return _axios["default"].post("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/share/getBase64Str"), {
36
- toUserId: toUserId
37
- }).then(function (getBase64Str) {
38
- return getBase64Str.data;
39
- });
40
- };
41
-
42
- exports.getImageBase64ByUrl = getImageBase64ByUrl;
43
-
44
- var createWidthKr = /*#__PURE__*/function () {
45
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(data) {
46
- var url, res;
47
- return regeneratorRuntime.wrap(function _callee$(_context) {
48
- while (1) {
49
- switch (_context.prev = _context.next) {
50
- case 0:
51
- url = "".concat(requestDomain(), "/api/v2/").concat(tenantId, "/").concat(userId, "/work/createWithKr");
52
- _context.next = 3;
53
- return _axios["default"].post(url, _objectSpread({
54
- workType: 6
55
- }, data), {
56
- headers: {
57
- "Content-Type": "application/x-www-form-urlencoded"
58
- },
59
- transformRequest: _qs["default"].stringify
60
- });
61
-
62
- case 3:
63
- res = _context.sent;
64
-
65
- if (!(res.data.Code == 1)) {
66
- _context.next = 6;
67
- break;
68
- }
69
-
70
- return _context.abrupt("return", res.data.Data);
71
-
72
- case 6:
73
- case "end":
74
- return _context.stop();
75
- }
76
- }
77
- }, _callee);
78
- }));
79
-
80
- return function createWidthKr(_x) {
81
- return _ref.apply(this, arguments);
82
- };
83
- }();
84
-
85
- exports.createWidthKr = createWidthKr;
86
-
87
- var getKrAnalysisInfos = /*#__PURE__*/function () {
88
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(params) {
89
- var url;
90
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
91
- while (1) {
92
- switch (_context2.prev = _context2.next) {
93
- case 0:
94
- url = "".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/create/analys");
95
- return _context2.abrupt("return", _axios["default"].post(url, params));
96
-
97
- case 2:
98
- case "end":
99
- return _context2.stop();
100
- }
101
- }
102
- }, _callee2);
103
- }));
104
-
105
- return function getKrAnalysisInfos(_x2) {
106
- return _ref2.apply(this, arguments);
107
- };
108
- }();
109
-
110
- exports.getKrAnalysisInfos = getKrAnalysisInfos;
111
-
112
- var updateOkrVisibility = /*#__PURE__*/function () {
113
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(params) {
114
- var url;
115
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
116
- while (1) {
117
- switch (_context3.prev = _context3.next) {
118
- case 0:
119
- url = "".concat(requestDomain(), "/api/v2/").concat(tenantId, "/").concat(userId, "/work/visiblity");
120
- return _context3.abrupt("return", _axios["default"].post(url, params));
121
-
122
- case 2:
123
- case "end":
124
- return _context3.stop();
125
- }
126
- }
127
- }, _callee3);
128
- }));
129
-
130
- return function updateOkrVisibility(_x3) {
131
- return _ref3.apply(this, arguments);
132
- };
133
- }();
134
-
135
- exports.updateOkrVisibility = updateOkrVisibility;
136
-
137
- var updateOCommitType = /*#__PURE__*/function () {
138
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(params) {
139
- var url;
140
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
141
- while (1) {
142
- switch (_context4.prev = _context4.next) {
143
- case 0:
144
- url = "".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/update/okrType?okrId=").concat(params.okrId);
145
- return _context4.abrupt("return", _axios["default"].post(url, params, {
146
- headers: {
147
- "Content-Type": "application/x-www-form-urlencoded"
148
- },
149
- transformRequest: _qs["default"].stringify
150
- }));
151
-
152
- case 2:
153
- case "end":
154
- return _context4.stop();
155
- }
156
- }
157
- }, _callee4);
158
- }));
159
-
160
- return function updateOCommitType(_x4) {
161
- return _ref4.apply(this, arguments);
162
- };
163
- }();
164
-
165
- exports.updateOCommitType = updateOCommitType;
166
-
167
- var getOAnalysisInfos = /*#__PURE__*/function () {
168
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(params) {
169
- var url;
170
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
171
- while (1) {
172
- switch (_context5.prev = _context5.next) {
173
- case 0:
174
- url = "".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/create/analys");
175
- return _context5.abrupt("return", _axios["default"].post(url, params));
176
-
177
- case 2:
178
- case "end":
179
- return _context5.stop();
180
- }
181
- }
182
- }, _callee5);
183
- }));
184
-
185
- return function getOAnalysisInfos(_x5) {
186
- return _ref5.apply(this, arguments);
187
- };
188
- }();
189
-
190
- exports.getOAnalysisInfos = getOAnalysisInfos;
191
-
192
- var getCycleSetting = /*#__PURE__*/function () {
193
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
194
- var url, res;
195
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
196
- while (1) {
197
- switch (_context6.prev = _context6.next) {
198
- case 0:
199
- url = "".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/cycleSetting");
200
- _context6.next = 3;
201
- return _axios["default"].get(url);
202
-
203
- case 3:
204
- res = _context6.sent;
205
- return _context6.abrupt("return", res.data.Data);
206
-
207
- case 5:
208
- case "end":
209
- return _context6.stop();
210
- }
211
- }
212
- }, _callee6);
213
- }));
214
-
215
- return function getCycleSetting() {
216
- return _ref6.apply(this, arguments);
217
- };
218
- }();
219
-
220
- exports.getCycleSetting = getCycleSetting;