@titaui/pc 1.11.33 → 1.11.35-beta.2
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/avatar/name-avatar/index.css +1 -0
- package/lib/components/avatar/name-avatar/index.js +22 -13
- package/lib/components/button/rect-btn/index.css +45 -11
- package/lib/components/button/rect-btn/index.js +12 -6
- package/lib/components/change-okr-modal/index.js +2 -1
- package/lib/components/checkbox/index.css +3 -3
- package/lib/components/create-okr-modal/index.js +48 -42
- package/lib/components/create-okr-modal/request-api.js +1 -1
- package/lib/components/dialog-confirm/index.css +2 -2
- package/lib/components/drawer/headerAction.js +5 -1
- package/lib/components/drawer/headerDrop.js +42 -4
- package/lib/components/drawer/index.css +33 -0
- package/lib/components/drawer/index.js +26 -3
- package/lib/components/dynamic/dynamic-list/index.js +14 -6
- package/lib/components/dynamic/index.js +9 -12
- package/lib/components/dynamic/request-api.js +7 -68
- package/lib/components/nav-top/index.js +8 -4
- package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +20 -4
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +9 -1
- package/lib/components/okr-detail/components/header/index.js +10 -3
- package/lib/components/okr-detail/components/header/o-name.js +10 -3
- package/lib/components/okr-detail/components/o-classify.js +5 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +13 -14
- package/lib/components/okr-detail/detail-header/constant.js +53 -0
- package/lib/components/okr-detail/detail-header/delete-confirm/delete-confirm.js +98 -43
- package/lib/components/okr-detail/detail-header/delete-confirm/index.css +55 -0
- package/lib/components/okr-detail/detail-header/index.css +11 -0
- package/lib/components/okr-detail/detail-header/index.js +228 -234
- package/lib/components/okr-detail/helper.js +108 -0
- package/lib/components/okr-detail/index.js +21 -4
- package/lib/components/okr-detail/okr-list/index.js +8 -3
- package/lib/components/okr-detail/request-apis.js +10 -4
- package/lib/components/okr-flow/export-modal/index.js +13 -1
- package/lib/components/okr-period-selector/index.js +9 -5
- package/lib/components/okr-period-selector/select-cycle.js +23 -19
- package/lib/components/operation-records/index.js +1 -1
- package/lib/components/operation-records/style.js +1 -1
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +16 -10
- package/lib/components/task-relation-modal/request-api.js +2 -1
- package/lib/components/textarea/index.css +142 -0
- package/lib/components/textarea/index.js +259 -0
- package/lib/components/time-picker/time-picker.js +37 -93
- package/lib/components/toast/index.js +5 -3
- package/lib/index.js +40 -0
- package/lib/pages/new-okr-list/header/common.js +52 -0
- package/lib/pages/new-okr-list/header/index.css +45 -0
- package/lib/pages/new-okr-list/header/index.js +38 -16
- package/lib/{components/dynamic/dynamic-liking/index.js → pages/new-okr-list/header/operate-record.js} +91 -39
- package/lib/pages/new-okr-list/index.js +3 -1
- package/lib/pages/new-okr-list/list/index.js +19 -2
- package/lib/pages/new-okr-list/request-api.js +8 -2
- package/lib/pages/okr-map/unsupport-ie/index.js +3 -5
- package/lib/utils/format-time.js +8 -1
- package/lib/utils/open-data.js +5 -1
- package/package.json +2 -2
- package/lib/components/dynamic/advertise/components/next-btn/index.css +0 -27
- package/lib/components/dynamic/advertise/components/next-btn/index.js +0 -32
- package/lib/components/dynamic/advertise/components/pre-btn/index.css +0 -26
- package/lib/components/dynamic/advertise/components/pre-btn/index.js +0 -32
- package/lib/components/dynamic/advertise/index.css +0 -21
- package/lib/components/dynamic/advertise/index.js +0 -126
- package/lib/components/dynamic/advertise/interface.js +0 -5
- package/lib/components/dynamic/advertise/util.js +0 -28
- package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -81
- package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -203
- package/lib/components/dynamic/components/first-level-tabs/index.css +0 -101
- package/lib/components/dynamic/components/first-level-tabs/index.js +0 -131
- package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -146
- package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -180
- package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -105
- package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
- package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
- package/lib/components/dynamic/dynamic-liking/index.css +0 -81
- package/lib/components/dynamic/dynamic-liking/item.js +0 -75
- package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
- package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +0 -16
- package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +0 -30
- package/lib/components/dynamic/dynamic-topping/index.css +0 -141
- package/lib/components/dynamic/dynamic-topping/index.js +0 -82
- package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
- package/lib/components/dynamic/dynamic-topping/item.js +0 -153
- package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
- package/lib/components/dynamic/dynamic.css +0 -173
- package/lib/components/dynamic/dynamic.js +0 -428
- package/lib/components/dynamic/export-module/index.js +0 -37
- package/lib/components/dynamic/img/dynamic-top.svg +0 -14
- package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
- package/lib/components/dynamic/my-team/img/line.png +0 -0
- package/lib/components/dynamic/my-team/img/team.png +0 -0
- package/lib/components/dynamic/my-team/index.css +0 -184
- package/lib/components/dynamic/my-team/index.js +0 -263
- package/lib/components/dynamic/my-team/request-api.js +0 -52
- package/lib/components/dynamic/my-team/util.js +0 -20
- package/lib/components/dynamic/new-ui.css +0 -192
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +0 -58
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +0 -68
- package/lib/components/dynamic/online-broadcast/data.js +0 -77
- package/lib/components/dynamic/online-broadcast/img/broadcast.svg +0 -14
- package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
- package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
- package/lib/components/dynamic/online-broadcast/index.css +0 -46
- package/lib/components/dynamic/online-broadcast/index.js +0 -61
- package/lib/components/dynamic/online-broadcast/interfact.js +0 -5
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -39
- package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -39
- package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -39
- package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-task/index.js +0 -44
- package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
- package/lib/components/dynamic/quick-operation/index.css +0 -51
- package/lib/components/dynamic/quick-operation/index.js +0 -120
- package/lib/components/okr-detail/detail-header/delete-confirm/style.js +0 -38
|
@@ -9,8 +9,6 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _titaUi = require("tita-ui");
|
|
13
|
-
|
|
14
12
|
var _userSelector = _interopRequireDefault(require("../../user-selector"));
|
|
15
13
|
|
|
16
14
|
var _drawer = _interopRequireDefault(require("../../drawer"));
|
|
@@ -27,7 +25,9 @@ var _requestApis = require("../request-apis");
|
|
|
27
25
|
|
|
28
26
|
var _okrShare = _interopRequireDefault(require("../../okr-share"));
|
|
29
27
|
|
|
30
|
-
var
|
|
28
|
+
var _context6 = require("../context");
|
|
29
|
+
|
|
30
|
+
var _constant = require("./constant");
|
|
31
31
|
|
|
32
32
|
var _deleteConfirm = _interopRequireDefault(require("./delete-confirm/delete-confirm"));
|
|
33
33
|
|
|
@@ -74,7 +74,7 @@ function OkrDetailHeader(_ref) {
|
|
|
74
74
|
setShareVisible = _useState2[1];
|
|
75
75
|
|
|
76
76
|
var userSelectRef = (0, _react.useRef)();
|
|
77
|
-
var
|
|
77
|
+
var deletePopRef = (0, _react.useRef)();
|
|
78
78
|
|
|
79
79
|
var _useState3 = (0, _react.useState)([]),
|
|
80
80
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -83,8 +83,11 @@ function OkrDetailHeader(_ref) {
|
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
var loginUserId = window.BSGlobal.loginUserInfo.Id;
|
|
86
|
-
var context = (0, _react.useContext)(
|
|
87
|
-
var commonContext = (0, _react.useContext)(
|
|
86
|
+
var context = (0, _react.useContext)(_context6.GeneralDataContext);
|
|
87
|
+
var commonContext = (0, _react.useContext)(_context6.CommonContext);
|
|
88
|
+
var approvalSetting = commonContext.approvalSetting,
|
|
89
|
+
okrInfo = commonContext.okrInfo;
|
|
90
|
+
var approveStatusColor = (0, _constant.ApproveStatusColor)(okrInfo.applyState);
|
|
88
91
|
var changVisiblity = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
89
92
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(workId, visibility) {
|
|
90
93
|
var visibilityScope,
|
|
@@ -133,220 +136,238 @@ function OkrDetailHeader(_ref) {
|
|
|
133
136
|
var closeShareModal = (0, _react.useCallback)(function () {
|
|
134
137
|
setShareVisible(false);
|
|
135
138
|
}, []);
|
|
139
|
+
|
|
140
|
+
var handleDeleteOkr = function handleDeleteOkr(selected) {
|
|
141
|
+
(0, _requestApis.workDelete)({
|
|
142
|
+
deleteType: selected,
|
|
143
|
+
workId: detailInfo.workId
|
|
144
|
+
}).then(function (resp) {
|
|
145
|
+
if (resp.Code === 1) {
|
|
146
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
147
|
+
|
|
148
|
+
setTimeout(function () {
|
|
149
|
+
commonContext.refreshAll();
|
|
150
|
+
}, 500);
|
|
151
|
+
} else {
|
|
152
|
+
_toast["default"].Error(resp.Message);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
|
|
136
157
|
var actions = (0, _react.useMemo)(function () {
|
|
137
158
|
if (!detailInfo) {
|
|
138
159
|
return [];
|
|
139
|
-
}
|
|
140
|
-
return (0, _actions.getOkrHeadActions)({
|
|
141
|
-
roleType: context.generalRoleType,
|
|
142
|
-
principalUser: context.generalPrincipalUser,
|
|
143
|
-
visibility: context.generalVisibility.visibility,
|
|
144
|
-
detailInfo: detailInfo,
|
|
145
|
-
openShareModal: function () {
|
|
146
|
-
var _openShareModal = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
147
|
-
var krss;
|
|
148
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
149
|
-
while (1) {
|
|
150
|
-
switch (_context2.prev = _context2.next) {
|
|
151
|
-
case 0:
|
|
152
|
-
_context2.next = 2;
|
|
153
|
-
return (0, _requestApis.getKrs)({
|
|
154
|
-
okrId: detailInfo.workId
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
case 2:
|
|
158
|
-
krss = _context2.sent;
|
|
159
|
-
setKrs(krss);
|
|
160
|
-
setShareVisible(true);
|
|
161
|
-
|
|
162
|
-
case 5:
|
|
163
|
-
case "end":
|
|
164
|
-
return _context2.stop();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}, _callee2);
|
|
168
|
-
}));
|
|
160
|
+
}
|
|
169
161
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
162
|
+
return (0, _actions.getOkrHeadActions)({
|
|
163
|
+
roleType: context.generalRoleType,
|
|
164
|
+
principalUser: context.generalPrincipalUser,
|
|
165
|
+
visibility: context.generalVisibility.visibility,
|
|
166
|
+
detailInfo: detailInfo,
|
|
167
|
+
openShareModal: function () {
|
|
168
|
+
var _openShareModal = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
169
|
+
var krss;
|
|
170
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
171
|
+
while (1) {
|
|
172
|
+
switch (_context2.prev = _context2.next) {
|
|
173
|
+
case 0:
|
|
174
|
+
_context2.next = 2;
|
|
175
|
+
return (0, _requestApis.getKrs)({
|
|
176
|
+
okrId: detailInfo.workId
|
|
177
|
+
});
|
|
173
178
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
case 2:
|
|
180
|
+
krss = _context2.sent;
|
|
181
|
+
setKrs(krss);
|
|
182
|
+
setShareVisible(true);
|
|
183
|
+
|
|
184
|
+
case 5:
|
|
185
|
+
case "end":
|
|
186
|
+
return _context2.stop();
|
|
187
|
+
}
|
|
180
188
|
}
|
|
189
|
+
}, _callee2);
|
|
190
|
+
}));
|
|
181
191
|
|
|
182
|
-
|
|
192
|
+
function openShareModal() {
|
|
193
|
+
return _openShareModal.apply(this, arguments);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return openShareModal;
|
|
197
|
+
}(),
|
|
198
|
+
changeVisiblilty: function changeVisiblilty(visibility) {
|
|
199
|
+
if (visibility === 4) {
|
|
200
|
+
if (userSelectRef.current) {
|
|
201
|
+
userSelectRef.current.open();
|
|
183
202
|
}
|
|
184
203
|
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
if (!follow) {
|
|
216
|
-
_context3.next = 9;
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
_context3.next = 7;
|
|
221
|
-
return (0, _requestApis.addUser)(loginUserId, detailInfo.workId, 3);
|
|
222
|
-
|
|
223
|
-
case 7:
|
|
224
|
-
_context3.next = 11;
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
changVisiblity(detailInfo.workId, visibility);
|
|
208
|
+
},
|
|
209
|
+
onDeleteOkr: function onDeleteOkr(e) {
|
|
210
|
+
deletePopRef.current.show();
|
|
211
|
+
},
|
|
212
|
+
onCopyOkr: function onCopyOkr() {
|
|
213
|
+
// @ts-ignore
|
|
214
|
+
window.openCopyOkrModal({
|
|
215
|
+
okrId: detailInfo.workId,
|
|
216
|
+
okrType: detailInfo.okrType
|
|
217
|
+
});
|
|
218
|
+
},
|
|
219
|
+
onChangeOkrFollow: function () {
|
|
220
|
+
var _onChangeOkrFollow = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(follow) {
|
|
221
|
+
var res;
|
|
222
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
223
|
+
while (1) {
|
|
224
|
+
switch (_context3.prev = _context3.next) {
|
|
225
|
+
case 0:
|
|
226
|
+
_context3.next = 2;
|
|
227
|
+
return (0, _confirm["default"])(follow ? (0, _getLocale.getLocale)('OKR_MyO_Err_Focuson') : (0, _getLocale.getLocale)('OKR_MyO_Err_Unfollow'), follow ? (0, _getLocale.getLocale)('OKR_MyO_Err_Payatten') : (0, _getLocale.getLocale)('OKR_MyO_Err_Progress'));
|
|
228
|
+
|
|
229
|
+
case 2:
|
|
230
|
+
res = _context3.sent;
|
|
231
|
+
|
|
232
|
+
if (!res) {
|
|
233
|
+
_context3.next = 14;
|
|
225
234
|
break;
|
|
235
|
+
}
|
|
226
236
|
|
|
227
|
-
|
|
228
|
-
_context3.next =
|
|
229
|
-
|
|
237
|
+
if (!follow) {
|
|
238
|
+
_context3.next = 9;
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
230
241
|
|
|
231
|
-
|
|
232
|
-
|
|
242
|
+
_context3.next = 7;
|
|
243
|
+
return (0, _requestApis.addUser)(loginUserId, detailInfo.workId, 3);
|
|
233
244
|
|
|
234
|
-
|
|
245
|
+
case 7:
|
|
246
|
+
_context3.next = 11;
|
|
247
|
+
break;
|
|
235
248
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
249
|
+
case 9:
|
|
250
|
+
_context3.next = 11;
|
|
251
|
+
return (0, _requestApis.deleteUser)(loginUserId, detailInfo.workId, 3);
|
|
239
252
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
253
|
+
case 11:
|
|
254
|
+
context.setGeneralRoleType(follow ? 3 : 0); // 关注
|
|
255
|
+
|
|
256
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
257
|
+
|
|
258
|
+
if (!follow) {
|
|
259
|
+
commonContext.refreshAll();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
case 14:
|
|
263
|
+
case "end":
|
|
264
|
+
return _context3.stop();
|
|
244
265
|
}
|
|
245
|
-
}
|
|
246
|
-
})
|
|
266
|
+
}
|
|
267
|
+
}, _callee3);
|
|
268
|
+
}));
|
|
247
269
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
270
|
+
function onChangeOkrFollow(_x3) {
|
|
271
|
+
return _onChangeOkrFollow.apply(this, arguments);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return onChangeOkrFollow;
|
|
275
|
+
}(),
|
|
276
|
+
onFinishOrReOpen: function () {
|
|
277
|
+
var _onFinishOrReOpen = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(isFinish) {
|
|
278
|
+
var res;
|
|
279
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
280
|
+
while (1) {
|
|
281
|
+
switch (_context4.prev = _context4.next) {
|
|
282
|
+
case 0:
|
|
283
|
+
_context4.next = 2;
|
|
284
|
+
return (0, _confirm["default"])(isFinish ? (0, _getLocale.getLocale)('OKR_MyO_Areycloseobjective') : (0, _getLocale.getLocale)('OKR_MyO_Err_Restart'));
|
|
285
|
+
|
|
286
|
+
case 2:
|
|
287
|
+
res = _context4.sent;
|
|
251
288
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
onFinishOrReOpen: function () {
|
|
255
|
-
var _onFinishOrReOpen = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(isFinish) {
|
|
256
|
-
var res;
|
|
257
|
-
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
258
|
-
while (1) {
|
|
259
|
-
switch (_context4.prev = _context4.next) {
|
|
260
|
-
case 0:
|
|
261
|
-
_context4.next = 2;
|
|
262
|
-
return (0, _confirm["default"])(isFinish ? (0, _getLocale.getLocale)('OKR_MyO_Areycloseobjective') : (0, _getLocale.getLocale)('OKR_MyO_Err_Restart'));
|
|
263
|
-
|
|
264
|
-
case 2:
|
|
265
|
-
res = _context4.sent;
|
|
266
|
-
|
|
267
|
-
if (!res) {
|
|
268
|
-
_context4.next = 13;
|
|
269
|
-
break;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
if (!isFinish) {
|
|
273
|
-
_context4.next = 9;
|
|
274
|
-
break;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
_context4.next = 7;
|
|
278
|
-
return (0, _requestApis.close)(detailInfo.workId);
|
|
279
|
-
|
|
280
|
-
case 7:
|
|
281
|
-
_context4.next = 11;
|
|
289
|
+
if (!res) {
|
|
290
|
+
_context4.next = 13;
|
|
282
291
|
break;
|
|
292
|
+
}
|
|
283
293
|
|
|
284
|
-
|
|
285
|
-
_context4.next =
|
|
286
|
-
|
|
294
|
+
if (!isFinish) {
|
|
295
|
+
_context4.next = 9;
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
_context4.next = 7;
|
|
300
|
+
return (0, _requestApis.close)(detailInfo.workId);
|
|
301
|
+
|
|
302
|
+
case 7:
|
|
303
|
+
_context4.next = 11;
|
|
304
|
+
break;
|
|
287
305
|
|
|
288
|
-
|
|
289
|
-
|
|
306
|
+
case 9:
|
|
307
|
+
_context4.next = 11;
|
|
308
|
+
return (0, _requestApis.start)(detailInfo.workId);
|
|
290
309
|
|
|
291
|
-
|
|
310
|
+
case 11:
|
|
311
|
+
commonContext.refreshAll(); // 刷新
|
|
292
312
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
313
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
314
|
+
|
|
315
|
+
case 13:
|
|
316
|
+
case "end":
|
|
317
|
+
return _context4.stop();
|
|
297
318
|
}
|
|
298
|
-
}
|
|
299
|
-
})
|
|
319
|
+
}
|
|
320
|
+
}, _callee4);
|
|
321
|
+
}));
|
|
300
322
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
323
|
+
function onFinishOrReOpen(_x4) {
|
|
324
|
+
return _onFinishOrReOpen.apply(this, arguments);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return onFinishOrReOpen;
|
|
328
|
+
}(),
|
|
329
|
+
onQuit: function () {
|
|
330
|
+
var _onQuit = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
331
|
+
var res;
|
|
332
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
333
|
+
while (1) {
|
|
334
|
+
switch (_context5.prev = _context5.next) {
|
|
335
|
+
case 0:
|
|
336
|
+
_context5.next = 2;
|
|
337
|
+
return (0, _confirm["default"])((0, _getLocale.getLocale)('OKR_MyO_Err_Quit'), (0, _getLocale.getLocale)('OKR_MyO_Err_Inchargec'));
|
|
338
|
+
|
|
339
|
+
case 2:
|
|
340
|
+
res = _context5.sent;
|
|
341
|
+
|
|
342
|
+
if (!res) {
|
|
343
|
+
_context5.next = 8;
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
304
346
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
case 2:
|
|
318
|
-
res = _context5.sent;
|
|
319
|
-
|
|
320
|
-
if (!res) {
|
|
321
|
-
_context5.next = 8;
|
|
322
|
-
break;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
_context5.next = 6;
|
|
326
|
-
return (0, _requestApis.deleteUser)(loginUserId, detailInfo.workId, 2);
|
|
327
|
-
|
|
328
|
-
case 6:
|
|
329
|
-
// context.setGeneralRoleType(0)
|
|
330
|
-
commonContext.refreshAll(); // 刷新
|
|
331
|
-
|
|
332
|
-
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
333
|
-
|
|
334
|
-
case 8:
|
|
335
|
-
case "end":
|
|
336
|
-
return _context5.stop();
|
|
337
|
-
}
|
|
347
|
+
_context5.next = 6;
|
|
348
|
+
return (0, _requestApis.deleteUser)(loginUserId, detailInfo.workId, 2);
|
|
349
|
+
|
|
350
|
+
case 6:
|
|
351
|
+
// context.setGeneralRoleType(0)
|
|
352
|
+
commonContext.refreshAll(); // 刷新
|
|
353
|
+
|
|
354
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
355
|
+
|
|
356
|
+
case 8:
|
|
357
|
+
case "end":
|
|
358
|
+
return _context5.stop();
|
|
338
359
|
}
|
|
339
|
-
}
|
|
340
|
-
})
|
|
360
|
+
}
|
|
361
|
+
}, _callee5);
|
|
362
|
+
}));
|
|
341
363
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
364
|
+
function onQuit() {
|
|
365
|
+
return _onQuit.apply(this, arguments);
|
|
366
|
+
}
|
|
345
367
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}
|
|
368
|
+
return onQuit;
|
|
369
|
+
}()
|
|
370
|
+
});
|
|
350
371
|
}, [detailInfo, context.generalRoleType, context.generalPrincipalUser, context.generalVisibility.visibility]);
|
|
351
372
|
var parent = null;
|
|
352
373
|
|
|
@@ -368,6 +389,8 @@ function OkrDetailHeader(_ref) {
|
|
|
368
389
|
|
|
369
390
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_drawer["default"].Header, {
|
|
370
391
|
actions: actions,
|
|
392
|
+
approvalSetting: approvalSetting,
|
|
393
|
+
detailInfo: detailInfo,
|
|
371
394
|
actionComponent: /*#__PURE__*/_react["default"].createElement(_wechatBtn["default"], {
|
|
372
395
|
id: detailInfo.workId,
|
|
373
396
|
objType: 62,
|
|
@@ -386,7 +409,14 @@ function OkrDetailHeader(_ref) {
|
|
|
386
409
|
krId: parent.id
|
|
387
410
|
});
|
|
388
411
|
}
|
|
389
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, parent.type === 'okr' ? 'O ' : 'KR '), parent.name)) : null
|
|
412
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, parent.type === 'okr' ? 'O ' : 'KR '), parent.name)) : null,
|
|
413
|
+
onlyShowContent: approveStatusColor ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
414
|
+
className: "okr-detail-header-status",
|
|
415
|
+
style: {
|
|
416
|
+
color: approveStatusColor.color,
|
|
417
|
+
backgroundColor: approveStatusColor.bgColor
|
|
418
|
+
}
|
|
419
|
+
}, (0, _constant.getApproveStatusTextMap)(okrInfo.applyState)) : null
|
|
390
420
|
}), /*#__PURE__*/_react["default"].createElement(_okrShare["default"], {
|
|
391
421
|
visible: shareVisible,
|
|
392
422
|
onClose: closeShareModal,
|
|
@@ -404,48 +434,12 @@ function OkrDetailHeader(_ref) {
|
|
|
404
434
|
})
|
|
405
435
|
},
|
|
406
436
|
zIndex: 2400
|
|
407
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
|
408
|
-
ref:
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
onConfirm: /*#__PURE__*/function () {
|
|
414
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(selected) {
|
|
415
|
-
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
416
|
-
while (1) {
|
|
417
|
-
switch (_context6.prev = _context6.next) {
|
|
418
|
-
case 0:
|
|
419
|
-
_context6.next = 2;
|
|
420
|
-
return (0, _requestApis.workDelete)({
|
|
421
|
-
deleteType: selected,
|
|
422
|
-
workId: detailInfo.workId
|
|
423
|
-
});
|
|
424
|
-
|
|
425
|
-
case 2:
|
|
426
|
-
_toast["default"].Success((0, _getLocale.getLocale)('Pro_detail_Deletsuccess'));
|
|
427
|
-
|
|
428
|
-
setTimeout(function () {
|
|
429
|
-
commonContext.refreshAll();
|
|
430
|
-
}, 500);
|
|
431
|
-
|
|
432
|
-
case 4:
|
|
433
|
-
case "end":
|
|
434
|
-
return _context6.stop();
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}, _callee6);
|
|
438
|
-
}));
|
|
439
|
-
|
|
440
|
-
return function (_x5) {
|
|
441
|
-
return _ref3.apply(this, arguments);
|
|
442
|
-
};
|
|
443
|
-
}(),
|
|
444
|
-
onCancel: function onCancel() {
|
|
445
|
-
return popRef.current && popRef.current.getRef().hide();
|
|
446
|
-
}
|
|
447
|
-
})
|
|
448
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
437
|
+
}), /*#__PURE__*/_react["default"].createElement(_deleteConfirm["default"], {
|
|
438
|
+
ref: deletePopRef,
|
|
439
|
+
okrInfo: okrInfo,
|
|
440
|
+
approvalSetting: approvalSetting,
|
|
441
|
+
onConfirm: handleDeleteOkr
|
|
442
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
449
443
|
style: {
|
|
450
444
|
textAlign: 'right',
|
|
451
445
|
height: 0
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getApprovalOpenItem = exports.getApprovalOkr = exports.getApprovalKr = exports.getApprovalIsShow = exports.getApproval = exports.EApproveStatus = exports.EApprovalTypes = exports.EApprovalKrTypes = void 0;
|
|
7
|
+
var EApprovalTypes;
|
|
8
|
+
exports.EApprovalTypes = EApprovalTypes;
|
|
9
|
+
|
|
10
|
+
(function (EApprovalTypes) {
|
|
11
|
+
EApprovalTypes[EApprovalTypes["CreateOkr"] = 53] = "CreateOkr";
|
|
12
|
+
EApprovalTypes[EApprovalTypes["ChangeOkrName"] = 54] = "ChangeOkrName";
|
|
13
|
+
EApprovalTypes[EApprovalTypes["ChangeOkrTime"] = 56] = "ChangeOkrTime";
|
|
14
|
+
EApprovalTypes[EApprovalTypes["DeleteOkr"] = 55] = "DeleteOkr";
|
|
15
|
+
})(EApprovalTypes || (exports.EApprovalTypes = EApprovalTypes = {}));
|
|
16
|
+
|
|
17
|
+
var EApprovalKrTypes;
|
|
18
|
+
exports.EApprovalKrTypes = EApprovalKrTypes;
|
|
19
|
+
|
|
20
|
+
(function (EApprovalKrTypes) {
|
|
21
|
+
EApprovalKrTypes[EApprovalKrTypes["Createkr"] = 57] = "Createkr";
|
|
22
|
+
EApprovalKrTypes[EApprovalKrTypes["ChangekrName"] = 58] = "ChangekrName";
|
|
23
|
+
EApprovalKrTypes[EApprovalKrTypes["ChangekrTime"] = 60] = "ChangekrTime";
|
|
24
|
+
EApprovalKrTypes[EApprovalKrTypes["Deletekr"] = 59] = "Deletekr";
|
|
25
|
+
})(EApprovalKrTypes || (exports.EApprovalKrTypes = EApprovalKrTypes = {}));
|
|
26
|
+
|
|
27
|
+
var EApproveStatus;
|
|
28
|
+
exports.EApproveStatus = EApproveStatus;
|
|
29
|
+
|
|
30
|
+
(function (EApproveStatus) {
|
|
31
|
+
EApproveStatus[EApproveStatus["None"] = 0] = "None";
|
|
32
|
+
EApproveStatus[EApproveStatus["WaitCommit"] = 6] = "WaitCommit";
|
|
33
|
+
EApproveStatus[EApproveStatus["Rejected"] = 3] = "Rejected";
|
|
34
|
+
EApproveStatus[EApproveStatus["UnderApproval"] = 1] = "UnderApproval";
|
|
35
|
+
EApproveStatus[EApproveStatus["ApproveAgree"] = 2] = "ApproveAgree";
|
|
36
|
+
EApproveStatus[EApproveStatus["WithDraw"] = 4] = "WithDraw";
|
|
37
|
+
EApproveStatus[EApproveStatus["Done"] = 5] = "Done";
|
|
38
|
+
})(EApproveStatus || (exports.EApproveStatus = EApproveStatus = {}));
|
|
39
|
+
|
|
40
|
+
var getApprovalOpenItem = function getApprovalOpenItem(setting) {
|
|
41
|
+
var result = {
|
|
42
|
+
isOpen: setting.isOpened === 1,
|
|
43
|
+
changeOkrName: false,
|
|
44
|
+
changeOkrTime: false,
|
|
45
|
+
deleteOkr: false,
|
|
46
|
+
createOkr: false
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
if (setting !== null && setting !== void 0 && setting.okrApprovalSettings) {
|
|
50
|
+
setting.okrApprovalSettings.forEach(function (item) {
|
|
51
|
+
if (item.approvalType === EApprovalTypes.ChangeOkrName) {
|
|
52
|
+
result.changeOkrName = true;
|
|
53
|
+
} else if (item.approvalType === EApprovalTypes.ChangeOkrTime) {
|
|
54
|
+
result.changeOkrTime = true;
|
|
55
|
+
} else if (item.approvalType === EApprovalTypes.CreateOkr) {
|
|
56
|
+
result.createOkr = true;
|
|
57
|
+
} else if (item.approvalType === EApprovalTypes.DeleteOkr) {
|
|
58
|
+
result.deleteOkr = true;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return result;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
exports.getApprovalOpenItem = getApprovalOpenItem;
|
|
67
|
+
|
|
68
|
+
var getApprovalIsShow = function getApprovalIsShow(approvalSetting, type, applyState) {
|
|
69
|
+
var okrType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
70
|
+
var krType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
71
|
+
{
|
|
72
|
+
/* 有编辑权限,
|
|
73
|
+
且审批开关没有开启
|
|
74
|
+
或者审批开关开启但是没开修改okr名字审批 且(状态不是审批中或者状态审批中且不为新建)
|
|
75
|
+
或者开启okr审批开关 且开启okr名字审批 且当前状态不是审批中的时候是可编辑的 */
|
|
76
|
+
}
|
|
77
|
+
var okrCreate = okrType === null || okrType === void 0 ? void 0 : okrType.includes(EApprovalTypes.CreateOkr);
|
|
78
|
+
var krCreate = krType === null || krType === void 0 ? void 0 : krType.includes(EApprovalKrTypes.Createkr);
|
|
79
|
+
var isCreate = okrCreate || krCreate;
|
|
80
|
+
return !approvalSetting.isOpen || approvalSetting.isOpen && !(approvalSetting !== null && approvalSetting !== void 0 && approvalSetting[type]) && (applyState !== EApproveStatus.UnderApproval || applyState === EApproveStatus.UnderApproval && !isCreate) || approvalSetting.isOpen && (approvalSetting === null || approvalSetting === void 0 ? void 0 : approvalSetting[type]) && applyState !== EApproveStatus.UnderApproval;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
exports.getApprovalIsShow = getApprovalIsShow;
|
|
84
|
+
|
|
85
|
+
var getApproval = function getApproval(approvalSetting, type, applyState, isCreate) {
|
|
86
|
+
return !(!(approvalSetting !== null && approvalSetting !== void 0 && approvalSetting[type]) && applyState === EApproveStatus.UnderApproval && isCreate || approvalSetting !== null && approvalSetting !== void 0 && approvalSetting[type] && applyState === EApproveStatus.UnderApproval);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
exports.getApproval = getApproval;
|
|
90
|
+
|
|
91
|
+
var getApprovalOkr = function getApprovalOkr(approvalSetting, type, applyState) {
|
|
92
|
+
var okrType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
93
|
+
var okrCreate = okrType === null || okrType === void 0 ? void 0 : okrType.includes(EApprovalTypes.CreateOkr);
|
|
94
|
+
return getApproval(approvalSetting, type, applyState, okrCreate);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
exports.getApprovalOkr = getApprovalOkr;
|
|
98
|
+
|
|
99
|
+
var getApprovalKr = function getApprovalKr(approvalSetting, type, applyState) {
|
|
100
|
+
var okrType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
101
|
+
var krType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
102
|
+
var okrCreate = okrType === null || okrType === void 0 ? void 0 : okrType.includes(EApprovalTypes.CreateOkr);
|
|
103
|
+
var krCreate = krType === null || krType === void 0 ? void 0 : krType.includes(EApprovalKrTypes.Createkr);
|
|
104
|
+
var isCreate = okrCreate || krCreate;
|
|
105
|
+
return getApproval(approvalSetting, type, applyState, isCreate);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
exports.getApprovalKr = getApprovalKr;
|