@titaui/pc 1.11.52-beta.4 → 1.11.52-beta.7
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/create-okr-modal/fields/o-new-name.js +9 -4
- package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
- package/lib/components/create-okr-modal/index.js +137 -114
- package/lib/components/create-okr-modal/kr-items/index.css +11 -12
- package/lib/components/create-okr-modal/kr-items/krDatas.js +92 -74
- package/lib/components/create-okr-modal/kr-items/krItem.js +39 -52
- package/lib/components/create-okr-modal/style.js +5 -5
- package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +8 -8
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +18 -18
- package/lib/components/nav-top/components/menu/index.js +4 -3
- package/lib/components/okr-detail/components/header/edit-name.js +1 -1
- package/lib/components/okr-detail/components/header/index.css +2 -1
- package/lib/components/okr-detail/components/header/o-classify.js +2 -1
- package/lib/components/okr-detail/components/header/o-name.js +7 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +4 -0
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +86 -38
- 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 +3 -1
- package/lib/components/okr-detail/okr-list/create-kr-item/index.js +16 -18
- 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-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-progress-detail/index.js +1 -3
- package/lib/components/search-key-handle/index.js +9 -7
- package/lib/components/wechat-btn/index.css +1 -0
- package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
- package/package.json +2 -2
|
@@ -9,6 +9,8 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
+
var _cloneDeep = _interopRequireDefault(require("clone-deep"));
|
|
13
|
+
|
|
12
14
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
13
15
|
|
|
14
16
|
var _bsGlobal = require("../../../utils/bs-global");
|
|
@@ -60,8 +62,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
60
62
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
61
63
|
|
|
62
64
|
function KrDatas(props) {
|
|
63
|
-
var
|
|
64
|
-
isCustomWeight = props.isCustomWeight,
|
|
65
|
+
var isCustomWeight = props.isCustomWeight,
|
|
65
66
|
wrapperRef = props.wrapperRef,
|
|
66
67
|
setKrDatas = props.setKrDatas,
|
|
67
68
|
krDatas = props.krDatas,
|
|
@@ -88,6 +89,7 @@ function KrDatas(props) {
|
|
|
88
89
|
|
|
89
90
|
var timerRef = (0, _react.useRef)();
|
|
90
91
|
var krNameIsEmpty = (0, _react.useRef)(!inputKrInfo || !inputKrInfo.mileStoneName);
|
|
92
|
+
var krDatasRef = (0, _react.useRef)(krDatas);
|
|
91
93
|
var setting = (0, _bsGlobal.getBSGlobal)('OkrAdvancedSetting').KRSetting;
|
|
92
94
|
|
|
93
95
|
var _getUserInfo = (0, _bsGlobal.getUserInfo)(),
|
|
@@ -99,49 +101,13 @@ function KrDatas(props) {
|
|
|
99
101
|
var total = 0;
|
|
100
102
|
|
|
101
103
|
if (isCustomWeight) {
|
|
102
|
-
|
|
104
|
+
krDatas.forEach(function (kr) {
|
|
103
105
|
return total += Number(kr.krWeight);
|
|
104
106
|
}); // total = RoundWeight(total); // 不知道为啥,这样如果自定义了总的超过100了还是会展示total100
|
|
105
107
|
|
|
106
108
|
total = total.toFixed(1);
|
|
107
109
|
} else {
|
|
108
110
|
total = 100;
|
|
109
|
-
} // 添加KR
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
function addKr() {
|
|
113
|
-
setKrIsValidate(false);
|
|
114
|
-
setTimeout(function () {
|
|
115
|
-
if (!wrapperRef.current || krDatas.length < 6) return;
|
|
116
|
-
wrapperRef.current.scrollTop = wrapperRef.current.scrollHeight;
|
|
117
|
-
}, 0);
|
|
118
|
-
|
|
119
|
-
if (!isCustomWeight) {
|
|
120
|
-
setKrDatas([].concat(_toConsumableArray(krDatas.map(function (kr) {
|
|
121
|
-
return _objectSpread(_objectSpread({}, kr), {}, {
|
|
122
|
-
krWeight: (0, _roundWeight.RoundWeight)(100 / (krDatas.length + 1))
|
|
123
|
-
});
|
|
124
|
-
})), [{
|
|
125
|
-
uuid: _uuid["default"].v1(),
|
|
126
|
-
principalId: Id,
|
|
127
|
-
principalName: Name,
|
|
128
|
-
userAvatar: UserAvatar,
|
|
129
|
-
krWeight: (0, _roundWeight.RoundWeight)(100 / (krDatas.length + 1)),
|
|
130
|
-
mileStoneName: '',
|
|
131
|
-
confidenceIndex: 5
|
|
132
|
-
}]));
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
setKrDatas([].concat(_toConsumableArray(krDatas), [{
|
|
137
|
-
uuid: _uuid["default"].v1(),
|
|
138
|
-
principalId: Id,
|
|
139
|
-
principalName: Name,
|
|
140
|
-
userAvatar: UserAvatar,
|
|
141
|
-
krWeight: 0,
|
|
142
|
-
mileStoneName: '',
|
|
143
|
-
confidenceIndex: 5
|
|
144
|
-
}]));
|
|
145
111
|
}
|
|
146
112
|
|
|
147
113
|
var getKrAnalysisInfo = function getKrAnalysisInfo() {
|
|
@@ -190,50 +156,78 @@ function KrDatas(props) {
|
|
|
190
156
|
})["finally"](function () {
|
|
191
157
|
setIsInputContent(false);
|
|
192
158
|
});
|
|
193
|
-
}; //
|
|
159
|
+
}; // 添加KR
|
|
194
160
|
|
|
195
161
|
|
|
196
|
-
|
|
197
|
-
var
|
|
198
|
-
|
|
199
|
-
|
|
162
|
+
function addKr() {
|
|
163
|
+
var krDatasClone = (0, _cloneDeep["default"])(krDatasRef.current);
|
|
164
|
+
var krsCount = krDatasClone.length;
|
|
165
|
+
setKrIsValidate(false);
|
|
166
|
+
setTimeout(function () {
|
|
167
|
+
if (!wrapperRef.current || krsCount < 6) return;
|
|
168
|
+
wrapperRef.current.scrollTop = wrapperRef.current.scrollHeight;
|
|
169
|
+
}, 0);
|
|
170
|
+
|
|
171
|
+
if (!isCustomWeight) {
|
|
172
|
+
var krWeight = (0, _roundWeight.RoundWeight)(100 / (krsCount + 1));
|
|
200
173
|
|
|
201
|
-
|
|
174
|
+
var _newKrs = [].concat(_toConsumableArray(krDatasClone.map(function (kr) {
|
|
175
|
+
return _objectSpread(_objectSpread({}, kr), {}, {
|
|
176
|
+
krWeight: krWeight
|
|
177
|
+
});
|
|
178
|
+
})), [{
|
|
179
|
+
uuid: _uuid["default"].v1(),
|
|
180
|
+
principalId: Id,
|
|
181
|
+
principalName: Name,
|
|
182
|
+
userAvatar: UserAvatar,
|
|
183
|
+
krWeight: krWeight,
|
|
184
|
+
mileStoneName: '',
|
|
185
|
+
mileStoneNamePureTextExcludeAt: '',
|
|
186
|
+
mileStoneNameRichText: undefined,
|
|
187
|
+
aiteUsers: [],
|
|
188
|
+
confidenceIndex: 5
|
|
189
|
+
}]);
|
|
190
|
+
|
|
191
|
+
setKrDatas(_newKrs);
|
|
192
|
+
krDatasRef.current = _newKrs;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
var newKrs = [].concat(_toConsumableArray(krDatasClone), [{
|
|
197
|
+
uuid: _uuid["default"].v1(),
|
|
198
|
+
principalId: Id,
|
|
199
|
+
principalName: Name,
|
|
200
|
+
userAvatar: UserAvatar,
|
|
201
|
+
krWeight: 0,
|
|
202
|
+
mileStoneName: '',
|
|
203
|
+
mileStoneNamePureTextExcludeAt: '',
|
|
204
|
+
mileStoneNameRichText: undefined,
|
|
205
|
+
aiteUsers: [],
|
|
206
|
+
confidenceIndex: 5
|
|
207
|
+
}]);
|
|
208
|
+
setKrDatas(newKrs);
|
|
209
|
+
krDatasRef.current = newKrs;
|
|
210
|
+
} // 修改KR
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
var _changeKr = (0, _react.useCallback)(function (kr, index) {
|
|
214
|
+
if (krDatasRef.current[index].krWeight !== kr.krWeight) {
|
|
202
215
|
setIsCustomWeight(true);
|
|
203
216
|
}
|
|
204
217
|
|
|
205
|
-
var newKrs = _toConsumableArray(
|
|
218
|
+
var newKrs = _toConsumableArray(krDatasRef.current);
|
|
206
219
|
|
|
207
220
|
newKrs[index] = kr;
|
|
208
221
|
setKrDatas(newKrs);
|
|
222
|
+
krDatasRef.current = newKrs;
|
|
209
223
|
setInputKrInfo(kr);
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
(0, _react.useEffect)(function () {
|
|
213
|
-
// 防抖
|
|
214
|
-
krNameIsEmpty.current = !inputKrInfo || !inputKrInfo.mileStoneName;
|
|
215
|
-
|
|
216
|
-
if (!inputKrInfo || !inputKrInfo.mileStoneName) {
|
|
217
|
-
setIsInputContent(false);
|
|
218
|
-
setKrsCheckResult({
|
|
219
|
-
finalResult: _okrCreateSuggest.EOkrCreateSuggestResultType.normal,
|
|
220
|
-
friendlyResult: []
|
|
221
|
-
});
|
|
222
|
-
} else if (timerRef.current) {
|
|
223
|
-
clearTimeout(timerRef.current);
|
|
224
|
-
timerRef.current = setTimeout(getKrAnalysisInfo, 1000);
|
|
225
|
-
} else {
|
|
226
|
-
timerRef.current = setTimeout(getKrAnalysisInfo, 1000);
|
|
227
|
-
}
|
|
224
|
+
}, [krDatasRef.current]); // 删除KR
|
|
228
225
|
|
|
229
|
-
return function () {
|
|
230
|
-
clearTimeout(timerRef.current);
|
|
231
|
-
};
|
|
232
|
-
}, [inputKrInfo, setIsInputContent]); // 删除KR
|
|
233
226
|
|
|
234
227
|
var deleteKr = function deleteKr(id) {
|
|
228
|
+
var krDatasClone = (0, _cloneDeep["default"])(krDatasRef.current);
|
|
235
229
|
setKrIsValidate(false);
|
|
236
|
-
var newKrDatas =
|
|
230
|
+
var newKrDatas = krDatasClone.filter(function (k) {
|
|
237
231
|
return k.uuid !== id;
|
|
238
232
|
});
|
|
239
233
|
|
|
@@ -246,6 +240,7 @@ function KrDatas(props) {
|
|
|
246
240
|
}
|
|
247
241
|
|
|
248
242
|
setKrDatas(newKrDatas);
|
|
243
|
+
krDatasRef.current = newKrDatas;
|
|
249
244
|
|
|
250
245
|
var tempKrCheckResult = _toConsumableArray(krsCheckFriendlyResult);
|
|
251
246
|
|
|
@@ -266,16 +261,39 @@ function KrDatas(props) {
|
|
|
266
261
|
|
|
267
262
|
var onKrInputStateChange = (0, _react.useCallback)(function (isFocus, krInfo) {
|
|
268
263
|
setInputKrInfo(krInfo);
|
|
264
|
+
handleKrInputStateChange === null || handleKrInputStateChange === void 0 ? void 0 : handleKrInputStateChange(isFocus);
|
|
265
|
+
}, []);
|
|
266
|
+
(0, _react.useEffect)(function () {
|
|
267
|
+
// 防抖
|
|
268
|
+
krNameIsEmpty.current = !inputKrInfo || !inputKrInfo.mileStoneName;
|
|
269
269
|
|
|
270
|
-
if (
|
|
271
|
-
|
|
270
|
+
if (!inputKrInfo || !inputKrInfo.mileStoneName) {
|
|
271
|
+
setIsInputContent(false);
|
|
272
|
+
setKrsCheckResult({
|
|
273
|
+
finalResult: _okrCreateSuggest.EOkrCreateSuggestResultType.normal,
|
|
274
|
+
friendlyResult: []
|
|
275
|
+
});
|
|
276
|
+
} else if (timerRef.current) {
|
|
277
|
+
clearTimeout(timerRef.current);
|
|
278
|
+
timerRef.current = setTimeout(getKrAnalysisInfo, 1000);
|
|
279
|
+
} else {
|
|
280
|
+
timerRef.current = setTimeout(getKrAnalysisInfo, 1000);
|
|
272
281
|
}
|
|
282
|
+
|
|
283
|
+
return function () {
|
|
284
|
+
clearTimeout(timerRef.current);
|
|
285
|
+
};
|
|
286
|
+
}, [inputKrInfo, setIsInputContent]);
|
|
287
|
+
(0, _react.useEffect)(function () {
|
|
288
|
+
krDatasRef.current = krDatas;
|
|
273
289
|
}, []);
|
|
274
|
-
return /*#__PURE__*/_react["default"].createElement("div", null,
|
|
290
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, krDatasRef.current.map(function (kr, index) {
|
|
275
291
|
return /*#__PURE__*/_react["default"].createElement(_krItem["default"], {
|
|
276
292
|
key: kr === null || kr === void 0 ? void 0 : kr.uuid,
|
|
277
293
|
krData: kr,
|
|
278
|
-
changeKr: changeKr
|
|
294
|
+
changeKr: function changeKr(newKr) {
|
|
295
|
+
return _changeKr(newKr, index);
|
|
296
|
+
},
|
|
279
297
|
deleteKr: deleteKr,
|
|
280
298
|
container: container,
|
|
281
299
|
index: index + 1,
|
|
@@ -292,7 +310,7 @@ function KrDatas(props) {
|
|
|
292
310
|
className: "add-kr-btn__icon",
|
|
293
311
|
src: _krAdd["default"],
|
|
294
312
|
alt: ""
|
|
295
|
-
}), (0, _getLocale.getLocale)('OKR_MyO_Pop_Butt_AddKR')),
|
|
313
|
+
}), (0, _getLocale.getLocale)('OKR_MyO_Pop_Butt_AddKR')), krDatasRef.current.length > 0 && openKrWeight && /*#__PURE__*/_react["default"].createElement("span", {
|
|
296
314
|
className: "krs-info__total-weight"
|
|
297
315
|
}, (0, _getLocale.getLocale)('OKR_MyO_Pop_Text_Total'), total, "%")));
|
|
298
316
|
}
|
|
@@ -9,6 +9,8 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
12
14
|
var _richEditor = require("@titaui/rich-editor");
|
|
13
15
|
|
|
14
16
|
var _bsGlobal = require("../../../utils/bs-global");
|
|
@@ -35,54 +37,37 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
35
37
|
|
|
36
38
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
37
39
|
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
function KrItem(_ref) {
|
|
51
|
-
var krData = _ref.krData,
|
|
52
|
-
changeKr = _ref.changeKr,
|
|
53
|
-
deleteKr = _ref.deleteKr,
|
|
54
|
-
container = _ref.container,
|
|
55
|
-
index = _ref.index,
|
|
56
|
-
onKrInputStateChange = _ref.onKrInputStateChange,
|
|
57
|
-
onAddKr = _ref.onAddKr,
|
|
58
|
-
setIsInputContent = _ref.setIsInputContent,
|
|
59
|
-
domRef = _ref.domRef,
|
|
60
|
-
krIsValidate = _ref.krIsValidate;
|
|
40
|
+
function KrItem(props) {
|
|
41
|
+
var krData = props.krData,
|
|
42
|
+
changeKr = props.changeKr,
|
|
43
|
+
deleteKr = props.deleteKr,
|
|
44
|
+
container = props.container,
|
|
45
|
+
index = props.index,
|
|
46
|
+
onKrInputStateChange = props.onKrInputStateChange,
|
|
47
|
+
onAddKr = props.onAddKr,
|
|
48
|
+
setIsInputContent = props.setIsInputContent,
|
|
49
|
+
domRef = props.domRef,
|
|
50
|
+
krIsValidate = props.krIsValidate;
|
|
61
51
|
var setting = (0, _bsGlobal.getBSGlobal)('OkrAdvancedSetting').KRSetting;
|
|
62
52
|
var openKrWeight = setting.KrWeight;
|
|
63
|
-
|
|
64
|
-
var _useState = (0, _react.useState)(false),
|
|
65
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
66
|
-
showDelIcon = _useState2[0],
|
|
67
|
-
setShowDelIcon = _useState2[1];
|
|
68
|
-
|
|
69
53
|
var mentionInputRef = (0, _react.useRef)();
|
|
70
54
|
var oldKrNameRef = (0, _react.useRef)('');
|
|
55
|
+
var krDataRef = (0, _react.useRef)(krData);
|
|
71
56
|
|
|
72
57
|
var onUserSelectorSubmitHandler = function onUserSelectorSubmitHandler(users) {
|
|
73
|
-
changeKr(_objectSpread(_objectSpread({},
|
|
58
|
+
changeKr(_objectSpread(_objectSpread({}, krDataRef.current), {}, {
|
|
74
59
|
principalId: users[0].Id,
|
|
75
60
|
principalName: users[0].Name,
|
|
76
61
|
userAvatar: users[0].UserAvatar
|
|
77
62
|
}));
|
|
78
63
|
};
|
|
79
64
|
|
|
80
|
-
var onKrNameInputChangeHandler = function
|
|
81
|
-
var mentionUsers =
|
|
82
|
-
pureText =
|
|
83
|
-
pureTextExcludeAt =
|
|
84
|
-
richText =
|
|
85
|
-
changeKr(_objectSpread(_objectSpread({},
|
|
65
|
+
var onKrNameInputChangeHandler = (0, _react.useCallback)(function (data) {
|
|
66
|
+
var mentionUsers = data.mentionUsers,
|
|
67
|
+
pureText = data.pureText,
|
|
68
|
+
pureTextExcludeAt = data.pureTextExcludeAt,
|
|
69
|
+
richText = data.richText;
|
|
70
|
+
changeKr(_objectSpread(_objectSpread({}, krDataRef.current), {}, {
|
|
86
71
|
mileStoneName: pureText,
|
|
87
72
|
mileStoneNameRichText: richText,
|
|
88
73
|
mileStoneNamePureTextExcludeAt: pureTextExcludeAt,
|
|
@@ -90,10 +75,10 @@ function KrItem(_ref) {
|
|
|
90
75
|
return user.mentionId;
|
|
91
76
|
})
|
|
92
77
|
}));
|
|
93
|
-
};
|
|
78
|
+
}, []);
|
|
94
79
|
|
|
95
80
|
var onDeleteKrClickHandler = function onDeleteKrClickHandler() {
|
|
96
|
-
deleteKr(krData.uuid);
|
|
81
|
+
return deleteKr(krData.uuid);
|
|
97
82
|
};
|
|
98
83
|
|
|
99
84
|
var formatUser = (0, _react.useMemo)(function () {
|
|
@@ -104,12 +89,6 @@ function KrItem(_ref) {
|
|
|
104
89
|
Id: krData.principalId
|
|
105
90
|
};
|
|
106
91
|
}, [krData.userAvatar.Medium, krData.principalName, krData.principalName, krData.principalId]);
|
|
107
|
-
var handleMouseEnter = (0, _react.useCallback)(function () {
|
|
108
|
-
setShowDelIcon(true);
|
|
109
|
-
}, []);
|
|
110
|
-
var handleMouseLeave = (0, _react.useCallback)(function () {
|
|
111
|
-
setShowDelIcon(false);
|
|
112
|
-
}, []);
|
|
113
92
|
var handleInputFocus = (0, _react.useCallback)(function () {
|
|
114
93
|
onKrInputStateChange && onKrInputStateChange(true, krData);
|
|
115
94
|
}, [krData]);
|
|
@@ -135,26 +114,34 @@ function KrItem(_ref) {
|
|
|
135
114
|
oldKrNameRef.current = e.target.value;
|
|
136
115
|
}
|
|
137
116
|
}, []);
|
|
117
|
+
(0, _react.useEffect)(function () {
|
|
118
|
+
krDataRef.current = krData;
|
|
119
|
+
}, [krData]);
|
|
120
|
+
var _krDataRef$current = krDataRef.current,
|
|
121
|
+
mileStoneNamePureTextExcludeAt = _krDataRef$current.mileStoneNamePureTextExcludeAt,
|
|
122
|
+
mileStoneNameRichText = _krDataRef$current.mileStoneNameRichText;
|
|
123
|
+
var krNameLen = (mileStoneNamePureTextExcludeAt === null || mileStoneNamePureTextExcludeAt === void 0 ? void 0 : mileStoneNamePureTextExcludeAt.length) || 0;
|
|
138
124
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
139
|
-
className: "create-kr-item-wrapper"
|
|
140
|
-
onMouseEnter: handleMouseEnter,
|
|
141
|
-
onMouseLeave: handleMouseLeave
|
|
125
|
+
className: "create-kr-item-wrapper"
|
|
142
126
|
}, /*#__PURE__*/_react["default"].createElement("a", {
|
|
143
|
-
className: "kr-item__delete-icon tu-icon-del
|
|
127
|
+
className: "kr-item__delete-icon tu-icon-del",
|
|
144
128
|
onClick: onDeleteKrClickHandler
|
|
145
129
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
146
|
-
className:
|
|
130
|
+
className: (0, _classnames["default"])('kr-item__right-block', {
|
|
131
|
+
'kr-item__right-block--error': krNameLen > 500
|
|
132
|
+
})
|
|
147
133
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
148
134
|
className: "kr-item__order"
|
|
149
135
|
}, "KR", index), /*#__PURE__*/_react["default"].createElement("div", {
|
|
150
136
|
className: "kr-item__input-wrapper"
|
|
151
137
|
}, /*#__PURE__*/_react["default"].createElement(_inputWithErrPopup["default"], {
|
|
152
|
-
strLength:
|
|
138
|
+
strLength: krNameLen,
|
|
153
139
|
maxLength: 500,
|
|
154
140
|
position: "top"
|
|
155
141
|
}, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
|
|
156
|
-
initialState:
|
|
157
|
-
|
|
142
|
+
initialState: mileStoneNameRichText,
|
|
143
|
+
key: krData === null || krData === void 0 ? void 0 : krData.uuid,
|
|
144
|
+
onDocChange: onKrNameInputChangeHandler,
|
|
158
145
|
onFocus: handleInputFocus,
|
|
159
146
|
onBlur: handleInputBlur,
|
|
160
147
|
onKeyDown: handleOnKeyDown,
|
|
@@ -13,7 +13,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
13
13
|
|
|
14
14
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
15
|
|
|
16
|
-
var Wrapper = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 449px;\n padding: 0 32px;\n
|
|
16
|
+
var Wrapper = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 449px;\n overflow: auto;\n \n .create-modal__wrapper-inner {\n padding: 0 32px;\n }\n"])));
|
|
17
17
|
|
|
18
18
|
exports.Wrapper = Wrapper;
|
|
19
19
|
|
|
@@ -48,17 +48,17 @@ var KrItemWrapper = _styledComponents["default"].div(_templateObject9 || (_templ
|
|
|
48
48
|
exports.KrItemWrapper = KrItemWrapper;
|
|
49
49
|
|
|
50
50
|
var KrEditWrapper = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n height: 36px;\n background: #ffffff;\n border: 1px solid ", ";\n border-radius: 4px;\n ", "\n display: flex;\n align-items: center;\n flex: 1;\n padding: 0 10px;\n transition: border 0.2s ease 0.2s, box-shadow 0.2s ease 0.2s;\n > span {\n font-size: 13px;\n font-weight: 400;\n text-align: left;\n color: #6f7886;\n margin-left: 18px;\n }\n :hover {\n border: 1px solid #2879ff;\n }\n"])), function (p) {
|
|
51
|
-
return p.active ?
|
|
51
|
+
return p.active ? '#2879ff' : '#f0f2f5';
|
|
52
52
|
}, function (p) {
|
|
53
|
-
return p.active ?
|
|
53
|
+
return p.active ? 'box-shadow: 0px 0px 6px 0px rgba(40, 121, 255, 0.3) inset;' : '';
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
exports.KrEditWrapper = KrEditWrapper;
|
|
57
57
|
|
|
58
58
|
var InputWrapper = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n height: 36px;\n background: #ffffff;\n border: 1px solid ", ";\n border-radius: 4px;\n ", "\n display: flex;\n align-items: center;\n flex: 1;\n padding: 0 10px;\n transition: border 0.2s ease 0.2s, box-shadow 0.2s ease 0.2s;\n :hover {\n border: 1px solid #2879ff;\n }\n > input {\n flex: 1;\n border: none;\n padding: 0;\n margin: 0;\n }\n"])), function (p) {
|
|
59
|
-
return p.active ?
|
|
59
|
+
return p.active ? '#2879ff' : '#f0f2f5';
|
|
60
60
|
}, function (p) {
|
|
61
|
-
return p.active ?
|
|
61
|
+
return p.active ? 'box-shadow: 0px 0px 6px 0px rgba(40, 121, 255, 0.3) inset;' : '';
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
exports.InputWrapper = InputWrapper;
|
|
@@ -23,7 +23,7 @@ require("./index.css");
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
25
|
|
|
26
|
-
var prefix =
|
|
26
|
+
var prefix = 'titaui-dynamic-operation';
|
|
27
27
|
|
|
28
28
|
var DynamicOperation = function DynamicOperation(_ref) {
|
|
29
29
|
var feedOperations = _ref.feedOperations,
|
|
@@ -41,20 +41,20 @@ var DynamicOperation = function DynamicOperation(_ref) {
|
|
|
41
41
|
|
|
42
42
|
var handleClickShowAll = function handleClickShowAll() {
|
|
43
43
|
if (feedType === _constant.EFeedType.Kr) {
|
|
44
|
-
_drawerManager["default"].open(
|
|
44
|
+
_drawerManager["default"].open('krDetail', {
|
|
45
45
|
krId: krId
|
|
46
46
|
});
|
|
47
47
|
} else if (feedType === _constant.EFeedType.O) {
|
|
48
|
-
_drawerManager["default"].open(
|
|
48
|
+
_drawerManager["default"].open('okrDetail', {
|
|
49
49
|
okrId: okrId,
|
|
50
|
-
activeTabKey:
|
|
50
|
+
activeTabKey: 'cooperation'
|
|
51
51
|
});
|
|
52
52
|
} else if (feedType === _constant.EFeedType.Task) {
|
|
53
|
-
window.Talent.app.vent.trigger(
|
|
53
|
+
window.Talent.app.vent.trigger('global-pull-screen', taskId, 'task');
|
|
54
54
|
} else if (feedType === _constant.EFeedType.Project) {
|
|
55
55
|
window.open(window.location.href.replace(window.location.hash, "#work?iTalentNavCode=tita-work&work_id=".concat(workId)));
|
|
56
56
|
} else if (feedType === _constant.EFeedType.MileStone) {
|
|
57
|
-
window.Talent.app.vent.trigger(
|
|
57
|
+
window.Talent.app.vent.trigger('global-pull-screen', mileStoneId, 'milestone', new window.Talent.Model(data), {
|
|
58
58
|
option: true,
|
|
59
59
|
width: 465,
|
|
60
60
|
React: _react["default"],
|
|
@@ -91,7 +91,7 @@ var DynamicOperation = function DynamicOperation(_ref) {
|
|
|
91
91
|
})
|
|
92
92
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
93
93
|
className: "".concat(prefix, "__operate-content")
|
|
94
|
-
}, (0, _openData.parseHtmlAndTextTag)(content)))), index === 2 && feedOperations.total > 3 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
94
|
+
}, (0, _openData.parseString)((0, _openData.parseHtmlAndTextTag)(content))))), index === 2 && feedOperations.total > 3 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
95
95
|
className: "".concat(prefix, "__operate-item")
|
|
96
96
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
97
97
|
className: "".concat(prefix, "__operate-icon"),
|
|
@@ -103,7 +103,7 @@ var DynamicOperation = function DynamicOperation(_ref) {
|
|
|
103
103
|
}, "\u5168\u90E8\u64CD\u4F5C", /*#__PURE__*/_react["default"].createElement("span", {
|
|
104
104
|
className: "".concat(prefix, "__operate-item-total-num")
|
|
105
105
|
}, feedOperations.total), /*#__PURE__*/_react["default"].createElement("i", {
|
|
106
|
-
className: (0, _classnames["default"])(
|
|
106
|
+
className: (0, _classnames["default"])('tu-icon-APP-xi')
|
|
107
107
|
}))));
|
|
108
108
|
}));
|
|
109
109
|
};
|
|
@@ -47,7 +47,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
47
47
|
|
|
48
48
|
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; }
|
|
49
49
|
|
|
50
|
-
var prefix =
|
|
50
|
+
var prefix = 'titaui-dynamic-create-o-item';
|
|
51
51
|
|
|
52
52
|
var DynamicCreateO = function DynamicCreateO(_ref) {
|
|
53
53
|
var data = _ref.data,
|
|
@@ -72,39 +72,39 @@ var DynamicCreateO = function DynamicCreateO(_ref) {
|
|
|
72
72
|
searchKeyWord = _useContext.searchKeyWord;
|
|
73
73
|
|
|
74
74
|
var handleClickOTitle = function handleClickOTitle() {
|
|
75
|
-
_drawerManager["default"].open(
|
|
75
|
+
_drawerManager["default"].open('okrDetail', {
|
|
76
76
|
okrId: okrId
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
var handleClickKrTitle = function handleClickKrTitle(id) {
|
|
81
|
-
_drawerManager["default"].open(
|
|
81
|
+
_drawerManager["default"].open('krDetail', {
|
|
82
82
|
krId: id
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
var okrTypeMap = {
|
|
87
87
|
1: {
|
|
88
|
-
icon:
|
|
89
|
-
text: (0, _getLocale.getLocale)(
|
|
88
|
+
icon: 'tu-icon-liebiao-geren',
|
|
89
|
+
text: (0, _getLocale.getLocale)('OKR_MyO_Pop_Individual')
|
|
90
90
|
},
|
|
91
91
|
// 个人
|
|
92
92
|
2: {
|
|
93
|
-
icon:
|
|
94
|
-
text: okrTypeId === -1 ?
|
|
93
|
+
icon: 'tu-icon-liebiao-xiashu',
|
|
94
|
+
text: okrTypeId === -1 ? '默认部门' : /*#__PURE__*/_react["default"].createElement(_openData.OpenDepartmentName, {
|
|
95
95
|
id: okrTypeId,
|
|
96
96
|
name: okrTypeName
|
|
97
97
|
})
|
|
98
98
|
},
|
|
99
99
|
// 部门
|
|
100
100
|
3: {
|
|
101
|
-
icon:
|
|
102
|
-
text: (0, _getLocale.getLocale)(
|
|
101
|
+
icon: 'tu-icon-gong_si',
|
|
102
|
+
text: (0, _getLocale.getLocale)('OKR_MyO_Pop_Company')
|
|
103
103
|
},
|
|
104
104
|
// 公司
|
|
105
105
|
4: {
|
|
106
|
-
icon:
|
|
107
|
-
text: okrTypeName || (0, _getLocale.getLocale)(
|
|
106
|
+
icon: 'tu-icon-liebiao-tuandui',
|
|
107
|
+
text: okrTypeName || (0, _getLocale.getLocale)('OKR_MyO_Text_Team')
|
|
108
108
|
} // 团队
|
|
109
109
|
|
|
110
110
|
};
|
|
@@ -112,15 +112,15 @@ var DynamicCreateO = function DynamicCreateO(_ref) {
|
|
|
112
112
|
|
|
113
113
|
if (!okrTypeInfo) {
|
|
114
114
|
okrTypeInfo = {
|
|
115
|
-
icon:
|
|
116
|
-
text: (0, _getLocale.getLocale)(
|
|
115
|
+
icon: 'tu-icon-liebiao-geren',
|
|
116
|
+
text: (0, _getLocale.getLocale)('OKR_Menu_Title_Others')
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
var renderDesc = (0, _react.useMemo)(function () {
|
|
121
121
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
122
122
|
className: "".concat(prefix, "__operate-desc")
|
|
123
|
-
}, (0, _getLocale.getLocale)(
|
|
123
|
+
}, (0, _getLocale.getLocale)('Mod_InChargeof'), (0, _getLocale.getLocale)('Mod_Objective'));
|
|
124
124
|
}, []);
|
|
125
125
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
126
126
|
className: prefix
|
|
@@ -136,9 +136,9 @@ var DynamicCreateO = function DynamicCreateO(_ref) {
|
|
|
136
136
|
}, /*#__PURE__*/_react["default"].createElement(_progress["default"].Circle, {
|
|
137
137
|
linear: true,
|
|
138
138
|
linearId: data.feedId,
|
|
139
|
-
linearStartColor: (0, _util.getProcessColor)(okrStatus, riskLevel,
|
|
140
|
-
linearEndColor: (0, _util.getProcessColor)(okrStatus, riskLevel,
|
|
141
|
-
backgroundColor: (0, _util.getProcessColor)(okrStatus, riskLevel,
|
|
139
|
+
linearStartColor: (0, _util.getProcessColor)(okrStatus, riskLevel, 'linearStartColor'),
|
|
140
|
+
linearEndColor: (0, _util.getProcessColor)(okrStatus, riskLevel, 'linearEndColor'),
|
|
141
|
+
backgroundColor: (0, _util.getProcessColor)(okrStatus, riskLevel, 'backgroundColor'),
|
|
142
142
|
percent: Number.parseInt(okrProgress || 0, 10),
|
|
143
143
|
showTextContent: true,
|
|
144
144
|
size: 48,
|
|
@@ -179,7 +179,7 @@ var DynamicCreateO = function DynamicCreateO(_ref) {
|
|
|
179
179
|
handleClickKrTitle(kr.krId);
|
|
180
180
|
}
|
|
181
181
|
}, /*#__PURE__*/_react["default"].createElement(_searchKeyHandle["default"], {
|
|
182
|
-
str: (0, _tools.htmlDecodeByRegExp)(kr.krName),
|
|
182
|
+
str: (0, _openData.parseString)((0, _tools.htmlDecodeByRegExp)(kr.krName)),
|
|
183
183
|
keyWord: searchKeyWord
|
|
184
184
|
})));
|
|
185
185
|
}))))));
|
|
@@ -106,9 +106,9 @@ var Menu = function Menu(_ref) {
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
(0, _react.useEffect)(function () {
|
|
109
|
-
var
|
|
109
|
+
var cacheIsKnow = localStorage.getItem("isNewMenuItem__".concat(userId));
|
|
110
110
|
|
|
111
|
-
if (
|
|
111
|
+
if (cacheIsKnow) {
|
|
112
112
|
setIsKonw(true);
|
|
113
113
|
}
|
|
114
114
|
}, []);
|
|
@@ -146,7 +146,8 @@ var Menu = function Menu(_ref) {
|
|
|
146
146
|
popup: menu.href === NEWMENUS ? popup : null,
|
|
147
147
|
mask: false,
|
|
148
148
|
action: ['focus'],
|
|
149
|
-
popupAlign: NewFeatureGuidePopupAlign
|
|
149
|
+
popupAlign: NewFeatureGuidePopupAlign,
|
|
150
|
+
zIndex: 1000
|
|
150
151
|
}, /*#__PURE__*/_react["default"].createElement("a", {
|
|
151
152
|
className: (0, _classnames["default"])("".concat(prefix, "__menu-show"), _defineProperty({}, "".concat(prefix, "__menu-show--active"), activeMenuId === menu.id)),
|
|
152
153
|
href: href,
|
|
@@ -191,7 +191,7 @@ function EditNameCmp(props) {
|
|
|
191
191
|
editable: editable,
|
|
192
192
|
initialState: okrNameData.richText,
|
|
193
193
|
manualWrap: true,
|
|
194
|
-
|
|
194
|
+
onDocChange: onChangeHandler,
|
|
195
195
|
onFocus: onFocusHandler,
|
|
196
196
|
ref: mentionInputRef
|
|
197
197
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
color: #89919f;
|
|
45
45
|
display: inline-block;
|
|
46
46
|
vertical-align: middle;
|
|
47
|
+
white-space: nowrap;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
.okr-drawer-header__classify--editable:hover {
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
vertical-align: middle;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
.okr-drawer-header__action-item {
|
|
77
|
+
.okr-drawer-header__action-item:not(:empty) {
|
|
77
78
|
margin-right: 12px;
|
|
78
79
|
}
|
|
79
80
|
|
|
@@ -110,7 +110,7 @@ var OClassify = function OClassify(props) {
|
|
|
110
110
|
}, okrClassify == 1 ? (0, _getLocale.getLocale)('OKR_MyO_Es_Commitment') : (0, _getLocale.getLocale)('OKR_MyO_Es_Visiontype'));
|
|
111
111
|
}, [okrClassify, editable]);
|
|
112
112
|
|
|
113
|
-
if (editable) {
|
|
113
|
+
if (editable && okrClassify !== 0) {
|
|
114
114
|
var popContent = /*#__PURE__*/_react["default"].createElement("div", {
|
|
115
115
|
className: "okr-drawer-header__classify-popup"
|
|
116
116
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -144,6 +144,7 @@ var OClassify = function OClassify(props) {
|
|
|
144
144
|
}, renderTrigger);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
if (okrClassify === 0) return null;
|
|
147
148
|
return renderTrigger;
|
|
148
149
|
};
|
|
149
150
|
|