@titaui/pc 1.11.52-beta.2 → 1.11.52-beta.20
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.
- package/lib/components/button/images/blue.svg +21 -0
- package/lib/components/button/images/red.svg +21 -0
- package/lib/components/button/images/white.svg +19 -0
- package/lib/components/button/rect-btn/index.js +3 -3
- package/lib/components/change-okr-modal/Item.js +19 -18
- package/lib/components/change-okr-modal/styledComponents.js +9 -9
- package/lib/components/checkbox/index.css +4 -0
- package/lib/components/contact-kefu/index.css +11 -1
- package/lib/components/contact-kefu/index.js +10 -4
- package/lib/components/create-okr-modal/createSuccessCmp.js +47 -19
- package/lib/components/create-okr-modal/fields/index.css +14 -3
- package/lib/components/create-okr-modal/fields/o-new-name.js +31 -20
- package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
- package/lib/components/create-okr-modal/index.js +197 -132
- package/lib/components/create-okr-modal/kr-items/index.css +23 -13
- package/lib/components/create-okr-modal/kr-items/krDatas.js +95 -76
- package/lib/components/create-okr-modal/kr-items/krItem.js +54 -57
- package/lib/components/create-okr-modal/style.js +5 -5
- package/lib/components/drop-selector/index.js +1 -2
- package/lib/components/dynamic/components/title/index.js +1 -1
- package/lib/components/dynamic/constant.js +1 -1
- package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +17 -17
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +9 -9
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +3 -1
- package/lib/components/eReport/eReportLists/reportList.js +29 -30
- package/lib/components/eReport/eReportShare/style.js +1 -1
- package/lib/components/edit-kr-wight/EditKrWightModal.js +11 -9
- package/lib/components/menus/export-modules/appraisal-menus/menus.js +11 -9
- package/lib/components/nav-top/components/menu/index.js +18 -16
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -1
- package/lib/components/nav-top/components/user-message/components/todos/todo-item.js +3 -3
- package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
- package/lib/components/okr-detail/components/header/edit-name.js +76 -39
- package/lib/components/okr-detail/components/header/index.css +122 -41
- package/lib/components/okr-detail/components/header/index.js +45 -48
- package/lib/components/okr-detail/components/header/o-classify.js +152 -0
- package/lib/components/okr-detail/components/header/o-name.js +7 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +81 -43
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +66 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +174 -64
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +9 -9
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +15 -13
- package/lib/components/okr-detail/detail-header/index.js +11 -5
- package/lib/components/okr-detail/e-list/index.js +2 -2
- package/lib/components/okr-detail/okr-list/create-kr-item/index.css +17 -0
- package/lib/components/okr-detail/okr-list/create-kr-item/index.js +75 -53
- package/lib/components/okr-detail/okr-list/index.css +9 -0
- package/lib/components/okr-detail/okr-list/index.js +25 -25
- package/lib/components/okr-detail/request-apis.js +73 -69
- package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
- package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
- package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-flow/child-node/kr-node.js +3 -1
- package/lib/components/okr-flow/child-node/work-node.js +3 -1
- package/lib/components/okr-flow/export-modal/index.js +26 -16
- package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
- package/lib/components/okr-progress/components/o-progress/index.js +3 -1
- package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +3 -3
- package/lib/components/okr-share/common-painter/openDataPainter.js +9 -6
- package/lib/components/okr-share/common-painter/utils.js +183 -36
- package/lib/components/okr-share/index.css +5 -4
- package/lib/components/okr-share/pink-card/card.js +3 -3
- package/lib/components/okr-share/pink-card/drawKrs.js +93 -18
- package/lib/components/okr-share/pink-card/index.js +20 -12
- package/lib/components/open-data-painter/index.js +6 -5
- package/lib/components/period-selector/interface.js +7 -0
- package/lib/components/progress/circle-progress/index.css +2 -0
- package/lib/components/search-input/index.css +1 -1
- package/lib/components/search-key-handle/index.js +12 -10
- package/lib/components/select-layer/index.css +1 -1
- package/lib/components/task-relation-modal/helper.js +139 -2
- package/lib/components/task-relation-modal/image/loading.gif +0 -0
- package/lib/components/task-relation-modal/index.js +9 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.css +18 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +267 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +135 -0
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.css +0 -0
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +131 -0
- package/lib/components/task-relation-modal/okr-relation/request-api.js +106 -0
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +120 -0
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +191 -0
- package/lib/components/task-relation-modal/request-api.js +28 -2
- package/lib/components/task-relation-modal/search/okr-status-select.js +3 -3
- package/lib/components/task-relation-modal/search/principal.js +36 -19
- package/lib/components/task-relation-modal/search/search-dropdown/index.css +2 -1
- package/lib/components/task-relation-modal/search/search-dropdown/index.js +1 -1
- package/lib/components/task-relation-modal/search/task-relation.js +83 -0
- package/lib/components/task-relation-modal/search/task-status-select.js +87 -0
- package/lib/components/task-relation-modal/search/work-relation.js +83 -0
- package/lib/components/task-relation-modal/search/work-status-select.js +74 -0
- package/lib/components/task-relation-modal/tree/category-tree/index.css +3 -3
- package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
- package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +16 -2
- package/lib/components/task-relation-modal/tree/task-list/index.css +0 -0
- package/lib/components/task-relation-modal/tree/task-list/index.js +1 -0
- package/lib/components/task-relation-modal/tree/work-list/index.css +14 -0
- package/lib/components/task-relation-modal/tree/work-list/index.js +176 -0
- package/lib/components/task-relation-modal/tree/work-list/search-form.js +123 -0
- package/lib/components/task-relation-modal/tree/work-tree/index.css +1 -1
- package/lib/components/task-relation-modal/tree-node/category-node/index.css +1 -1
- package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -4
- package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
- package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
- package/lib/components/task-relation-modal/work-relation/index.css +0 -0
- package/lib/components/task-relation-modal/work-relation/index.js +256 -0
- package/lib/components/task-tree/task-item-node/index.css +2 -2
- package/lib/components/tooltip/index.js +3 -0
- package/lib/components/tooltip/tooltip-rows/index.css +26 -0
- package/lib/components/tooltip/tooltip-rows/index.js +106 -0
- package/lib/components/upload/components/uploadedPreview.js +18 -18
- package/lib/components/upload/index.js +57 -29
- package/lib/components/user-selector/category-selector-panel/index.js +6 -1
- package/lib/components/user-selector/category-selector-panel/subordinate-tree.js +61 -0
- package/lib/components/user-selector/constant.js +10 -2
- package/lib/components/user-selector/empty/index.css +5 -0
- package/lib/components/user-selector/empty/index.js +9 -3
- package/lib/components/user-selector/export-modules/depart-search-selector/index.js +45 -17
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +16 -15
- package/lib/components/user-selector/images/no-auth.png +0 -0
- package/lib/components/user-selector/request-apis.js +28 -9
- package/lib/components/user-selector/searched-panel/index.js +32 -12
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +46 -18
- package/lib/components/wechat-btn/index.css +5 -1
- package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
- package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
- package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
- package/lib/pages/new-okr-list/header/index.js +16 -18
- package/lib/utils/auth.js +12 -0
- package/lib/utils/hooks.js +19 -5
- package/lib/utils/open-data.js +214 -66
- package/lib/utils/planDataJson.js +11115 -0
- package/lib/utils/tita-okr-cycle.js +24 -0
- package/package.json +2 -1
|
@@ -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)(
|
|
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)(
|
|
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 ?
|
|
136
|
+
color: !parent.parentWorkName ? '#BFC7D5' : ''
|
|
135
137
|
}
|
|
136
|
-
}, !parent.parentWorkName ? (0, _getLocale.getLocale)(
|
|
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", {
|
|
@@ -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)(
|
|
135
|
+
var _useState = (0, _react.useState)('initialization'),
|
|
125
136
|
_useState2 = _slicedToArray(_useState, 2),
|
|
126
|
-
|
|
127
|
-
|
|
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
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
|
163
|
+
var _useState7 = (0, _react.useState)({
|
|
148
164
|
name: Name,
|
|
149
165
|
id: Id,
|
|
150
166
|
avatar: UserAvatar
|
|
151
167
|
}),
|
|
152
|
-
|
|
153
|
-
user =
|
|
154
|
-
setUser =
|
|
168
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
169
|
+
user = _useState8[0],
|
|
170
|
+
setUser = _useState8[1]; // 负责人
|
|
155
171
|
|
|
156
172
|
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
isCustomWeight =
|
|
160
|
-
setIsCustomWeight =
|
|
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
|
|
179
|
+
var _useState11 = (0, _react.useState)({
|
|
164
180
|
departmentId: 0,
|
|
165
181
|
departmentName: ''
|
|
166
182
|
}),
|
|
167
|
-
|
|
168
|
-
dept =
|
|
169
|
-
setDept =
|
|
183
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
184
|
+
dept = _useState12[0],
|
|
185
|
+
setDept = _useState12[1]; // 部门信息 用于目标类型为部门时
|
|
170
186
|
|
|
171
187
|
|
|
172
|
-
var
|
|
188
|
+
var _useState13 = (0, _react.useState)({
|
|
173
189
|
groupId: 0,
|
|
174
190
|
groupName: ''
|
|
175
191
|
}),
|
|
176
|
-
|
|
177
|
-
team =
|
|
178
|
-
setTeam =
|
|
192
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
193
|
+
team = _useState14[0],
|
|
194
|
+
setTeam = _useState14[1]; // 团队信息 用于目标类型为团队时
|
|
179
195
|
|
|
180
196
|
|
|
181
|
-
var
|
|
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
|
-
|
|
193
|
-
|
|
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
|
-
|
|
199
|
-
|
|
208
|
+
cycle = _useState18[0],
|
|
209
|
+
setCycle = _useState18[1]; // 目标周期信息
|
|
200
210
|
|
|
201
211
|
|
|
202
|
-
var _useState19 = (0, _react.useState)(
|
|
212
|
+
var _useState19 = (0, _react.useState)(),
|
|
203
213
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
211
|
-
|
|
220
|
+
visibility = _useState22[0],
|
|
221
|
+
setVisibility = _useState22[1]; // 可见性
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
var _useState23 = (0, _react.useState)({}),
|
|
225
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
226
|
+
visiableLimit = _useState24[0],
|
|
227
|
+
setVisiableLimit = _useState24[1]; // 可见性指定范围
|
|
212
228
|
|
|
213
229
|
|
|
214
|
-
var
|
|
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
|
-
|
|
225
|
-
krDatas =
|
|
226
|
-
setKrDatas =
|
|
243
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
244
|
+
krDatas = _useState26[0],
|
|
245
|
+
setKrDatas = _useState26[1];
|
|
227
246
|
|
|
228
|
-
var
|
|
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
|
-
|
|
242
|
-
|
|
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
|
-
|
|
247
|
-
|
|
260
|
+
oNameIsInput = _useState30[0],
|
|
261
|
+
setONameIsInput = _useState30[1];
|
|
248
262
|
|
|
249
|
-
var _useState31 = (0, _react.useState)(
|
|
263
|
+
var _useState31 = (0, _react.useState)(false),
|
|
250
264
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
251
|
-
|
|
252
|
-
|
|
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];
|
|
253
272
|
|
|
254
|
-
var
|
|
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
|
-
|
|
265
|
-
|
|
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
|
-
|
|
271
|
-
|
|
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
|
-
|
|
276
|
-
|
|
289
|
+
customCloseKrSuggest = _useState40[0],
|
|
290
|
+
setCustomCloseKrSuggest = _useState40[1];
|
|
277
291
|
|
|
278
|
-
var _useState41 = (0, _react.useState)(
|
|
292
|
+
var _useState41 = (0, _react.useState)(),
|
|
279
293
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
280
|
-
|
|
281
|
-
|
|
294
|
+
createdSuccessInfo = _useState42[0],
|
|
295
|
+
setCreatedSuccessInfo = _useState42[1];
|
|
282
296
|
|
|
283
|
-
var _useState43 = (0, _react.useState)(
|
|
297
|
+
var _useState43 = (0, _react.useState)(false),
|
|
284
298
|
_useState44 = _slicedToArray(_useState43, 2),
|
|
285
|
-
|
|
286
|
-
|
|
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
|
-
|
|
291
|
-
|
|
304
|
+
tipIndex = _useState46[0],
|
|
305
|
+
setTipIndex = _useState46[1];
|
|
292
306
|
|
|
293
|
-
var _useState47 = (0, _react.useState)(
|
|
307
|
+
var _useState47 = (0, _react.useState)(''),
|
|
294
308
|
_useState48 = _slicedToArray(_useState47, 2),
|
|
295
|
-
|
|
296
|
-
|
|
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
|
-
|
|
301
|
-
|
|
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
|
-
|
|
306
|
-
|
|
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
|
-
|
|
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,13 +369,21 @@ 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
|
-
|
|
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
|
},
|
|
357
389
|
show: showCreateOkrModal,
|
|
@@ -401,13 +433,15 @@ function CreateOkrModal(_ref, ref) {
|
|
|
401
433
|
|
|
402
434
|
var onModalOkHandler = /*#__PURE__*/function () {
|
|
403
435
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
404
|
-
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;
|
|
405
437
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
406
438
|
while (1) {
|
|
407
439
|
switch (_context.prev = _context.next) {
|
|
408
440
|
case 0:
|
|
409
|
-
|
|
410
|
-
|
|
441
|
+
mentionUsers = okrNameData.mentionUsers, pureText = okrNameData.pureText, pureTextExcludeAt = okrNameData.pureTextExcludeAt, richText = okrNameData.richText;
|
|
442
|
+
|
|
443
|
+
if (pureText) {
|
|
444
|
+
_context.next = 4;
|
|
411
445
|
break;
|
|
412
446
|
}
|
|
413
447
|
|
|
@@ -417,9 +451,9 @@ function CreateOkrModal(_ref, ref) {
|
|
|
417
451
|
|
|
418
452
|
return _context.abrupt("return");
|
|
419
453
|
|
|
420
|
-
case
|
|
421
|
-
if (!(
|
|
422
|
-
_context.next =
|
|
454
|
+
case 4:
|
|
455
|
+
if (!(pureTextExcludeAt.length > 500)) {
|
|
456
|
+
_context.next = 7;
|
|
423
457
|
break;
|
|
424
458
|
}
|
|
425
459
|
|
|
@@ -429,9 +463,9 @@ function CreateOkrModal(_ref, ref) {
|
|
|
429
463
|
|
|
430
464
|
return _context.abrupt("return");
|
|
431
465
|
|
|
432
|
-
case
|
|
466
|
+
case 7:
|
|
433
467
|
if (allKrHasName) {
|
|
434
|
-
_context.next =
|
|
468
|
+
_context.next = 11;
|
|
435
469
|
break;
|
|
436
470
|
}
|
|
437
471
|
|
|
@@ -442,13 +476,15 @@ function CreateOkrModal(_ref, ref) {
|
|
|
442
476
|
setKrIsValidate(true);
|
|
443
477
|
return _context.abrupt("return");
|
|
444
478
|
|
|
445
|
-
case
|
|
479
|
+
case 11:
|
|
446
480
|
orkNameLengthValidate = krDatas.filter(function (kr) {
|
|
447
|
-
|
|
481
|
+
var _trim;
|
|
482
|
+
|
|
483
|
+
return ((_trim = (kr.mileStoneNamePureTextExcludeAt || '').trim()) === null || _trim === void 0 ? void 0 : _trim.length) > 500;
|
|
448
484
|
}).length == 0;
|
|
449
485
|
|
|
450
486
|
if (orkNameLengthValidate) {
|
|
451
|
-
_context.next =
|
|
487
|
+
_context.next = 15;
|
|
452
488
|
break;
|
|
453
489
|
}
|
|
454
490
|
|
|
@@ -458,11 +494,11 @@ function CreateOkrModal(_ref, ref) {
|
|
|
458
494
|
|
|
459
495
|
return _context.abrupt("return");
|
|
460
496
|
|
|
461
|
-
case
|
|
497
|
+
case 15:
|
|
462
498
|
setKrIsValidate(false);
|
|
463
499
|
|
|
464
500
|
if (krWeightValid) {
|
|
465
|
-
_context.next =
|
|
501
|
+
_context.next = 19;
|
|
466
502
|
break;
|
|
467
503
|
}
|
|
468
504
|
|
|
@@ -472,27 +508,32 @@ function CreateOkrModal(_ref, ref) {
|
|
|
472
508
|
|
|
473
509
|
return _context.abrupt("return");
|
|
474
510
|
|
|
475
|
-
case
|
|
511
|
+
case 19:
|
|
476
512
|
if (cycle) {
|
|
477
|
-
_context.next =
|
|
513
|
+
_context.next = 21;
|
|
478
514
|
break;
|
|
479
515
|
}
|
|
480
516
|
|
|
481
517
|
return _context.abrupt("return");
|
|
482
518
|
|
|
483
|
-
case
|
|
519
|
+
case 21:
|
|
484
520
|
handleCreatedClose();
|
|
485
521
|
visibilityArea = formatVisiableLimit();
|
|
486
|
-
|
|
487
|
-
return (0, _requestApi.createWidthKr)(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
522
|
+
formData = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
488
523
|
krInfos: krDatas.map(function (kr) {
|
|
524
|
+
// @ts-ignore
|
|
525
|
+
delete kr.mileStoneNamePureTextExcludeAt;
|
|
489
526
|
return _objectSpread(_objectSpread({}, kr), {}, {
|
|
490
527
|
startDate: cycle.startDate,
|
|
491
528
|
endDate: cycle.endDate
|
|
492
529
|
});
|
|
493
530
|
})
|
|
494
531
|
}, cycle), {}, {
|
|
495
|
-
workName:
|
|
532
|
+
workName: pureText,
|
|
533
|
+
workNameRichText: richText,
|
|
534
|
+
aiteUsers: mentionUsers === null || mentionUsers === void 0 ? void 0 : mentionUsers.map(function (user) {
|
|
535
|
+
return user.mentionId;
|
|
536
|
+
})
|
|
496
537
|
}, parent), {}, {
|
|
497
538
|
workType: 6,
|
|
498
539
|
visibility: visibility,
|
|
@@ -505,13 +546,15 @@ function CreateOkrModal(_ref, ref) {
|
|
|
505
546
|
}]
|
|
506
547
|
}, visibilityArea), {}, {
|
|
507
548
|
CreateFromAssess: isFromAssess
|
|
508
|
-
})
|
|
549
|
+
});
|
|
550
|
+
_context.next = 26;
|
|
551
|
+
return (0, _requestApi.createWidthKr)(formData);
|
|
509
552
|
|
|
510
|
-
case
|
|
553
|
+
case 26:
|
|
511
554
|
data = _context.sent;
|
|
512
555
|
|
|
513
556
|
if (!(data.Code === 0)) {
|
|
514
|
-
_context.next =
|
|
557
|
+
_context.next = 30;
|
|
515
558
|
break;
|
|
516
559
|
}
|
|
517
560
|
|
|
@@ -521,7 +564,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
521
564
|
|
|
522
565
|
return _context.abrupt("return");
|
|
523
566
|
|
|
524
|
-
case
|
|
567
|
+
case 30:
|
|
525
568
|
hideCreateOkrModal();
|
|
526
569
|
|
|
527
570
|
if (onSuccess || !isHiddenCreatedCard) {
|
|
@@ -529,8 +572,10 @@ function CreateOkrModal(_ref, ref) {
|
|
|
529
572
|
krNum = krDatas.length;
|
|
530
573
|
krTotalLength = 0;
|
|
531
574
|
krDatas && krDatas.forEach(function (kr) {
|
|
575
|
+
var _kr$mileStoneNamePure;
|
|
576
|
+
|
|
532
577
|
// 计算平均长度要去掉百分号和数字
|
|
533
|
-
krTotalLength += kr.
|
|
578
|
+
krTotalLength += (_kr$mileStoneNamePure = kr.mileStoneNamePureTextExcludeAt) === null || _kr$mileStoneNamePure === void 0 ? void 0 : _kr$mileStoneNamePure.replace(/(%|\d)/g, '').length;
|
|
534
579
|
});
|
|
535
580
|
krAvarageLength = krDatas.length > 0 ? krTotalLength / krDatas.length : 0;
|
|
536
581
|
krMeasurableLength = krsCheckResult.friendlyResult.filter(function (kr) {
|
|
@@ -538,7 +583,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
538
583
|
}).length;
|
|
539
584
|
oHasVtWords = oNameCheckResult[0].result === _okrCreateSuggest.EOkrCreateSuggestResultType.correct;
|
|
540
585
|
callData = data;
|
|
541
|
-
callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(
|
|
586
|
+
callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(okrNameData.pureTextExcludeAt.replace(/(%|\d)/g, '').length, oHasVtWords, krNum, krMeasurableLength, Number.parseInt(krAvarageLength.toString()));
|
|
542
587
|
newOkrDataRef.current = callData;
|
|
543
588
|
handleOnSuccess();
|
|
544
589
|
} else {
|
|
@@ -551,7 +596,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
551
596
|
|
|
552
597
|
setIsApplyTpl(false);
|
|
553
598
|
|
|
554
|
-
case
|
|
599
|
+
case 33:
|
|
555
600
|
case "end":
|
|
556
601
|
return _context.stop();
|
|
557
602
|
}
|
|
@@ -566,9 +611,15 @@ function CreateOkrModal(_ref, ref) {
|
|
|
566
611
|
|
|
567
612
|
|
|
568
613
|
var OnOkRApplyTplHandler = function OnOkRApplyTplHandler(data) {
|
|
614
|
+
setRichEditorStatus('refresh');
|
|
569
615
|
var name = data.name,
|
|
570
616
|
subelements = data.subelements;
|
|
571
|
-
|
|
617
|
+
setOkrNameData({
|
|
618
|
+
mentionUsers: [],
|
|
619
|
+
pureText: name,
|
|
620
|
+
pureTextExcludeAt: name,
|
|
621
|
+
richText: (0, _richEditor.TitaRichEditorInitTextState)(name)
|
|
622
|
+
});
|
|
572
623
|
setKrDatas(subelements.map(function (s) {
|
|
573
624
|
return {
|
|
574
625
|
uuid: _uuid["default"].v1(),
|
|
@@ -577,11 +628,15 @@ function CreateOkrModal(_ref, ref) {
|
|
|
577
628
|
userAvatar: UserAvatar,
|
|
578
629
|
krWeight: (0, _roundWeight.RoundWeight)(100 / subelements.length),
|
|
579
630
|
mileStoneName: s.name,
|
|
631
|
+
mileStoneNamePureTextExcludeAt: s.name,
|
|
632
|
+
mileStoneNameRichText: (0, _richEditor.TitaRichEditorInitTextState)(s.name),
|
|
633
|
+
aiteUsers: [],
|
|
580
634
|
confidenceIndex: 5
|
|
581
635
|
};
|
|
582
636
|
}));
|
|
583
637
|
setIsCustomWeight(false);
|
|
584
638
|
setIsApplyTpl(true);
|
|
639
|
+
setRichEditorStatus('initialization');
|
|
585
640
|
};
|
|
586
641
|
|
|
587
642
|
(0, _react.useEffect)(function () {
|
|
@@ -593,9 +648,12 @@ function CreateOkrModal(_ref, ref) {
|
|
|
593
648
|
userAvatar: UserAvatar,
|
|
594
649
|
krWeight: 100,
|
|
595
650
|
mileStoneName: '',
|
|
651
|
+
mileStoneNamePureTextExcludeAt: '',
|
|
652
|
+
mileStoneNameRichText: undefined,
|
|
653
|
+
aiteUsers: [],
|
|
596
654
|
confidenceIndex: 5
|
|
597
655
|
}]);
|
|
598
|
-
|
|
656
|
+
setOkrNameData(DefaultOkrNameData);
|
|
599
657
|
setUser({
|
|
600
658
|
name: Name,
|
|
601
659
|
id: Id,
|
|
@@ -620,6 +678,10 @@ function CreateOkrModal(_ref, ref) {
|
|
|
620
678
|
parentKrId: 0
|
|
621
679
|
});
|
|
622
680
|
}
|
|
681
|
+
|
|
682
|
+
return function () {
|
|
683
|
+
return setRichEditorStatus('initialization');
|
|
684
|
+
};
|
|
623
685
|
}, [isVisible]);
|
|
624
686
|
var handleONameSuggestClose = (0, _react.useCallback)(function () {
|
|
625
687
|
setONameIsInput(false);
|
|
@@ -839,17 +901,20 @@ function CreateOkrModal(_ref, ref) {
|
|
|
839
901
|
}
|
|
840
902
|
}, /*#__PURE__*/_react["default"].createElement(_style.Wrapper, {
|
|
841
903
|
ref: wrapperRef
|
|
904
|
+
}, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
905
|
+
className: "create-modal__wrapper-inner"
|
|
842
906
|
}, /*#__PURE__*/_react["default"].createElement(_oNewName["default"], {
|
|
843
907
|
container: modalRef,
|
|
908
|
+
richEditorStatus: richEditorStatus,
|
|
909
|
+
key: richEditorStatus,
|
|
844
910
|
user: user,
|
|
845
911
|
setUser: setUser,
|
|
846
|
-
|
|
847
|
-
|
|
912
|
+
okrNameData: okrNameData,
|
|
913
|
+
setOkrNameData: setOkrNameData,
|
|
848
914
|
onOInputFocusStateChange: handleOInputFocusStateChange,
|
|
849
915
|
setONameCheckResult: setONameCheckResult,
|
|
850
916
|
setIsInputContent: setIsInputContent
|
|
851
917
|
}), /*#__PURE__*/_react["default"].createElement(_krDatas["default"], {
|
|
852
|
-
krs: krDatas,
|
|
853
918
|
isCustomWeight: isCustomWeight,
|
|
854
919
|
wrapperRef: wrapperRef,
|
|
855
920
|
krDatas: krDatas,
|
|
@@ -899,29 +964,29 @@ function CreateOkrModal(_ref, ref) {
|
|
|
899
964
|
okrClassify: okrClassify,
|
|
900
965
|
setOkrClassify: setOkrClassify,
|
|
901
966
|
isCreateModal: true
|
|
902
|
-
}))),
|
|
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"], {
|
|
903
976
|
isInput: isInputContent,
|
|
904
977
|
isOSuggest: true,
|
|
905
978
|
descs: (0, _constant.getODesc)(),
|
|
906
979
|
example: (0, _constant.getOExample)(),
|
|
907
980
|
results: oNameCheckResult,
|
|
908
981
|
handleClose: handleONameSuggestClose
|
|
909
|
-
}) : null, /*#__PURE__*/_react["default"].createElement("
|
|
910
|
-
className: "teach-suggest teach-suggest__o",
|
|
911
|
-
src: _hand["default"],
|
|
912
|
-
onClick: handleShowOSuggest
|
|
913
|
-
}), !customCloseKrSuggest && krIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
|
|
982
|
+
}) : null, !customCloseKrSuggest && krIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
|
|
914
983
|
isInput: isInputContent,
|
|
915
984
|
isOSuggest: false,
|
|
916
985
|
descs: (0, _constant.getKrDesc)(),
|
|
917
986
|
example: (0, _constant.KrExample)(),
|
|
918
987
|
results: krCheckFinalResult,
|
|
919
988
|
handleClose: handleKrSuggestClose
|
|
920
|
-
}) : null, /*#__PURE__*/_react["default"].createElement("
|
|
921
|
-
className: "teach-suggest teach-suggest__kr",
|
|
922
|
-
src: _hand["default"],
|
|
923
|
-
onClick: handleShowKrSuggest
|
|
924
|
-
})))), !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"], {
|
|
925
990
|
tipIndex: tipIndex,
|
|
926
991
|
createdSuccessInfo: createdSuccessInfo,
|
|
927
992
|
isDownload: false,
|