@titaui/pc 1.12.4 → 1.12.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/contact-kefu/index.css +1 -1
- package/lib/components/contact-kefu/index.js +2 -2
- package/lib/components/drop-selector/index.js +1 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +78 -42
- package/lib/components/okr-flow/export-modal/index.js +20 -10
- package/lib/components/progress/circle-progress/index.css +2 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +8 -3
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +4 -2
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +1 -1
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +8 -2
- package/lib/components/upload/components/uploadedPreview.js +1 -1
- package/lib/components/upload/index.js +34 -6
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +0 -1
- package/lib/components/user-selector/searched-panel/index.js +8 -2
- package/lib/pages/new-okr-list/header/index.js +1 -3
- package/lib/utils/auth.js +12 -0
- package/lib/utils/hooks.js +14 -0
- package/lib/utils/tita-okr-cycle.js +24 -0
- package/package.json +1 -1
|
@@ -54,7 +54,7 @@ var ContactKefu = function ContactKefu() {
|
|
|
54
54
|
setVisible = _useState2[1];
|
|
55
55
|
|
|
56
56
|
var handleShowCode = function handleShowCode() {
|
|
57
|
-
setVisible(
|
|
57
|
+
setVisible(!visible);
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
var isTrial = ((_window$BSGlobal = window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$tena = _window$BSGlobal.tenantAuthentication) === null || _window$BSGlobal$tena === void 0 ? void 0 : _window$BSGlobal$tena.Version) === 1 && (0, _platform.isOfficialSite)();
|
|
@@ -78,7 +78,7 @@ var ContactKefu = function ContactKefu() {
|
|
|
78
78
|
return /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
79
79
|
popup: popup,
|
|
80
80
|
popupTransitionName: "tita-popup-zoom-left-bottom",
|
|
81
|
-
|
|
81
|
+
popupPlacement: "topLeft",
|
|
82
82
|
popupAlign: {
|
|
83
83
|
offset: [-32, -10],
|
|
84
84
|
overflow: {
|
|
@@ -156,8 +156,7 @@ function DropSelector(props) {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
var handlePopVisibleChange = (0, _react.useCallback)(function (visible) {
|
|
159
|
-
console.log('visible' in props)
|
|
160
|
-
|
|
159
|
+
// console.log('visible' in props)
|
|
161
160
|
if (!('visible' in props)) {
|
|
162
161
|
setVisible(visible);
|
|
163
162
|
}
|
|
@@ -21,6 +21,8 @@ var _precls = _interopRequireDefault(require("../../precls"));
|
|
|
21
21
|
|
|
22
22
|
var _drawerManager = _interopRequireDefault(require("../../../../../drawer-manager"));
|
|
23
23
|
|
|
24
|
+
var _taskRelationModal = _interopRequireDefault(require("../../../../../task-relation-modal"));
|
|
25
|
+
|
|
24
26
|
var _auth = require("../../../../../../utils/auth");
|
|
25
27
|
|
|
26
28
|
var _tooltipText = _interopRequireDefault(require("../../../../../tooltip/tooltip-text"));
|
|
@@ -41,10 +43,25 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
41
43
|
|
|
42
44
|
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); }); }; }
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
47
|
+
|
|
48
|
+
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."); }
|
|
49
|
+
|
|
50
|
+
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); }
|
|
51
|
+
|
|
52
|
+
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; }
|
|
53
|
+
|
|
54
|
+
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; }
|
|
55
|
+
|
|
56
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
57
|
+
|
|
58
|
+
var hasProject = (0, _bsGlobal.hasWebHead)('project');
|
|
59
|
+
var RelationTaskModel = _taskRelationModal["default"].RelationTaskModel,
|
|
60
|
+
RelationWorkModel = _taskRelationModal["default"].RelationWorkModel;
|
|
61
|
+
var baseAuth = new _auth.BaseAuth();
|
|
45
62
|
|
|
46
63
|
var EKrNode = function EKrNode(props) {
|
|
47
|
-
var _okrInfo$authority;
|
|
64
|
+
var _window, _window$BSGlobal, _window$BSGlobal$Work, _window$BSGlobal$Work2, _okrInfo$authority;
|
|
48
65
|
|
|
49
66
|
var index = props.index,
|
|
50
67
|
title = props.title,
|
|
@@ -60,6 +77,19 @@ var EKrNode = function EKrNode(props) {
|
|
|
60
77
|
var _useContext2 = (0, _react.useContext)(_context2.EListContext),
|
|
61
78
|
refreshEList = _useContext2.refreshEList;
|
|
62
79
|
|
|
80
|
+
var _useState = (0, _react.useState)(false),
|
|
81
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
82
|
+
isShowWork = _useState2[0],
|
|
83
|
+
setIsShowWork = _useState2[1];
|
|
84
|
+
|
|
85
|
+
var _useState3 = (0, _react.useState)(false),
|
|
86
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
87
|
+
isShowTask = _useState4[0],
|
|
88
|
+
setIsShowTask = _useState4[1];
|
|
89
|
+
|
|
90
|
+
var onlySuperCreateWork = (_window = window) === null || _window === void 0 ? void 0 : (_window$BSGlobal = _window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$Work = _window$BSGlobal.WorkAdvancedSetting) === null || _window$BSGlobal$Work === void 0 ? void 0 : (_window$BSGlobal$Work2 = _window$BSGlobal$Work.WorkFunctionSetting) === null || _window$BSGlobal$Work2 === void 0 ? void 0 : _window$BSGlobal$Work2.WorkCreate; //开启后,仅超管、目标管理员、老板/助理可创建项目
|
|
91
|
+
|
|
92
|
+
var canCreateWork = baseAuth.isBoss() || baseAuth.isManager() || baseAuth.isWorkManager() || baseAuth.isAssistant() || !onlySuperCreateWork;
|
|
63
93
|
var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
|
|
64
94
|
var hasRelativeAuth;
|
|
65
95
|
|
|
@@ -85,7 +115,7 @@ var EKrNode = function EKrNode(props) {
|
|
|
85
115
|
while (1) {
|
|
86
116
|
switch (_context.prev = _context.next) {
|
|
87
117
|
case 0:
|
|
88
|
-
if (name ===
|
|
118
|
+
if (name === 'addTask') {
|
|
89
119
|
params = {
|
|
90
120
|
objId: data.workId,
|
|
91
121
|
objType: 4,
|
|
@@ -105,7 +135,7 @@ var EKrNode = function EKrNode(props) {
|
|
|
105
135
|
allowObjectOptions: false
|
|
106
136
|
}
|
|
107
137
|
}).then(function () {
|
|
108
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
138
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'), {
|
|
109
139
|
canClose: false
|
|
110
140
|
});
|
|
111
141
|
|
|
@@ -116,7 +146,7 @@ var EKrNode = function EKrNode(props) {
|
|
|
116
146
|
okrId: data.workId,
|
|
117
147
|
krId: data.mileStoneId
|
|
118
148
|
}).then(function () {
|
|
119
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
149
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'), {
|
|
120
150
|
canClose: false
|
|
121
151
|
});
|
|
122
152
|
|
|
@@ -137,38 +167,29 @@ var EKrNode = function EKrNode(props) {
|
|
|
137
167
|
};
|
|
138
168
|
}(), []);
|
|
139
169
|
var openRelatePop = (0, _react.useCallback)(function (name) {
|
|
140
|
-
if (name ===
|
|
141
|
-
|
|
142
|
-
okrId: data.workId,
|
|
143
|
-
krId: data.mileStoneId
|
|
144
|
-
}).then(function () {
|
|
145
|
-
_toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
|
|
146
|
-
canClose: false
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
setTimeout(refreshEList, 2000);
|
|
150
|
-
})["catch"](function (e) {
|
|
151
|
-
_toast["default"].Error(e, {
|
|
152
|
-
canClose: false
|
|
153
|
-
});
|
|
154
|
-
});
|
|
170
|
+
if (name === 'relateTask') {
|
|
171
|
+
setIsShowTask(true);
|
|
155
172
|
} else {
|
|
156
|
-
|
|
157
|
-
okrId: data.workId,
|
|
158
|
-
krId: data.mileStoneId
|
|
159
|
-
}).then(function () {
|
|
160
|
-
_toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
|
|
161
|
-
canClose: false
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
setTimeout(refreshEList, 2000);
|
|
165
|
-
})["catch"](function (e) {
|
|
166
|
-
_toast["default"].Error(e.errorMsg, {
|
|
167
|
-
canClose: false
|
|
168
|
-
});
|
|
169
|
-
});
|
|
173
|
+
setIsShowWork(true);
|
|
170
174
|
}
|
|
171
|
-
});
|
|
175
|
+
}, []);
|
|
176
|
+
|
|
177
|
+
var onModelCancel = function onModelCancel() {
|
|
178
|
+
setIsShowTask(false);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
var onModelWorkCancel = function onModelWorkCancel() {
|
|
182
|
+
setIsShowWork(false);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
var onModelOk = function onModelOk(data) {
|
|
186
|
+
setTimeout(refreshEList, 2000);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
var onModelWorkOK = function onModelWorkOK(data) {
|
|
190
|
+
setTimeout(refreshEList, 2000);
|
|
191
|
+
};
|
|
192
|
+
|
|
172
193
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
173
194
|
key: index,
|
|
174
195
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node"))
|
|
@@ -180,7 +201,7 @@ var EKrNode = function EKrNode(props) {
|
|
|
180
201
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node-title")),
|
|
181
202
|
onClick: function onClick() {
|
|
182
203
|
if (data.mileStoneId) {
|
|
183
|
-
_drawerManager["default"].open(
|
|
204
|
+
_drawerManager["default"].open('krDetail', {
|
|
184
205
|
krId: data.mileStoneId
|
|
185
206
|
});
|
|
186
207
|
}
|
|
@@ -199,32 +220,47 @@ var EKrNode = function EKrNode(props) {
|
|
|
199
220
|
ref: btnRef
|
|
200
221
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
201
222
|
className: "tu-icon-add1"
|
|
202
|
-
}), (0, _getLocale.getLocale)(
|
|
223
|
+
}), (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Newlybuild'))
|
|
203
224
|
}, /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
204
225
|
icon: "tu-icon-Add-renwu",
|
|
205
226
|
exIconClass: "e-kr-node-layer-icon",
|
|
206
227
|
name: "addTask"
|
|
207
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)(
|
|
228
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Addtask'))), hasProject && canCreateWork ? /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
208
229
|
icon: "tu-icon-Add-xiangmu",
|
|
209
230
|
exIconClass: "e-kr-node-layer-icon",
|
|
210
231
|
name: "addProject"
|
|
211
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)(
|
|
232
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Addproject'))) : /*#__PURE__*/_react["default"].createElement("span", null)), hasRelation && /*#__PURE__*/_react["default"].createElement(_dropSelector["default"], {
|
|
212
233
|
popupPlacement: "bottomRight",
|
|
213
234
|
onChange: openRelatePop,
|
|
214
235
|
trigger: /*#__PURE__*/_react["default"].createElement("span", {
|
|
215
236
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node-actions-connect"))
|
|
216
237
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
217
238
|
className: "tu-icon-guanlian e-kr-node__guanlian-icon"
|
|
218
|
-
}), (0, _getLocale.getLocale)(
|
|
239
|
+
}), (0, _getLocale.getLocale)('Mod_Associate'))
|
|
219
240
|
}, /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
220
241
|
icon: "tu-icon-GL-renwu",
|
|
221
242
|
exIconClass: "e-kr-node-layer-icon",
|
|
222
243
|
name: "relateTask"
|
|
223
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)(
|
|
244
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Assotask'))), hasProject ? /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
224
245
|
icon: "tu-icon-GL-xiangmu",
|
|
225
246
|
exIconClass: "e-kr-node-layer-icon",
|
|
226
247
|
name: "relateProject"
|
|
227
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)(
|
|
248
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_AssProjects'))) : /*#__PURE__*/_react["default"].createElement("span", null)), isShowTask && /*#__PURE__*/_react["default"].createElement(RelationTaskModel, {
|
|
249
|
+
noScreen: true,
|
|
250
|
+
zIndex: 2400,
|
|
251
|
+
krId: data === null || data === void 0 ? void 0 : data.mileStoneId,
|
|
252
|
+
okrId: data.workId,
|
|
253
|
+
defaultVisible: true,
|
|
254
|
+
onCancel: onModelCancel,
|
|
255
|
+
onRelateSuccess: onModelOk
|
|
256
|
+
}), isShowWork && /*#__PURE__*/_react["default"].createElement(RelationWorkModel, {
|
|
257
|
+
zIndex: 2400,
|
|
258
|
+
krId: data === null || data === void 0 ? void 0 : data.mileStoneId,
|
|
259
|
+
okrId: data.workId,
|
|
260
|
+
defaultVisible: true,
|
|
261
|
+
onCancel: onModelWorkCancel,
|
|
262
|
+
onRelateSuccess: onModelWorkOK
|
|
263
|
+
})) : null);
|
|
228
264
|
};
|
|
229
265
|
|
|
230
266
|
var _default = EKrNode;
|
|
@@ -201,13 +201,18 @@ var ExportMapModal = function ExportMapModal(props) {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
size = size / 1024 / 1024; // @ts-ignore
|
|
204
|
+
// window.titaTracker && window.titaTracker("action").record({
|
|
205
|
+
// actionName: userId+'租户:'+telentId+'我得到了图片大小为:'+size+',路径为'+imgUrl.slice(1,200),
|
|
206
|
+
// actionGroup: 'okr地图图片',
|
|
207
|
+
// productName: 'okr地图导出',
|
|
208
|
+
// });
|
|
204
209
|
|
|
205
210
|
// @ts-ignore
|
|
206
|
-
window.titaTracker && window.titaTracker("action").record({
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
});
|
|
211
|
+
// window.titaTracker && window.titaTracker("action").record({
|
|
212
|
+
// actionName: userId+'租户:'+telentId+'我得到了图片大小为:'+size+',路径为'+imgUrl.slice(1,200),
|
|
213
|
+
// actionGroup: 'okr地图图片',
|
|
214
|
+
// productName: 'okr地图导出',
|
|
215
|
+
// });
|
|
211
216
|
Sentry.withScope(function (scope) {
|
|
212
217
|
scope.setTag("error-level", "P0");
|
|
213
218
|
scope.setTag("error-type", "地图导出-图片生成");
|
|
@@ -215,13 +220,18 @@ var ExportMapModal = function ExportMapModal(props) {
|
|
|
215
220
|
});
|
|
216
221
|
(0, _requestApis.getBase64DownloadUrl)(imgUrl.split(',')[1]).then(function (url) {
|
|
217
222
|
var image = new Image(); // @ts-ignore
|
|
223
|
+
// window.titaTracker && window.titaTracker("action").record({
|
|
224
|
+
// actionName: userId+'租户:'+telentId+'我获得了地址'+url.Data.obj,
|
|
225
|
+
// actionGroup: 'okr地图接口',
|
|
226
|
+
// productName: 'okr地图导出',
|
|
227
|
+
// });
|
|
218
228
|
|
|
219
229
|
// @ts-ignore
|
|
220
|
-
window.titaTracker && window.titaTracker("action").record({
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
});
|
|
230
|
+
// window.titaTracker && window.titaTracker("action").record({
|
|
231
|
+
// actionName: userId+'租户:'+telentId+'我获得了地址'+url.Data.obj,
|
|
232
|
+
// actionGroup: 'okr地图接口',
|
|
233
|
+
// productName: 'okr地图导出',
|
|
234
|
+
// });
|
|
225
235
|
Sentry.withScope(function (scope) {
|
|
226
236
|
scope.setTag("error-level", "P0");
|
|
227
237
|
scope.setTag("error-type", "地图导出-图片地址");
|
|
@@ -29,7 +29,7 @@ var _getLocale = require("../../../../utils/getLocale");
|
|
|
29
29
|
|
|
30
30
|
require("./index.css");
|
|
31
31
|
|
|
32
|
-
var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "krId", "okrId", "isRelationOther", "onRelateSuccess", "lastSelected"];
|
|
32
|
+
var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "krId", "okrId", "zIndex", "isRelationOther", "onRelateSuccess", "noScreen", "lastSelected"];
|
|
33
33
|
|
|
34
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
35
|
|
|
@@ -76,9 +76,13 @@ function OkrRelationTaskModal(props) {
|
|
|
76
76
|
onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
|
|
77
77
|
krId = props.krId,
|
|
78
78
|
okrId = props.okrId,
|
|
79
|
+
_props$zIndex = props.zIndex,
|
|
80
|
+
zIndex = _props$zIndex === void 0 ? 1000 : _props$zIndex,
|
|
79
81
|
_props$isRelationOthe = props.isRelationOther,
|
|
80
82
|
isRelationOther = _props$isRelationOthe === void 0 ? false : _props$isRelationOthe,
|
|
81
83
|
onRelateSuccess = props.onRelateSuccess,
|
|
84
|
+
_props$noScreen = props.noScreen,
|
|
85
|
+
noScreen = _props$noScreen === void 0 ? false : _props$noScreen,
|
|
82
86
|
_props$lastSelected = props.lastSelected,
|
|
83
87
|
lastSelected = _props$lastSelected === void 0 ? [] : _props$lastSelected,
|
|
84
88
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
@@ -220,7 +224,7 @@ function OkrRelationTaskModal(props) {
|
|
|
220
224
|
height: '590px'
|
|
221
225
|
},
|
|
222
226
|
width: 840,
|
|
223
|
-
zIndex:
|
|
227
|
+
zIndex: zIndex,
|
|
224
228
|
noHeadLine: true,
|
|
225
229
|
noFooterLine: true // getContainer={getContainer}
|
|
226
230
|
,
|
|
@@ -246,7 +250,8 @@ function OkrRelationTaskModal(props) {
|
|
|
246
250
|
setSelected: setSelected,
|
|
247
251
|
data: taskData,
|
|
248
252
|
multiple: true,
|
|
249
|
-
pageSize: pageSize
|
|
253
|
+
pageSize: pageSize,
|
|
254
|
+
noScreen: noScreen
|
|
250
255
|
})), !!total && /*#__PURE__*/_react["default"].createElement("div", {
|
|
251
256
|
className: "".concat(preCls, "__content-pagination")
|
|
252
257
|
}, /*#__PURE__*/_react["default"].createElement(_pagination["default"], {
|
|
@@ -21,7 +21,7 @@ var _getLocale = require("../../../../utils/getLocale");
|
|
|
21
21
|
|
|
22
22
|
require("./index.css");
|
|
23
23
|
|
|
24
|
-
var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "onRelateSuccess", "krId", "okrId", "isRelationOther", "lastSelected"];
|
|
24
|
+
var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "onRelateSuccess", "krId", "zIndex", "okrId", "isRelationOther", "lastSelected"];
|
|
25
25
|
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
27
|
|
|
@@ -59,6 +59,8 @@ function OkrRelationWorkModal(props) {
|
|
|
59
59
|
onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
|
|
60
60
|
onRelateSuccess = props.onRelateSuccess,
|
|
61
61
|
krId = props.krId,
|
|
62
|
+
_props$zIndex = props.zIndex,
|
|
63
|
+
zIndex = _props$zIndex === void 0 ? 1000 : _props$zIndex,
|
|
62
64
|
okrId = props.okrId,
|
|
63
65
|
_props$isRelationOthe = props.isRelationOther,
|
|
64
66
|
isRelationOther = _props$isRelationOthe === void 0 ? false : _props$isRelationOthe,
|
|
@@ -111,7 +113,7 @@ function OkrRelationWorkModal(props) {
|
|
|
111
113
|
height: '590px'
|
|
112
114
|
},
|
|
113
115
|
width: 840,
|
|
114
|
-
zIndex:
|
|
116
|
+
zIndex: zIndex,
|
|
115
117
|
noHeadLine: true,
|
|
116
118
|
noFooterLine: true // getContainer={getContainer}
|
|
117
119
|
,
|
|
@@ -48,7 +48,9 @@ var TaskTree = function TaskTree(_ref) {
|
|
|
48
48
|
setSelected = _ref.setSelected,
|
|
49
49
|
pageSize = _ref.pageSize,
|
|
50
50
|
_ref$isWork = _ref.isWork,
|
|
51
|
-
isWork = _ref$isWork === void 0 ? false : _ref$isWork
|
|
51
|
+
isWork = _ref$isWork === void 0 ? false : _ref$isWork,
|
|
52
|
+
_ref$noScreen = _ref.noScreen,
|
|
53
|
+
noScreen = _ref$noScreen === void 0 ? false : _ref$noScreen;
|
|
52
54
|
var scrollStyle = {
|
|
53
55
|
height: '100%',
|
|
54
56
|
backgroundColor: 'transparent',
|
|
@@ -59,7 +61,11 @@ var TaskTree = function TaskTree(_ref) {
|
|
|
59
61
|
if (isWork) {
|
|
60
62
|
window.open("#work?work_id=".concat(id, "&to_user_id=").concat((0, _helpers.getLoginUserInfo)().Id, "&status=1"));
|
|
61
63
|
} else {
|
|
62
|
-
|
|
64
|
+
if (noScreen) {
|
|
65
|
+
window.open("https://".concat(location.host).concat(location.pathname, "#more/taskinfo?id=").concat(id));
|
|
66
|
+
} else {
|
|
67
|
+
window.Talent.app.vent.trigger('global-pull-screen', id, 'task');
|
|
68
|
+
}
|
|
63
69
|
}
|
|
64
70
|
};
|
|
65
71
|
|
|
@@ -212,7 +212,7 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
212
212
|
}, /*#__PURE__*/_react["default"].createElement(_style.PreviewFileTitle, {
|
|
213
213
|
"data-tip": uploadResultItem.FileName,
|
|
214
214
|
key: uploadResultItem.uid
|
|
215
|
-
}, uploadResultItem.FileName,
|
|
215
|
+
}, uploadResultItem.FileName, uploadResultItem.uploadStatus === 2 ? /*#__PURE__*/_react["default"].createElement(_style.UploadProgress, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
216
216
|
style: {
|
|
217
217
|
width: "".concat(uploadResultItem.percentComplete, "%")
|
|
218
218
|
},
|
|
@@ -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) {
|
|
@@ -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
|
}
|
|
@@ -21,6 +21,8 @@ var _empty = _interopRequireDefault(require("../empty"));
|
|
|
21
21
|
|
|
22
22
|
var _group = _interopRequireDefault(require("../empty/group"));
|
|
23
23
|
|
|
24
|
+
var _hooks = require("../../../utils/hooks");
|
|
25
|
+
|
|
24
26
|
var _context = require("../context");
|
|
25
27
|
|
|
26
28
|
var _getLocale = require("../../../utils/getLocale");
|
|
@@ -90,7 +92,7 @@ function _default(props) {
|
|
|
90
92
|
noAuth = _useState10[0],
|
|
91
93
|
setNoAuth = _useState10[1];
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
var searchUser = function searchUser() {
|
|
94
96
|
setLoading(true);
|
|
95
97
|
(0, _requestApis.search)({
|
|
96
98
|
searchKey: searchKey,
|
|
@@ -114,7 +116,11 @@ function _default(props) {
|
|
|
114
116
|
setDeparts((0, _utils.translateDepartsToTreeNode)(departments || []));
|
|
115
117
|
setLoading(false);
|
|
116
118
|
});
|
|
117
|
-
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
(0, _hooks.useDebouncedEffect)(function () {
|
|
122
|
+
searchUser();
|
|
123
|
+
}, 200, [searchKey]); // 计算结果,是否显示空值
|
|
118
124
|
|
|
119
125
|
var itemCount = 0;
|
|
120
126
|
|
|
@@ -37,8 +37,6 @@ var _requestApi = require("../request-api");
|
|
|
37
37
|
|
|
38
38
|
var _getLocale = require("../../../utils/getLocale");
|
|
39
39
|
|
|
40
|
-
var _tools = require("../../../utils/tools");
|
|
41
|
-
|
|
42
40
|
require("./index.css");
|
|
43
41
|
|
|
44
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -235,7 +233,7 @@ function Header(props, ref) {
|
|
|
235
233
|
userInfo: userInfo
|
|
236
234
|
}), /*#__PURE__*/_react["default"].createElement(_filter["default"], {
|
|
237
235
|
onSearch: onSearch
|
|
238
|
-
}), Number(cycleType) !== -1 &&
|
|
236
|
+
}), Number(cycleType) !== -1 && Number(relation) !== 2 && Number(relation) !== 3 && departmentId === undefined && /*#__PURE__*/_react["default"].createElement(_operateRecord["default"], {
|
|
239
237
|
toUserId: toUserId,
|
|
240
238
|
userInfo: userInfo,
|
|
241
239
|
relation: relationShip,
|
package/lib/utils/auth.js
CHANGED
|
@@ -49,6 +49,18 @@ var BaseAuth = /*#__PURE__*/function () {
|
|
|
49
49
|
value: function isManager() {
|
|
50
50
|
// console.log('ismanager', this.loginUserInfor.IsOkrManager)
|
|
51
51
|
return this.loginUserInfor.IsOkrManager;
|
|
52
|
+
} // 助理或者说动态管理员
|
|
53
|
+
|
|
54
|
+
}, {
|
|
55
|
+
key: "isAssistant",
|
|
56
|
+
value: function isAssistant() {
|
|
57
|
+
return this.loginUserInfor.Role === 1;
|
|
58
|
+
} // 项目管理员
|
|
59
|
+
|
|
60
|
+
}, {
|
|
61
|
+
key: "isWorkManager",
|
|
62
|
+
value: function isWorkManager() {
|
|
63
|
+
return this.loginUserInfor.IsWorkManager;
|
|
52
64
|
}
|
|
53
65
|
}, {
|
|
54
66
|
key: "isDepartmentLeader",
|
package/lib/utils/hooks.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = useQuery;
|
|
7
7
|
exports.parseUrl = parseUrl;
|
|
8
|
+
exports.useDebouncedEffect = useDebouncedEffect;
|
|
8
9
|
|
|
9
10
|
var _react = require("react");
|
|
10
11
|
|
|
@@ -69,4 +70,17 @@ function useQuery(name) {
|
|
|
69
70
|
};
|
|
70
71
|
}, []);
|
|
71
72
|
return state;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function useDebouncedEffect(fn, ms, deps) {
|
|
76
|
+
(0, _react.useEffect)(function () {
|
|
77
|
+
var clean = null;
|
|
78
|
+
var timer = setTimeout(function () {
|
|
79
|
+
clean = fn();
|
|
80
|
+
}, ms);
|
|
81
|
+
return function () {
|
|
82
|
+
clearTimeout(timer);
|
|
83
|
+
if (clean) clean();
|
|
84
|
+
};
|
|
85
|
+
}, deps);
|
|
72
86
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.cycleType = void 0;
|
|
7
|
+
// annualNum: "2022" 年份
|
|
8
|
+
// cycleType: "-1" 全部周期
|
|
9
|
+
// endDate: ""
|
|
10
|
+
// startDate: ""
|
|
11
|
+
// yqmNum: "0"
|
|
12
|
+
// annualNum: "2022"
|
|
13
|
+
// cycleType: "5" 上半年
|
|
14
|
+
// endDate: "2022/09/30"
|
|
15
|
+
// startDate: "2022/04/01"
|
|
16
|
+
// yqmNum: "1"
|
|
17
|
+
var cycleType = {
|
|
18
|
+
'-1': '全部周期',
|
|
19
|
+
'1': '年度',
|
|
20
|
+
"2": "季度",
|
|
21
|
+
"4": "双月",
|
|
22
|
+
"5": "半年度"
|
|
23
|
+
};
|
|
24
|
+
exports.cycleType = cycleType;
|