@titaui/pc 1.10.3 → 1.10.5
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/index.js +105 -88
- package/lib/components/dialog-confirm/index.css +2 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +21 -12
- package/lib/pages/group-management/page-view/importGroupStaff/index.js +1 -3
- package/lib/utils/bs-global.js +8 -4
- package/package.json +1 -1
|
@@ -78,13 +78,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
78
78
|
var pageSize = 20;
|
|
79
79
|
|
|
80
80
|
function parseUser(toUser) {
|
|
81
|
+
if (!toUser || JSON.stringify(toUser) === '{}') return {};
|
|
81
82
|
return {
|
|
82
83
|
Name: toUser.name,
|
|
83
84
|
Id: toUser.userId,
|
|
84
85
|
DepartmentId: 0,
|
|
85
86
|
Email: toUser.email,
|
|
86
87
|
UserAvatar: toUser.avatar,
|
|
87
|
-
Department:
|
|
88
|
+
Department: ''
|
|
88
89
|
};
|
|
89
90
|
} // ChangeOKR 是伴随父组件的出现而出现的, 构造阶段就已经有所有的数据
|
|
90
91
|
|
|
@@ -113,11 +114,11 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
113
114
|
status: null,
|
|
114
115
|
cycle: null,
|
|
115
116
|
type: null,
|
|
116
|
-
users: [user],
|
|
117
|
+
users: JSON.stringify(user) === '{}' ? [] : [user],
|
|
117
118
|
// 构造之后这里还是空的
|
|
118
119
|
departments: [],
|
|
119
120
|
data: [],
|
|
120
|
-
keywords:
|
|
121
|
+
keywords: '',
|
|
121
122
|
loadingMore: false,
|
|
122
123
|
isEnd: false,
|
|
123
124
|
nextPage: 1,
|
|
@@ -141,7 +142,7 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
141
142
|
this.setState({
|
|
142
143
|
users: [user],
|
|
143
144
|
data: [],
|
|
144
|
-
keywords:
|
|
145
|
+
keywords: ''
|
|
145
146
|
});
|
|
146
147
|
}
|
|
147
148
|
}
|
|
@@ -155,20 +156,20 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
155
156
|
// 首次加载的时候 需要把 cycle 通过 cycleType 与 yqmNum 合并出来
|
|
156
157
|
|
|
157
158
|
var url = (0, _requestV.getApiUrl)("customizequery/condition/get?dataKey=".concat(this.DATA_KEY, "&pageId=").concat(this.PAGE_ID));
|
|
158
|
-
(0, _requestV.taker)(url,
|
|
159
|
+
(0, _requestV.taker)(url, 'GET').then(function (res) {
|
|
159
160
|
// condition 设置完筛选条件 然后再调用 getData()
|
|
160
161
|
if (res.Code === 1) {
|
|
161
162
|
var _res$Data = res.Data,
|
|
162
163
|
cycleType = _res$Data.cycleType,
|
|
163
164
|
yqmNum = _res$Data.yqmNum,
|
|
164
165
|
annualNum = _res$Data.annualNum,
|
|
165
|
-
okrType = _res$Data.okrType,
|
|
166
166
|
status = _res$Data.status,
|
|
167
167
|
users = _res$Data.users;
|
|
168
|
+
var okrType = res.Data.okrType;
|
|
168
169
|
var cycle;
|
|
169
|
-
cycleType ||
|
|
170
|
+
cycleType || '';
|
|
170
171
|
|
|
171
|
-
if (cycleType
|
|
172
|
+
if (cycleType === 1 || cycleType === -1) {
|
|
172
173
|
cycle = "".concat(cycleType);
|
|
173
174
|
} else {
|
|
174
175
|
cycle = cycleType ? "".concat(cycleType, ",").concat(yqmNum) : null;
|
|
@@ -176,7 +177,7 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
176
177
|
|
|
177
178
|
var year = annualNum || null; // status = status || 0;
|
|
178
179
|
|
|
179
|
-
okrType = okrType
|
|
180
|
+
okrType = okrType === undefined ? null : okrType;
|
|
180
181
|
|
|
181
182
|
if (!_this2.KRSetting.OkrTypeSetting) {
|
|
182
183
|
okrType = null;
|
|
@@ -188,8 +189,8 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
188
189
|
year: year,
|
|
189
190
|
status: status,
|
|
190
191
|
type: okrType,
|
|
191
|
-
users: [user],
|
|
192
|
-
keywords:
|
|
192
|
+
users: JSON.stringify(user) === '{}' ? [] : [user],
|
|
193
|
+
keywords: '',
|
|
193
194
|
nextPage: 1
|
|
194
195
|
}, function () {
|
|
195
196
|
return _this2.getListData();
|
|
@@ -209,9 +210,9 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
209
210
|
Id: id,
|
|
210
211
|
DepartmentId: 0,
|
|
211
212
|
Email: email,
|
|
212
|
-
Department:
|
|
213
|
-
UserAvatar:
|
|
214
|
-
keywords:
|
|
213
|
+
Department: '',
|
|
214
|
+
UserAvatar: '',
|
|
215
|
+
keywords: '',
|
|
215
216
|
nextPage: 1
|
|
216
217
|
};
|
|
217
218
|
})
|
|
@@ -239,13 +240,15 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
239
240
|
isEnd = _this$state.isEnd,
|
|
240
241
|
departments = _this$state.departments,
|
|
241
242
|
keywords = _this$state.keywords,
|
|
242
|
-
remembered = _this$state.remembered;
|
|
243
|
+
remembered = _this$state.remembered; // container
|
|
244
|
+
|
|
243
245
|
var _this$props = this.props,
|
|
244
246
|
className = _this$props.className,
|
|
245
247
|
okrPopType = _this$props.okrPopType,
|
|
246
248
|
parentId = _this$props.parentId,
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
hideCancelBtn = _this$props.hideCancelBtn,
|
|
250
|
+
alilgn = _this$props.alilgn,
|
|
251
|
+
autoAdjust = _this$props.autoAdjust;
|
|
249
252
|
var activeItem = selected || {
|
|
250
253
|
workId: parentId
|
|
251
254
|
};
|
|
@@ -258,8 +261,8 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
258
261
|
ref: function ref(r) {
|
|
259
262
|
return _this3.pop = r;
|
|
260
263
|
},
|
|
261
|
-
align:
|
|
262
|
-
autoAdjust:
|
|
264
|
+
align: alilgn,
|
|
265
|
+
autoAdjust: autoAdjust,
|
|
263
266
|
onBeforeShow: this.onBeforeShow,
|
|
264
267
|
onAfterShow: this.onAfterShow,
|
|
265
268
|
onBeforeHide: this.onBeforeShow,
|
|
@@ -272,7 +275,7 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
272
275
|
}, /*#__PURE__*/_react["default"].createElement(_styledComponents.Header, null, (0, _constant.getPopType)()[okrPopType], /*#__PURE__*/_react["default"].createElement("i", {
|
|
273
276
|
className: "tu-icon-close",
|
|
274
277
|
style: {
|
|
275
|
-
cursor:
|
|
278
|
+
cursor: 'pointer'
|
|
276
279
|
},
|
|
277
280
|
onClick: this.hide
|
|
278
281
|
})), /*#__PURE__*/_react["default"].createElement(_styledComponents.Body, null, /*#__PURE__*/_react["default"].createElement(_Filter["default"], {
|
|
@@ -291,11 +294,11 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
291
294
|
ref: function ref(r) {
|
|
292
295
|
return _this3.list = r;
|
|
293
296
|
}
|
|
294
|
-
}, data.map(function (d
|
|
297
|
+
}, data.map(function (d) {
|
|
295
298
|
return /*#__PURE__*/_react["default"].createElement(_Item["default"], {
|
|
296
299
|
data: d,
|
|
297
300
|
keywords: keywords,
|
|
298
|
-
key: "".concat(d.workId)
|
|
301
|
+
key: "".concat(d.workId),
|
|
299
302
|
active: activeItem,
|
|
300
303
|
onSelect: function onSelect(data) {
|
|
301
304
|
return _this3.handleSelect(data);
|
|
@@ -306,21 +309,21 @@ var ChangeOkr = /*#__PURE__*/function (_PureComponent) {
|
|
|
306
309
|
onClick: function onClick() {
|
|
307
310
|
return _this3.getListData(true);
|
|
308
311
|
}
|
|
309
|
-
}, loadingMore ? "".concat((0, _getLocale.getLocale)(
|
|
312
|
+
}, loadingMore ? "".concat((0, _getLocale.getLocale)('Mod_loading'), "\u2026") : (0, _getLocale.getLocale)('OKR_MyO_Butt_Loadmore'), /*#__PURE__*/_react["default"].createElement("i", {
|
|
310
313
|
className: "tu-icon-arrow-down"
|
|
311
|
-
}))), !!data.length && isEnd && /*#__PURE__*/_react["default"].createElement(_styledComponents.NoMore, null, (0, _getLocale.getLocale)(
|
|
314
|
+
}))), !!data.length && isEnd && /*#__PURE__*/_react["default"].createElement(_styledComponents.NoMore, null, (0, _getLocale.getLocale)('Mod_Nomore'), "\uFF5E"))), /*#__PURE__*/_react["default"].createElement(_styledComponents.Footer, null, okrPopType === 1 && parentId !== 0 && !hideCancelBtn && /*#__PURE__*/_react["default"].createElement(_styledComponents.Button, {
|
|
312
315
|
type: "confirm",
|
|
313
316
|
onClick: this.handleUnConnect
|
|
314
|
-
}, (0, _getLocale.getLocale)(
|
|
317
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Text_Cancel')), /*#__PURE__*/_react["default"].createElement(_styledComponents.ButtonGroup, null, /*#__PURE__*/_react["default"].createElement(_styledComponents.Button, {
|
|
315
318
|
onClick: this.hide
|
|
316
|
-
}, (0, _getLocale.getLocale)(
|
|
319
|
+
}, (0, _getLocale.getLocale)('Mod_Cancel')), /*#__PURE__*/_react["default"].createElement(_styledComponents.Button, {
|
|
317
320
|
style: {
|
|
318
321
|
marginLeft: 15
|
|
319
322
|
},
|
|
320
|
-
disabled: !selected && parentId
|
|
323
|
+
disabled: !selected && parentId === 0,
|
|
321
324
|
type: "confirm",
|
|
322
325
|
onClick: this.handleConfirm
|
|
323
|
-
}, (0, _getLocale.getLocale)(
|
|
326
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Butt_Determine'))))));
|
|
324
327
|
}
|
|
325
328
|
}]);
|
|
326
329
|
|
|
@@ -335,9 +338,9 @@ ChangeOkr.defaultProps = {
|
|
|
335
338
|
var _initialiseProps = function _initialiseProps() {
|
|
336
339
|
var _this4 = this;
|
|
337
340
|
|
|
338
|
-
this.PAGE_ID = this.props.okrPopType
|
|
341
|
+
this.PAGE_ID = this.props.okrPopType === 1 ? 40001 : 40011;
|
|
339
342
|
this.DATA_KEY = "62_".concat((0, _bsGlobal.getUserInfo)().Id);
|
|
340
|
-
this.KRSetting = (0, _bsGlobal.getBSGlobal)(
|
|
343
|
+
this.KRSetting = (0, _bsGlobal.getBSGlobal)('OkrAdvancedSetting').KRSetting;
|
|
341
344
|
this.page = 1;
|
|
342
345
|
this.moveX = 0;
|
|
343
346
|
this.pending = false;
|
|
@@ -363,9 +366,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
363
366
|
});
|
|
364
367
|
}
|
|
365
368
|
|
|
366
|
-
if (okrPopType
|
|
369
|
+
if (okrPopType === 1) {
|
|
367
370
|
_this4.setState({
|
|
368
|
-
keywords:
|
|
371
|
+
keywords: '',
|
|
369
372
|
nextPage: 1
|
|
370
373
|
});
|
|
371
374
|
}
|
|
@@ -386,21 +389,21 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
386
389
|
};
|
|
387
390
|
|
|
388
391
|
this.onBeforeShow = function () {
|
|
389
|
-
var p = document.querySelector(
|
|
392
|
+
var p = document.querySelector('.okr-panel-changeOkrPop'); // @ts-ignore
|
|
390
393
|
|
|
391
394
|
p && (p.style.transform = "translate(".concat(_this4.moveX, "px,-20px) scale(0)"));
|
|
392
395
|
};
|
|
393
396
|
|
|
394
397
|
this.onAfterShow = function () {
|
|
395
|
-
var p = document.querySelector(
|
|
398
|
+
var p = document.querySelector('.okr-panel-changeOkrPop'); // @ts-ignore
|
|
396
399
|
|
|
397
|
-
p && (p.style.transform =
|
|
400
|
+
p && (p.style.transform = 'translate(0,0) scale(1)');
|
|
398
401
|
};
|
|
399
402
|
|
|
400
403
|
this.handleFilterChange = function (propName, value) {
|
|
401
404
|
var _this4$setState;
|
|
402
405
|
|
|
403
|
-
if (propName
|
|
406
|
+
if (propName === 'clear') {
|
|
404
407
|
_this4.setState({
|
|
405
408
|
users: [],
|
|
406
409
|
departments: [],
|
|
@@ -419,7 +422,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
419
422
|
|
|
420
423
|
_this4.setState((_this4$setState = {}, _defineProperty(_this4$setState, propName, value), _defineProperty(_this4$setState, "nextPage", 1), _defineProperty(_this4$setState, "remembered", false), _this4$setState), _this4.getListData);
|
|
421
424
|
|
|
422
|
-
if (propName
|
|
425
|
+
if (propName === 'remembered' && value) {
|
|
423
426
|
_this4.setState(_defineProperty({}, propName, value));
|
|
424
427
|
|
|
425
428
|
_this4.saveCondition(_this4.state.users, _this4.state.departments);
|
|
@@ -427,7 +430,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
427
430
|
return;
|
|
428
431
|
}
|
|
429
432
|
|
|
430
|
-
if (propName
|
|
433
|
+
if (propName === 'remembered' && !value) {
|
|
431
434
|
_this4.setState(_defineProperty({}, propName, value));
|
|
432
435
|
|
|
433
436
|
_this4.deleteCondition();
|
|
@@ -435,7 +438,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
435
438
|
};
|
|
436
439
|
|
|
437
440
|
this.saveCondition = function (users, depts) {
|
|
438
|
-
var url = (0, _requestV.getApiUrl)(
|
|
441
|
+
var url = (0, _requestV.getApiUrl)('customizequery/condition/save');
|
|
439
442
|
var departmentIdsArr = depts.map(function (item) {
|
|
440
443
|
return item.Id;
|
|
441
444
|
});
|
|
@@ -449,31 +452,31 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
449
452
|
// 用户ID_项目ID_里程碑ID
|
|
450
453
|
pageId: _this4.PAGE_ID,
|
|
451
454
|
// 列表页Id
|
|
452
|
-
startTime:
|
|
455
|
+
startTime: '',
|
|
453
456
|
// 开始时间
|
|
454
|
-
endTime:
|
|
457
|
+
endTime: '',
|
|
455
458
|
// 结束时间
|
|
456
|
-
departmentIds: departmentIdsArr.join(
|
|
459
|
+
departmentIds: departmentIdsArr.join(','),
|
|
457
460
|
// 部门id
|
|
458
461
|
userObjects: [{
|
|
459
|
-
Id:
|
|
460
|
-
Name:
|
|
461
|
-
Email:
|
|
462
|
+
Id: '',
|
|
463
|
+
Name: '',
|
|
464
|
+
Email: '',
|
|
462
465
|
Relation: 0
|
|
463
466
|
}],
|
|
464
467
|
// 用户id
|
|
465
|
-
scope:
|
|
466
|
-
|
|
467
|
-
categoryIds:
|
|
468
|
+
scope: '',
|
|
469
|
+
//范围
|
|
470
|
+
categoryIds: '',
|
|
468
471
|
// 分类
|
|
469
|
-
sortType:
|
|
472
|
+
sortType: '',
|
|
470
473
|
// 排序
|
|
471
474
|
annualNum: year,
|
|
472
475
|
// 0 -1 undefined 1999
|
|
473
476
|
status: status,
|
|
474
477
|
okrType: type,
|
|
475
|
-
cycleType: cycle ? "".concat(cycle).split(
|
|
476
|
-
yqmNum: cycle ? "".concat(cycle).split(
|
|
478
|
+
cycleType: cycle ? "".concat(cycle).split(',')[0] : null,
|
|
479
|
+
yqmNum: cycle ? "".concat(cycle).split(',')[1] : null
|
|
477
480
|
};
|
|
478
481
|
data.userObjects = [];
|
|
479
482
|
users.forEach(function (item) {
|
|
@@ -484,21 +487,23 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
484
487
|
Relation: 0
|
|
485
488
|
});
|
|
486
489
|
});
|
|
487
|
-
(0, _requestV.taker)(url,
|
|
490
|
+
(0, _requestV.taker)(url, 'POST', data);
|
|
488
491
|
};
|
|
489
492
|
|
|
490
493
|
this.deleteCondition = function () {
|
|
491
494
|
var url = (0, _requestV.getApiUrl)("customizequery/condition/delete?dataKey=".concat(_this4.DATA_KEY, "&pageId=").concat(_this4.PAGE_ID));
|
|
492
|
-
(0, _requestV.taker)(url,
|
|
495
|
+
(0, _requestV.taker)(url, 'DELETE', {});
|
|
493
496
|
};
|
|
494
497
|
|
|
495
498
|
this.scollListToTop = function () {
|
|
496
|
-
|
|
499
|
+
if (_this4.list) {
|
|
500
|
+
_this4.list.scrollTop = 0;
|
|
501
|
+
}
|
|
497
502
|
};
|
|
498
503
|
|
|
499
504
|
this.getListData = /*#__PURE__*/function () {
|
|
500
505
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(isLoading) {
|
|
501
|
-
var _this4$state2,
|
|
506
|
+
var _this4$state2, keywords, type, users, departments, data, nextPage, toUserId, _this4$state3, status, cycle, year, okrPopType, url;
|
|
502
507
|
|
|
503
508
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
504
509
|
while (1) {
|
|
@@ -512,15 +517,17 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
512
517
|
return _context.abrupt("return");
|
|
513
518
|
|
|
514
519
|
case 2:
|
|
515
|
-
_this4$state2 = _this4.state,
|
|
516
|
-
cycle = cycle
|
|
520
|
+
_this4$state2 = _this4.state, keywords = _this4$state2.keywords, type = _this4$state2.type, users = _this4$state2.users, departments = _this4$state2.departments, data = _this4$state2.data, nextPage = _this4$state2.nextPage, toUserId = _this4$state2.toUserId;
|
|
521
|
+
_this4$state3 = _this4.state, status = _this4$state3.status, cycle = _this4$state3.cycle, year = _this4$state3.year;
|
|
522
|
+
okrPopType = _this4.props.okrPopType;
|
|
523
|
+
cycle = cycle || '-1';
|
|
517
524
|
year = year || -1;
|
|
518
525
|
status = status || 0;
|
|
519
|
-
url = (0, _requestV.getApiUrl)(
|
|
526
|
+
url = (0, _requestV.getApiUrl)('okr/search');
|
|
520
527
|
_this4.pending = true;
|
|
521
528
|
|
|
522
529
|
if (isLoading) {
|
|
523
|
-
_this4.page
|
|
530
|
+
_this4.page = _this4.page + 1;
|
|
524
531
|
|
|
525
532
|
_this4.setState({
|
|
526
533
|
loadingMore: true
|
|
@@ -529,38 +536,38 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
529
536
|
_this4.page = 1;
|
|
530
537
|
}
|
|
531
538
|
|
|
532
|
-
(0, _requestV.taker)(url,
|
|
539
|
+
(0, _requestV.taker)(url, 'POST', {
|
|
533
540
|
// 优秀!
|
|
534
541
|
|
|
535
542
|
/**
|
|
536
543
|
* pageNum: 0
|
|
537
544
|
* pageSize: 20
|
|
538
545
|
*/
|
|
539
|
-
cycleType: "".concat(cycle).split(
|
|
540
|
-
yqmNum: "".concat(cycle).split(
|
|
546
|
+
cycleType: "".concat(cycle).split(',')[0],
|
|
547
|
+
yqmNum: "".concat(cycle).split(',')[1] || 0,
|
|
541
548
|
// 如果是 undefined 就控制成 0 说明没有第二条件
|
|
542
549
|
annualNum: year,
|
|
543
|
-
pageNum: nextPage
|
|
550
|
+
pageNum: nextPage === 0 ? 1 : _this4.page,
|
|
544
551
|
// pageNum 最小是1
|
|
545
552
|
pageSize: pageSize,
|
|
546
553
|
status: status,
|
|
547
554
|
keywords: keywords,
|
|
548
|
-
okrType: type
|
|
549
|
-
orderType:
|
|
550
|
-
// 13:按人员排序
|
|
555
|
+
okrType: type === -1 ? '' : type,
|
|
556
|
+
orderType: 1,
|
|
557
|
+
// 13:按人员排序 1按照创建时间最晚排序
|
|
551
558
|
departmentIds: departments.map(function (d) {
|
|
552
559
|
return d.Id;
|
|
553
|
-
}).join(
|
|
560
|
+
}).join(','),
|
|
554
561
|
userIds: users.map(function (u) {
|
|
555
562
|
return u.Id;
|
|
556
|
-
}).join(
|
|
557
|
-
searchKr:
|
|
563
|
+
}).join(','),
|
|
564
|
+
searchKr: okrPopType,
|
|
558
565
|
// 是否搜索KR:默认为0-不搜索,1-只有对齐目标弹层可以搜索KR
|
|
559
|
-
toUserId:
|
|
566
|
+
toUserId: toUserId
|
|
560
567
|
}).then(function (res) {
|
|
561
568
|
_this4.pending = false;
|
|
562
569
|
var resData = res && res.Data && res.Data.works || [];
|
|
563
|
-
var isRefresh = _this4.page
|
|
570
|
+
var isRefresh = _this4.page === 1;
|
|
564
571
|
|
|
565
572
|
_this4.setState({
|
|
566
573
|
nextPage: res.Data.nextPage,
|
|
@@ -568,16 +575,22 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
568
575
|
data: isRefresh ? resData : [].concat(_toConsumableArray(data), _toConsumableArray(resData)),
|
|
569
576
|
isEnd: res.Data.nextPage === 0
|
|
570
577
|
}, function () {
|
|
571
|
-
|
|
578
|
+
if (isRefresh) {
|
|
579
|
+
_this4.scollListToTop();
|
|
580
|
+
}
|
|
572
581
|
});
|
|
573
|
-
})["catch"](function (
|
|
582
|
+
})["catch"](function () {
|
|
574
583
|
_this4.pending = false;
|
|
575
|
-
_this4.state.loadingMore
|
|
576
|
-
|
|
577
|
-
|
|
584
|
+
var loadingMore = _this4.state.loadingMore;
|
|
585
|
+
|
|
586
|
+
if (loadingMore) {
|
|
587
|
+
_this4.setState({
|
|
588
|
+
loadingMore: false
|
|
589
|
+
});
|
|
590
|
+
}
|
|
578
591
|
});
|
|
579
592
|
|
|
580
|
-
case
|
|
593
|
+
case 12:
|
|
581
594
|
case "end":
|
|
582
595
|
return _context.stop();
|
|
583
596
|
}
|
|
@@ -601,7 +614,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
601
614
|
selectData.workId = 0;
|
|
602
615
|
}
|
|
603
616
|
|
|
604
|
-
if (selected && (selectData.workId && selected.workId && selectData.workId
|
|
617
|
+
if (selected && (selectData.workId && selected.workId && selectData.workId === selected.workId || selectData.mileStoneId && selected.mileStoneId && selectData.mileStoneId === selected.mileStoneId)) return;
|
|
605
618
|
|
|
606
619
|
_this4.setState({
|
|
607
620
|
selected: selectData,
|
|
@@ -610,9 +623,12 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
610
623
|
};
|
|
611
624
|
|
|
612
625
|
this.handleConfirm = function () {
|
|
613
|
-
var _this4$
|
|
614
|
-
selected = _this4$
|
|
615
|
-
selectOkr = _this4$
|
|
626
|
+
var _this4$state4 = _this4.state,
|
|
627
|
+
selected = _this4$state4.selected,
|
|
628
|
+
selectOkr = _this4$state4.selectOkr;
|
|
629
|
+
var _this4$props2 = _this4.props,
|
|
630
|
+
onConfirm = _this4$props2.onConfirm,
|
|
631
|
+
parentId = _this4$props2.parentId;
|
|
616
632
|
var parentType = selected && selected.mileStoneId ? 2 : 1; // 临时注入
|
|
617
633
|
|
|
618
634
|
var data = _objectSpread(_objectSpread({}, selected), {}, {
|
|
@@ -622,27 +638,28 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
622
638
|
|
|
623
639
|
data.parentType = parentType;
|
|
624
640
|
|
|
625
|
-
if (selected && (selected.workId || selected.mileStoneId)
|
|
626
|
-
|
|
641
|
+
if (selected && (selected.workId || selected.mileStoneId) !== parentId) {
|
|
642
|
+
onConfirm(data);
|
|
627
643
|
}
|
|
628
644
|
|
|
629
645
|
_this4.hide();
|
|
630
646
|
};
|
|
631
647
|
|
|
632
648
|
this.handleUnConnect = function () {
|
|
633
|
-
// 取消关联对齐目标
|
|
634
|
-
|
|
649
|
+
var onConfirm = _this4.props.onConfirm; // 取消关联对齐目标
|
|
650
|
+
|
|
651
|
+
onConfirm({
|
|
635
652
|
workId: 0,
|
|
636
|
-
workName:
|
|
653
|
+
workName: '',
|
|
637
654
|
mileStoneId: 0,
|
|
638
|
-
mileStoneName:
|
|
655
|
+
mileStoneName: '',
|
|
639
656
|
parentType: 0
|
|
640
657
|
});
|
|
641
658
|
|
|
642
659
|
_this4.setState({
|
|
643
660
|
selected: {
|
|
644
661
|
workId: 0,
|
|
645
|
-
workName:
|
|
662
|
+
workName: ''
|
|
646
663
|
}
|
|
647
664
|
});
|
|
648
665
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
.titaui-dialog-confirm__btn-cancel {
|
|
35
35
|
background: #ffffff;
|
|
36
|
-
border: 1px solid #
|
|
36
|
+
border: 1px solid #dfe3ea;
|
|
37
37
|
color: #6f7886;
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
|
|
100
100
|
.titaui-dialog-confirm__body-title {
|
|
101
101
|
display: flex;
|
|
102
|
+
align-items: center;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
.titaui-dialog-confirm__body-title-icon {
|
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports["default"] =
|
|
8
|
+
exports["default"] = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -27,6 +27,8 @@ var _tooltipText = _interopRequireDefault(require("../../../../../tooltip/toolti
|
|
|
27
27
|
|
|
28
28
|
var _getLocale = require("../../../../../../utils/getLocale");
|
|
29
29
|
|
|
30
|
+
var _bsGlobal = require("../../../../../../utils/bs-global");
|
|
31
|
+
|
|
30
32
|
require("./index.css");
|
|
31
33
|
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -39,7 +41,9 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
39
41
|
|
|
40
42
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
var hasProject = (0, _bsGlobal.hasWebHead)("project");
|
|
45
|
+
|
|
46
|
+
var EKrNode = function EKrNode(props) {
|
|
43
47
|
var index = props.index,
|
|
44
48
|
title = props.title,
|
|
45
49
|
data = props.data,
|
|
@@ -77,7 +81,7 @@ function _default(props) {
|
|
|
77
81
|
while (1) {
|
|
78
82
|
switch (_context.prev = _context.next) {
|
|
79
83
|
case 0:
|
|
80
|
-
if (name
|
|
84
|
+
if (name === "addTask") {
|
|
81
85
|
params = {
|
|
82
86
|
objId: data.workId,
|
|
83
87
|
objType: 4,
|
|
@@ -129,7 +133,7 @@ function _default(props) {
|
|
|
129
133
|
};
|
|
130
134
|
}(), []);
|
|
131
135
|
var openRelatePop = (0, _react.useCallback)(function (name) {
|
|
132
|
-
if (name
|
|
136
|
+
if (name === "relateTask") {
|
|
133
137
|
window.openRelateTaskPop(btnRef.current, {
|
|
134
138
|
okrId: data.workId,
|
|
135
139
|
krId: data.mileStoneId
|
|
@@ -169,9 +173,11 @@ function _default(props) {
|
|
|
169
173
|
}, "KR", index + 1), /*#__PURE__*/_react["default"].createElement("span", {
|
|
170
174
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node-title")),
|
|
171
175
|
onClick: function onClick() {
|
|
172
|
-
data.mileStoneId
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
if (data.mileStoneId) {
|
|
177
|
+
_drawerManager["default"].open("krDetail", {
|
|
178
|
+
krId: data.mileStoneId
|
|
179
|
+
});
|
|
180
|
+
}
|
|
175
181
|
}
|
|
176
182
|
}, /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
|
|
177
183
|
text: title,
|
|
@@ -192,11 +198,11 @@ function _default(props) {
|
|
|
192
198
|
icon: "tu-icon-Add-renwu",
|
|
193
199
|
exIconClass: "e-kr-node-layer-icon",
|
|
194
200
|
name: "addTask"
|
|
195
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_Addtask"))), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
201
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_Addtask"))), hasProject ? /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
196
202
|
icon: "tu-icon-Add-xiangmu",
|
|
197
203
|
exIconClass: "e-kr-node-layer-icon",
|
|
198
204
|
name: "addProject"
|
|
199
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_Addproject")))), /*#__PURE__*/_react["default"].createElement(_dropSelector["default"], {
|
|
205
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_Addproject"))) : /*#__PURE__*/_react["default"].createElement("span", null)), /*#__PURE__*/_react["default"].createElement(_dropSelector["default"], {
|
|
200
206
|
popupPlacement: "bottomRight",
|
|
201
207
|
onChange: openRelatePop,
|
|
202
208
|
trigger: /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -208,9 +214,12 @@ function _default(props) {
|
|
|
208
214
|
icon: "tu-icon-GL-renwu",
|
|
209
215
|
exIconClass: "e-kr-node-layer-icon",
|
|
210
216
|
name: "relateTask"
|
|
211
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_Assotask"))), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
217
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_Assotask"))), hasProject ? /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
212
218
|
icon: "tu-icon-GL-xiangmu",
|
|
213
219
|
exIconClass: "e-kr-node-layer-icon",
|
|
214
220
|
name: "relateProject"
|
|
215
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_AssProjects"))))) : null);
|
|
216
|
-
}
|
|
221
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_AssProjects"))) : /*#__PURE__*/_react["default"].createElement("span", null))) : null);
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
var _default = EKrNode;
|
|
225
|
+
exports["default"] = _default;
|
|
@@ -181,9 +181,7 @@ function _default(props) {
|
|
|
181
181
|
className: "user-group-page__import-download-template"
|
|
182
182
|
}, /*#__PURE__*/_react["default"].createElement("p", null, "1\u3001\u8BF7\u5148\u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F\uFF0C\u6279\u91CF\u586B\u5199\u5458\u5DE5\u4FE1\u606F"), /*#__PURE__*/_react["default"].createElement("a", {
|
|
183
183
|
href: url,
|
|
184
|
-
|
|
185
|
-
return console.log(url, "type".concat(type));
|
|
186
|
-
},
|
|
184
|
+
target: "_blank",
|
|
187
185
|
className: "user-group-page__import-download-template-button"
|
|
188
186
|
}, "\u4E0B\u8F7D\u6A21\u677F")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
189
187
|
className: "user-group-page__import-download-template"
|
package/lib/utils/bs-global.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.hasWebHead = exports.getVersion = exports.getUserInfo = exports.getUploadMaxSize = exports.getTenantInfo = exports.getSource = exports.getOkrAdvancedSetting = exports.getBSGlobal = exports.getAppHead = exports.formatNum = void 0;
|
|
6
|
+
exports.hasWebHead = exports.getVersion = exports.getUserInfo = exports.getUploadMaxSize = exports.getTenantInfo = exports.getSource = exports.getOkrAdvancedSetting = exports.getBSGlobal = exports.getAppHead = exports.formatNum = exports["default"] = void 0;
|
|
7
7
|
exports.isWx = isWx;
|
|
8
8
|
|
|
9
9
|
var getUserInfo = function getUserInfo() {
|
|
@@ -101,10 +101,14 @@ var hasWebHead = function hasWebHead(webHeadName) {
|
|
|
101
101
|
apply: 907,
|
|
102
102
|
kaohe: 403
|
|
103
103
|
};
|
|
104
|
-
var webHead = window.BSGlobal.
|
|
104
|
+
var webHead = window.BSGlobal.newNavigation;
|
|
105
105
|
return webHead.findIndex(function (v) {
|
|
106
|
-
return v.
|
|
106
|
+
return v.appId === webHeadMap[webHeadName];
|
|
107
107
|
}) !== -1;
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
exports.hasWebHead = hasWebHead;
|
|
110
|
+
exports.hasWebHead = hasWebHead;
|
|
111
|
+
var _default = {
|
|
112
|
+
hasWebHead: hasWebHead
|
|
113
|
+
};
|
|
114
|
+
exports["default"] = _default;
|