@titaui/pc 1.10.6-3.beta-4 → 1.10.6-3.beta-7
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/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +3 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +2 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +3 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +18 -3
- package/lib/components/okr-detail/e-list/index.js +30 -16
- package/lib/components/okr-detail/e-list/util.js +5 -1
- package/package.json +1 -1
|
@@ -44,6 +44,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
44
44
|
var hasProject = (0, _bsGlobal.hasWebHead)("project");
|
|
45
45
|
|
|
46
46
|
var EKrNode = function EKrNode(props) {
|
|
47
|
+
var _okrInfo$authority;
|
|
48
|
+
|
|
47
49
|
var index = props.index,
|
|
48
50
|
title = props.title,
|
|
49
51
|
data = props.data,
|
|
@@ -61,7 +63,7 @@ var EKrNode = function EKrNode(props) {
|
|
|
61
63
|
var _useContext2 = (0, _react.useContext)(_context2.EListContext),
|
|
62
64
|
refreshEList = _useContext2.refreshEList;
|
|
63
65
|
|
|
64
|
-
var isParticipant = okrInfo.authority.roleRelation && okrInfo.authority.roleRelation.roleType === 2;
|
|
66
|
+
var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
|
|
65
67
|
var hasRelativeAuth;
|
|
66
68
|
|
|
67
69
|
if (isOTask) {
|
|
@@ -62,7 +62,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
62
62
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
63
63
|
|
|
64
64
|
function _default(props) {
|
|
65
|
-
var _data$principalUser, _data$principalUser2;
|
|
65
|
+
var _okrInfo$authority, _data$principalUser, _data$principalUser2;
|
|
66
66
|
|
|
67
67
|
var index = props.index,
|
|
68
68
|
title = props.title,
|
|
@@ -84,7 +84,7 @@ function _default(props) {
|
|
|
84
84
|
var _useContext2 = (0, _react.useContext)(_context.EListContext),
|
|
85
85
|
refreshEList = _useContext2.refreshEList;
|
|
86
86
|
|
|
87
|
-
var isParticipant = okrInfo.authority.roleRelation && okrInfo.authority.roleRelation.roleType === 2;
|
|
87
|
+
var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
|
|
88
88
|
var hasRelativeAuth = new _auth.KRAuth({
|
|
89
89
|
user: data.user,
|
|
90
90
|
createUserId: createUserId
|
|
@@ -82,6 +82,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
82
82
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
83
83
|
|
|
84
84
|
function _default(props) {
|
|
85
|
+
var _okrInfo$authority;
|
|
86
|
+
|
|
85
87
|
var index = props.index,
|
|
86
88
|
title = props.title,
|
|
87
89
|
data = props.data,
|
|
@@ -147,7 +149,7 @@ function _default(props) {
|
|
|
147
149
|
principalUser: okrInfo.principalUser,
|
|
148
150
|
createUserId: okrInfo.createUserId
|
|
149
151
|
}).hasAuth()) && data.status !== 5;
|
|
150
|
-
var isParticipant = okrInfo.authority.roleRelation && okrInfo.authority.roleRelation.roleType === 2;
|
|
152
|
+
var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
|
|
151
153
|
var hasRelativeAuth = new _auth.KRAuth({
|
|
152
154
|
user: data.user,
|
|
153
155
|
createUserId: createUserId
|
|
@@ -83,6 +83,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
83
83
|
|
|
84
84
|
// status=3 已过期 status=2 已完成
|
|
85
85
|
function ETaskNode(props) {
|
|
86
|
+
var _okrInfo$authority;
|
|
87
|
+
|
|
86
88
|
var index = props.index,
|
|
87
89
|
title = props.title,
|
|
88
90
|
data = props.data,
|
|
@@ -91,7 +93,9 @@ function ETaskNode(props) {
|
|
|
91
93
|
_props$hasProgress = props.hasProgress,
|
|
92
94
|
hasProgress = _props$hasProgress === void 0 ? true : _props$hasProgress,
|
|
93
95
|
_props$hasRelation = props.hasRelation,
|
|
94
|
-
hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation
|
|
96
|
+
hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation,
|
|
97
|
+
_props$isPushScreen = props.isPushScreen,
|
|
98
|
+
isPushScreen = _props$isPushScreen === void 0 ? false : _props$isPushScreen;
|
|
95
99
|
|
|
96
100
|
var _useState = (0, _react.useState)(false),
|
|
97
101
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -154,7 +158,7 @@ function ETaskNode(props) {
|
|
|
154
158
|
principalUser: okrInfo.principalUser,
|
|
155
159
|
createUserId: okrInfo.createUserId
|
|
156
160
|
}).hasAuth()) && data.status !== 5;
|
|
157
|
-
var isParticipant = okrInfo.authority.roleRelation && okrInfo.authority.roleRelation.roleType === 2;
|
|
161
|
+
var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
|
|
158
162
|
var hasRelativeAuth = new _auth.KRAuth({
|
|
159
163
|
user: krUser,
|
|
160
164
|
createUserId: createUserId
|
|
@@ -328,7 +332,18 @@ function ETaskNode(props) {
|
|
|
328
332
|
_drawerManager["default"].close();
|
|
329
333
|
}
|
|
330
334
|
|
|
331
|
-
|
|
335
|
+
if (isPushScreen) {
|
|
336
|
+
var _window$Talent, _window$Talent2;
|
|
337
|
+
|
|
338
|
+
(_window$Talent = window.Talent) === null || _window$Talent === void 0 ? void 0 : _window$Talent.app.vent.off("global-pull-screen:closed:".concat(data.taskId));
|
|
339
|
+
(_window$Talent2 = window.Talent) === null || _window$Talent2 === void 0 ? void 0 : _window$Talent2.app.vent.on("global-pull-screen:closed:".concat(data.taskId), function () {
|
|
340
|
+
refreshEList && refreshEList();
|
|
341
|
+
}); // 任务:打开推屏
|
|
342
|
+
|
|
343
|
+
window.Talent.app.vent.trigger('global-pull-screen', data.taskId, 'task');
|
|
344
|
+
} else {
|
|
345
|
+
window.open("//".concat(window.location.host).concat(window.location.pathname, "#more/taskinfo?id=").concat(data.taskId));
|
|
346
|
+
}
|
|
332
347
|
};
|
|
333
348
|
|
|
334
349
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -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
|
|
|
@@ -51,7 +51,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
51
51
|
|
|
52
52
|
var preCls = "okr-detail-e";
|
|
53
53
|
|
|
54
|
-
function
|
|
54
|
+
function Elist(props, ref) {
|
|
55
55
|
var okrId = props.okrId,
|
|
56
56
|
_props$hasSearch = props.hasSearch,
|
|
57
57
|
hasSearch = _props$hasSearch === void 0 ? true : _props$hasSearch,
|
|
@@ -66,9 +66,15 @@ function _default(props) {
|
|
|
66
66
|
_props$hasdivider = props.hasdivider,
|
|
67
67
|
hasdivider = _props$hasdivider === void 0 ? false : _props$hasdivider,
|
|
68
68
|
className = props.className,
|
|
69
|
-
changeData = props.changeData,
|
|
70
69
|
_props$includeWork = props.includeWork,
|
|
71
|
-
includeWork = _props$includeWork === void 0 ? true : _props$includeWork
|
|
70
|
+
includeWork = _props$includeWork === void 0 ? true : _props$includeWork,
|
|
71
|
+
_props$IncludeNoTaskK = props.IncludeNoTaskKr,
|
|
72
|
+
IncludeNoTaskKr = _props$IncludeNoTaskK === void 0 ? true : _props$IncludeNoTaskK,
|
|
73
|
+
_props$hasLoading = props.hasLoading,
|
|
74
|
+
hasLoading = _props$hasLoading === void 0 ? true : _props$hasLoading,
|
|
75
|
+
_props$IsDateFilter = props.IsDateFilter,
|
|
76
|
+
IsDateFilter = _props$IsDateFilter === void 0 ? false : _props$IsDateFilter,
|
|
77
|
+
emptyPage = props.emptyPage;
|
|
72
78
|
var loginUser = (0, _bsGlobal.getUserInfo)().Id;
|
|
73
79
|
var hasCondition = hasSearch && localStorage.getItem("hasRememberCondition".concat(loginUser));
|
|
74
80
|
|
|
@@ -142,15 +148,11 @@ function _default(props) {
|
|
|
142
148
|
startDate: startDate,
|
|
143
149
|
endDate: endDate,
|
|
144
150
|
toLevel: toLevel,
|
|
145
|
-
includeWork: includeWork
|
|
151
|
+
includeWork: includeWork,
|
|
152
|
+
IncludeNoTaskKr: IncludeNoTaskKr,
|
|
153
|
+
IsDateFilter: IsDateFilter
|
|
146
154
|
})
|
|
147
155
|
}).then(function (krs) {
|
|
148
|
-
debugger;
|
|
149
|
-
|
|
150
|
-
if (!krs || !krs.length) {
|
|
151
|
-
changeData(true);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
156
|
var formatKrs = formatEList(krs, okrId, (0, _util.getIfInitCondition)(selectName, checkedStatus, selectUsers, searchKey));
|
|
155
157
|
var expandedKrEs = (formatKrs.krsEList || []).map(function (it) {
|
|
156
158
|
return it.key;
|
|
@@ -166,17 +168,24 @@ function _default(props) {
|
|
|
166
168
|
});
|
|
167
169
|
};
|
|
168
170
|
|
|
171
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
172
|
+
return {
|
|
173
|
+
getKrEsData: getKrEsData
|
|
174
|
+
};
|
|
175
|
+
});
|
|
169
176
|
(0, _react.useEffect)(function () {
|
|
170
177
|
// 可以接收一个格式化方法
|
|
171
178
|
getKrEsData(formatTree);
|
|
172
|
-
}, [noteOrder, searchKey, selectName, checkedStatus, selectUsers]);
|
|
179
|
+
}, [noteOrder, searchKey, selectName, checkedStatus, selectUsers, startDate, endDate, okrId]);
|
|
173
180
|
(0, _react.useEffect)(function () {
|
|
174
181
|
var oElistLength = oEList[0] && oEList[0].length || 0;
|
|
175
182
|
setTotalDataNum(krList.length + oElistLength);
|
|
176
183
|
}, [krList, oEList]);
|
|
177
184
|
return /*#__PURE__*/_react["default"].createElement(_context.EListContext.Provider, {
|
|
178
185
|
value: {
|
|
179
|
-
refreshEList:
|
|
186
|
+
refreshEList: function refreshEList() {
|
|
187
|
+
return getKrEsData(formatTree);
|
|
188
|
+
}
|
|
180
189
|
}
|
|
181
190
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
182
191
|
className: "".concat(preCls, " ").concat(className)
|
|
@@ -191,7 +200,7 @@ function _default(props) {
|
|
|
191
200
|
selectUsers: selectUsers,
|
|
192
201
|
setSelectUsers: setSelectUsers,
|
|
193
202
|
okrId: okrId
|
|
194
|
-
})), !loading ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
203
|
+
})), !loading || !hasLoading ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
195
204
|
condition: totalDataNum !== 0
|
|
196
205
|
}, krList.map(function (kr, index) {
|
|
197
206
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_paddingLayout["default"], {
|
|
@@ -212,7 +221,7 @@ function _default(props) {
|
|
|
212
221
|
}));
|
|
213
222
|
})), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
214
223
|
condition: totalDataNum === 0
|
|
215
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
224
|
+
}, emptyPage ? emptyPage() : /*#__PURE__*/_react["default"].createElement("div", {
|
|
216
225
|
className: "".concat(preCls, "__empty")
|
|
217
226
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
218
227
|
className: "".concat(preCls, "__empty-img"),
|
|
@@ -222,4 +231,9 @@ function _default(props) {
|
|
|
222
231
|
}, "\u6CA1\u6709\u641C\u7D22\u5230\u7B26\u5408\u6761\u4EF6\u7684E-\u6267\u884C")))) : /*#__PURE__*/_react["default"].createElement(_loading["default"], {
|
|
223
232
|
type: "panel"
|
|
224
233
|
})));
|
|
225
|
-
}
|
|
234
|
+
} // @ts-ignore
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
Elist = /*#__PURE__*/(0, _react.forwardRef)(Elist);
|
|
238
|
+
var _default = Elist;
|
|
239
|
+
exports["default"] = _default;
|
|
@@ -167,7 +167,9 @@ var formatCondition = function formatCondition(_ref) {
|
|
|
167
167
|
startDate = _ref.startDate,
|
|
168
168
|
endDate = _ref.endDate,
|
|
169
169
|
toLevel = _ref.toLevel,
|
|
170
|
-
includeWork = _ref.includeWork
|
|
170
|
+
includeWork = _ref.includeWork,
|
|
171
|
+
IncludeNoTaskKr = _ref.IncludeNoTaskKr,
|
|
172
|
+
IsDateFilter = _ref.IsDateFilter;
|
|
171
173
|
var resultStatus = [];
|
|
172
174
|
|
|
173
175
|
if (checkedStatus.includes("all")) {
|
|
@@ -200,6 +202,8 @@ var formatCondition = function formatCondition(_ref) {
|
|
|
200
202
|
startDate: startDate || '',
|
|
201
203
|
endDate: endDate || '',
|
|
202
204
|
includeWork: includeWork,
|
|
205
|
+
IncludeNoTaskKr: IncludeNoTaskKr,
|
|
206
|
+
IsDateFilter: IsDateFilter,
|
|
203
207
|
status: resultStatus.join(","),
|
|
204
208
|
userObjects: users.map(function (user) {
|
|
205
209
|
return {
|