@titaui/pc 1.12.6 → 1.12.8

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 (137) hide show
  1. package/lib/components/change-okr-modal/Item.js +19 -18
  2. package/lib/components/change-okr-modal/index.js +4 -2
  3. package/lib/components/change-okr-modal/styledComponents.js +9 -9
  4. package/lib/components/common-share/publishMblog.js +4 -2
  5. package/lib/components/create-okr-modal/createSuccessCmp.js +47 -19
  6. package/lib/components/create-okr-modal/fields/index.css +14 -3
  7. package/lib/components/create-okr-modal/fields/o-new-name.js +31 -20
  8. package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
  9. package/lib/components/create-okr-modal/fields/okr-type-detail.js +4 -2
  10. package/lib/components/create-okr-modal/fields/okr-visibility-detail.js +4 -2
  11. package/lib/components/create-okr-modal/index.js +201 -134
  12. package/lib/components/create-okr-modal/kr-items/index.css +23 -13
  13. package/lib/components/create-okr-modal/kr-items/krDatas.js +95 -76
  14. package/lib/components/create-okr-modal/kr-items/krItem.js +54 -57
  15. package/lib/components/create-okr-modal/request-api.js +16 -12
  16. package/lib/components/create-okr-modal/style.js +5 -5
  17. package/lib/components/create-okr-modal/utils/helper.js +6 -2
  18. package/lib/components/drawer-manager/drawerWrapper.js +4 -2
  19. package/lib/components/dynamic/components/title/index.js +1 -1
  20. package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +7 -7
  21. package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +7 -7
  22. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +17 -17
  23. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +3 -1
  24. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +9 -9
  25. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +3 -1
  26. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +3 -1
  27. package/lib/components/eReport/eReportLists/reportList.js +29 -30
  28. package/lib/components/eReport/eReportShare/style.js +1 -1
  29. package/lib/components/edit-kr-wight/EditKrWightModal.js +11 -9
  30. package/lib/components/firework/index.js +6 -2
  31. package/lib/components/form/form-fields/input-verification-code/index.js +4 -2
  32. package/lib/components/grid-layout/util/network.js +10 -6
  33. package/lib/components/nav-top/components/menu/index.js +3 -3
  34. package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -1
  35. package/lib/components/nav-top/components/user-message/components/todos/todo-item.js +3 -3
  36. package/lib/components/okr-detail/base-info/other-infos/principal/index.js +4 -2
  37. package/lib/components/okr-detail/components/ao-nice/index.css +0 -1
  38. package/lib/components/okr-detail/components/ao-nice/index.js +6 -4
  39. package/lib/components/okr-detail/components/header/edit-name.js +80 -41
  40. package/lib/components/okr-detail/components/header/index.css +122 -41
  41. package/lib/components/okr-detail/components/header/index.js +45 -48
  42. package/lib/components/okr-detail/components/header/o-avatar.js +4 -2
  43. package/lib/components/okr-detail/components/header/o-classify.js +154 -0
  44. package/lib/components/okr-detail/components/header/o-name.js +7 -5
  45. package/lib/components/okr-detail/components/o-classify.js +4 -2
  46. package/lib/components/okr-detail/components/o-progress-update/index.js +14 -8
  47. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +7 -3
  48. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +4 -2
  49. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +4 -2
  50. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +66 -4
  51. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +178 -66
  52. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +4 -2
  53. package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.js +8 -6
  54. package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +9 -9
  55. package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +19 -15
  56. package/lib/components/okr-detail/components/tab-panel-content/index.css +1 -0
  57. package/lib/components/okr-detail/detail-footer/index.js +4 -2
  58. package/lib/components/okr-detail/detail-header/index.js +23 -15
  59. package/lib/components/okr-detail/okr-list/create-kr-item/index.css +17 -0
  60. package/lib/components/okr-detail/okr-list/create-kr-item/index.js +75 -53
  61. package/lib/components/okr-detail/okr-list/index.css +9 -0
  62. package/lib/components/okr-detail/okr-list/index.js +29 -27
  63. package/lib/components/okr-detail/request-apis.js +79 -71
  64. package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
  65. package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
  66. package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
  67. package/lib/components/okr-flow/child-node/fields/creator.js +4 -2
  68. package/lib/components/okr-flow/child-node/kr-node.js +3 -1
  69. package/lib/components/okr-flow/child-node/work-node.js +7 -3
  70. package/lib/components/okr-flow/export-modal/index.js +10 -29
  71. package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +10 -8
  72. package/lib/components/okr-flow/request-apis.js +6 -2
  73. package/lib/components/okr-flow/root-node/index.js +4 -2
  74. package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
  75. package/lib/components/okr-progress/components/o-progress/index.js +3 -1
  76. package/lib/components/okr-progress/components/o-progress-update/index.js +10 -6
  77. package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
  78. package/lib/components/okr-progress-modal/index.js +4 -2
  79. package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +7 -5
  80. package/lib/components/okr-share/common-painter/darwAvatar.js +8 -4
  81. package/lib/components/okr-share/common-painter/openDataPainter.js +15 -8
  82. package/lib/components/okr-share/common-painter/utils.js +187 -36
  83. package/lib/components/okr-share/index.css +5 -4
  84. package/lib/components/okr-share/pink-card/card.js +3 -3
  85. package/lib/components/okr-share/pink-card/drawDepartmentName.js +6 -2
  86. package/lib/components/okr-share/pink-card/drawKrs.js +97 -18
  87. package/lib/components/okr-share/pink-card/drawQuote.js +6 -2
  88. package/lib/components/okr-share/pink-card/drawUserName.js +6 -2
  89. package/lib/components/okr-share/pink-card/index.js +26 -14
  90. package/lib/components/okr-share/publishMblog.js +4 -2
  91. package/lib/components/okr-share/shareCardSelector.js +6 -4
  92. package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +4 -4
  93. package/lib/components/okrcase-library/server/network.js +24 -20
  94. package/lib/components/open-data-painter/index.js +12 -7
  95. package/lib/components/period-selector/helper/index.js +6 -2
  96. package/lib/components/search-key-handle/index.js +12 -10
  97. package/lib/components/superset-charts/fetch-assets-and-append/get-assets-with-cache.js +6 -2
  98. package/lib/components/superset-charts/fetch-assets-and-append/index.js +8 -4
  99. package/lib/components/survey-model/request-api.js +6 -2
  100. package/lib/components/task-relation-modal/index.js +6 -4
  101. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +2 -2
  102. package/lib/components/task-relation-modal/tree/category-tree/index.js +4 -2
  103. package/lib/components/task-relation-modal/tree/okr-tree/index.js +4 -2
  104. package/lib/components/task-relation-modal/tree/work-tree/index.js +4 -2
  105. package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -4
  106. package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
  107. package/lib/components/task-relation-modal/work-relation/index.js +6 -4
  108. package/lib/components/task-tree/task-item-node/e-project.js +4 -2
  109. package/lib/components/task-tree/task-item-node/e-task.js +4 -2
  110. package/lib/components/toast/index.js +12 -8
  111. package/lib/components/upload/components/uploadedPreview.js +17 -17
  112. package/lib/components/upload/index.js +23 -23
  113. package/lib/components/upvote/index.js +6 -4
  114. package/lib/components/user-selector/export-modules/field-tree-selector/index.js +14 -14
  115. package/lib/components/user-selector/searched-panel/index.js +4 -4
  116. package/lib/components/version-change-modal/index.js +6 -4
  117. package/lib/components/version-change-modal/request-api.js +6 -2
  118. package/lib/components/wechat-btn/index.css +5 -1
  119. package/lib/components/weekly-report/card.js +4 -12
  120. package/lib/components/weekly-report/common-painter/darwAvatar.js +10 -6
  121. package/lib/components/weekly-report/common-painter/drawName.js +6 -2
  122. package/lib/components/weekly-report/common-painter/openDataPainter.js +6 -2
  123. package/lib/components/weekly-report/index.js +6 -4
  124. package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
  125. package/lib/pages/group-management/groupInterface.js +6 -2
  126. package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
  127. package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
  128. package/lib/pages/new-okr-list/header/index.js +15 -15
  129. package/lib/pages/new-okr-list/request-api.js +18 -14
  130. package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +4 -2
  131. package/lib/pages/okr-map/request-apis.js +6 -2
  132. package/lib/utils/hooks.js +5 -5
  133. package/lib/utils/open-data.js +216 -66
  134. package/lib/utils/request-v1.js +6 -2
  135. package/lib/utils/request.js +6 -2
  136. package/lib/utils/tita-okr-cycle.js +3 -3
  137. package/package.json +2 -1
@@ -9,18 +9,18 @@ exports["default"] = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
12
- var _titaUi = require("tita-ui");
13
-
14
12
  var _classnames = _interopRequireDefault(require("classnames"));
15
13
 
14
+ var _richEditor = require("@titaui/rich-editor");
15
+
16
+ var _titaUi = require("tita-ui");
17
+
16
18
  var _userSelector = _interopRequireDefault(require("../../../user-selector"));
17
19
 
18
20
  var _confidence = _interopRequireDefault(require("../../../confidence"));
19
21
 
20
22
  var _bsGlobal = require("../../../../utils/bs-global");
21
23
 
22
- var _dom = require("./dom");
23
-
24
24
  var _requestApis = require("../../request-apis");
25
25
 
26
26
  var _getLocale = require("../../../../utils/getLocale");
@@ -51,7 +51,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
51
51
 
52
52
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
53
53
 
54
- var preCls = "okr-list-create-kr";
54
+ var preCls = 'okr-list-create-kr';
55
55
 
56
56
  function CreateKr(_ref) {
57
57
  var startDate = _ref.startDate,
@@ -62,17 +62,22 @@ function CreateKr(_ref) {
62
62
  onHide = _ref.onHide;
63
63
  var dataRef = (0, _react.useRef)();
64
64
 
65
- var _useState = (0, _react.useState)(""),
65
+ var _useState = (0, _react.useState)({
66
+ pureText: '',
67
+ pureTextExcludeAt: '',
68
+ mentionUsers: [],
69
+ richText: undefined
70
+ }),
66
71
  _useState2 = _slicedToArray(_useState, 2),
67
- krName = _useState2[0],
68
- setKrName = _useState2[1];
72
+ krNameData = _useState2[0],
73
+ setKrNameData = _useState2[1];
69
74
 
70
75
  var _useState3 = (0, _react.useState)(false),
71
76
  _useState4 = _slicedToArray(_useState3, 2),
72
77
  showTip = _useState4[0],
73
78
  setShowTip = _useState4[1];
74
79
 
75
- var tipsEnable = localStorage.getItem("list_create_kr_tips_".concat((0, _bsGlobal.getUserInfo)().Id)) != "false";
80
+ var tipsEnable = localStorage.getItem("list_create_kr_tips_".concat((0, _bsGlobal.getUserInfo)().Id)) != 'false';
76
81
 
77
82
  var _useState5 = (0, _react.useState)(5),
78
83
  _useState6 = _slicedToArray(_useState5, 2),
@@ -97,11 +102,14 @@ function CreateKr(_ref) {
97
102
  }),
98
103
  _useState8 = _slicedToArray(_useState7, 2),
99
104
  user = _useState8[0],
100
- setUser = _useState8[1];
105
+ setUser = _useState8[1]; // const inputRef =
106
+ // useRef<HTMLInputElement>() as React.RefObject<HTMLInputElement>
107
+
101
108
 
102
- var inputRef = (0, _react.useRef)();
109
+ var mentionInputRef = (0, _react.useRef)();
110
+ var pendingRef = (0, _react.useRef)(false);
103
111
  dataRef.current = _objectSpread(_objectSpread({}, dataRef.current), {}, {
104
- krName: krName,
112
+ krNameData: krNameData,
105
113
  user: user,
106
114
  startDate: startDate,
107
115
  endDate: endDate,
@@ -110,23 +118,34 @@ function CreateKr(_ref) {
110
118
  getWrapperRef: getWrapperRef,
111
119
  onHide: onHide
112
120
  });
113
- var create = (0, _react.useCallback)(function (e) {
121
+ var createKr = (0, _react.useCallback)(function () {
114
122
  // 选中了选人组件中的item
115
- if ((0, _dom.hasAncestorElement)(e.target, "titaui-popup")) return;
116
-
117
- if (dataRef.current.getWrapperRef().current && dataRef.current.getWrapperRef().current.contains(e.target)) {
118
- return;
119
- }
120
-
121
- if (dataRef.current.krName.trim()) {
123
+ // if (hasAncestorElement(e.target, 'titaui-popup')) return
124
+ // if (
125
+ // dataRef.current.getWrapperRef().current &&
126
+ // dataRef.current.getWrapperRef().current.contains(e.target as Node)
127
+ // ) {
128
+ // return
129
+ // }
130
+ var _dataRef$current$krNa = dataRef.current.krNameData,
131
+ mentionUsers = _dataRef$current$krNa.mentionUsers,
132
+ pureText = _dataRef$current$krNa.pureText,
133
+ richText = _dataRef$current$krNa.richText;
134
+
135
+ if (pureText.trim()) {
122
136
  (0, _requestApis.createNewKr)({
123
137
  PrincipalId: dataRef.current.user.id,
124
- mileStoneName: dataRef.current.krName,
138
+ mileStoneName: pureText,
139
+ mileStoneNameRichText: richText,
140
+ aiteUsers: mentionUsers === null || mentionUsers === void 0 ? void 0 : mentionUsers.map(function (user) {
141
+ return user.mentionId;
142
+ }),
125
143
  startDate: dataRef.current.startDate,
126
144
  endDate: dataRef.current.endDate,
127
145
  workId: dataRef.current.workId,
128
146
  confidenceIndex: confidenceIndex
129
147
  }).then(function (res) {
148
+ setShowTip(false);
130
149
  dataRef.current.addKr(res);
131
150
  dataRef.current.onHide();
132
151
  });
@@ -137,26 +156,35 @@ function CreateKr(_ref) {
137
156
 
138
157
  var focus = function focus() {
139
158
  setTimeout(function () {
140
- inputRef.current && inputRef.current.focus();
159
+ var _mentionInputRef$curr, _mentionInputRef$curr2;
160
+
161
+ (_mentionInputRef$curr = mentionInputRef.current) === null || _mentionInputRef$curr === void 0 ? void 0 : (_mentionInputRef$curr2 = _mentionInputRef$curr.methods()) === null || _mentionInputRef$curr2 === void 0 ? void 0 : _mentionInputRef$curr2.focus();
141
162
  }, 0);
142
- };
163
+ }; // useEffect(() => {
164
+ // document.addEventListener('click', create, false)
165
+ // return () => document.removeEventListener('click', create)
166
+ // }, [])
167
+
143
168
 
144
- (0, _react.useEffect)(function () {
145
- document.addEventListener("click", create, false);
146
- return function () {
147
- return document.removeEventListener("click", create);
148
- };
149
- }, []);
150
169
  (0, _react.useEffect)(function () {
151
170
  focus();
152
171
  }, []);
153
172
 
154
173
  var onInputKeyDown = function onInputKeyDown(e) {
155
- if (e.key.toLocaleLowerCase() == "enter") {
156
- if (krName.trim()) {
174
+ if (e.key.toLocaleLowerCase() == 'enter' && !pendingRef.current) {
175
+ pendingRef.current = true;
176
+ var mentionUsers = krNameData.mentionUsers,
177
+ pureText = krNameData.pureText,
178
+ richText = krNameData.richText;
179
+
180
+ if (pureText.trim()) {
157
181
  (0, _requestApis.createNewKr)({
158
182
  PrincipalId: user.id,
159
- mileStoneName: krName,
183
+ mileStoneName: pureText,
184
+ mileStoneNameRichText: richText,
185
+ aiteUsers: mentionUsers === null || mentionUsers === void 0 ? void 0 : mentionUsers.map(function (user) {
186
+ return user.mentionId;
187
+ }),
160
188
  startDate: startDate,
161
189
  endDate: endDate,
162
190
  workId: workId,
@@ -164,19 +192,15 @@ function CreateKr(_ref) {
164
192
  }).then(function (res) {
165
193
  addKr(res);
166
194
  onHide();
195
+ pendingRef.current = false;
167
196
  });
168
197
  } else {
169
198
  onHide();
199
+ pendingRef.current = false;
170
200
  }
171
201
  }
172
202
  };
173
203
 
174
- var onBlur = function onBlur() {
175
- setTimeout(function () {
176
- setShowTip(false);
177
- }, 200);
178
- };
179
-
180
204
  var onFocus = function onFocus() {
181
205
  tipsEnable && !dataRef.current.hideTips && setShowTip(true);
182
206
  };
@@ -193,7 +217,7 @@ function CreateKr(_ref) {
193
217
 
194
218
  var onNoMoreShow = function onNoMoreShow() {
195
219
  setShowTip(false);
196
- localStorage.setItem("list_create_kr_tips_".concat((0, _bsGlobal.getUserInfo)().Id), "false");
220
+ localStorage.setItem("list_create_kr_tips_".concat((0, _bsGlobal.getUserInfo)().Id), 'false');
197
221
  };
198
222
 
199
223
  var onUserSubmit = function onUserSubmit(_ref2) {
@@ -216,33 +240,31 @@ function CreateKr(_ref) {
216
240
  className: preCls
217
241
  }, /*#__PURE__*/_react["default"].createElement("div", {
218
242
  className: (0, _classnames["default"])("".concat(preCls, "__input"))
219
- }, /*#__PURE__*/_react["default"].createElement(_titaUi.Input, {
220
- placeholder: (0, _getLocale.getLocale)("OKR_MyO_Text_Createkeyr"),
221
- inputRef: inputRef,
222
- value: krName,
223
- onChange: function onChange(e) {
224
- return setKrName(e.target.value);
225
- },
243
+ }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
244
+ initialState: undefined,
245
+ onDocChange: setKrNameData,
246
+ onBlur: createKr,
226
247
  onFocus: onFocus,
227
- onBlur: onBlur,
228
- onKeyDown: onInputKeyDown
248
+ onKeyDown: onInputKeyDown,
249
+ placeholder: (0, _getLocale.getLocale)('OKR_MyO_Text_Createkeyr'),
250
+ ref: mentionInputRef
229
251
  }), /*#__PURE__*/_react["default"].createElement("p", {
230
252
  style: {
231
- display: showTip ? "block" : "none",
253
+ display: showTip ? 'block' : 'none',
232
254
  zIndex: 1
233
255
  },
234
256
  onClick: stopPropagation
235
- }, (0, _getLocale.getLocale)("OKR_MyO_Text_Recommendation"), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("p", null, (0, _getLocale.getLocale)("OKR_MyO_Text_ExampleC")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("a", {
257
+ }, (0, _getLocale.getLocale)('OKR_MyO_Text_Recommendation'), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("p", null, (0, _getLocale.getLocale)('OKR_MyO_Text_ExampleC')), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("a", {
236
258
  onClick: onNextTalk
237
- }, (0, _getLocale.getLocale)("OKR_MyO_Butt_Nexttime")), /*#__PURE__*/_react["default"].createElement("a", {
259
+ }, (0, _getLocale.getLocale)('OKR_MyO_Butt_Nexttime')), /*#__PURE__*/_react["default"].createElement("a", {
238
260
  onClick: onNoMoreShow
239
- }, (0, _getLocale.getLocale)("OKR_MyO_Butt_Nomor")))), /*#__PURE__*/_react["default"].createElement("span", {
261
+ }, (0, _getLocale.getLocale)('OKR_MyO_Butt_Nomor')))), /*#__PURE__*/_react["default"].createElement("span", {
240
262
  className: (0, _classnames["default"])("".concat(preCls, "__heart"))
241
263
  }, /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
242
264
  content: "\u4FEE\u65391"
243
265
  }, /*#__PURE__*/_react["default"].createElement("span", {
244
266
  style: {
245
- display: "inline-flex"
267
+ display: 'inline-flex'
246
268
  }
247
269
  }, /*#__PURE__*/_react["default"].createElement(_confidence["default"], {
248
270
  editable: true,
@@ -120,3 +120,12 @@
120
120
  color: #a4acb9;
121
121
  line-height: 22px;
122
122
  }
123
+
124
+ .okr-detail-okrs-list .tita-okrdt-tree {
125
+ overflow: visible;
126
+ }
127
+
128
+ .okr-detail-okrs-list .tita-okrdt-tree .titaui-tree,
129
+ .okr-detail-okrs-list .tita-okrdt-tree .rc-tree-list-holder {
130
+ overflow: visible;
131
+ }
@@ -73,6 +73,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
73
73
 
74
74
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
75
75
 
76
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
77
+
76
78
  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); } }
77
79
 
78
80
  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); }); }; }
@@ -94,16 +96,16 @@ var _getUserInfo = (0, _bsGlobal.getUserInfo)(),
94
96
  Id = _getUserInfo.Id,
95
97
  UserAvatar = _getUserInfo.UserAvatar;
96
98
 
97
- var preCls = "okr-detail-okrs-list";
99
+ var preCls = 'okr-detail-okrs-list';
98
100
 
99
101
  var treeDataFormate = function treeDataFormate(nodes) {
100
- var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "kr";
102
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'kr';
101
103
  var canEditOkr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
102
104
  var formateNodes = [];
103
105
  nodes.forEach(function (it, index) {
104
- var title = "";
105
- if (type == "kr" || type == "kr-parent") title = it.mileStoneName;
106
- if (type == "o-child" || type == "o-parent") title = it.workName;
106
+ var title = ''; // if (type == "kr" || type == "kr-parent") title = it.mileStoneName;
107
+
108
+ if (type == 'o-child' || type == 'o-parent') title = it.workName;
107
109
  formateNodes.push({
108
110
  key: it.mileStoneId,
109
111
  index: index,
@@ -187,10 +189,10 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
187
189
  canEditOkr = _useState16[0];
188
190
 
189
191
  var getParentAndChildWorks = /*#__PURE__*/function () {
190
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
192
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
191
193
  var _yield$getRelWorks, Data, _Data$childWorks, childWorks, parentWork, parentKr, authChildWorks;
192
194
 
193
- return regeneratorRuntime.wrap(function _callee$(_context) {
195
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
194
196
  while (1) {
195
197
  switch (_context.prev = _context.next) {
196
198
  case 0:
@@ -206,7 +208,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
206
208
  });
207
209
 
208
210
  if (authChildWorks.length > 0) {
209
- setChildOkrs(treeDataFormate(authChildWorks, "o-child"));
211
+ setChildOkrs(treeDataFormate(authChildWorks, 'o-child'));
210
212
  } else {
211
213
  setChildOkrs(null);
212
214
  }
@@ -277,7 +279,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
277
279
  updateKrs();
278
280
  }, []);
279
281
  (0, _react.useEffect)(function () {
280
- var strucKrs = treeDataFormate(pureKrs, "kr", canEditOkr);
282
+ var strucKrs = treeDataFormate(pureKrs, 'kr', canEditOkr);
281
283
  setKrs(strucKrs);
282
284
  }, [pureKrs, canEditOkr]);
283
285
 
@@ -285,7 +287,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
285
287
  refreshAll();
286
288
  updateKrs();
287
289
 
288
- _toast["default"].Success((0, _getLocale.getLocale)("OKR_Db_Success"), {
290
+ _toast["default"].Success((0, _getLocale.getLocale)('OKR_Db_Success'), {
289
291
  canClose: false
290
292
  });
291
293
  };
@@ -324,7 +326,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
324
326
 
325
327
  (0, _requestApis.updateParentId)(params).then(function (data) {
326
328
  if (data.Code == 1) {
327
- _toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"));
329
+ _toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
328
330
 
329
331
  setGeneralParent({
330
332
  parentId: params.parentId,
@@ -376,7 +378,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
376
378
  if (!canEditOkr) return;
377
379
  var dropNode = info.node;
378
380
  var dragNode = info.dragNode;
379
- var dropPos = info.node.pos.split("-");
381
+ var dropPos = info.node.pos.split('-');
380
382
  var dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]); // 移动类型,after 1 before 2
381
383
 
382
384
  var isDown = dropPosition != -1;
@@ -410,17 +412,17 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
410
412
  parentOkr: parentOkr
411
413
  });
412
414
 
413
- okrParent = treeDataFormate([newParentKr], "kr-parent");
415
+ okrParent = treeDataFormate([newParentKr], 'kr-parent');
414
416
  } else if (parentOkr) {
415
- okrParent = treeDataFormate([parentOkr], "o-parent");
417
+ okrParent = treeDataFormate([parentOkr], 'o-parent');
416
418
  }
417
419
 
418
420
  var isShowAlignOkr = (0, _react.useMemo)(function () {
419
- return childOkrs && childOkrs.length > 0 // 有子目标
420
- || parentOkr // 有父目标
421
- || !parentOkr && canEditOkr // 无父目标但有权限编辑
422
- ;
423
- }, [parentOkr, childOkrs, canEditOkr]);
421
+ return childOkrs && childOkrs.length > 0 || // 有子目标
422
+ parentOkr || // 有父目标
423
+ !parentOkr && canEditOkr;
424
+ }, // 无父目标但有权限编辑
425
+ [parentOkr, childOkrs, canEditOkr]);
424
426
 
425
427
  var renderKrs = function renderKrs() {
426
428
  var _classNames;
@@ -432,9 +434,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
432
434
  },
433
435
  canEditOkr: canEditOkr || isInnerUser,
434
436
  style: isShowAlignOkr ? {
435
- padding: "40px 0 24px 0"
437
+ padding: '40px 0 24px 0'
436
438
  } : {
437
- padding: "100px 0"
439
+ padding: '100px 0'
438
440
  }
439
441
  });
440
442
  }
@@ -449,7 +451,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
449
451
  okrInfo: okrInfo,
450
452
  draggable: canEditOkr && (okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState) === _helper.EApproveStatus.UnderApproval,
451
453
  onDrop: onOkrItemDropHandler
452
- }))), (canEditOkr || isInnerUser) && (0, _helper.getApprovalOkr)(approvalSetting, "createOkr", okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes) && /*#__PURE__*/_react["default"].createElement("div", {
454
+ }))), (canEditOkr || isInnerUser) && (0, _helper.getApprovalOkr)(approvalSetting, 'createOkr', okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes) && /*#__PURE__*/_react["default"].createElement("div", {
453
455
  ref: wrapperRef,
454
456
  className: (0, _classnames["default"])("".concat(preCls, "__addkr"))
455
457
  }, /*#__PURE__*/_react["default"].createElement(_paddingLayout["default"], null, createKrShow ? /*#__PURE__*/_react["default"].createElement(_createKrItem["default"], {
@@ -468,10 +470,10 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
468
470
  return setCreateKrShow(true);
469
471
  }
470
472
  }, /*#__PURE__*/_react["default"].createElement("span", {
471
- className: (0, _classnames["default"])("".concat(preCls, "__addkr-prefix"), "tu-icon-add1")
473
+ className: (0, _classnames["default"])("".concat(preCls, "__addkr-prefix"), 'tu-icon-add1')
472
474
  }), /*#__PURE__*/_react["default"].createElement("span", {
473
475
  className: (0, _classnames["default"])("".concat(preCls, "__addkr-text"))
474
- }, (0, _getLocale.getLocale)("OKR_MyO_Pop_Butt_AddKR"))))));
476
+ }, (0, _getLocale.getLocale)('OKR_MyO_Pop_Butt_AddKR'))))));
475
477
  };
476
478
 
477
479
  return /*#__PURE__*/_react["default"].createElement(_context2.OkrListContext.Provider, {
@@ -487,13 +489,13 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
487
489
  className: (0, _classnames["default"])(preCls)
488
490
  }, !loading ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, renderKrs(), isShowAlignOkr && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_blockLine["default"], {
489
491
  style: {
490
- padding: "0 32px"
492
+ padding: '0 32px'
491
493
  }
492
494
  }), /*#__PURE__*/_react["default"].createElement("div", {
493
495
  className: (0, _classnames["default"])("".concat(preCls, "__align-to"))
494
496
  }, /*#__PURE__*/_react["default"].createElement("div", {
495
497
  className: (0, _classnames["default"])("".concat(preCls, "__align-to-title"))
496
- }, (0, _getLocale.getLocale)("OKR_MyO_Pop_SetAlignment")), !parentOkr && canEditOkr ? /*#__PURE__*/_react["default"].createElement(_addParentOkr["default"], {
498
+ }, (0, _getLocale.getLocale)('OKR_MyO_Pop_SetAlignment')), !parentOkr && canEditOkr ? /*#__PURE__*/_react["default"].createElement(_addParentOkr["default"], {
497
499
  onClick: onAddParentOkrHandler
498
500
  }) : /*#__PURE__*/_react["default"].createElement("div", {
499
501
  className: (0, _classnames["default"])("".concat(preCls, "__align-to-tree"))
@@ -506,7 +508,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
506
508
  onClick: function onClick() {
507
509
  return setIsOpened(!isOpened);
508
510
  }
509
- }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_KRP_OKRs_Alignedmeobje"), "\uFF08", childOkrs.length, "\uFF09")), /*#__PURE__*/_react["default"].createElement(_reactCollapse.Collapse, {
511
+ }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_KRP_OKRs_Alignedmeobje'), "\uFF08", childOkrs.length, "\uFF09")), /*#__PURE__*/_react["default"].createElement(_reactCollapse.Collapse, {
510
512
  isOpened: isOpened
511
513
  }, /*#__PURE__*/_react["default"].createElement("div", {
512
514
  className: (0, _classnames["default"])("".concat(preCls, "__align-on-tree"))