@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
|
@@ -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 =
|
|
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
|
-
|
|
68
|
-
|
|
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)) !=
|
|
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
|
|
109
|
+
var mentionInputRef = (0, _react.useRef)();
|
|
110
|
+
var pendingRef = (0, _react.useRef)(false);
|
|
103
111
|
dataRef.current = _objectSpread(_objectSpread({}, dataRef.current), {}, {
|
|
104
|
-
|
|
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
|
|
121
|
+
var createKr = (0, _react.useCallback)(function () {
|
|
114
122
|
// 选中了选人组件中的item
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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:
|
|
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
|
-
|
|
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() ==
|
|
156
|
-
|
|
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:
|
|
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),
|
|
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(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
228
|
-
|
|
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 ?
|
|
253
|
+
display: showTip ? 'block' : 'none',
|
|
232
254
|
zIndex: 1
|
|
233
255
|
},
|
|
234
256
|
onClick: stopPropagation
|
|
235
|
-
}, (0, _getLocale.getLocale)(
|
|
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)(
|
|
259
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Butt_Nexttime')), /*#__PURE__*/_react["default"].createElement("a", {
|
|
238
260
|
onClick: onNoMoreShow
|
|
239
|
-
}, (0, _getLocale.getLocale)(
|
|
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:
|
|
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
|
+
}
|
|
@@ -94,16 +94,16 @@ var _getUserInfo = (0, _bsGlobal.getUserInfo)(),
|
|
|
94
94
|
Id = _getUserInfo.Id,
|
|
95
95
|
UserAvatar = _getUserInfo.UserAvatar;
|
|
96
96
|
|
|
97
|
-
var preCls =
|
|
97
|
+
var preCls = 'okr-detail-okrs-list';
|
|
98
98
|
|
|
99
99
|
var treeDataFormate = function treeDataFormate(nodes) {
|
|
100
|
-
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
100
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'kr';
|
|
101
101
|
var canEditOkr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
102
102
|
var formateNodes = [];
|
|
103
103
|
nodes.forEach(function (it, index) {
|
|
104
|
-
var title = "";
|
|
105
|
-
|
|
106
|
-
if (type ==
|
|
104
|
+
var title = ''; // if (type == "kr" || type == "kr-parent") title = it.mileStoneName;
|
|
105
|
+
|
|
106
|
+
if (type == 'o-child' || type == 'o-parent') title = it.workName;
|
|
107
107
|
formateNodes.push({
|
|
108
108
|
key: it.mileStoneId,
|
|
109
109
|
index: index,
|
|
@@ -206,7 +206,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
206
206
|
});
|
|
207
207
|
|
|
208
208
|
if (authChildWorks.length > 0) {
|
|
209
|
-
setChildOkrs(treeDataFormate(authChildWorks,
|
|
209
|
+
setChildOkrs(treeDataFormate(authChildWorks, 'o-child'));
|
|
210
210
|
} else {
|
|
211
211
|
setChildOkrs(null);
|
|
212
212
|
}
|
|
@@ -277,7 +277,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
277
277
|
updateKrs();
|
|
278
278
|
}, []);
|
|
279
279
|
(0, _react.useEffect)(function () {
|
|
280
|
-
var strucKrs = treeDataFormate(pureKrs,
|
|
280
|
+
var strucKrs = treeDataFormate(pureKrs, 'kr', canEditOkr);
|
|
281
281
|
setKrs(strucKrs);
|
|
282
282
|
}, [pureKrs, canEditOkr]);
|
|
283
283
|
|
|
@@ -285,7 +285,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
285
285
|
refreshAll();
|
|
286
286
|
updateKrs();
|
|
287
287
|
|
|
288
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
288
|
+
_toast["default"].Success((0, _getLocale.getLocale)('OKR_Db_Success'), {
|
|
289
289
|
canClose: false
|
|
290
290
|
});
|
|
291
291
|
};
|
|
@@ -324,7 +324,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
324
324
|
|
|
325
325
|
(0, _requestApis.updateParentId)(params).then(function (data) {
|
|
326
326
|
if (data.Code == 1) {
|
|
327
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
327
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
328
328
|
|
|
329
329
|
setGeneralParent({
|
|
330
330
|
parentId: params.parentId,
|
|
@@ -376,7 +376,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
376
376
|
if (!canEditOkr) return;
|
|
377
377
|
var dropNode = info.node;
|
|
378
378
|
var dragNode = info.dragNode;
|
|
379
|
-
var dropPos = info.node.pos.split(
|
|
379
|
+
var dropPos = info.node.pos.split('-');
|
|
380
380
|
var dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]); // 移动类型,after 1 before 2
|
|
381
381
|
|
|
382
382
|
var isDown = dropPosition != -1;
|
|
@@ -410,17 +410,17 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
410
410
|
parentOkr: parentOkr
|
|
411
411
|
});
|
|
412
412
|
|
|
413
|
-
okrParent = treeDataFormate([newParentKr],
|
|
413
|
+
okrParent = treeDataFormate([newParentKr], 'kr-parent');
|
|
414
414
|
} else if (parentOkr) {
|
|
415
|
-
okrParent = treeDataFormate([parentOkr],
|
|
415
|
+
okrParent = treeDataFormate([parentOkr], 'o-parent');
|
|
416
416
|
}
|
|
417
417
|
|
|
418
418
|
var isShowAlignOkr = (0, _react.useMemo)(function () {
|
|
419
|
-
return childOkrs && childOkrs.length > 0 // 有子目标
|
|
420
|
-
||
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
419
|
+
return childOkrs && childOkrs.length > 0 || // 有子目标
|
|
420
|
+
parentOkr || // 有父目标
|
|
421
|
+
!parentOkr && canEditOkr;
|
|
422
|
+
}, // 无父目标但有权限编辑
|
|
423
|
+
[parentOkr, childOkrs, canEditOkr]);
|
|
424
424
|
|
|
425
425
|
var renderKrs = function renderKrs() {
|
|
426
426
|
var _classNames;
|
|
@@ -432,9 +432,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
432
432
|
},
|
|
433
433
|
canEditOkr: canEditOkr || isInnerUser,
|
|
434
434
|
style: isShowAlignOkr ? {
|
|
435
|
-
padding:
|
|
435
|
+
padding: '40px 0 24px 0'
|
|
436
436
|
} : {
|
|
437
|
-
padding:
|
|
437
|
+
padding: '100px 0'
|
|
438
438
|
}
|
|
439
439
|
});
|
|
440
440
|
}
|
|
@@ -449,7 +449,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
449
449
|
okrInfo: okrInfo,
|
|
450
450
|
draggable: canEditOkr && (okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState) === _helper.EApproveStatus.UnderApproval,
|
|
451
451
|
onDrop: onOkrItemDropHandler
|
|
452
|
-
}))), (canEditOkr || isInnerUser) && (0, _helper.getApprovalOkr)(approvalSetting,
|
|
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", {
|
|
453
453
|
ref: wrapperRef,
|
|
454
454
|
className: (0, _classnames["default"])("".concat(preCls, "__addkr"))
|
|
455
455
|
}, /*#__PURE__*/_react["default"].createElement(_paddingLayout["default"], null, createKrShow ? /*#__PURE__*/_react["default"].createElement(_createKrItem["default"], {
|
|
@@ -468,10 +468,10 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
468
468
|
return setCreateKrShow(true);
|
|
469
469
|
}
|
|
470
470
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
471
|
-
className: (0, _classnames["default"])("".concat(preCls, "__addkr-prefix"),
|
|
471
|
+
className: (0, _classnames["default"])("".concat(preCls, "__addkr-prefix"), 'tu-icon-add1')
|
|
472
472
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
473
473
|
className: (0, _classnames["default"])("".concat(preCls, "__addkr-text"))
|
|
474
|
-
}, (0, _getLocale.getLocale)(
|
|
474
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Pop_Butt_AddKR'))))));
|
|
475
475
|
};
|
|
476
476
|
|
|
477
477
|
return /*#__PURE__*/_react["default"].createElement(_context2.OkrListContext.Provider, {
|
|
@@ -487,13 +487,13 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
487
487
|
className: (0, _classnames["default"])(preCls)
|
|
488
488
|
}, !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
489
|
style: {
|
|
490
|
-
padding:
|
|
490
|
+
padding: '0 32px'
|
|
491
491
|
}
|
|
492
492
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
493
493
|
className: (0, _classnames["default"])("".concat(preCls, "__align-to"))
|
|
494
494
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
495
495
|
className: (0, _classnames["default"])("".concat(preCls, "__align-to-title"))
|
|
496
|
-
}, (0, _getLocale.getLocale)(
|
|
496
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Pop_SetAlignment')), !parentOkr && canEditOkr ? /*#__PURE__*/_react["default"].createElement(_addParentOkr["default"], {
|
|
497
497
|
onClick: onAddParentOkrHandler
|
|
498
498
|
}) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
499
499
|
className: (0, _classnames["default"])("".concat(preCls, "__align-to-tree"))
|
|
@@ -506,7 +506,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
506
506
|
onClick: function onClick() {
|
|
507
507
|
return setIsOpened(!isOpened);
|
|
508
508
|
}
|
|
509
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)(
|
|
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, {
|
|
510
510
|
isOpened: isOpened
|
|
511
511
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
512
512
|
className: (0, _classnames["default"])("".concat(preCls, "__align-on-tree"))
|