@titaui/pc 1.11.51 → 1.11.52-beta.11

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 (225) hide show
  1. package/lib/components/button/images/blue.svg +21 -0
  2. package/lib/components/button/images/red.svg +21 -0
  3. package/lib/components/button/images/white.svg +19 -0
  4. package/lib/components/button/rect-btn/index.js +3 -3
  5. package/lib/components/change-okr-modal/Item.js +19 -18
  6. package/lib/components/change-okr-modal/styledComponents.js +9 -9
  7. package/lib/components/checkbox/index.css +4 -0
  8. package/lib/components/contact-kefu/index.css +11 -1
  9. package/lib/components/contact-kefu/index.js +10 -4
  10. package/lib/components/create-okr-modal/createSuccessCmp.js +47 -19
  11. package/lib/components/create-okr-modal/fields/index.css +14 -3
  12. package/lib/components/create-okr-modal/fields/o-new-name.js +30 -19
  13. package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
  14. package/lib/components/create-okr-modal/index.js +200 -133
  15. package/lib/components/create-okr-modal/kr-items/index.css +23 -13
  16. package/lib/components/create-okr-modal/kr-items/krDatas.js +95 -76
  17. package/lib/components/create-okr-modal/kr-items/krItem.js +53 -56
  18. package/lib/components/create-okr-modal/style.js +5 -5
  19. package/lib/components/date-picker/BodyItem.js +3 -3
  20. package/lib/components/date-picker/CalendarHeader.js +3 -3
  21. package/lib/components/delete-confirm-pop/ConfirmPop.js +3 -3
  22. package/lib/components/dynamic/constant.js +1 -1
  23. package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +8 -8
  24. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +8 -8
  25. package/lib/components/dynamic/dynamic-list/index.js +14 -7
  26. package/lib/components/dynamic/index.js +9 -12
  27. package/lib/components/dynamic/request-api.js +7 -68
  28. package/lib/components/eReport/eReportLists/reportList.js +3 -3
  29. package/lib/components/emotions-selector/selector-pop.js +3 -3
  30. package/lib/components/ereport-list/index.js +3 -3
  31. package/lib/components/mblog/components/MblogAction.js +3 -3
  32. package/lib/components/menus/export-modules/appraisal-menus/menus.js +11 -9
  33. package/lib/components/nav-top/components/menu/index.js +18 -16
  34. package/lib/components/nav-top/index.js +2 -2
  35. package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
  36. package/lib/components/okr-detail/components/header/edit-name.js +86 -40
  37. package/lib/components/okr-detail/components/header/index.css +120 -41
  38. package/lib/components/okr-detail/components/header/index.js +36 -46
  39. package/lib/components/okr-detail/components/header/o-classify.js +152 -0
  40. package/lib/components/okr-detail/components/header/o-name.js +7 -5
  41. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +3 -1
  42. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +58 -4
  43. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +159 -63
  44. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
  45. package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +9 -9
  46. package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +15 -13
  47. package/lib/components/okr-detail/detail-header/index.js +8 -4
  48. package/lib/components/okr-detail/e-list/index.js +2 -2
  49. package/lib/components/okr-detail/okr-list/create-kr-item/index.css +17 -0
  50. package/lib/components/okr-detail/okr-list/create-kr-item/index.js +75 -53
  51. package/lib/components/okr-detail/request-apis.js +73 -69
  52. package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
  53. package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
  54. package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
  55. package/lib/components/okr-flow/child-node/kr-node.js +3 -1
  56. package/lib/components/okr-flow/child-node/work-node.js +3 -1
  57. package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
  58. package/lib/components/okr-progress/components/o-progress/index.js +3 -1
  59. package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
  60. package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +3 -3
  61. package/lib/components/okr-review/components/ReviewItem/index.js +3 -3
  62. package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +3 -3
  63. package/lib/components/okr-share/common-painter/openDataPainter.js +9 -6
  64. package/lib/components/okr-share/common-painter/utils.js +183 -36
  65. package/lib/components/okr-share/index.css +5 -4
  66. package/lib/components/okr-share/pink-card/card.js +3 -3
  67. package/lib/components/okr-share/pink-card/drawKrs.js +93 -18
  68. package/lib/components/okr-share/pink-card/index.js +20 -12
  69. package/lib/components/open-data-painter/index.js +6 -5
  70. package/lib/components/period-selector/interface.js +7 -0
  71. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +16 -10
  72. package/lib/components/range-selector-pop/RangeSelectorPop.js +3 -3
  73. package/lib/components/rich-editor/models/schema.js +6 -6
  74. package/lib/components/rich-editor/plugins/block/block-quote/index.js +8 -8
  75. package/lib/components/rich-editor/plugins/block/heading/index.js +8 -8
  76. package/lib/components/rich-editor/plugins/block/lists/index.js +14 -14
  77. package/lib/components/rich-editor/plugins/block/paragraph/index.js +5 -5
  78. package/lib/components/rich-editor/plugins/core/index.js +4 -4
  79. package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -5
  80. package/lib/components/rich-editor/plugins/extension/placeholder/index.js +4 -4
  81. package/lib/components/rich-editor/plugins/inline/color/index.js +11 -11
  82. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +8 -8
  83. package/lib/components/rich-editor/plugins/inline/em/index.js +5 -5
  84. package/lib/components/rich-editor/plugins/inline/link/index.js +8 -8
  85. package/lib/components/rich-editor/plugins/inline/strong/index.js +8 -8
  86. package/lib/components/rich-editor/plugins/inline/under-line/index.js +8 -8
  87. package/lib/components/rich-editor/react/uiProvider.js +3 -3
  88. package/lib/components/rich-editor/ui/Popup/index.js +3 -3
  89. package/lib/components/search-input/index.css +1 -1
  90. package/lib/components/search-key-handle/index.js +9 -7
  91. package/lib/components/select/Option.js +3 -3
  92. package/lib/components/select-layer/index.css +1 -1
  93. package/lib/components/task-relation-modal/helper.js +139 -2
  94. package/lib/components/task-relation-modal/image/loading.gif +0 -0
  95. package/lib/components/task-relation-modal/index.js +9 -0
  96. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.css +18 -0
  97. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +262 -0
  98. package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +135 -0
  99. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.css +0 -0
  100. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +129 -0
  101. package/lib/components/task-relation-modal/okr-relation/request-api.js +106 -0
  102. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +120 -0
  103. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +185 -0
  104. package/lib/components/task-relation-modal/request-api.js +28 -2
  105. package/lib/components/task-relation-modal/search/okr-status-select.js +3 -3
  106. package/lib/components/task-relation-modal/search/principal.js +36 -19
  107. package/lib/components/task-relation-modal/search/search-dropdown/index.css +2 -1
  108. package/lib/components/task-relation-modal/search/search-dropdown/index.js +1 -1
  109. package/lib/components/{dynamic/dynamic-topping/index.js → task-relation-modal/search/task-relation.js} +45 -44
  110. package/lib/components/task-relation-modal/search/task-status-select.js +87 -0
  111. package/lib/components/{dynamic/dynamic-liking/index.js → task-relation-modal/search/work-relation.js} +43 -39
  112. package/lib/components/task-relation-modal/search/work-status-select.js +74 -0
  113. package/lib/components/task-relation-modal/tree/category-tree/index.css +3 -3
  114. package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
  115. package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +16 -2
  116. package/lib/components/task-relation-modal/tree/task-list/index.css +0 -0
  117. package/lib/components/task-relation-modal/tree/task-list/index.js +1 -0
  118. package/lib/components/task-relation-modal/tree/work-list/index.css +14 -0
  119. package/lib/components/task-relation-modal/tree/work-list/index.js +176 -0
  120. package/lib/components/task-relation-modal/tree/work-list/search-form.js +123 -0
  121. package/lib/components/task-relation-modal/tree/work-tree/index.css +1 -1
  122. package/lib/components/task-relation-modal/tree-node/category-node/index.css +1 -12
  123. package/lib/components/task-relation-modal/tree-node/category-node/index.js +1 -3
  124. package/lib/components/task-relation-modal/tree-node/kr-node/index.css +0 -16
  125. package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -10
  126. package/lib/components/task-relation-modal/tree-node/milestone-node/index.css +0 -16
  127. package/lib/components/task-relation-modal/tree-node/milestone-node/index.js +0 -4
  128. package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
  129. package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
  130. package/lib/components/task-relation-modal/work-relation/index.css +0 -0
  131. package/lib/components/task-relation-modal/work-relation/index.js +256 -0
  132. package/lib/components/tita-chart/errorBoundary/index.js +3 -3
  133. package/lib/components/tooltip/index.js +3 -0
  134. package/lib/components/tooltip/tooltip-rows/index.css +26 -0
  135. package/lib/components/{dynamic/advertise → tooltip/tooltip-rows}/index.js +65 -85
  136. package/lib/components/user-selector/category-selector-panel/index.js +6 -1
  137. package/lib/components/{dynamic/quick-operation/components/create-task/index.js → user-selector/category-selector-panel/subordinate-tree.js} +37 -20
  138. package/lib/components/user-selector/constant.js +10 -2
  139. package/lib/components/user-selector/empty/index.css +5 -0
  140. package/lib/components/user-selector/empty/index.js +9 -3
  141. package/lib/components/user-selector/export-modules/depart-search-selector/index.js +45 -17
  142. package/lib/components/user-selector/export-modules/field-tree-selector/index.js +3 -1
  143. package/lib/components/user-selector/images/no-auth.png +0 -0
  144. package/lib/components/user-selector/request-apis.js +28 -9
  145. package/lib/components/user-selector/searched-panel/index.js +21 -7
  146. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +46 -18
  147. package/lib/components/wechat-btn/index.css +5 -1
  148. package/lib/components-v1/animate/AnimateChild.js +3 -3
  149. package/lib/components-v1/avatar/index.js +3 -3
  150. package/lib/components-v1/dropDownSelector/StatelessDropdown.js +3 -3
  151. package/lib/components-v1/progress/CircleProgress.js +3 -3
  152. package/lib/components-v1/select/Option.js +3 -3
  153. package/lib/components-v1/userSelector/UserSelectorPop.js +3 -3
  154. package/lib/components-v1/userSelector/components/MultiMode/index.js +3 -3
  155. package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
  156. package/lib/components-v1/userSelector/components/UserItem.js +3 -3
  157. package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
  158. package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
  159. package/lib/utils/open-data.js +213 -65
  160. package/lib/utils/planDataJson.js +11115 -0
  161. package/package.json +3 -2
  162. package/lib/components/dynamic/advertise/components/next-btn/index.css +0 -27
  163. package/lib/components/dynamic/advertise/components/next-btn/index.js +0 -32
  164. package/lib/components/dynamic/advertise/components/pre-btn/index.css +0 -26
  165. package/lib/components/dynamic/advertise/components/pre-btn/index.js +0 -32
  166. package/lib/components/dynamic/advertise/index.css +0 -21
  167. package/lib/components/dynamic/advertise/interface.js +0 -5
  168. package/lib/components/dynamic/advertise/util.js +0 -28
  169. package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -81
  170. package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -203
  171. package/lib/components/dynamic/components/first-level-tabs/index.css +0 -101
  172. package/lib/components/dynamic/components/first-level-tabs/index.js +0 -131
  173. package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
  174. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
  175. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
  176. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
  177. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
  178. package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -146
  179. package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -180
  180. package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -105
  181. package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
  182. package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
  183. package/lib/components/dynamic/dynamic-liking/index.css +0 -81
  184. package/lib/components/dynamic/dynamic-liking/item.js +0 -75
  185. package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
  186. package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +0 -16
  187. package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +0 -30
  188. package/lib/components/dynamic/dynamic-topping/index.css +0 -141
  189. package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
  190. package/lib/components/dynamic/dynamic-topping/item.js +0 -153
  191. package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
  192. package/lib/components/dynamic/dynamic.css +0 -173
  193. package/lib/components/dynamic/dynamic.js +0 -428
  194. package/lib/components/dynamic/export-module/index.js +0 -37
  195. package/lib/components/dynamic/img/dynamic-top.svg +0 -14
  196. package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
  197. package/lib/components/dynamic/my-team/img/line.png +0 -0
  198. package/lib/components/dynamic/my-team/img/team.png +0 -0
  199. package/lib/components/dynamic/my-team/index.css +0 -184
  200. package/lib/components/dynamic/my-team/index.js +0 -263
  201. package/lib/components/dynamic/my-team/request-api.js +0 -52
  202. package/lib/components/dynamic/my-team/util.js +0 -20
  203. package/lib/components/dynamic/new-ui.css +0 -192
  204. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +0 -58
  205. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +0 -68
  206. package/lib/components/dynamic/online-broadcast/data.js +0 -95
  207. package/lib/components/dynamic/online-broadcast/img/broadcast.svg +0 -14
  208. package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
  209. package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
  210. package/lib/components/dynamic/online-broadcast/index.css +0 -46
  211. package/lib/components/dynamic/online-broadcast/index.js +0 -61
  212. package/lib/components/dynamic/online-broadcast/interfact.js +0 -5
  213. package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
  214. package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -39
  215. package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
  216. package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -39
  217. package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
  218. package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -39
  219. package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
  220. package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
  221. package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
  222. package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
  223. package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
  224. package/lib/components/dynamic/quick-operation/index.css +0 -51
  225. package/lib/components/dynamic/quick-operation/index.js +0 -120
@@ -9,10 +9,14 @@ exports["default"] = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
12
+ var _richEditor = require("@titaui/rich-editor");
13
+
12
14
  var _uuid = _interopRequireDefault(require("uuid"));
13
15
 
14
16
  var _titaUi = require("tita-ui");
15
17
 
18
+ var _scrollbar = _interopRequireDefault(require("../scrollbar"));
19
+
16
20
  var _bsGlobal = require("../../utils/bs-global");
17
21
 
18
22
  var _roundWeight = require("../../utils/roundWeight");
@@ -106,6 +110,13 @@ var initOCheckResult = function initOCheckResult() {
106
110
  });
107
111
  };
108
112
 
113
+ var DefaultOkrNameData = {
114
+ mentionUsers: [],
115
+ pureText: '',
116
+ pureTextExcludeAt: '',
117
+ richText: undefined
118
+ };
119
+
109
120
  function CreateOkrModal(_ref, ref) {
110
121
  var initCycle = _ref.initCycle,
111
122
  userInfo = _ref.userInfo,
@@ -121,10 +132,15 @@ function CreateOkrModal(_ref, ref) {
121
132
  _ref$isFromAssess = _ref.isFromAssess,
122
133
  isFromAssess = _ref$isFromAssess === void 0 ? false : _ref$isFromAssess;
123
134
 
124
- var _useState = (0, _react.useState)(visible),
135
+ var _useState = (0, _react.useState)('initialization'),
125
136
  _useState2 = _slicedToArray(_useState, 2),
126
- isVisible = _useState2[0],
127
- setVisible = _useState2[1]; // @ts-ignore
137
+ richEditorStatus = _useState2[0],
138
+ setRichEditorStatus = _useState2[1];
139
+
140
+ var _useState3 = (0, _react.useState)(visible),
141
+ _useState4 = _slicedToArray(_useState3, 2),
142
+ isVisible = _useState4[0],
143
+ setVisible = _useState4[1]; // @ts-ignore
128
144
 
129
145
 
130
146
  var userId = BSGlobal.loginUserInfo.Id;
@@ -138,80 +154,80 @@ function CreateOkrModal(_ref, ref) {
138
154
  Id = _ref2.Id,
139
155
  UserAvatar = _ref2.UserAvatar;
140
156
 
141
- var _useState3 = (0, _react.useState)(''),
142
- _useState4 = _slicedToArray(_useState3, 2),
143
- okrName = _useState4[0],
144
- setOkrName = _useState4[1]; // 目标名称
157
+ var _useState5 = (0, _react.useState)(DefaultOkrNameData),
158
+ _useState6 = _slicedToArray(_useState5, 2),
159
+ okrNameData = _useState6[0],
160
+ setOkrNameData = _useState6[1]; // 目标名称
145
161
 
146
162
 
147
- var _useState5 = (0, _react.useState)({
163
+ var _useState7 = (0, _react.useState)({
148
164
  name: Name,
149
165
  id: Id,
150
166
  avatar: UserAvatar
151
167
  }),
152
- _useState6 = _slicedToArray(_useState5, 2),
153
- user = _useState6[0],
154
- setUser = _useState6[1]; // 负责人
168
+ _useState8 = _slicedToArray(_useState7, 2),
169
+ user = _useState8[0],
170
+ setUser = _useState8[1]; // 负责人
155
171
 
156
172
 
157
- var _useState7 = (0, _react.useState)(false),
158
- _useState8 = _slicedToArray(_useState7, 2),
159
- isCustomWeight = _useState8[0],
160
- setIsCustomWeight = _useState8[1]; // 是否自定义权重
173
+ var _useState9 = (0, _react.useState)(false),
174
+ _useState10 = _slicedToArray(_useState9, 2),
175
+ isCustomWeight = _useState10[0],
176
+ setIsCustomWeight = _useState10[1]; // 是否自定义权重
161
177
 
162
178
 
163
- var _useState9 = (0, _react.useState)({
179
+ var _useState11 = (0, _react.useState)({
164
180
  departmentId: 0,
165
181
  departmentName: ''
166
182
  }),
167
- _useState10 = _slicedToArray(_useState9, 2),
168
- dept = _useState10[0],
169
- setDept = _useState10[1]; // 部门信息 用于目标类型为部门时
183
+ _useState12 = _slicedToArray(_useState11, 2),
184
+ dept = _useState12[0],
185
+ setDept = _useState12[1]; // 部门信息 用于目标类型为部门时
170
186
 
171
187
 
172
- var _useState11 = (0, _react.useState)({
188
+ var _useState13 = (0, _react.useState)({
173
189
  groupId: 0,
174
190
  groupName: ''
175
191
  }),
176
- _useState12 = _slicedToArray(_useState11, 2),
177
- team = _useState12[0],
178
- setTeam = _useState12[1]; // 团队信息 用于目标类型为团队时
192
+ _useState14 = _slicedToArray(_useState13, 2),
193
+ team = _useState14[0],
194
+ setTeam = _useState14[1]; // 团队信息 用于目标类型为团队时
179
195
 
180
196
 
181
- var _useState13 = (0, _react.useState)({
197
+ var _useState15 = (0, _react.useState)({
182
198
  typeName: (0, _getLocale.getLocale)('OKR_MyO_Pop_Individual'),
183
199
  typeId: 1
184
200
  }),
185
- _useState14 = _slicedToArray(_useState13, 2),
186
- type = _useState14[0],
187
- setType = _useState14[1]; // 目标类型
188
-
189
-
190
- var _useState15 = (0, _react.useState)(initCycle),
191
201
  _useState16 = _slicedToArray(_useState15, 2),
192
- cycle = _useState16[0],
193
- setCycle = _useState16[1]; // 目标周期信息
202
+ type = _useState16[0],
203
+ setType = _useState16[1]; // 目标类型
194
204
 
195
205
 
196
- var _useState17 = (0, _react.useState)(),
206
+ var _useState17 = (0, _react.useState)(initCycle),
197
207
  _useState18 = _slicedToArray(_useState17, 2),
198
- okrClassify = _useState18[0],
199
- setOkrClassify = _useState18[1]; // 目标类别
208
+ cycle = _useState18[0],
209
+ setCycle = _useState18[1]; // 目标周期信息
200
210
 
201
211
 
202
- var _useState19 = (0, _react.useState)(1),
212
+ var _useState19 = (0, _react.useState)(),
203
213
  _useState20 = _slicedToArray(_useState19, 2),
204
- visibility = _useState20[0],
205
- setVisibility = _useState20[1]; // 可见性
214
+ okrClassify = _useState20[0],
215
+ setOkrClassify = _useState20[1]; // 目标类别
206
216
 
207
217
 
208
- var _useState21 = (0, _react.useState)({}),
218
+ var _useState21 = (0, _react.useState)(1),
209
219
  _useState22 = _slicedToArray(_useState21, 2),
210
- visiableLimit = _useState22[0],
211
- setVisiableLimit = _useState22[1]; // 可见性指定范围
220
+ visibility = _useState22[0],
221
+ setVisibility = _useState22[1]; // 可见性
212
222
 
213
223
 
214
- var _useState23 = (0, _react.useState)([{
224
+ var _useState23 = (0, _react.useState)({}),
225
+ _useState24 = _slicedToArray(_useState23, 2),
226
+ visiableLimit = _useState24[0],
227
+ setVisiableLimit = _useState24[1]; // 可见性指定范围
228
+
229
+
230
+ var _useState25 = (0, _react.useState)([{
215
231
  // kr信息
216
232
  uuid: _uuid["default"].v1(),
217
233
  principalId: Id,
@@ -219,91 +235,94 @@ function CreateOkrModal(_ref, ref) {
219
235
  userAvatar: UserAvatar,
220
236
  krWeight: 100,
221
237
  mileStoneName: '',
238
+ mileStoneNamePureTextExcludeAt: '',
239
+ mileStoneNameRichText: undefined,
240
+ aiteUsers: [],
222
241
  confidenceIndex: 5
223
242
  }]),
224
- _useState24 = _slicedToArray(_useState23, 2),
225
- krDatas = _useState24[0],
226
- setKrDatas = _useState24[1];
243
+ _useState26 = _slicedToArray(_useState25, 2),
244
+ krDatas = _useState26[0],
245
+ setKrDatas = _useState26[1];
227
246
 
228
- var _useState25 = (0, _react.useState)({
247
+ var _useState27 = (0, _react.useState)({
229
248
  // 对其目标
230
249
  parentWorkId: 0,
231
250
  parentWorkName: '',
232
251
  parentType: 0,
233
252
  parentKrId: 0
234
253
  }),
235
- _useState26 = _slicedToArray(_useState25, 2),
236
- parent = _useState26[0],
237
- setParent = _useState26[1];
238
-
239
- var _useState27 = (0, _react.useState)(false),
240
254
  _useState28 = _slicedToArray(_useState27, 2),
241
- oNameIsInput = _useState28[0],
242
- setONameIsInput = _useState28[1];
255
+ parent = _useState28[0],
256
+ setParent = _useState28[1];
243
257
 
244
258
  var _useState29 = (0, _react.useState)(false),
245
259
  _useState30 = _slicedToArray(_useState29, 2),
246
- krIsInput = _useState30[0],
247
- setKrIsInput = _useState30[1];
260
+ oNameIsInput = _useState30[0],
261
+ setONameIsInput = _useState30[1];
248
262
 
249
- var _useState31 = (0, _react.useState)(initOCheckResult()),
263
+ var _useState31 = (0, _react.useState)(false),
250
264
  _useState32 = _slicedToArray(_useState31, 2),
251
- oNameCheckResult = _useState32[0],
252
- setONameCheckResult = _useState32[1];
265
+ krIsInput = _useState32[0],
266
+ setKrIsInput = _useState32[1];
253
267
 
254
- var _useState33 = (0, _react.useState)({
268
+ var _useState33 = (0, _react.useState)(initOCheckResult()),
269
+ _useState34 = _slicedToArray(_useState33, 2),
270
+ oNameCheckResult = _useState34[0],
271
+ setONameCheckResult = _useState34[1];
272
+
273
+ var _useState35 = (0, _react.useState)({
255
274
  finalResult: _okrCreateSuggest.EOkrCreateSuggestResultType.normal,
256
275
  friendlyResult: []
257
276
  }),
258
- _useState34 = _slicedToArray(_useState33, 2),
259
- krsCheckResult = _useState34[0],
260
- setKrsCheckResult = _useState34[1];
261
-
262
- var _useState35 = (0, _react.useState)(false),
263
277
  _useState36 = _slicedToArray(_useState35, 2),
264
- customCloseOSuggest = _useState36[0],
265
- setCustomCloseOSuggest = _useState36[1]; // 用户点击收起后不再自动弹出
266
-
278
+ krsCheckResult = _useState36[0],
279
+ setKrsCheckResult = _useState36[1];
267
280
 
268
281
  var _useState37 = (0, _react.useState)(false),
269
282
  _useState38 = _slicedToArray(_useState37, 2),
270
- customCloseKrSuggest = _useState38[0],
271
- setCustomCloseKrSuggest = _useState38[1];
283
+ customCloseOSuggest = _useState38[0],
284
+ setCustomCloseOSuggest = _useState38[1]; // 用户点击收起后不再自动弹出
285
+
272
286
 
273
- var _useState39 = (0, _react.useState)(),
287
+ var _useState39 = (0, _react.useState)(false),
274
288
  _useState40 = _slicedToArray(_useState39, 2),
275
- createdSuccessInfo = _useState40[0],
276
- setCreatedSuccessInfo = _useState40[1];
289
+ customCloseKrSuggest = _useState40[0],
290
+ setCustomCloseKrSuggest = _useState40[1];
277
291
 
278
- var _useState41 = (0, _react.useState)(false),
292
+ var _useState41 = (0, _react.useState)(),
279
293
  _useState42 = _slicedToArray(_useState41, 2),
280
- showCreatedSuccessInfo = _useState42[0],
281
- setShowCreatedSuccessInfo = _useState42[1];
294
+ createdSuccessInfo = _useState42[0],
295
+ setCreatedSuccessInfo = _useState42[1];
282
296
 
283
- var _useState43 = (0, _react.useState)(Math.floor(Math.random() * 6)),
297
+ var _useState43 = (0, _react.useState)(false),
284
298
  _useState44 = _slicedToArray(_useState43, 2),
285
- tipIndex = _useState44[0],
286
- setTipIndex = _useState44[1];
299
+ showCreatedSuccessInfo = _useState44[0],
300
+ setShowCreatedSuccessInfo = _useState44[1];
287
301
 
288
- var _useState45 = (0, _react.useState)(''),
302
+ var _useState45 = (0, _react.useState)(Math.floor(Math.random() * 6)),
289
303
  _useState46 = _slicedToArray(_useState45, 2),
290
- userAvatarBase64Url = _useState46[0],
291
- setUserAvatarBase64Url = _useState46[1];
304
+ tipIndex = _useState46[0],
305
+ setTipIndex = _useState46[1];
292
306
 
293
- var _useState47 = (0, _react.useState)(false),
307
+ var _useState47 = (0, _react.useState)(''),
294
308
  _useState48 = _slicedToArray(_useState47, 2),
295
- krIsValidate = _useState48[0],
296
- setKrIsValidate = _useState48[1];
309
+ userAvatarBase64Url = _useState48[0],
310
+ setUserAvatarBase64Url = _useState48[1];
297
311
 
298
312
  var _useState49 = (0, _react.useState)(false),
299
313
  _useState50 = _slicedToArray(_useState49, 2),
300
- isApplyTpl = _useState50[0],
301
- setIsApplyTpl = _useState50[1];
314
+ krIsValidate = _useState50[0],
315
+ setKrIsValidate = _useState50[1];
302
316
 
303
317
  var _useState51 = (0, _react.useState)(false),
304
318
  _useState52 = _slicedToArray(_useState51, 2),
305
- isInputContent = _useState52[0],
306
- setIsInputContent = _useState52[1];
319
+ isApplyTpl = _useState52[0],
320
+ setIsApplyTpl = _useState52[1];
321
+
322
+ var _useState53 = (0, _react.useState)(false),
323
+ _useState54 = _slicedToArray(_useState53, 2),
324
+ isInputContent = _useState54[0],
325
+ setIsInputContent = _useState54[1];
307
326
 
308
327
  var wrapperRef = (0, _react.useRef)();
309
328
  var modalRef = (0, _react.useRef)();
@@ -336,7 +355,12 @@ function CreateOkrModal(_ref, ref) {
336
355
  setCase: function setCase(data) {
337
356
  var name = data.name,
338
357
  subelements = data.subelements;
339
- setOkrName(name);
358
+ setOkrNameData({
359
+ mentionUsers: [],
360
+ pureText: name,
361
+ pureTextExcludeAt: name,
362
+ richText: (0, _richEditor.TitaRichEditorInitTextState)(name)
363
+ });
340
364
  setKrDatas(subelements.map(function (s) {
341
365
  return {
342
366
  uuid: _uuid["default"].v1(),
@@ -345,15 +369,25 @@ function CreateOkrModal(_ref, ref) {
345
369
  userAvatar: UserAvatar,
346
370
  krWeight: (0, _roundWeight.RoundWeight)(100 / subelements.length),
347
371
  mileStoneName: s.name,
372
+ mileStoneNamePureTextExcludeAt: '',
373
+ mileStoneNameRichText: (0, _richEditor.TitaRichEditorInitTextState)(s.name),
374
+ aiteUsers: [],
348
375
  confidenceIndex: 5
349
376
  };
350
377
  }));
351
378
  setIsCustomWeight(false);
352
379
  },
353
380
  setData: function setData(data) {
354
- setOkrName(data.okrName);
381
+ setOkrNameData({
382
+ mentionUsers: [],
383
+ pureText: data.okrName,
384
+ pureTextExcludeAt: data.okrName,
385
+ richText: (0, _richEditor.TitaRichEditorInitTextState)(data.okrName)
386
+ });
355
387
  setUser(data.user);
356
- }
388
+ },
389
+ show: showCreateOkrModal,
390
+ hide: hideCreateOkrModal
357
391
  };
358
392
  });
359
393
  var handleOnSuccess = (0, _react.useCallback)(function () {
@@ -399,13 +433,15 @@ function CreateOkrModal(_ref, ref) {
399
433
 
400
434
  var onModalOkHandler = /*#__PURE__*/function () {
401
435
  var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
402
- var orkNameLengthValidate, visibilityArea, data, krNum, krTotalLength, krAvarageLength, krMeasurableLength, oHasVtWords, callData, workId;
436
+ var mentionUsers, pureText, pureTextExcludeAt, richText, orkNameLengthValidate, visibilityArea, formData, data, krNum, krTotalLength, krAvarageLength, krMeasurableLength, oHasVtWords, callData, workId;
403
437
  return regeneratorRuntime.wrap(function _callee$(_context) {
404
438
  while (1) {
405
439
  switch (_context.prev = _context.next) {
406
440
  case 0:
407
- if (okrName) {
408
- _context.next = 3;
441
+ mentionUsers = okrNameData.mentionUsers, pureText = okrNameData.pureText, pureTextExcludeAt = okrNameData.pureTextExcludeAt, richText = okrNameData.richText;
442
+
443
+ if (pureText) {
444
+ _context.next = 4;
409
445
  break;
410
446
  }
411
447
 
@@ -415,9 +451,9 @@ function CreateOkrModal(_ref, ref) {
415
451
 
416
452
  return _context.abrupt("return");
417
453
 
418
- case 3:
419
- if (!(okrName.length > 500)) {
420
- _context.next = 6;
454
+ case 4:
455
+ if (!(pureTextExcludeAt.length > 500)) {
456
+ _context.next = 7;
421
457
  break;
422
458
  }
423
459
 
@@ -427,9 +463,9 @@ function CreateOkrModal(_ref, ref) {
427
463
 
428
464
  return _context.abrupt("return");
429
465
 
430
- case 6:
466
+ case 7:
431
467
  if (allKrHasName) {
432
- _context.next = 10;
468
+ _context.next = 11;
433
469
  break;
434
470
  }
435
471
 
@@ -440,13 +476,15 @@ function CreateOkrModal(_ref, ref) {
440
476
  setKrIsValidate(true);
441
477
  return _context.abrupt("return");
442
478
 
443
- case 10:
479
+ case 11:
444
480
  orkNameLengthValidate = krDatas.filter(function (kr) {
445
- return kr.mileStoneName.trim().length > 500;
481
+ var _trim;
482
+
483
+ return ((_trim = (kr.mileStoneNamePureTextExcludeAt || '').trim()) === null || _trim === void 0 ? void 0 : _trim.length) > 500;
446
484
  }).length == 0;
447
485
 
448
486
  if (orkNameLengthValidate) {
449
- _context.next = 14;
487
+ _context.next = 15;
450
488
  break;
451
489
  }
452
490
 
@@ -456,11 +494,11 @@ function CreateOkrModal(_ref, ref) {
456
494
 
457
495
  return _context.abrupt("return");
458
496
 
459
- case 14:
497
+ case 15:
460
498
  setKrIsValidate(false);
461
499
 
462
500
  if (krWeightValid) {
463
- _context.next = 18;
501
+ _context.next = 19;
464
502
  break;
465
503
  }
466
504
 
@@ -470,27 +508,32 @@ function CreateOkrModal(_ref, ref) {
470
508
 
471
509
  return _context.abrupt("return");
472
510
 
473
- case 18:
511
+ case 19:
474
512
  if (cycle) {
475
- _context.next = 20;
513
+ _context.next = 21;
476
514
  break;
477
515
  }
478
516
 
479
517
  return _context.abrupt("return");
480
518
 
481
- case 20:
519
+ case 21:
482
520
  handleCreatedClose();
483
521
  visibilityArea = formatVisiableLimit();
484
- _context.next = 24;
485
- return (0, _requestApi.createWidthKr)(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
522
+ formData = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
486
523
  krInfos: krDatas.map(function (kr) {
524
+ // @ts-ignore
525
+ delete kr.mileStoneNamePureTextExcludeAt;
487
526
  return _objectSpread(_objectSpread({}, kr), {}, {
488
527
  startDate: cycle.startDate,
489
528
  endDate: cycle.endDate
490
529
  });
491
530
  })
492
531
  }, cycle), {}, {
493
- workName: okrName
532
+ workName: pureText,
533
+ workNameRichText: richText,
534
+ aiteUsers: mentionUsers === null || mentionUsers === void 0 ? void 0 : mentionUsers.map(function (user) {
535
+ return user.mentionId;
536
+ })
494
537
  }, parent), {}, {
495
538
  workType: 6,
496
539
  visibility: visibility,
@@ -503,13 +546,15 @@ function CreateOkrModal(_ref, ref) {
503
546
  }]
504
547
  }, visibilityArea), {}, {
505
548
  CreateFromAssess: isFromAssess
506
- }));
549
+ });
550
+ _context.next = 26;
551
+ return (0, _requestApi.createWidthKr)(formData);
507
552
 
508
- case 24:
553
+ case 26:
509
554
  data = _context.sent;
510
555
 
511
556
  if (!(data.Code === 0)) {
512
- _context.next = 28;
557
+ _context.next = 30;
513
558
  break;
514
559
  }
515
560
 
@@ -519,7 +564,7 @@ function CreateOkrModal(_ref, ref) {
519
564
 
520
565
  return _context.abrupt("return");
521
566
 
522
- case 28:
567
+ case 30:
523
568
  hideCreateOkrModal();
524
569
 
525
570
  if (onSuccess || !isHiddenCreatedCard) {
@@ -527,8 +572,10 @@ function CreateOkrModal(_ref, ref) {
527
572
  krNum = krDatas.length;
528
573
  krTotalLength = 0;
529
574
  krDatas && krDatas.forEach(function (kr) {
575
+ var _kr$mileStoneNamePure;
576
+
530
577
  // 计算平均长度要去掉百分号和数字
531
- krTotalLength += kr.mileStoneName.replace(/(%|\d)/g, '').length;
578
+ krTotalLength += (_kr$mileStoneNamePure = kr.mileStoneNamePureTextExcludeAt) === null || _kr$mileStoneNamePure === void 0 ? void 0 : _kr$mileStoneNamePure.replace(/(%|\d)/g, '').length;
532
579
  });
533
580
  krAvarageLength = krDatas.length > 0 ? krTotalLength / krDatas.length : 0;
534
581
  krMeasurableLength = krsCheckResult.friendlyResult.filter(function (kr) {
@@ -536,7 +583,7 @@ function CreateOkrModal(_ref, ref) {
536
583
  }).length;
537
584
  oHasVtWords = oNameCheckResult[0].result === _okrCreateSuggest.EOkrCreateSuggestResultType.correct;
538
585
  callData = data;
539
- callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(okrName.replace(/(%|\d)/g, '').length, oHasVtWords, krNum, krMeasurableLength, Number.parseInt(krAvarageLength.toString()));
586
+ callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(okrNameData.pureTextExcludeAt.replace(/(%|\d)/g, '').length, oHasVtWords, krNum, krMeasurableLength, Number.parseInt(krAvarageLength.toString()));
540
587
  newOkrDataRef.current = callData;
541
588
  handleOnSuccess();
542
589
  } else {
@@ -549,7 +596,7 @@ function CreateOkrModal(_ref, ref) {
549
596
 
550
597
  setIsApplyTpl(false);
551
598
 
552
- case 31:
599
+ case 33:
553
600
  case "end":
554
601
  return _context.stop();
555
602
  }
@@ -564,9 +611,15 @@ function CreateOkrModal(_ref, ref) {
564
611
 
565
612
 
566
613
  var OnOkRApplyTplHandler = function OnOkRApplyTplHandler(data) {
614
+ setRichEditorStatus('refresh');
567
615
  var name = data.name,
568
616
  subelements = data.subelements;
569
- setOkrName(name);
617
+ setOkrNameData({
618
+ mentionUsers: [],
619
+ pureText: name,
620
+ pureTextExcludeAt: name,
621
+ richText: (0, _richEditor.TitaRichEditorInitTextState)(name)
622
+ });
570
623
  setKrDatas(subelements.map(function (s) {
571
624
  return {
572
625
  uuid: _uuid["default"].v1(),
@@ -575,11 +628,15 @@ function CreateOkrModal(_ref, ref) {
575
628
  userAvatar: UserAvatar,
576
629
  krWeight: (0, _roundWeight.RoundWeight)(100 / subelements.length),
577
630
  mileStoneName: s.name,
631
+ mileStoneNamePureTextExcludeAt: s.name,
632
+ mileStoneNameRichText: (0, _richEditor.TitaRichEditorInitTextState)(s.name),
633
+ aiteUsers: [],
578
634
  confidenceIndex: 5
579
635
  };
580
636
  }));
581
637
  setIsCustomWeight(false);
582
638
  setIsApplyTpl(true);
639
+ setRichEditorStatus('initialization');
583
640
  };
584
641
 
585
642
  (0, _react.useEffect)(function () {
@@ -591,9 +648,12 @@ function CreateOkrModal(_ref, ref) {
591
648
  userAvatar: UserAvatar,
592
649
  krWeight: 100,
593
650
  mileStoneName: '',
651
+ mileStoneNamePureTextExcludeAt: '',
652
+ mileStoneNameRichText: undefined,
653
+ aiteUsers: [],
594
654
  confidenceIndex: 5
595
655
  }]);
596
- setOkrName('');
656
+ setOkrNameData(DefaultOkrNameData);
597
657
  setUser({
598
658
  name: Name,
599
659
  id: Id,
@@ -618,6 +678,10 @@ function CreateOkrModal(_ref, ref) {
618
678
  parentKrId: 0
619
679
  });
620
680
  }
681
+
682
+ return function () {
683
+ return setRichEditorStatus('initialization');
684
+ };
621
685
  }, [isVisible]);
622
686
  var handleONameSuggestClose = (0, _react.useCallback)(function () {
623
687
  setONameIsInput(false);
@@ -837,17 +901,20 @@ function CreateOkrModal(_ref, ref) {
837
901
  }
838
902
  }, /*#__PURE__*/_react["default"].createElement(_style.Wrapper, {
839
903
  ref: wrapperRef
904
+ }, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
905
+ className: "create-modal__wrapper-inner"
840
906
  }, /*#__PURE__*/_react["default"].createElement(_oNewName["default"], {
841
907
  container: modalRef,
908
+ richEditorStatus: richEditorStatus,
909
+ key: richEditorStatus,
842
910
  user: user,
843
911
  setUser: setUser,
844
- okrName: okrName,
845
- setOkrName: setOkrName,
912
+ okrNameData: okrNameData,
913
+ setOkrNameData: setOkrNameData,
846
914
  onOInputFocusStateChange: handleOInputFocusStateChange,
847
915
  setONameCheckResult: setONameCheckResult,
848
916
  setIsInputContent: setIsInputContent
849
917
  }), /*#__PURE__*/_react["default"].createElement(_krDatas["default"], {
850
- krs: krDatas,
851
918
  isCustomWeight: isCustomWeight,
852
919
  wrapperRef: wrapperRef,
853
920
  krDatas: krDatas,
@@ -897,29 +964,29 @@ function CreateOkrModal(_ref, ref) {
897
964
  okrClassify: okrClassify,
898
965
  setOkrClassify: setOkrClassify,
899
966
  isCreateModal: true
900
- }))), !customCloseOSuggest && oNameIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
967
+ }))))), /*#__PURE__*/_react["default"].createElement("img", {
968
+ className: "teach-suggest teach-suggest__o",
969
+ src: _hand["default"],
970
+ onClick: handleShowOSuggest
971
+ }), /*#__PURE__*/_react["default"].createElement("img", {
972
+ className: "teach-suggest teach-suggest__kr",
973
+ src: _hand["default"],
974
+ onClick: handleShowKrSuggest
975
+ }), !customCloseOSuggest && oNameIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
901
976
  isInput: isInputContent,
902
977
  isOSuggest: true,
903
978
  descs: (0, _constant.getODesc)(),
904
979
  example: (0, _constant.getOExample)(),
905
980
  results: oNameCheckResult,
906
981
  handleClose: handleONameSuggestClose
907
- }) : null, /*#__PURE__*/_react["default"].createElement("img", {
908
- className: "teach-suggest teach-suggest__o",
909
- src: _hand["default"],
910
- onClick: handleShowOSuggest
911
- }), !customCloseKrSuggest && krIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
982
+ }) : null, !customCloseKrSuggest && krIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
912
983
  isInput: isInputContent,
913
984
  isOSuggest: false,
914
985
  descs: (0, _constant.getKrDesc)(),
915
986
  example: (0, _constant.KrExample)(),
916
987
  results: krCheckFinalResult,
917
988
  handleClose: handleKrSuggestClose
918
- }) : null, /*#__PURE__*/_react["default"].createElement("img", {
919
- className: "teach-suggest teach-suggest__kr",
920
- src: _hand["default"],
921
- onClick: handleShowKrSuggest
922
- })))), !isApplyTpl && !isHiddenCreatedCard && showCreatedSuccessInfo ? /*#__PURE__*/_react["default"].createElement(_createSuccessCmpWrapper["default"], null, /*#__PURE__*/_react["default"].createElement(_createSuccessCmp["default"], {
989
+ }) : null))), !isApplyTpl && !isHiddenCreatedCard && showCreatedSuccessInfo ? /*#__PURE__*/_react["default"].createElement(_createSuccessCmpWrapper["default"], null, /*#__PURE__*/_react["default"].createElement(_createSuccessCmp["default"], {
923
990
  tipIndex: tipIndex,
924
991
  createdSuccessInfo: createdSuccessInfo,
925
992
  isDownload: false,