@titaui/pc 1.15.28 → 1.15.29
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/dynamic/dynamic-item/dynamic-new-report/index.js +5 -1
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +5 -1
- package/lib/components/dynamic/dynamic-item/index.js +4 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +14 -7
- package/lib/components/task-relation-modal/index.js +24 -14
- package/lib/components/task-relation-modal/relation-single-okr/index.css +77 -0
- package/lib/components/task-relation-modal/relation-single-okr/index.js +183 -0
- package/lib/components/task-relation-modal/request-api.js +9 -1
- package/package.json +1 -1
|
@@ -47,7 +47,7 @@ var _bsGlobal = require("../../../../utils/bs-global");
|
|
|
47
47
|
|
|
48
48
|
require("./index.css");
|
|
49
49
|
|
|
50
|
-
var _excluded = ["data"];
|
|
50
|
+
var _excluded = ["data", "isFold"];
|
|
51
51
|
|
|
52
52
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
53
53
|
|
|
@@ -91,6 +91,8 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
91
91
|
var _classNames;
|
|
92
92
|
|
|
93
93
|
var data = _ref.data,
|
|
94
|
+
_ref$isFold = _ref.isFold,
|
|
95
|
+
isFold = _ref$isFold === void 0 ? true : _ref$isFold,
|
|
94
96
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
95
97
|
|
|
96
98
|
var feedId = data.feedId,
|
|
@@ -283,6 +285,8 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
283
285
|
}
|
|
284
286
|
|
|
285
287
|
var handleInView = function handleInView(inview) {
|
|
288
|
+
if (!isFold) return;
|
|
289
|
+
|
|
286
290
|
if (inview) {
|
|
287
291
|
window.titaTracker('planAction').record({
|
|
288
292
|
actionName: '查看日报',
|
|
@@ -29,7 +29,7 @@ var _getLocale = require("../../../../utils/getLocale");
|
|
|
29
29
|
|
|
30
30
|
require("./index.css");
|
|
31
31
|
|
|
32
|
-
var _excluded = ["data"];
|
|
32
|
+
var _excluded = ["data", "isFold"];
|
|
33
33
|
|
|
34
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
35
|
|
|
@@ -58,6 +58,8 @@ var prefix = 'titaui-dynamic-report-item';
|
|
|
58
58
|
|
|
59
59
|
var DynamicReply = function DynamicReply(_ref) {
|
|
60
60
|
var data = _ref.data,
|
|
61
|
+
_ref$isFold = _ref.isFold,
|
|
62
|
+
isFold = _ref$isFold === void 0 ? true : _ref$isFold,
|
|
61
63
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
62
64
|
|
|
63
65
|
var submitState = data.submitState,
|
|
@@ -163,6 +165,8 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
var handleInView = function handleInView(inview) {
|
|
168
|
+
if (!isFold) return;
|
|
169
|
+
|
|
166
170
|
if (inview) {
|
|
167
171
|
window.titaTracker('planAction').record({
|
|
168
172
|
actionName: '查看日报',
|
|
@@ -314,11 +314,13 @@ var DynamicItem = function DynamicItem(_ref) {
|
|
|
314
314
|
return /*#__PURE__*/_react["default"].createElement(_dynamicNewReport["default"], _extends({
|
|
315
315
|
data: data,
|
|
316
316
|
onDeleteFeed: onDeleteFeed,
|
|
317
|
-
curAtUser: curAtUser
|
|
317
|
+
curAtUser: curAtUser,
|
|
318
|
+
isFold: isFold
|
|
318
319
|
}, restProps));
|
|
319
320
|
}
|
|
320
321
|
|
|
321
322
|
return /*#__PURE__*/_react["default"].createElement(_dynamicReport["default"], _extends({
|
|
323
|
+
isFold: isFold,
|
|
322
324
|
data: data,
|
|
323
325
|
onDeleteFeed: onDeleteFeed
|
|
324
326
|
}, restProps));
|
|
@@ -400,7 +402,7 @@ var DynamicItem = function DynamicItem(_ref) {
|
|
|
400
402
|
default:
|
|
401
403
|
return null;
|
|
402
404
|
}
|
|
403
|
-
}, [data, curAtUser]);
|
|
405
|
+
}, [data, curAtUser, isFold]);
|
|
404
406
|
|
|
405
407
|
var renderUpvoteCount = function renderUpvoteCount(type, count) {
|
|
406
408
|
if (count === 0) {
|
|
@@ -125,18 +125,25 @@ var EKrNode = function EKrNode(props) {
|
|
|
125
125
|
objType: 4,
|
|
126
126
|
AppId: 1,
|
|
127
127
|
AppType: 1,
|
|
128
|
-
TaskType: 0,
|
|
129
|
-
WorkMileStoneId: data.mileStoneId
|
|
130
|
-
};
|
|
128
|
+
TaskType: 0 // WorkMileStoneId: data.mileStoneId,
|
|
131
129
|
|
|
132
|
-
if (data.mileStoneId > 0) {
|
|
133
|
-
|
|
134
|
-
}
|
|
130
|
+
}; // if (data.mileStoneId > 0) {
|
|
131
|
+
// params.WorkMileStoneName = data.mileStoneName
|
|
132
|
+
// }
|
|
135
133
|
|
|
136
134
|
window.openCreateTaskPop(btnRef.current, {
|
|
137
135
|
createParams: params,
|
|
138
136
|
createTaskOption: {
|
|
139
|
-
allowObjectOptions:
|
|
137
|
+
allowObjectOptions: true,
|
|
138
|
+
labelOption: {
|
|
139
|
+
isOnlyCurrent: true,
|
|
140
|
+
labelId: data.mileStoneId,
|
|
141
|
+
workId: data.workId,
|
|
142
|
+
workName: okrInfo.workName,
|
|
143
|
+
name: data.mileStoneName,
|
|
144
|
+
krId: data.mileStoneId,
|
|
145
|
+
type: "kr"
|
|
146
|
+
}
|
|
140
147
|
}
|
|
141
148
|
}).then(function () {
|
|
142
149
|
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'), {
|
|
@@ -35,9 +35,11 @@ var _relationWorkModel = _interopRequireDefault(require("./okr-relation/relation
|
|
|
35
35
|
|
|
36
36
|
var _workRelation = _interopRequireDefault(require("./work-relation"));
|
|
37
37
|
|
|
38
|
+
var _relationSingleOkr = _interopRequireDefault(require("./relation-single-okr"));
|
|
39
|
+
|
|
38
40
|
require("./index.css");
|
|
39
41
|
|
|
40
|
-
var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "taskId", "isRelationOther", "lastSelected"];
|
|
42
|
+
var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "taskId", "isRelationOther", "lastSelected", "isOnlyCurrent"];
|
|
41
43
|
|
|
42
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
43
45
|
|
|
@@ -91,17 +93,25 @@ function TaskRelationModal(props) {
|
|
|
91
93
|
isRelationOther = _props$isRelationOthe === void 0 ? false : _props$isRelationOthe,
|
|
92
94
|
_props$lastSelected = props.lastSelected,
|
|
93
95
|
lastSelected = _props$lastSelected === void 0 ? [] : _props$lastSelected,
|
|
96
|
+
isOnlyCurrent = props.isOnlyCurrent,
|
|
94
97
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
95
98
|
|
|
99
|
+
if (isOnlyCurrent) return /*#__PURE__*/_react["default"].createElement(_relationSingleOkr["default"], {
|
|
100
|
+
lastSelected: lastSelected,
|
|
101
|
+
defaultVisible: defaultVisible,
|
|
102
|
+
onCancel: onCancel,
|
|
103
|
+
onOk: onOk
|
|
104
|
+
});
|
|
105
|
+
|
|
96
106
|
var _useState = (0, _react.useState)(defaultVisible),
|
|
97
107
|
_useState2 = _slicedToArray(_useState, 2),
|
|
98
108
|
visible = _useState2[0],
|
|
99
109
|
setVisible = _useState2[1];
|
|
100
110
|
|
|
101
111
|
var _useState3 = (0, _react.useState)(function () {
|
|
102
|
-
if (_helper.isOpenOkrManage) return
|
|
103
|
-
if (_helper.isOpenWorkManage) return
|
|
104
|
-
return
|
|
112
|
+
if (_helper.isOpenOkrManage) return 'okr';
|
|
113
|
+
if (_helper.isOpenWorkManage) return 'work';
|
|
114
|
+
return 'category';
|
|
105
115
|
}),
|
|
106
116
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
107
117
|
activeTab = _useState4[0],
|
|
@@ -155,7 +165,7 @@ function TaskRelationModal(props) {
|
|
|
155
165
|
if (Message) {
|
|
156
166
|
_toast["default"].Error(Message);
|
|
157
167
|
} else {
|
|
158
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
168
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
159
169
|
}
|
|
160
170
|
|
|
161
171
|
case 5:
|
|
@@ -202,7 +212,7 @@ function TaskRelationModal(props) {
|
|
|
202
212
|
if (Message) {
|
|
203
213
|
_toast["default"].Error(Message);
|
|
204
214
|
} else {
|
|
205
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
215
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
206
216
|
}
|
|
207
217
|
|
|
208
218
|
case 7:
|
|
@@ -250,14 +260,14 @@ function TaskRelationModal(props) {
|
|
|
250
260
|
};
|
|
251
261
|
|
|
252
262
|
var openLableSetting = function openLableSetting() {
|
|
253
|
-
window.open(
|
|
263
|
+
window.open('#set?page_id=class', '_blank');
|
|
254
264
|
};
|
|
255
265
|
|
|
256
266
|
var renderCateGory = function renderCateGory() {
|
|
257
267
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
258
268
|
className: "".concat(_helper.preCls, "__catetory-set"),
|
|
259
269
|
onClick: openLableSetting
|
|
260
|
-
}, (0, _getLocale.getLocale)(
|
|
270
|
+
}, (0, _getLocale.getLocale)('Tasks_Menu_Category'));
|
|
261
271
|
};
|
|
262
272
|
|
|
263
273
|
return /*#__PURE__*/_react["default"].createElement(_dialog["default"], _extends({
|
|
@@ -267,13 +277,13 @@ function TaskRelationModal(props) {
|
|
|
267
277
|
onCancel: onCancelHandler,
|
|
268
278
|
onClose: onCancelHandler,
|
|
269
279
|
style: {
|
|
270
|
-
height:
|
|
280
|
+
height: '590px'
|
|
271
281
|
},
|
|
272
282
|
width: 840,
|
|
273
283
|
noFooterLine: true,
|
|
274
|
-
extendFooterBtn: activeTab ===
|
|
284
|
+
extendFooterBtn: activeTab === 'category' && isCategory && renderCateGory() // getContainer={getContainer}
|
|
275
285
|
,
|
|
276
|
-
extraClass: [
|
|
286
|
+
extraClass: ['pull-screen-ignore', 'tita-user-pop'],
|
|
277
287
|
destroyOnClose: false
|
|
278
288
|
}, restProps), /*#__PURE__*/_react["default"].createElement(_context3.Context.Provider, {
|
|
279
289
|
value: {
|
|
@@ -292,19 +302,19 @@ function TaskRelationModal(props) {
|
|
|
292
302
|
className: "".concat(_helper.preCls, "__tabs")
|
|
293
303
|
}, _helper.isOpenOkrManage && /*#__PURE__*/_react["default"].createElement(_tabs.TabPane, {
|
|
294
304
|
key: "okr",
|
|
295
|
-
tab: (0, _getLocale.getLocale)(
|
|
305
|
+
tab: (0, _getLocale.getLocale)('Tasks_Menu_AffiliateOKR')
|
|
296
306
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
297
307
|
className: "".concat(_helper.preCls, "__content")
|
|
298
308
|
}, /*#__PURE__*/_react["default"].createElement(_okrTree["default"], {
|
|
299
309
|
multiple: multiple
|
|
300
310
|
}))), _helper.isOpenWorkManage && /*#__PURE__*/_react["default"].createElement(_tabs.TabPane, {
|
|
301
311
|
key: "work",
|
|
302
|
-
tab: (0, _getLocale.getLocale)(
|
|
312
|
+
tab: (0, _getLocale.getLocale)('OKR_MyO_E_Butt_AssProjects')
|
|
303
313
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
304
314
|
className: "".concat(_helper.preCls, "__content")
|
|
305
315
|
}, /*#__PURE__*/_react["default"].createElement(_workTree["default"], null))), _helper.isOpenLabel && !isRelationOther && /*#__PURE__*/_react["default"].createElement(_tabs.TabPane, {
|
|
306
316
|
key: "category",
|
|
307
|
-
tab: (0, _getLocale.getLocale)(
|
|
317
|
+
tab: (0, _getLocale.getLocale)('Tasks_Menu_AffiliateCa')
|
|
308
318
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
309
319
|
className: "".concat(_helper.preCls, "__content")
|
|
310
320
|
}, /*#__PURE__*/_react["default"].createElement(_categoryTree["default"], null)))), selected.length > 0 && multiple && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
.relation-single-okr__pop {
|
|
2
|
+
width: 280px;
|
|
3
|
+
height: 246px;
|
|
4
|
+
background: #FFFFFF;
|
|
5
|
+
box-shadow: 0px 4px 16px 0px rgba(127, 145, 180, 0.2);
|
|
6
|
+
border: 1px solid #F0F2F5;
|
|
7
|
+
border-radius: 24px;
|
|
8
|
+
padding: 20px 4px 16px 16px;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
overflow: auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.relation-single-okr__pop-O {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
padding: 5px 4px 5px 4px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.relation-single-okr__pop-O-img {
|
|
21
|
+
line-height: 22px !important;
|
|
22
|
+
color: #3F4755;
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
position: relative;
|
|
25
|
+
top: 1px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.relation-single-okr__pop-O-title {
|
|
29
|
+
margin-left: 4px;
|
|
30
|
+
width: 224px;
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
color: #3F4755;
|
|
33
|
+
line-height: 22px;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.relation-single-okr__pop-O--selected {
|
|
38
|
+
color: #2879FF;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.relation-single-okr__pop-O:hover {
|
|
42
|
+
background: #F0F4FA;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.relation-single-okr__pop-krs-kr {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
padding-left: 18px;
|
|
49
|
+
padding: 5px 4px 5px 22px;
|
|
50
|
+
border-radius: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.relation-single-okr__pop-krs-kr__sort {
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
font-weight: 400;
|
|
56
|
+
color: #89919F;
|
|
57
|
+
line-height: 18px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.relation-single-okr__pop-krs-kr__title {
|
|
61
|
+
flex: 1;
|
|
62
|
+
margin-left: 6px;
|
|
63
|
+
flex-wrap: wrap;
|
|
64
|
+
font-size: 12px;
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
color: #3F4755;
|
|
67
|
+
line-height: 18px;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.relation-single-okr__pop-krs-kr__title--selected {
|
|
72
|
+
color: #2879FF;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.relation-single-okr__pop-krs-kr:hover {
|
|
76
|
+
background: #F0F4FA;
|
|
77
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
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 _popup = _interopRequireDefault(require("../../../components/popup"));
|
|
13
|
+
|
|
14
|
+
var _requestApi = require("../request-api");
|
|
15
|
+
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
18
|
+
require("./index.css");
|
|
19
|
+
|
|
20
|
+
var _excluded = ["defaultVisible", "lastSelected", "onOk", "onCancel"];
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
43
|
+
|
|
44
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
45
|
+
|
|
46
|
+
var preCls = 'relation-single-okr';
|
|
47
|
+
|
|
48
|
+
function RelationSingleOkr(props) {
|
|
49
|
+
var _props$defaultVisible = props.defaultVisible,
|
|
50
|
+
defaultVisible = _props$defaultVisible === void 0 ? false : _props$defaultVisible,
|
|
51
|
+
_props$lastSelected = props.lastSelected,
|
|
52
|
+
lastSelected = _props$lastSelected === void 0 ? [] : _props$lastSelected,
|
|
53
|
+
onOk = props.onOk,
|
|
54
|
+
onCancel = props.onCancel,
|
|
55
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
56
|
+
|
|
57
|
+
var _useState = (0, _react.useState)(defaultVisible),
|
|
58
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
+
popupVisible = _useState2[0],
|
|
60
|
+
setPopupVisible = _useState2[1];
|
|
61
|
+
|
|
62
|
+
var _useState3 = (0, _react.useState)(function () {
|
|
63
|
+
var labelId = lastSelected[0].labelId;
|
|
64
|
+
return labelId || 0;
|
|
65
|
+
}),
|
|
66
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
67
|
+
selectedId = _useState4[0],
|
|
68
|
+
setSelectedId = _useState4[1];
|
|
69
|
+
|
|
70
|
+
var _useState5 = (0, _react.useState)([]),
|
|
71
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
72
|
+
krs = _useState6[0],
|
|
73
|
+
setKrs = _useState6[1];
|
|
74
|
+
|
|
75
|
+
(0, _react.useEffect)(function () {
|
|
76
|
+
setPopupVisible(defaultVisible);
|
|
77
|
+
}, [defaultVisible]);
|
|
78
|
+
(0, _react.useEffect)(function () {
|
|
79
|
+
if (!(lastSelected !== null && lastSelected !== void 0 && lastSelected.length)) return;
|
|
80
|
+
var workId = lastSelected[0].workId;
|
|
81
|
+
(0, _requestApi.getKrIds)(workId).then(function (res) {
|
|
82
|
+
if (res) {
|
|
83
|
+
setKrs(res);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}, [lastSelected]);
|
|
87
|
+
|
|
88
|
+
var handlePopupVisibleChange = function handlePopupVisibleChange(visible) {
|
|
89
|
+
setPopupVisible(visible);
|
|
90
|
+
|
|
91
|
+
if (!visible) {
|
|
92
|
+
onCancel && onCancel();
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
var selectOKr = function selectOKr(id, name) {
|
|
97
|
+
var _lastSelected$ = lastSelected[0],
|
|
98
|
+
workId = _lastSelected$.workId,
|
|
99
|
+
workName = _lastSelected$.workName;
|
|
100
|
+
var selected = {};
|
|
101
|
+
|
|
102
|
+
if (id == workId) {
|
|
103
|
+
selected = {
|
|
104
|
+
id: id,
|
|
105
|
+
krId: 0,
|
|
106
|
+
name: workName,
|
|
107
|
+
labelId: workId,
|
|
108
|
+
type: 'okr',
|
|
109
|
+
workId: workId,
|
|
110
|
+
workName: workName
|
|
111
|
+
};
|
|
112
|
+
} else {
|
|
113
|
+
selected = {
|
|
114
|
+
id: id,
|
|
115
|
+
krId: id,
|
|
116
|
+
name: name,
|
|
117
|
+
type: 'kr',
|
|
118
|
+
labelId: id,
|
|
119
|
+
workId: workId,
|
|
120
|
+
workName: workName
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
setSelectedId(id);
|
|
125
|
+
|
|
126
|
+
if (onOk) {
|
|
127
|
+
onOk([selected]);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
setPopupVisible(false);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
var popContent = function popContent() {
|
|
134
|
+
var _lastSelected$2 = lastSelected[0],
|
|
135
|
+
workId = _lastSelected$2.workId,
|
|
136
|
+
workName = _lastSelected$2.workName;
|
|
137
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
138
|
+
className: "".concat(preCls, "__pop")
|
|
139
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
140
|
+
className: (0, _classnames["default"])("".concat(preCls, "__pop-O")),
|
|
141
|
+
onClick: function onClick() {
|
|
142
|
+
return selectOKr(workId, workName);
|
|
143
|
+
}
|
|
144
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
145
|
+
className: "".concat(preCls, "__pop-O-img tu-icon-O")
|
|
146
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
147
|
+
className: (0, _classnames["default"])("".concat(preCls, "__pop-O-title"), _defineProperty({}, "".concat(preCls, "__pop-O--selected"), selectedId == workId))
|
|
148
|
+
}, workName)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
149
|
+
className: "".concat(preCls, "__pop-krs")
|
|
150
|
+
}, krs.map(function (item) {
|
|
151
|
+
var SortNum = item.SortNum,
|
|
152
|
+
mileStoneName = item.mileStoneName,
|
|
153
|
+
mileStoneId = item.mileStoneId;
|
|
154
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
155
|
+
className: "".concat(preCls, "__pop-krs-kr"),
|
|
156
|
+
key: mileStoneId
|
|
157
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
158
|
+
className: "".concat(preCls, "__pop-krs-kr__sort")
|
|
159
|
+
}, "KR", SortNum + 1), /*#__PURE__*/_react["default"].createElement("div", {
|
|
160
|
+
className: (0, _classnames["default"])("".concat(preCls, "__pop-krs-kr__title"), _defineProperty({}, "".concat(preCls, "__pop-krs-kr__title--selected"), selectedId == mileStoneId)),
|
|
161
|
+
onClick: function onClick() {
|
|
162
|
+
return selectOKr(mileStoneId, mileStoneName);
|
|
163
|
+
}
|
|
164
|
+
}, mileStoneName));
|
|
165
|
+
})));
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
return /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
169
|
+
popup: popContent,
|
|
170
|
+
onPopupVisibleChange: handlePopupVisibleChange,
|
|
171
|
+
popupVisible: popupVisible,
|
|
172
|
+
popupPlacement: "bottomLeft",
|
|
173
|
+
destroyPopupOnHide: true,
|
|
174
|
+
extraClass: 'pull-screen-ignore tita-user-pop',
|
|
175
|
+
popupAlign: {
|
|
176
|
+
points: ['tr', 'br'],
|
|
177
|
+
offset: [161, 4]
|
|
178
|
+
}
|
|
179
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
var _default = RelationSingleOkr;
|
|
183
|
+
exports["default"] = _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.workData = exports.updateLable = exports.relationWorks = exports.okrSearch = exports.getWorks = exports.getUserById = exports.getCategory = void 0;
|
|
6
|
+
exports.workData = exports.updateLable = exports.relationWorks = exports.okrSearch = exports.getWorks = exports.getUserById = exports.getKrIds = exports.getCategory = void 0;
|
|
7
7
|
|
|
8
8
|
var _request = require("../../utils/request");
|
|
9
9
|
|
|
@@ -83,6 +83,14 @@ var getUserById = function getUserById(userId) {
|
|
|
83
83
|
|
|
84
84
|
exports.getUserById = getUserById;
|
|
85
85
|
|
|
86
|
+
var getKrIds = function getKrIds(workId) {
|
|
87
|
+
return (0, _request.rget)('v1')("kr/list?workId=".concat(workId)).then(function (res) {
|
|
88
|
+
return res.Data;
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
exports.getKrIds = getKrIds;
|
|
93
|
+
|
|
86
94
|
var workData = function workData(params, pageNum, pageSize) {
|
|
87
95
|
var _params$keyWords2 = params.keyWords,
|
|
88
96
|
keyWords = _params$keyWords2 === void 0 ? '' : _params$keyWords2,
|