@titaui/pc 1.12.7 → 1.12.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/change-okr-modal/Item.js +19 -18
- package/lib/components/change-okr-modal/styledComponents.js +9 -9
- 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/dynamic/components/title/index.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/nav-top/components/menu/index.js +3 -3
- 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/ao-nice/index.css +0 -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 +154 -0
- package/lib/components/okr-detail/components/header/o-name.js +7 -5
- package/lib/components/okr-detail/components/o-progress-update/index.js +2 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +3 -1
- 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/components/tab-panel-content/index.css +1 -0
- package/lib/components/okr-detail/detail-header/index.js +11 -5
- 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 +6 -6
- 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/o-progress-update/index.js +2 -2
- 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 +187 -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 +97 -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/search-key-handle/index.js +12 -10
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +2 -2
- 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/upload/components/uploadedPreview.js +17 -17
- package/lib/components/upload/index.js +23 -23
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +14 -14
- package/lib/components/user-selector/searched-panel/index.js +4 -4
- 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 +15 -15
- package/lib/utils/hooks.js +5 -5
- package/lib/utils/open-data.js +216 -66
- package/lib/utils/tita-okr-cycle.js +3 -3
- 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
|
+
}
|
|
@@ -96,16 +96,16 @@ var _getUserInfo = (0, _bsGlobal.getUserInfo)(),
|
|
|
96
96
|
Id = _getUserInfo.Id,
|
|
97
97
|
UserAvatar = _getUserInfo.UserAvatar;
|
|
98
98
|
|
|
99
|
-
var preCls =
|
|
99
|
+
var preCls = 'okr-detail-okrs-list';
|
|
100
100
|
|
|
101
101
|
var treeDataFormate = function treeDataFormate(nodes) {
|
|
102
|
-
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
102
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'kr';
|
|
103
103
|
var canEditOkr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
104
104
|
var formateNodes = [];
|
|
105
105
|
nodes.forEach(function (it, index) {
|
|
106
|
-
var title = "";
|
|
107
|
-
|
|
108
|
-
if (type ==
|
|
106
|
+
var title = ''; // if (type == "kr" || type == "kr-parent") title = it.mileStoneName;
|
|
107
|
+
|
|
108
|
+
if (type == 'o-child' || type == 'o-parent') title = it.workName;
|
|
109
109
|
formateNodes.push({
|
|
110
110
|
key: it.mileStoneId,
|
|
111
111
|
index: index,
|
|
@@ -208,7 +208,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
if (authChildWorks.length > 0) {
|
|
211
|
-
setChildOkrs(treeDataFormate(authChildWorks,
|
|
211
|
+
setChildOkrs(treeDataFormate(authChildWorks, 'o-child'));
|
|
212
212
|
} else {
|
|
213
213
|
setChildOkrs(null);
|
|
214
214
|
}
|
|
@@ -279,7 +279,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
279
279
|
updateKrs();
|
|
280
280
|
}, []);
|
|
281
281
|
(0, _react.useEffect)(function () {
|
|
282
|
-
var strucKrs = treeDataFormate(pureKrs,
|
|
282
|
+
var strucKrs = treeDataFormate(pureKrs, 'kr', canEditOkr);
|
|
283
283
|
setKrs(strucKrs);
|
|
284
284
|
}, [pureKrs, canEditOkr]);
|
|
285
285
|
|
|
@@ -287,7 +287,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
287
287
|
refreshAll();
|
|
288
288
|
updateKrs();
|
|
289
289
|
|
|
290
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
290
|
+
_toast["default"].Success((0, _getLocale.getLocale)('OKR_Db_Success'), {
|
|
291
291
|
canClose: false
|
|
292
292
|
});
|
|
293
293
|
};
|
|
@@ -326,7 +326,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
326
326
|
|
|
327
327
|
(0, _requestApis.updateParentId)(params).then(function (data) {
|
|
328
328
|
if (data.Code == 1) {
|
|
329
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
329
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
330
330
|
|
|
331
331
|
setGeneralParent({
|
|
332
332
|
parentId: params.parentId,
|
|
@@ -378,7 +378,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
378
378
|
if (!canEditOkr) return;
|
|
379
379
|
var dropNode = info.node;
|
|
380
380
|
var dragNode = info.dragNode;
|
|
381
|
-
var dropPos = info.node.pos.split(
|
|
381
|
+
var dropPos = info.node.pos.split('-');
|
|
382
382
|
var dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]); // 移动类型,after 1 before 2
|
|
383
383
|
|
|
384
384
|
var isDown = dropPosition != -1;
|
|
@@ -412,17 +412,17 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
412
412
|
parentOkr: parentOkr
|
|
413
413
|
});
|
|
414
414
|
|
|
415
|
-
okrParent = treeDataFormate([newParentKr],
|
|
415
|
+
okrParent = treeDataFormate([newParentKr], 'kr-parent');
|
|
416
416
|
} else if (parentOkr) {
|
|
417
|
-
okrParent = treeDataFormate([parentOkr],
|
|
417
|
+
okrParent = treeDataFormate([parentOkr], 'o-parent');
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
var isShowAlignOkr = (0, _react.useMemo)(function () {
|
|
421
|
-
return childOkrs && childOkrs.length > 0 // 有子目标
|
|
422
|
-
||
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
421
|
+
return childOkrs && childOkrs.length > 0 || // 有子目标
|
|
422
|
+
parentOkr || // 有父目标
|
|
423
|
+
!parentOkr && canEditOkr;
|
|
424
|
+
}, // 无父目标但有权限编辑
|
|
425
|
+
[parentOkr, childOkrs, canEditOkr]);
|
|
426
426
|
|
|
427
427
|
var renderKrs = function renderKrs() {
|
|
428
428
|
var _classNames;
|
|
@@ -434,9 +434,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
434
434
|
},
|
|
435
435
|
canEditOkr: canEditOkr || isInnerUser,
|
|
436
436
|
style: isShowAlignOkr ? {
|
|
437
|
-
padding:
|
|
437
|
+
padding: '40px 0 24px 0'
|
|
438
438
|
} : {
|
|
439
|
-
padding:
|
|
439
|
+
padding: '100px 0'
|
|
440
440
|
}
|
|
441
441
|
});
|
|
442
442
|
}
|
|
@@ -451,7 +451,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
451
451
|
okrInfo: okrInfo,
|
|
452
452
|
draggable: canEditOkr && (okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState) === _helper.EApproveStatus.UnderApproval,
|
|
453
453
|
onDrop: onOkrItemDropHandler
|
|
454
|
-
}))), (canEditOkr || isInnerUser) && (0, _helper.getApprovalOkr)(approvalSetting,
|
|
454
|
+
}))), (canEditOkr || isInnerUser) && (0, _helper.getApprovalOkr)(approvalSetting, 'createOkr', okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
455
455
|
ref: wrapperRef,
|
|
456
456
|
className: (0, _classnames["default"])("".concat(preCls, "__addkr"))
|
|
457
457
|
}, /*#__PURE__*/_react["default"].createElement(_paddingLayout["default"], null, createKrShow ? /*#__PURE__*/_react["default"].createElement(_createKrItem["default"], {
|
|
@@ -470,10 +470,10 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
470
470
|
return setCreateKrShow(true);
|
|
471
471
|
}
|
|
472
472
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
473
|
-
className: (0, _classnames["default"])("".concat(preCls, "__addkr-prefix"),
|
|
473
|
+
className: (0, _classnames["default"])("".concat(preCls, "__addkr-prefix"), 'tu-icon-add1')
|
|
474
474
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
475
475
|
className: (0, _classnames["default"])("".concat(preCls, "__addkr-text"))
|
|
476
|
-
}, (0, _getLocale.getLocale)(
|
|
476
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Pop_Butt_AddKR'))))));
|
|
477
477
|
};
|
|
478
478
|
|
|
479
479
|
return /*#__PURE__*/_react["default"].createElement(_context2.OkrListContext.Provider, {
|
|
@@ -489,13 +489,13 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
489
489
|
className: (0, _classnames["default"])(preCls)
|
|
490
490
|
}, !loading ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, renderKrs(), isShowAlignOkr && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_blockLine["default"], {
|
|
491
491
|
style: {
|
|
492
|
-
padding:
|
|
492
|
+
padding: '0 32px'
|
|
493
493
|
}
|
|
494
494
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
495
495
|
className: (0, _classnames["default"])("".concat(preCls, "__align-to"))
|
|
496
496
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
497
497
|
className: (0, _classnames["default"])("".concat(preCls, "__align-to-title"))
|
|
498
|
-
}, (0, _getLocale.getLocale)(
|
|
498
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Pop_SetAlignment')), !parentOkr && canEditOkr ? /*#__PURE__*/_react["default"].createElement(_addParentOkr["default"], {
|
|
499
499
|
onClick: onAddParentOkrHandler
|
|
500
500
|
}) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
501
501
|
className: (0, _classnames["default"])("".concat(preCls, "__align-to-tree"))
|
|
@@ -508,7 +508,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
508
508
|
onClick: function onClick() {
|
|
509
509
|
return setIsOpened(!isOpened);
|
|
510
510
|
}
|
|
511
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)(
|
|
511
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_KRP_OKRs_Alignedmeobje'), "\uFF08", childOkrs.length, "\uFF09")), /*#__PURE__*/_react["default"].createElement(_reactCollapse.Collapse, {
|
|
512
512
|
isOpened: isOpened
|
|
513
513
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
514
514
|
className: (0, _classnames["default"])("".concat(preCls, "__align-on-tree"))
|