@titaui/pc 1.11.52-beta.6 → 1.11.52-beta.9

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 (52) hide show
  1. package/lib/components/create-okr-modal/fields/o-new-name.js +9 -4
  2. package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
  3. package/lib/components/create-okr-modal/index.js +137 -114
  4. package/lib/components/create-okr-modal/kr-items/index.css +11 -12
  5. package/lib/components/create-okr-modal/kr-items/krDatas.js +92 -74
  6. package/lib/components/create-okr-modal/kr-items/krItem.js +39 -52
  7. package/lib/components/create-okr-modal/style.js +5 -5
  8. package/lib/components/date-picker/BodyItem.js +3 -3
  9. package/lib/components/date-picker/CalendarHeader.js +3 -3
  10. package/lib/components/delete-confirm-pop/ConfirmPop.js +3 -3
  11. package/lib/components/eReport/eReportLists/reportList.js +3 -3
  12. package/lib/components/emotions-selector/selector-pop.js +3 -3
  13. package/lib/components/ereport-list/index.js +3 -3
  14. package/lib/components/mblog/components/MblogAction.js +3 -3
  15. package/lib/components/okr-detail/components/header/edit-name.js +1 -1
  16. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +4 -0
  17. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +83 -37
  18. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
  19. package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +15 -13
  20. package/lib/components/okr-detail/okr-list/create-kr-item/index.js +6 -2
  21. package/lib/components/okr-detail/schedule/components/o-progress/index.js +32 -32
  22. package/lib/components/okr-review/components/ReviewItem/index.js +3 -3
  23. package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +3 -3
  24. package/lib/components/range-selector-pop/RangeSelectorPop.js +3 -3
  25. package/lib/components/rich-editor/models/schema.js +6 -6
  26. package/lib/components/rich-editor/plugins/block/block-quote/index.js +8 -8
  27. package/lib/components/rich-editor/plugins/block/heading/index.js +8 -8
  28. package/lib/components/rich-editor/plugins/block/lists/index.js +14 -14
  29. package/lib/components/rich-editor/plugins/block/paragraph/index.js +5 -5
  30. package/lib/components/rich-editor/plugins/core/index.js +4 -4
  31. package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -5
  32. package/lib/components/rich-editor/plugins/extension/placeholder/index.js +4 -4
  33. package/lib/components/rich-editor/plugins/inline/color/index.js +11 -11
  34. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +8 -8
  35. package/lib/components/rich-editor/plugins/inline/em/index.js +5 -5
  36. package/lib/components/rich-editor/plugins/inline/link/index.js +8 -8
  37. package/lib/components/rich-editor/plugins/inline/strong/index.js +8 -8
  38. package/lib/components/rich-editor/plugins/inline/under-line/index.js +8 -8
  39. package/lib/components/rich-editor/react/uiProvider.js +3 -3
  40. package/lib/components/rich-editor/ui/Popup/index.js +3 -3
  41. package/lib/components/select/Option.js +3 -3
  42. package/lib/components/tita-chart/errorBoundary/index.js +3 -3
  43. package/lib/components/wechat-btn/index.css +1 -0
  44. package/lib/components-v1/animate/AnimateChild.js +3 -3
  45. package/lib/components-v1/avatar/index.js +3 -3
  46. package/lib/components-v1/dropDownSelector/StatelessDropdown.js +3 -3
  47. package/lib/components-v1/progress/CircleProgress.js +3 -3
  48. package/lib/components-v1/select/Option.js +3 -3
  49. package/lib/components-v1/userSelector/UserSelectorPop.js +3 -3
  50. package/lib/components-v1/userSelector/components/MultiMode/index.js +3 -3
  51. package/lib/components-v1/userSelector/components/UserItem.js +3 -3
  52. package/package.json +2 -2
@@ -55,7 +55,8 @@ var initOCheckResult = function initOCheckResult() {
55
55
  };
56
56
 
57
57
  function ONewName(_ref) {
58
- var okrNameData = _ref.okrNameData,
58
+ var richEditorStatus = _ref.richEditorStatus,
59
+ okrNameData = _ref.okrNameData,
59
60
  setOkrNameData = _ref.setOkrNameData,
60
61
  container = _ref.container,
61
62
  user = _ref.user,
@@ -182,6 +183,9 @@ function ONewName(_ref) {
182
183
  oldONameRef.current = e.target.value;
183
184
  }
184
185
  }, []);
186
+ var pureTextExcludeAt = okrNameData.pureTextExcludeAt,
187
+ richText = okrNameData.richText;
188
+ var okrNameLen = (pureTextExcludeAt === null || pureTextExcludeAt === void 0 ? void 0 : pureTextExcludeAt.length) || 0;
185
189
  return /*#__PURE__*/_react["default"].createElement("div", {
186
190
  className: "okr-o-new-name"
187
191
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -189,12 +193,13 @@ function ONewName(_ref) {
189
193
  }, /*#__PURE__*/_react["default"].createElement("span", {
190
194
  className: "left-block__title"
191
195
  }, "O"), /*#__PURE__*/_react["default"].createElement(_inputWithErrPopup["default"], {
192
- strLength: okrNameData.pureText.length,
196
+ strLength: okrNameLen,
193
197
  maxLength: 500,
194
198
  position: "top"
195
199
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
196
- initialState: okrNameData.richText,
197
- onChange: onChangeHandler,
200
+ initialState: richText,
201
+ key: richEditorStatus,
202
+ onDocChange: onChangeHandler,
198
203
  onFocus: handleInputFocus,
199
204
  onBlur: handleInputBlur,
200
205
  onKeyDown: handleOnKeyDown,
@@ -19,6 +19,8 @@ var _changeOkrModal = _interopRequireDefault(require("../../change-okr-modal"));
19
19
 
20
20
  var _getLocale = require("../../../utils/getLocale");
21
21
 
22
+ var _openData = require("../../../utils/open-data");
23
+
22
24
  require("./index.css");
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -68,7 +70,7 @@ function _default(_ref) {
68
70
  e.stopPropagation();
69
71
  setParent({
70
72
  parentWorkId: 0,
71
- parentWorkName: "",
73
+ parentWorkName: '',
72
74
  parentType: 0,
73
75
  parentKrId: 0
74
76
  });
@@ -107,7 +109,7 @@ function _default(_ref) {
107
109
 
108
110
  (0, _react.useEffect)(function () {
109
111
  // @ts-ignore
110
- (0, _helper.taker)((0, _helper.getApiUrl)("org/Get"), "get").then(function (res) {
112
+ (0, _helper.taker)((0, _helper.getApiUrl)('org/Get'), 'get').then(function (res) {
111
113
  if (res.Code == 1) {
112
114
  var SuperiorUser = res.Data.SuperiorUser;
113
115
 
@@ -127,13 +129,13 @@ function _default(_ref) {
127
129
  className: "create-modal__sub-block"
128
130
  }, isCreateModal ? /*#__PURE__*/_react["default"].createElement("div", {
129
131
  className: "create-modal__sub-title"
130
- }, (0, _getLocale.getLocale)("OKR_MyO_Pop_SetAlignment")) : /*#__PURE__*/_react["default"].createElement(_style.TitleLine, null, (0, _getLocale.getLocale)("OKR_MyO_Pop_SetAlignment")), /*#__PURE__*/_react["default"].createElement(_style.SelectBtn, {
132
+ }, (0, _getLocale.getLocale)('OKR_MyO_Pop_SetAlignment')) : /*#__PURE__*/_react["default"].createElement(_style.TitleLine, null, (0, _getLocale.getLocale)('OKR_MyO_Pop_SetAlignment')), /*#__PURE__*/_react["default"].createElement(_style.SelectBtn, {
131
133
  onClick: onSelectClickHandler
132
134
  }, /*#__PURE__*/_react["default"].createElement("span", {
133
135
  style: {
134
- color: !parent.parentWorkName ? "#BFC7D5" : ""
136
+ color: !parent.parentWorkName ? '#BFC7D5' : ''
135
137
  }
136
- }, !parent.parentWorkName ? (0, _getLocale.getLocale)("OKR_MyO_Pop_Aligneobjective") : parent.parentWorkName), !!parent.parentWorkName && /*#__PURE__*/_react["default"].createElement("a", {
138
+ }, !parent.parentWorkName ? (0, _getLocale.getLocale)('OKR_MyO_Pop_Aligneobjective') : (0, _openData.parseString)(parent.parentWorkName)), !!parent.parentWorkName && /*#__PURE__*/_react["default"].createElement("a", {
137
139
  className: "tu-icon-cross",
138
140
  onClick: iconCrossClickHandler
139
141
  }), /*#__PURE__*/_react["default"].createElement("i", {
@@ -15,6 +15,8 @@ var _uuid = _interopRequireDefault(require("uuid"));
15
15
 
16
16
  var _titaUi = require("tita-ui");
17
17
 
18
+ var _scrollbar = _interopRequireDefault(require("../scrollbar"));
19
+
18
20
  var _bsGlobal = require("../../utils/bs-global");
19
21
 
20
22
  var _roundWeight = require("../../utils/roundWeight");
@@ -130,10 +132,15 @@ function CreateOkrModal(_ref, ref) {
130
132
  _ref$isFromAssess = _ref.isFromAssess,
131
133
  isFromAssess = _ref$isFromAssess === void 0 ? false : _ref$isFromAssess;
132
134
 
133
- var _useState = (0, _react.useState)(visible),
135
+ var _useState = (0, _react.useState)('initialization'),
134
136
  _useState2 = _slicedToArray(_useState, 2),
135
- isVisible = _useState2[0],
136
- 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
137
144
 
138
145
 
139
146
  var userId = BSGlobal.loginUserInfo.Id;
@@ -147,80 +154,80 @@ function CreateOkrModal(_ref, ref) {
147
154
  Id = _ref2.Id,
148
155
  UserAvatar = _ref2.UserAvatar;
149
156
 
150
- var _useState3 = (0, _react.useState)(DefaultOkrNameData),
151
- _useState4 = _slicedToArray(_useState3, 2),
152
- okrNameData = _useState4[0],
153
- setOkrNameData = _useState4[1]; // 目标名称
157
+ var _useState5 = (0, _react.useState)(DefaultOkrNameData),
158
+ _useState6 = _slicedToArray(_useState5, 2),
159
+ okrNameData = _useState6[0],
160
+ setOkrNameData = _useState6[1]; // 目标名称
154
161
 
155
162
 
156
- var _useState5 = (0, _react.useState)({
163
+ var _useState7 = (0, _react.useState)({
157
164
  name: Name,
158
165
  id: Id,
159
166
  avatar: UserAvatar
160
167
  }),
161
- _useState6 = _slicedToArray(_useState5, 2),
162
- user = _useState6[0],
163
- setUser = _useState6[1]; // 负责人
168
+ _useState8 = _slicedToArray(_useState7, 2),
169
+ user = _useState8[0],
170
+ setUser = _useState8[1]; // 负责人
164
171
 
165
172
 
166
- var _useState7 = (0, _react.useState)(false),
167
- _useState8 = _slicedToArray(_useState7, 2),
168
- isCustomWeight = _useState8[0],
169
- setIsCustomWeight = _useState8[1]; // 是否自定义权重
173
+ var _useState9 = (0, _react.useState)(false),
174
+ _useState10 = _slicedToArray(_useState9, 2),
175
+ isCustomWeight = _useState10[0],
176
+ setIsCustomWeight = _useState10[1]; // 是否自定义权重
170
177
 
171
178
 
172
- var _useState9 = (0, _react.useState)({
179
+ var _useState11 = (0, _react.useState)({
173
180
  departmentId: 0,
174
181
  departmentName: ''
175
182
  }),
176
- _useState10 = _slicedToArray(_useState9, 2),
177
- dept = _useState10[0],
178
- setDept = _useState10[1]; // 部门信息 用于目标类型为部门时
183
+ _useState12 = _slicedToArray(_useState11, 2),
184
+ dept = _useState12[0],
185
+ setDept = _useState12[1]; // 部门信息 用于目标类型为部门时
179
186
 
180
187
 
181
- var _useState11 = (0, _react.useState)({
188
+ var _useState13 = (0, _react.useState)({
182
189
  groupId: 0,
183
190
  groupName: ''
184
191
  }),
185
- _useState12 = _slicedToArray(_useState11, 2),
186
- team = _useState12[0],
187
- setTeam = _useState12[1]; // 团队信息 用于目标类型为团队时
192
+ _useState14 = _slicedToArray(_useState13, 2),
193
+ team = _useState14[0],
194
+ setTeam = _useState14[1]; // 团队信息 用于目标类型为团队时
188
195
 
189
196
 
190
- var _useState13 = (0, _react.useState)({
197
+ var _useState15 = (0, _react.useState)({
191
198
  typeName: (0, _getLocale.getLocale)('OKR_MyO_Pop_Individual'),
192
199
  typeId: 1
193
200
  }),
194
- _useState14 = _slicedToArray(_useState13, 2),
195
- type = _useState14[0],
196
- setType = _useState14[1]; // 目标类型
197
-
198
-
199
- var _useState15 = (0, _react.useState)(initCycle),
200
201
  _useState16 = _slicedToArray(_useState15, 2),
201
- cycle = _useState16[0],
202
- setCycle = _useState16[1]; // 目标周期信息
202
+ type = _useState16[0],
203
+ setType = _useState16[1]; // 目标类型
203
204
 
204
205
 
205
- var _useState17 = (0, _react.useState)(),
206
+ var _useState17 = (0, _react.useState)(initCycle),
206
207
  _useState18 = _slicedToArray(_useState17, 2),
207
- okrClassify = _useState18[0],
208
- setOkrClassify = _useState18[1]; // 目标类别
208
+ cycle = _useState18[0],
209
+ setCycle = _useState18[1]; // 目标周期信息
209
210
 
210
211
 
211
- var _useState19 = (0, _react.useState)(1),
212
+ var _useState19 = (0, _react.useState)(),
212
213
  _useState20 = _slicedToArray(_useState19, 2),
213
- visibility = _useState20[0],
214
- setVisibility = _useState20[1]; // 可见性
214
+ okrClassify = _useState20[0],
215
+ setOkrClassify = _useState20[1]; // 目标类别
215
216
 
216
217
 
217
- var _useState21 = (0, _react.useState)({}),
218
+ var _useState21 = (0, _react.useState)(1),
218
219
  _useState22 = _slicedToArray(_useState21, 2),
219
- visiableLimit = _useState22[0],
220
- setVisiableLimit = _useState22[1]; // 可见性指定范围
220
+ visibility = _useState22[0],
221
+ setVisibility = _useState22[1]; // 可见性
221
222
 
222
223
 
223
- 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)([{
224
231
  // kr信息
225
232
  uuid: _uuid["default"].v1(),
226
233
  principalId: Id,
@@ -233,89 +240,89 @@ function CreateOkrModal(_ref, ref) {
233
240
  aiteUsers: [],
234
241
  confidenceIndex: 5
235
242
  }]),
236
- _useState24 = _slicedToArray(_useState23, 2),
237
- krDatas = _useState24[0],
238
- setKrDatas = _useState24[1];
243
+ _useState26 = _slicedToArray(_useState25, 2),
244
+ krDatas = _useState26[0],
245
+ setKrDatas = _useState26[1];
239
246
 
240
- var _useState25 = (0, _react.useState)({
247
+ var _useState27 = (0, _react.useState)({
241
248
  // 对其目标
242
249
  parentWorkId: 0,
243
250
  parentWorkName: '',
244
251
  parentType: 0,
245
252
  parentKrId: 0
246
253
  }),
247
- _useState26 = _slicedToArray(_useState25, 2),
248
- parent = _useState26[0],
249
- setParent = _useState26[1];
250
-
251
- var _useState27 = (0, _react.useState)(false),
252
254
  _useState28 = _slicedToArray(_useState27, 2),
253
- oNameIsInput = _useState28[0],
254
- setONameIsInput = _useState28[1];
255
+ parent = _useState28[0],
256
+ setParent = _useState28[1];
255
257
 
256
258
  var _useState29 = (0, _react.useState)(false),
257
259
  _useState30 = _slicedToArray(_useState29, 2),
258
- krIsInput = _useState30[0],
259
- setKrIsInput = _useState30[1];
260
+ oNameIsInput = _useState30[0],
261
+ setONameIsInput = _useState30[1];
260
262
 
261
- var _useState31 = (0, _react.useState)(initOCheckResult()),
263
+ var _useState31 = (0, _react.useState)(false),
262
264
  _useState32 = _slicedToArray(_useState31, 2),
263
- oNameCheckResult = _useState32[0],
264
- setONameCheckResult = _useState32[1];
265
+ krIsInput = _useState32[0],
266
+ setKrIsInput = _useState32[1];
267
+
268
+ var _useState33 = (0, _react.useState)(initOCheckResult()),
269
+ _useState34 = _slicedToArray(_useState33, 2),
270
+ oNameCheckResult = _useState34[0],
271
+ setONameCheckResult = _useState34[1];
265
272
 
266
- var _useState33 = (0, _react.useState)({
273
+ var _useState35 = (0, _react.useState)({
267
274
  finalResult: _okrCreateSuggest.EOkrCreateSuggestResultType.normal,
268
275
  friendlyResult: []
269
276
  }),
270
- _useState34 = _slicedToArray(_useState33, 2),
271
- krsCheckResult = _useState34[0],
272
- setKrsCheckResult = _useState34[1];
273
-
274
- var _useState35 = (0, _react.useState)(false),
275
277
  _useState36 = _slicedToArray(_useState35, 2),
276
- customCloseOSuggest = _useState36[0],
277
- setCustomCloseOSuggest = _useState36[1]; // 用户点击收起后不再自动弹出
278
-
278
+ krsCheckResult = _useState36[0],
279
+ setKrsCheckResult = _useState36[1];
279
280
 
280
281
  var _useState37 = (0, _react.useState)(false),
281
282
  _useState38 = _slicedToArray(_useState37, 2),
282
- customCloseKrSuggest = _useState38[0],
283
- setCustomCloseKrSuggest = _useState38[1];
283
+ customCloseOSuggest = _useState38[0],
284
+ setCustomCloseOSuggest = _useState38[1]; // 用户点击收起后不再自动弹出
285
+
284
286
 
285
- var _useState39 = (0, _react.useState)(),
287
+ var _useState39 = (0, _react.useState)(false),
286
288
  _useState40 = _slicedToArray(_useState39, 2),
287
- createdSuccessInfo = _useState40[0],
288
- setCreatedSuccessInfo = _useState40[1];
289
+ customCloseKrSuggest = _useState40[0],
290
+ setCustomCloseKrSuggest = _useState40[1];
289
291
 
290
- var _useState41 = (0, _react.useState)(false),
292
+ var _useState41 = (0, _react.useState)(),
291
293
  _useState42 = _slicedToArray(_useState41, 2),
292
- showCreatedSuccessInfo = _useState42[0],
293
- setShowCreatedSuccessInfo = _useState42[1];
294
+ createdSuccessInfo = _useState42[0],
295
+ setCreatedSuccessInfo = _useState42[1];
294
296
 
295
- var _useState43 = (0, _react.useState)(Math.floor(Math.random() * 6)),
297
+ var _useState43 = (0, _react.useState)(false),
296
298
  _useState44 = _slicedToArray(_useState43, 2),
297
- tipIndex = _useState44[0],
298
- setTipIndex = _useState44[1];
299
+ showCreatedSuccessInfo = _useState44[0],
300
+ setShowCreatedSuccessInfo = _useState44[1];
299
301
 
300
- var _useState45 = (0, _react.useState)(''),
302
+ var _useState45 = (0, _react.useState)(Math.floor(Math.random() * 6)),
301
303
  _useState46 = _slicedToArray(_useState45, 2),
302
- userAvatarBase64Url = _useState46[0],
303
- setUserAvatarBase64Url = _useState46[1];
304
+ tipIndex = _useState46[0],
305
+ setTipIndex = _useState46[1];
304
306
 
305
- var _useState47 = (0, _react.useState)(false),
307
+ var _useState47 = (0, _react.useState)(''),
306
308
  _useState48 = _slicedToArray(_useState47, 2),
307
- krIsValidate = _useState48[0],
308
- setKrIsValidate = _useState48[1];
309
+ userAvatarBase64Url = _useState48[0],
310
+ setUserAvatarBase64Url = _useState48[1];
309
311
 
310
312
  var _useState49 = (0, _react.useState)(false),
311
313
  _useState50 = _slicedToArray(_useState49, 2),
312
- isApplyTpl = _useState50[0],
313
- setIsApplyTpl = _useState50[1];
314
+ krIsValidate = _useState50[0],
315
+ setKrIsValidate = _useState50[1];
314
316
 
315
317
  var _useState51 = (0, _react.useState)(false),
316
318
  _useState52 = _slicedToArray(_useState51, 2),
317
- isInputContent = _useState52[0],
318
- 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];
319
326
 
320
327
  var wrapperRef = (0, _react.useRef)();
321
328
  var modalRef = (0, _react.useRef)();
@@ -351,7 +358,7 @@ function CreateOkrModal(_ref, ref) {
351
358
  setOkrNameData({
352
359
  mentionUsers: [],
353
360
  pureText: name,
354
- pureTextExcludeAt: '',
361
+ pureTextExcludeAt: name,
355
362
  richText: (0, _richEditor.TitaRichEditorInitTextState)(name)
356
363
  });
357
364
  setKrDatas(subelements.map(function (s) {
@@ -374,7 +381,7 @@ function CreateOkrModal(_ref, ref) {
374
381
  setOkrNameData({
375
382
  mentionUsers: [],
376
383
  pureText: data.okrName,
377
- pureTextExcludeAt: '',
384
+ pureTextExcludeAt: data.okrName,
378
385
  richText: (0, _richEditor.TitaRichEditorInitTextState)(data.okrName)
379
386
  });
380
387
  setUser(data.user);
@@ -424,7 +431,7 @@ function CreateOkrModal(_ref, ref) {
424
431
 
425
432
  var onModalOkHandler = /*#__PURE__*/function () {
426
433
  var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
427
- var mentionUsers, pureText, pureTextExcludeAt, richText, orkNameLengthValidate, visibilityArea, data, krNum, krTotalLength, krAvarageLength, krMeasurableLength, oHasVtWords, callData, workId;
434
+ var mentionUsers, pureText, pureTextExcludeAt, richText, orkNameLengthValidate, visibilityArea, formData, data, krNum, krTotalLength, krAvarageLength, krMeasurableLength, oHasVtWords, callData, workId;
428
435
  return regeneratorRuntime.wrap(function _callee$(_context) {
429
436
  while (1) {
430
437
  switch (_context.prev = _context.next) {
@@ -471,7 +478,7 @@ function CreateOkrModal(_ref, ref) {
471
478
  orkNameLengthValidate = krDatas.filter(function (kr) {
472
479
  var _trim;
473
480
 
474
- return ((_trim = ((kr === null || kr === void 0 ? void 0 : kr.mileStoneNamePureTextExcludeAt) || '').trim()) === null || _trim === void 0 ? void 0 : _trim.length) > 500;
481
+ return ((_trim = (kr.mileStoneNamePureTextExcludeAt || '').trim()) === null || _trim === void 0 ? void 0 : _trim.length) > 500;
475
482
  }).length == 0;
476
483
 
477
484
  if (orkNameLengthValidate) {
@@ -510,9 +517,9 @@ function CreateOkrModal(_ref, ref) {
510
517
  case 21:
511
518
  handleCreatedClose();
512
519
  visibilityArea = formatVisiableLimit();
513
- _context.next = 25;
514
- return (0, _requestApi.createWidthKr)(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
520
+ formData = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
515
521
  krInfos: krDatas.map(function (kr) {
522
+ // @ts-ignore
516
523
  delete kr.mileStoneNamePureTextExcludeAt;
517
524
  return _objectSpread(_objectSpread({}, kr), {}, {
518
525
  startDate: cycle.startDate,
@@ -537,13 +544,15 @@ function CreateOkrModal(_ref, ref) {
537
544
  }]
538
545
  }, visibilityArea), {}, {
539
546
  CreateFromAssess: isFromAssess
540
- }));
547
+ });
548
+ _context.next = 26;
549
+ return (0, _requestApi.createWidthKr)(formData);
541
550
 
542
- case 25:
551
+ case 26:
543
552
  data = _context.sent;
544
553
 
545
554
  if (!(data.Code === 0)) {
546
- _context.next = 29;
555
+ _context.next = 30;
547
556
  break;
548
557
  }
549
558
 
@@ -553,7 +562,7 @@ function CreateOkrModal(_ref, ref) {
553
562
 
554
563
  return _context.abrupt("return");
555
564
 
556
- case 29:
565
+ case 30:
557
566
  hideCreateOkrModal();
558
567
 
559
568
  if (onSuccess || !isHiddenCreatedCard) {
@@ -561,8 +570,10 @@ function CreateOkrModal(_ref, ref) {
561
570
  krNum = krDatas.length;
562
571
  krTotalLength = 0;
563
572
  krDatas && krDatas.forEach(function (kr) {
573
+ var _kr$mileStoneNamePure;
574
+
564
575
  // 计算平均长度要去掉百分号和数字
565
- krTotalLength += kr.mileStoneName.replace(/(%|\d)/g, '').length;
576
+ krTotalLength += (_kr$mileStoneNamePure = kr.mileStoneNamePureTextExcludeAt) === null || _kr$mileStoneNamePure === void 0 ? void 0 : _kr$mileStoneNamePure.replace(/(%|\d)/g, '').length;
566
577
  });
567
578
  krAvarageLength = krDatas.length > 0 ? krTotalLength / krDatas.length : 0;
568
579
  krMeasurableLength = krsCheckResult.friendlyResult.filter(function (kr) {
@@ -570,7 +581,7 @@ function CreateOkrModal(_ref, ref) {
570
581
  }).length;
571
582
  oHasVtWords = oNameCheckResult[0].result === _okrCreateSuggest.EOkrCreateSuggestResultType.correct;
572
583
  callData = data;
573
- callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(okrNameData.pureText.replace(/(%|\d)/g, '').length, oHasVtWords, krNum, krMeasurableLength, Number.parseInt(krAvarageLength.toString()));
584
+ callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(okrNameData.pureTextExcludeAt.replace(/(%|\d)/g, '').length, oHasVtWords, krNum, krMeasurableLength, Number.parseInt(krAvarageLength.toString()));
574
585
  newOkrDataRef.current = callData;
575
586
  handleOnSuccess();
576
587
  } else {
@@ -583,7 +594,7 @@ function CreateOkrModal(_ref, ref) {
583
594
 
584
595
  setIsApplyTpl(false);
585
596
 
586
- case 32:
597
+ case 33:
587
598
  case "end":
588
599
  return _context.stop();
589
600
  }
@@ -598,12 +609,13 @@ function CreateOkrModal(_ref, ref) {
598
609
 
599
610
 
600
611
  var OnOkRApplyTplHandler = function OnOkRApplyTplHandler(data) {
612
+ setRichEditorStatus('refresh');
601
613
  var name = data.name,
602
614
  subelements = data.subelements;
603
615
  setOkrNameData({
604
616
  mentionUsers: [],
605
617
  pureText: name,
606
- pureTextExcludeAt: '',
618
+ pureTextExcludeAt: name,
607
619
  richText: (0, _richEditor.TitaRichEditorInitTextState)(name)
608
620
  });
609
621
  setKrDatas(subelements.map(function (s) {
@@ -614,11 +626,15 @@ function CreateOkrModal(_ref, ref) {
614
626
  userAvatar: UserAvatar,
615
627
  krWeight: (0, _roundWeight.RoundWeight)(100 / subelements.length),
616
628
  mileStoneName: s.name,
629
+ mileStoneNamePureTextExcludeAt: s.name,
630
+ mileStoneNameRichText: (0, _richEditor.TitaRichEditorInitTextState)(s.name),
631
+ aiteUsers: [],
617
632
  confidenceIndex: 5
618
633
  };
619
634
  }));
620
635
  setIsCustomWeight(false);
621
636
  setIsApplyTpl(true);
637
+ setRichEditorStatus('initialization');
622
638
  };
623
639
 
624
640
  (0, _react.useEffect)(function () {
@@ -660,6 +676,10 @@ function CreateOkrModal(_ref, ref) {
660
676
  parentKrId: 0
661
677
  });
662
678
  }
679
+
680
+ return function () {
681
+ return setRichEditorStatus('initialization');
682
+ };
663
683
  }, [isVisible]);
664
684
  var handleONameSuggestClose = (0, _react.useCallback)(function () {
665
685
  setONameIsInput(false);
@@ -879,8 +899,12 @@ function CreateOkrModal(_ref, ref) {
879
899
  }
880
900
  }, /*#__PURE__*/_react["default"].createElement(_style.Wrapper, {
881
901
  ref: wrapperRef
902
+ }, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
903
+ className: "create-modal__wrapper-inner"
882
904
  }, /*#__PURE__*/_react["default"].createElement(_oNewName["default"], {
883
905
  container: modalRef,
906
+ richEditorStatus: richEditorStatus,
907
+ key: richEditorStatus,
884
908
  user: user,
885
909
  setUser: setUser,
886
910
  okrNameData: okrNameData,
@@ -889,7 +913,6 @@ function CreateOkrModal(_ref, ref) {
889
913
  setONameCheckResult: setONameCheckResult,
890
914
  setIsInputContent: setIsInputContent
891
915
  }), /*#__PURE__*/_react["default"].createElement(_krDatas["default"], {
892
- krs: krDatas,
893
916
  isCustomWeight: isCustomWeight,
894
917
  wrapperRef: wrapperRef,
895
918
  krDatas: krDatas,
@@ -939,29 +962,29 @@ function CreateOkrModal(_ref, ref) {
939
962
  okrClassify: okrClassify,
940
963
  setOkrClassify: setOkrClassify,
941
964
  isCreateModal: true
942
- }))), !customCloseOSuggest && oNameIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
965
+ }))))), /*#__PURE__*/_react["default"].createElement("img", {
966
+ className: "teach-suggest teach-suggest__o",
967
+ src: _hand["default"],
968
+ onClick: handleShowOSuggest
969
+ }), /*#__PURE__*/_react["default"].createElement("img", {
970
+ className: "teach-suggest teach-suggest__kr",
971
+ src: _hand["default"],
972
+ onClick: handleShowKrSuggest
973
+ }), !customCloseOSuggest && oNameIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
943
974
  isInput: isInputContent,
944
975
  isOSuggest: true,
945
976
  descs: (0, _constant.getODesc)(),
946
977
  example: (0, _constant.getOExample)(),
947
978
  results: oNameCheckResult,
948
979
  handleClose: handleONameSuggestClose
949
- }) : null, /*#__PURE__*/_react["default"].createElement("img", {
950
- className: "teach-suggest teach-suggest__o",
951
- src: _hand["default"],
952
- onClick: handleShowOSuggest
953
- }), !customCloseKrSuggest && krIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
980
+ }) : null, !customCloseKrSuggest && krIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
954
981
  isInput: isInputContent,
955
982
  isOSuggest: false,
956
983
  descs: (0, _constant.getKrDesc)(),
957
984
  example: (0, _constant.KrExample)(),
958
985
  results: krCheckFinalResult,
959
986
  handleClose: handleKrSuggestClose
960
- }) : null, /*#__PURE__*/_react["default"].createElement("img", {
961
- className: "teach-suggest teach-suggest__kr",
962
- src: _hand["default"],
963
- onClick: handleShowKrSuggest
964
- })))), !isApplyTpl && !isHiddenCreatedCard && showCreatedSuccessInfo ? /*#__PURE__*/_react["default"].createElement(_createSuccessCmpWrapper["default"], null, /*#__PURE__*/_react["default"].createElement(_createSuccessCmp["default"], {
987
+ }) : null))), !isApplyTpl && !isHiddenCreatedCard && showCreatedSuccessInfo ? /*#__PURE__*/_react["default"].createElement(_createSuccessCmpWrapper["default"], null, /*#__PURE__*/_react["default"].createElement(_createSuccessCmp["default"], {
965
988
  tipIndex: tipIndex,
966
989
  createdSuccessInfo: createdSuccessInfo,
967
990
  isDownload: false,
@@ -80,34 +80,33 @@
80
80
  }
81
81
 
82
82
  .create-kr-item-wrapper .kr-item__delete-icon {
83
- color: #000000;
84
- font-size: 14px;
85
83
  margin-left: 7px;
86
84
  margin-right: 8px;
85
+ font-size: 14px;
86
+ opacity: 0;
87
+ transition: all 0.3s ease;
88
+ color: #000000;
87
89
  visibility: hidden;
88
90
  }
89
91
 
90
- .create-kr-item-wrapper .kr-item__delete-icon :hover {
92
+ .create-kr-item-wrapper .kr-item__delete-icon:hover {
91
93
  color: #f05e5e;
92
94
  }
93
95
 
94
- .create-kr-item-wrapper .kr-item__delete-icon--show {
96
+ .create-kr-item-wrapper:hover .kr-item__delete-icon {
97
+ opacity: 1;
95
98
  visibility: visible;
96
99
  }
97
100
 
98
- .create-kr-item-wrapper .kr-item__delete-icon--show:hover {
99
- color: #f05e5e;
100
- }
101
-
102
101
  .kr-item-weight {
103
102
  width: 73px;
104
- border-radius: 3px;
103
+ margin-right: 10px;
105
104
  padding: 4px 10px 4px 4px;
105
+ border: 1px solid transparent;
106
+ border-radius: 8px;
106
107
  box-sizing: border-box;
107
108
  display: flex;
108
109
  align-items: center;
109
- border: 1px solid transparent;
110
- margin-right: 10px;
111
110
  }
112
111
 
113
112
  .kr-item-weight .kr-item-weight__input {
@@ -166,9 +165,9 @@
166
165
 
167
166
  .krs-info .add-kr-btn {
168
167
  font-size: 12px;
169
- font-family: PingFangSC-Regular, PingFang SC;
170
168
  font-weight: 400;
171
169
  color: #2879ff;
170
+ cursor: pointer;
172
171
  display: flex;
173
172
  align-items: center;
174
173
  line-height: 18px;