@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
|
@@ -99,7 +99,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
99
99
|
|
|
100
100
|
if (fileInput) {
|
|
101
101
|
// @ts-ignore
|
|
102
|
-
fileInput.value =
|
|
102
|
+
fileInput.value = '';
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
|
|
@@ -161,7 +161,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
161
161
|
var uploadStartFile = null;
|
|
162
162
|
var timestamp = new Date().getTime(); // 给每个文件加一个时间戳
|
|
163
163
|
|
|
164
|
-
var uploadFileType = element.name.substring(element.name.lastIndexOf(
|
|
164
|
+
var uploadFileType = element.name.substring(element.name.lastIndexOf('.') + 1);
|
|
165
165
|
uploadStartFile = {
|
|
166
166
|
FileName: element.name,
|
|
167
167
|
FileType: (0, _type._dealAttachmentType)(uploadFileType).FileType,
|
|
@@ -173,17 +173,17 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
173
173
|
// 开始上传
|
|
174
174
|
IsSuccess: false,
|
|
175
175
|
uid: (0, _uuid["default"])(),
|
|
176
|
-
_smallImageUrl:
|
|
177
|
-
_bigImageUrl:
|
|
178
|
-
MediaType:
|
|
176
|
+
_smallImageUrl: '',
|
|
177
|
+
_bigImageUrl: '',
|
|
178
|
+
MediaType: '',
|
|
179
179
|
UserId: 0,
|
|
180
180
|
MaxDocCount: 0,
|
|
181
|
-
DfsPath:
|
|
182
|
-
ClientUrl:
|
|
183
|
-
SmallImageUrl:
|
|
184
|
-
BigImageUrl:
|
|
185
|
-
DownloadUrl:
|
|
186
|
-
Msg:
|
|
181
|
+
DfsPath: '',
|
|
182
|
+
ClientUrl: '',
|
|
183
|
+
SmallImageUrl: '',
|
|
184
|
+
BigImageUrl: '',
|
|
185
|
+
DownloadUrl: '',
|
|
186
|
+
Msg: '',
|
|
187
187
|
AllowUploadAttachmentSize: 50,
|
|
188
188
|
Deleteable: true,
|
|
189
189
|
requestXHR: new XMLHttpRequest() // 在这创建是为了取消用
|
|
@@ -202,7 +202,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
202
202
|
_this._dealUploadStart(uploadStartFiles); // 处理开始上传的文件
|
|
203
203
|
|
|
204
204
|
|
|
205
|
-
formData.append(
|
|
205
|
+
formData.append('file', element);
|
|
206
206
|
var url = action || (0, _requestV.getApiUrl)("Upload/PostFiles?format=json×tamp=".concat(timestamp));
|
|
207
207
|
|
|
208
208
|
_this._dealUploadXHRRequest(formData, url, uploadStartFile);
|
|
@@ -213,7 +213,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
213
213
|
if (uploadStartFile.FileSize > _this.props.fileSizeLimit * 1024 * 1024) {
|
|
214
214
|
setTimeout(function () {
|
|
215
215
|
_this._dealUploadSuccess(_objectSpread(_objectSpread({}, uploadStartFile), {
|
|
216
|
-
Msg:
|
|
216
|
+
Msg: '上传失败,文件过大',
|
|
217
217
|
IsImage: false,
|
|
218
218
|
uploadStatus: 5
|
|
219
219
|
}));
|
|
@@ -221,12 +221,32 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
var xhr = uploadStartFile.requestXHR;
|
|
224
|
+
var xhr = uploadStartFile.requestXHR; // xhr.onreadystatechange = () => {
|
|
225
|
+
// if (xhr.readyState == 4 && xhr.status == 200) {
|
|
226
|
+
// const result = { ...JSON.parse(xhr.responseText).Result[0] }; // 上传成功接口返回数据
|
|
227
|
+
// result.percentComplete = 100;
|
|
228
|
+
// result.IsSuccess = !!result.IsSuccess;
|
|
229
|
+
// result.uploadStatus = result.IsSuccess ? 3 : 4; // 3上传成功;4上传失败
|
|
230
|
+
// this._dealUploadSuccess({ ...uploadStartFile, ...result });
|
|
231
|
+
// }
|
|
232
|
+
// };
|
|
233
|
+
// // 进度条部分
|
|
234
|
+
// xhr.upload.onprogress = (evt) => {
|
|
235
|
+
// const uploadSuccessFiles = [...this.state.uploadSuccessFiles];
|
|
236
|
+
// if (evt.lengthComputable) {
|
|
237
|
+
// uploadSuccessFiles.forEach((item: UploadResultObj) => {
|
|
238
|
+
// if (this.isSameFile(item, uploadStartFile)) {
|
|
239
|
+
// item.uploadStatus = 2; // 上传中
|
|
240
|
+
// item.percentComplete = Math.round((evt.loaded * 100) / evt.total);
|
|
241
|
+
// }
|
|
242
|
+
// });
|
|
243
|
+
// this.setState({ uploadSuccessFiles });
|
|
244
|
+
// }
|
|
245
|
+
// };
|
|
225
246
|
|
|
226
247
|
xhr.onreadystatechange = function () {
|
|
227
248
|
if (xhr.readyState == 4 && xhr.status == 200) {
|
|
228
|
-
var result = _objectSpread({}, JSON.parse(xhr.responseText).Result[0]); // 上传成功接口返回数据
|
|
229
|
-
|
|
249
|
+
var result = Object.assign({}, _objectSpread({}, JSON.parse(xhr.responseText).Result[0])); // 上传成功接口返回数据
|
|
230
250
|
|
|
231
251
|
result.percentComplete = 100;
|
|
232
252
|
result.IsSuccess = !!result.IsSuccess;
|
|
@@ -234,11 +254,11 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
234
254
|
|
|
235
255
|
_this._dealUploadSuccess(_objectSpread(_objectSpread({}, uploadStartFile), result));
|
|
236
256
|
}
|
|
237
|
-
};
|
|
257
|
+
}; //进度条部分
|
|
238
258
|
|
|
239
259
|
|
|
240
260
|
xhr.upload.onprogress = function (evt) {
|
|
241
|
-
var uploadSuccessFiles =
|
|
261
|
+
var uploadSuccessFiles = JSON.parse(JSON.stringify(_this.state.uploadSuccessFiles));
|
|
242
262
|
|
|
243
263
|
if (evt.lengthComputable) {
|
|
244
264
|
uploadSuccessFiles.forEach(function (item) {
|
|
@@ -263,7 +283,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
263
283
|
item.uploadStatus = 4; // 上传失败
|
|
264
284
|
|
|
265
285
|
item.percentComplete = Math.round(evt.loaded * 100 / evt.total);
|
|
266
|
-
item.Msg =
|
|
286
|
+
item.Msg = '网络异常,请重新上传';
|
|
267
287
|
}
|
|
268
288
|
});
|
|
269
289
|
|
|
@@ -272,7 +292,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
272
292
|
});
|
|
273
293
|
};
|
|
274
294
|
|
|
275
|
-
xhr.open(
|
|
295
|
+
xhr.open('POST', url, true);
|
|
276
296
|
xhr.send(formData); // 开始上传,发送form数据
|
|
277
297
|
};
|
|
278
298
|
|
|
@@ -331,12 +351,20 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
331
351
|
});
|
|
332
352
|
};
|
|
333
353
|
|
|
354
|
+
_this.isImg = function (fileType) {
|
|
355
|
+
if (/^(jpg|png|gif|jpeg|image|JPG|PNG|GIF|JPEG)$/.test(fileType)) {
|
|
356
|
+
return true;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
return false;
|
|
360
|
+
};
|
|
361
|
+
|
|
334
362
|
_this.getImgIndex = function (index) {
|
|
335
363
|
var newIndex = 0;
|
|
336
364
|
var uploadSuccessFiles = _this.state.uploadSuccessFiles;
|
|
337
365
|
|
|
338
366
|
for (var i = 0; i < index; i++) {
|
|
339
|
-
if (isImg(uploadSuccessFiles[i].FileType)) {
|
|
367
|
+
if (_this.isImg(uploadSuccessFiles[i].FileType)) {
|
|
340
368
|
newIndex++;
|
|
341
369
|
}
|
|
342
370
|
}
|
|
@@ -349,12 +377,12 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
349
377
|
onSubmit = _this$props2.onSubmit,
|
|
350
378
|
onDelete = _this$props2.onDelete;
|
|
351
379
|
|
|
352
|
-
if (options ===
|
|
380
|
+
if (options === 'cancel') {
|
|
353
381
|
var reUploadFileInfo = _this.state.uploadSuccessFiles[index];
|
|
354
382
|
reUploadFileInfo.requestXHR.abort();
|
|
355
383
|
}
|
|
356
384
|
|
|
357
|
-
if (options ===
|
|
385
|
+
if (options === 'delete' || options === 'cancel') {
|
|
358
386
|
var uploadResultFiles = _toConsumableArray(_this.state.uploadSuccessFiles);
|
|
359
387
|
|
|
360
388
|
var deleteFiles = uploadResultFiles[index];
|
|
@@ -370,11 +398,11 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
370
398
|
_this.setState({
|
|
371
399
|
uploadSuccessFiles: uploadResultFiles
|
|
372
400
|
});
|
|
373
|
-
} else if (options ===
|
|
401
|
+
} else if (options === 'preview') {
|
|
374
402
|
var imgIndex = _this.getImgIndex(index);
|
|
375
403
|
|
|
376
404
|
_this.refs.imgViewerRef.show(imgIndex);
|
|
377
|
-
} else if (options ===
|
|
405
|
+
} else if (options === 'reupload') {
|
|
378
406
|
var _reUploadFileInfo = _this.state.uploadSuccessFiles[index];
|
|
379
407
|
var reUploadFile = _this.state.selectFiles[_reUploadFileInfo.FileName];
|
|
380
408
|
|
|
@@ -465,7 +493,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
465
493
|
className = _this$props3.className,
|
|
466
494
|
style = _this$props3.style,
|
|
467
495
|
_this$props3$attachme = _this$props3.attachmentTipText,
|
|
468
|
-
attachmentTipText = _this$props3$attachme === void 0 ? (0, _getLocale.getLocale)(
|
|
496
|
+
attachmentTipText = _this$props3$attachme === void 0 ? (0, _getLocale.getLocale)('OKR_MyO_KRP_Draganddropu') : _this$props3$attachme;
|
|
469
497
|
var uploadSuccessFiles = this.state.uploadSuccessFiles;
|
|
470
498
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
471
499
|
container: document.body,
|
|
@@ -483,7 +511,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
483
511
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
484
512
|
ref: "uploader-trigger",
|
|
485
513
|
style: {
|
|
486
|
-
cursor:
|
|
514
|
+
cursor: 'pointer'
|
|
487
515
|
}
|
|
488
516
|
}, children), /*#__PURE__*/_react["default"].createElement("input", {
|
|
489
517
|
type: "file",
|
|
@@ -491,7 +519,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
491
519
|
className: "upload_file_input",
|
|
492
520
|
multiple: this.props.multiple,
|
|
493
521
|
style: {
|
|
494
|
-
display:
|
|
522
|
+
display: 'none'
|
|
495
523
|
},
|
|
496
524
|
onChange: this.onFileInputChange
|
|
497
525
|
}))), this.renderUploadList(uploadSuccessFiles));
|
|
@@ -507,7 +535,7 @@ Upload.defaultProps = {
|
|
|
507
535
|
fileSizeLimit: 50,
|
|
508
536
|
filesTotal: 50,
|
|
509
537
|
multiple: true,
|
|
510
|
-
attachmentPreviewBox:
|
|
538
|
+
attachmentPreviewBox: 'MBlog__attachmentViewBox'
|
|
511
539
|
};
|
|
512
540
|
var _default = Upload;
|
|
513
541
|
exports["default"] = _default;
|
|
@@ -39,7 +39,12 @@ function _default(props) {
|
|
|
39
39
|
multiple = props.multiple;
|
|
40
40
|
|
|
41
41
|
var _useContext = (0, _react.useContext)(_context.CommonContext),
|
|
42
|
-
panes = _useContext.panes
|
|
42
|
+
panes = _useContext.panes,
|
|
43
|
+
departOnly = _useContext.departOnly;
|
|
44
|
+
|
|
45
|
+
if (departOnly) {
|
|
46
|
+
panes.subordinate = false;
|
|
47
|
+
}
|
|
43
48
|
|
|
44
49
|
var _useState = (0, _react.useState)(function () {
|
|
45
50
|
var panelCount = 0;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _chooseTree = _interopRequireDefault(require("../select-tree/choose-tree"));
|
|
13
|
+
|
|
14
|
+
var _requestApis = require("../request-apis");
|
|
15
|
+
|
|
16
|
+
var _context = require("../context");
|
|
17
|
+
|
|
18
|
+
require("./index.css");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
var SubordinateTree = function SubordinateTree(props) {
|
|
27
|
+
var onSelect = props.onSelect,
|
|
28
|
+
selected = props.selected,
|
|
29
|
+
multiple = props.multiple,
|
|
30
|
+
itemHeight = props.itemHeight,
|
|
31
|
+
height = props.height;
|
|
32
|
+
|
|
33
|
+
var _useContext = (0, _react.useContext)(_context.CommonContext),
|
|
34
|
+
auth = _useContext.auth,
|
|
35
|
+
authType = _useContext.authType,
|
|
36
|
+
isGetRoot = _useContext.isGetRoot;
|
|
37
|
+
|
|
38
|
+
var onGetTreeData = function onGetTreeData() {
|
|
39
|
+
return (0, _requestApis.getSubordinateData)({
|
|
40
|
+
auth: auth,
|
|
41
|
+
authType: authType
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return /*#__PURE__*/_react["default"].createElement(_context.TreeNodeContext.Provider, {
|
|
46
|
+
value: {}
|
|
47
|
+
}, /*#__PURE__*/_react["default"].createElement(_chooseTree["default"], {
|
|
48
|
+
onSelect: onSelect,
|
|
49
|
+
selected: selected,
|
|
50
|
+
multiple: multiple,
|
|
51
|
+
virtual: true,
|
|
52
|
+
asyncData: true,
|
|
53
|
+
height: height,
|
|
54
|
+
isGetRoot: isGetRoot,
|
|
55
|
+
itemHeight: itemHeight,
|
|
56
|
+
getTreeData: onGetTreeData
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var _default = SubordinateTree;
|
|
61
|
+
exports["default"] = _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getPanesConfig = void 0;
|
|
6
|
+
exports.getPanesConfig = exports["default"] = void 0;
|
|
7
7
|
|
|
8
8
|
var _getLocale = require("../../utils/getLocale");
|
|
9
9
|
|
|
@@ -11,6 +11,8 @@ var _departTree = _interopRequireDefault(require("./category-selector-panel/depa
|
|
|
11
11
|
|
|
12
12
|
var _groupTree = _interopRequireDefault(require("./category-selector-panel/group-tree"));
|
|
13
13
|
|
|
14
|
+
var _subordinateTree = _interopRequireDefault(require("./category-selector-panel/subordinate-tree"));
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
17
|
|
|
16
18
|
var getPanesConfig = function getPanesConfig() {
|
|
@@ -22,8 +24,14 @@ var getPanesConfig = function getPanesConfig() {
|
|
|
22
24
|
group: {
|
|
23
25
|
label: (0, _getLocale.getLocale)("Mod_Groups"),
|
|
24
26
|
Component: _groupTree["default"]
|
|
27
|
+
},
|
|
28
|
+
subordinate: {
|
|
29
|
+
label: (0, _getLocale.getLocale)("OKR_MyO_Butt_Subordinate"),
|
|
30
|
+
Component: _subordinateTree["default"]
|
|
25
31
|
}
|
|
26
32
|
};
|
|
27
33
|
};
|
|
28
34
|
|
|
29
|
-
exports.getPanesConfig = getPanesConfig;
|
|
35
|
+
exports.getPanesConfig = getPanesConfig;
|
|
36
|
+
var _default = getPanesConfig;
|
|
37
|
+
exports["default"] = _default;
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
background: url(../images/empty-131.png) transparent no-repeat 50% 50%;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
.persel-empty > span.empty-special {
|
|
16
|
+
background-image: url("../images/no-auth.png");
|
|
17
|
+
background-size: contain;
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
.add-group {
|
|
16
21
|
display: inline-block;
|
|
17
22
|
color: #2879ff;
|
|
@@ -7,13 +7,17 @@ exports["default"] = _default;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
10
12
|
var _getLocale = require("../../../utils/getLocale");
|
|
11
13
|
|
|
12
14
|
require("./index.css");
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
17
|
|
|
16
|
-
function _default() {
|
|
18
|
+
function _default(_ref) {
|
|
19
|
+
var _ref$errorTip = _ref.errorTip,
|
|
20
|
+
errorTip = _ref$errorTip === void 0 ? "" : _ref$errorTip;
|
|
17
21
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
18
22
|
style: {
|
|
19
23
|
textAlign: "center"
|
|
@@ -21,8 +25,10 @@ function _default() {
|
|
|
21
25
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
22
26
|
className: "persel-empty"
|
|
23
27
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
24
|
-
className: "icon"
|
|
28
|
+
className: (0, _classnames["default"])("icon", {
|
|
29
|
+
"empty-special": !!errorTip
|
|
30
|
+
})
|
|
25
31
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
26
32
|
className: "empty-tip"
|
|
27
|
-
}, (0, _getLocale.getLocale)("OKR_MyO_Thnothinghere")));
|
|
33
|
+
}, errorTip || (0, _getLocale.getLocale)("OKR_MyO_Thnothinghere")));
|
|
28
34
|
}
|
|
@@ -19,6 +19,8 @@ var _resultPart = _interopRequireDefault(require("./result-part"));
|
|
|
19
19
|
|
|
20
20
|
var _chooseTree = _interopRequireDefault(require("../../select-tree/choose-tree"));
|
|
21
21
|
|
|
22
|
+
var _empty = _interopRequireDefault(require("../../empty"));
|
|
23
|
+
|
|
22
24
|
var _selectorInput = _interopRequireDefault(require("../../../selector-input"));
|
|
23
25
|
|
|
24
26
|
var _layout = require("../../layout");
|
|
@@ -29,6 +31,8 @@ var _utils = require("../../utils");
|
|
|
29
31
|
|
|
30
32
|
var _requestApis = require("../../request-apis");
|
|
31
33
|
|
|
34
|
+
var _getLocale = require("../../../../utils/getLocale");
|
|
35
|
+
|
|
32
36
|
require("rc-tabs/assets/index.css");
|
|
33
37
|
|
|
34
38
|
require("./index.css");
|
|
@@ -102,12 +106,17 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
102
106
|
users = _useState10[0],
|
|
103
107
|
setUsers = _useState10[1];
|
|
104
108
|
|
|
105
|
-
var _useState11 = (0, _react.useState)(
|
|
109
|
+
var _useState11 = (0, _react.useState)(false),
|
|
110
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
111
|
+
noAuth = _useState12[0],
|
|
112
|
+
setNoAuth = _useState12[1];
|
|
113
|
+
|
|
114
|
+
var _useState13 = (0, _react.useState)(function () {
|
|
106
115
|
if (!auth) return [];
|
|
107
116
|
return ["-1"];
|
|
108
117
|
}),
|
|
109
|
-
|
|
110
|
-
defaultExpandedKeys =
|
|
118
|
+
_useState14 = _slicedToArray(_useState13, 1),
|
|
119
|
+
defaultExpandedKeys = _useState14[0];
|
|
111
120
|
|
|
112
121
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
113
122
|
return {
|
|
@@ -120,12 +129,12 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
120
129
|
};
|
|
121
130
|
});
|
|
122
131
|
|
|
123
|
-
var
|
|
132
|
+
var _useState15 = (0, _react.useState)(function () {
|
|
124
133
|
if (props.selected) return props.selected;
|
|
125
134
|
}),
|
|
126
|
-
|
|
127
|
-
selected =
|
|
128
|
-
setSelected =
|
|
135
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
136
|
+
selected = _useState16[0],
|
|
137
|
+
setSelected = _useState16[1]; // 获取数据的API
|
|
129
138
|
|
|
130
139
|
|
|
131
140
|
var searchTreeData = function searchTreeData() {
|
|
@@ -134,9 +143,17 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
134
143
|
departOnly: true,
|
|
135
144
|
sourceFrom: sourceFrom
|
|
136
145
|
}).then(function (res) {
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
var Code = res.Code,
|
|
147
|
+
Data = res.Data;
|
|
148
|
+
|
|
149
|
+
if (Code === 401) {
|
|
150
|
+
setNoAuth(true);
|
|
151
|
+
} else {
|
|
152
|
+
setNoAuth(false);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
var departments = Data.departments,
|
|
156
|
+
users = Data.users;
|
|
140
157
|
|
|
141
158
|
if (searchDepart) {
|
|
142
159
|
setDeparts((0, _utils.translateDepartsToTreeNode)(departments || []));
|
|
@@ -197,18 +214,29 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
197
214
|
onGetTreeDataDone(departs);
|
|
198
215
|
});
|
|
199
216
|
}
|
|
200
|
-
}, []);
|
|
217
|
+
}, []);
|
|
218
|
+
|
|
219
|
+
var getResult = function getResult() {
|
|
220
|
+
if (noAuth) {
|
|
221
|
+
return /*#__PURE__*/_react["default"].createElement(_empty["default"], {
|
|
222
|
+
errorTip: (0, _getLocale.getLocale)("Mod_Nopermissiondep")
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return /*#__PURE__*/_react["default"].createElement(_resultPart["default"], {
|
|
227
|
+
treeData: searchDepart ? departs : searchUser ? users : [],
|
|
228
|
+
onSelect: onSelectHandler,
|
|
229
|
+
departOnly: true,
|
|
230
|
+
height: height - 44
|
|
231
|
+
});
|
|
232
|
+
}; // 选人组件内容
|
|
233
|
+
|
|
201
234
|
|
|
202
235
|
var popup = /*#__PURE__*/_react["default"].createElement("div", {
|
|
203
236
|
className: (0, _classnames["default"])("persel-box", "perspm-depart-search-selector")
|
|
204
237
|
}, /*#__PURE__*/_react["default"].createElement(_layout.SinglePersonalLayout, null, /*#__PURE__*/_react["default"].createElement(_selectorInput["default"], {
|
|
205
238
|
onChange: onSearchChangeHandler
|
|
206
|
-
}), searchKey ? loading ? /*#__PURE__*/_react["default"].createElement(_loading["default"], null) : /*#__PURE__*/_react["default"].createElement(
|
|
207
|
-
treeData: searchDepart ? departs : searchUser ? users : [],
|
|
208
|
-
onSelect: onSelectHandler,
|
|
209
|
-
departOnly: true,
|
|
210
|
-
height: height - 44
|
|
211
|
-
}) : /*#__PURE__*/_react["default"].createElement(_context.TreeNodeContext.Provider, {
|
|
239
|
+
}), searchKey ? loading ? /*#__PURE__*/_react["default"].createElement(_loading["default"], null) : getResult() : /*#__PURE__*/_react["default"].createElement(_context.TreeNodeContext.Provider, {
|
|
212
240
|
value: {}
|
|
213
241
|
}, /*#__PURE__*/_react["default"].createElement(_chooseTree["default"], {
|
|
214
242
|
onSelect: onSelectHandler,
|
|
@@ -59,7 +59,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
59
59
|
_props$onSelect = props.onSelect,
|
|
60
60
|
onSelect = _props$onSelect === void 0 ? function () {} : _props$onSelect,
|
|
61
61
|
_props$position = props.position,
|
|
62
|
-
position = _props$position === void 0 ?
|
|
62
|
+
position = _props$position === void 0 ? 'bottomRight' : _props$position,
|
|
63
63
|
_props$selectNodes = props.selectNodes,
|
|
64
64
|
selectNodes = _props$selectNodes === void 0 ? defauleSelectNodes : _props$selectNodes,
|
|
65
65
|
sourceFrom = props.sourceFrom,
|
|
@@ -67,7 +67,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
67
67
|
_props$auth = props.auth,
|
|
68
68
|
auth = _props$auth === void 0 ? false : _props$auth,
|
|
69
69
|
_props$placeholder = props.placeholder,
|
|
70
|
-
placeholder = _props$placeholder === void 0 ? (0, _getLocale.getLocale)(
|
|
70
|
+
placeholder = _props$placeholder === void 0 ? (0, _getLocale.getLocale)('Mod_Pleaseselect') : _props$placeholder,
|
|
71
71
|
authType = props.authType,
|
|
72
72
|
getDepartRoot = props.getDepartRoot,
|
|
73
73
|
_props$destroyPopupOn = props.destroyPopupOnHide,
|
|
@@ -81,7 +81,8 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
81
81
|
_props$panes = props.panes,
|
|
82
82
|
panes = _props$panes === void 0 ? {
|
|
83
83
|
depart: true,
|
|
84
|
-
group: true
|
|
84
|
+
group: true,
|
|
85
|
+
subordinate: true
|
|
85
86
|
} : _props$panes,
|
|
86
87
|
_props$searchedPanes = props.searchedPanes,
|
|
87
88
|
searchedPanes = _props$searchedPanes === void 0 ? {
|
|
@@ -92,7 +93,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
92
93
|
_onPopupVisibleChange = props.onPopupVisibleChange,
|
|
93
94
|
popClass = props.popClass,
|
|
94
95
|
_props$searchWord = props.searchWord,
|
|
95
|
-
searchWord = _props$searchWord === void 0 ?
|
|
96
|
+
searchWord = _props$searchWord === void 0 ? '' : _props$searchWord,
|
|
96
97
|
_props$showSearchInpu = props.showSearchInput,
|
|
97
98
|
showSearchInput = _props$showSearchInpu === void 0 ? true : _props$showSearchInpu,
|
|
98
99
|
getPopupContainer = props.getPopupContainer,
|
|
@@ -111,7 +112,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
111
112
|
selected = _useState2[0],
|
|
112
113
|
setSelected = _useState2[1];
|
|
113
114
|
|
|
114
|
-
var _useState3 = (0, _react.useState)(
|
|
115
|
+
var _useState3 = (0, _react.useState)(''),
|
|
115
116
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
116
117
|
selectedText = _useState4[0],
|
|
117
118
|
setSelectedText = _useState4[1];
|
|
@@ -135,7 +136,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
135
136
|
var users = selectNodes.users;
|
|
136
137
|
(groups || []).forEach(function (data) {
|
|
137
138
|
selected.push({
|
|
138
|
-
nodeType:
|
|
139
|
+
nodeType: 'group',
|
|
139
140
|
id: data.id,
|
|
140
141
|
data: data
|
|
141
142
|
});
|
|
@@ -144,7 +145,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
144
145
|
});
|
|
145
146
|
(departments || []).forEach(function (data) {
|
|
146
147
|
selected.push({
|
|
147
|
-
nodeType:
|
|
148
|
+
nodeType: 'depart',
|
|
148
149
|
id: data.id,
|
|
149
150
|
data: data
|
|
150
151
|
});
|
|
@@ -156,7 +157,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
156
157
|
});
|
|
157
158
|
(users || []).forEach(function (data) {
|
|
158
159
|
selected.push({
|
|
159
|
-
nodeType:
|
|
160
|
+
nodeType: 'person',
|
|
160
161
|
id: "".concat(data.userId),
|
|
161
162
|
data: data
|
|
162
163
|
});
|
|
@@ -166,7 +167,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
166
167
|
name: data.name
|
|
167
168
|
}));
|
|
168
169
|
});
|
|
169
|
-
var text = texts.join(
|
|
170
|
+
var text = texts.join('、'); // if (!text) text = placeholder;
|
|
170
171
|
|
|
171
172
|
setSelectedText(text);
|
|
172
173
|
setJsxDomValues(jsxDomValues);
|
|
@@ -179,7 +180,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
179
180
|
|
|
180
181
|
(0, _react.useEffect)(function () {
|
|
181
182
|
if (getDepartRoot) {
|
|
182
|
-
(0, _requestApis.getTreeData)(
|
|
183
|
+
(0, _requestApis.getTreeData)('-1', {
|
|
183
184
|
departOnly: departOnly,
|
|
184
185
|
auth: auth,
|
|
185
186
|
isGetRoot: isGetRoot,
|
|
@@ -190,7 +191,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
190
191
|
for (var i = 0; i < departs.length; i++) {
|
|
191
192
|
var it = departs[i];
|
|
192
193
|
|
|
193
|
-
if (it.id ==
|
|
194
|
+
if (it.id == '-1') {
|
|
194
195
|
rootNode = it;
|
|
195
196
|
break;
|
|
196
197
|
}
|
|
@@ -224,7 +225,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
224
225
|
var jsxDomValues = [];
|
|
225
226
|
selectNodes.forEach(function (item) {
|
|
226
227
|
switch (item.nodeType) {
|
|
227
|
-
case
|
|
228
|
+
case 'person':
|
|
228
229
|
users.push(item.data);
|
|
229
230
|
texts.push(item.data.name);
|
|
230
231
|
jsxDomValues.push( /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
@@ -233,7 +234,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
233
234
|
}));
|
|
234
235
|
break;
|
|
235
236
|
|
|
236
|
-
case
|
|
237
|
+
case 'depart':
|
|
237
238
|
departments.push(item.data);
|
|
238
239
|
texts.push(item.data.name);
|
|
239
240
|
jsxDomValues.push( /*#__PURE__*/_react["default"].createElement(_openData.OpenDepartmentName, {
|
|
@@ -242,7 +243,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
242
243
|
}));
|
|
243
244
|
break;
|
|
244
245
|
|
|
245
|
-
case
|
|
246
|
+
case 'group':
|
|
246
247
|
groups.push(item.data);
|
|
247
248
|
texts.push(item.data.name);
|
|
248
249
|
jsxDomValues.push( /*#__PURE__*/_react["default"].createElement("span", null, item.data.name));
|
|
@@ -267,7 +268,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
267
268
|
onSelect(selectNodes, wechartOpts, e);
|
|
268
269
|
}
|
|
269
270
|
|
|
270
|
-
var text = texts.join(
|
|
271
|
+
var text = texts.join('、'); // if (!text) text = placeholder;
|
|
271
272
|
|
|
272
273
|
setSelectedText(text);
|
|
273
274
|
setJsxDomValues(jsxDomValues);
|
|
Binary file
|