@cloudbase/weda-ui 3.4.4 → 3.4.6
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/dist/configs/components/chart/bar.json +113 -8
- package/dist/configs/components/chart/line.js +113 -8
- package/dist/configs/components/chart/pie.json +113 -8
- package/dist/configs/components/chart/statisticsCard.json +57 -0
- package/dist/configs/components/dataView.js +7 -7
- package/dist/configs/components/form/input.json +48 -2
- package/dist/configs/components/form/richText.json +2 -1
- package/dist/configs/components/form/uploader.json +62 -14
- package/dist/configs/components/graphicCard.json +1 -1
- package/dist/configs/components/grid/col.js +4 -1
- package/dist/configs/components/grid/grid.js +8 -3
- package/dist/configs/components/grid/row.js +51 -3
- package/dist/configs/components/listView.js +113 -9
- package/dist/configs/components/navLayout.json +1 -1
- package/dist/configs/components/repeater.js +4 -1
- package/dist/configs/components/table.json +125 -9
- package/dist/configs/components/wd-bubble.js +6 -0
- package/dist/configs/components/wd-button.js +6 -0
- package/dist/configs/components/wd-divider.js +7 -18
- package/dist/configs/components/wd-icon.js +7 -0
- package/dist/configs/components/wd-image.js +7 -0
- package/dist/configs/components/wd-link.js +7 -2
- package/dist/configs/components/wd-text.js +14 -6
- package/dist/configs/index.js +0 -2
- package/dist/docs/common/componentList.js +1 -1
- package/dist/style/index.scss +1 -1
- package/dist/web/actions/showModal/index.js +1 -1
- package/dist/web/components/calendar/index.js +2 -2
- package/dist/web/components/chart/common/data-transform.js +1 -1
- package/dist/web/components/chart/statisticsCard/index.js +1 -1
- package/dist/web/components/flow/components/index.js +0 -4
- package/dist/web/components/flow/frame/index.js +4 -3
- package/dist/web/components/flow/frame/types.js +11 -5
- package/dist/web/components/flow/frame/utils.js +60 -1
- package/dist/web/components/flow/modules/chart/Chart.js +2 -3
- package/dist/web/components/flow/modules/chart/index.css +0 -3
- package/dist/web/components/flow/modules/combination/index.js +1 -1
- package/dist/web/components/flow/modules/operations/components/button/index.js +11 -0
- package/dist/web/components/flow/modules/operations/components/button/style.css +5 -0
- package/dist/web/components/flow/modules/operations/components/index.js +6 -0
- package/dist/web/components/flow/modules/operations/components/popup/index.js +100 -0
- package/dist/web/components/flow/modules/operations/components/popup/style.css +154 -0
- package/dist/web/components/flow/modules/operations/components/popup/types.js +1 -0
- package/dist/web/components/flow/modules/operations/components/user-select/index.js +43 -0
- package/dist/web/components/flow/modules/operations/components/user-select/style.css +4 -0
- package/dist/web/components/flow/modules/operations/components/user-select/types.js +1 -0
- package/dist/web/components/flow/modules/operations/config/approval-form-config.js +140 -0
- package/dist/web/components/flow/modules/operations/config/control-config.js +218 -0
- package/dist/web/components/flow/modules/operations/config/index.js +2 -0
- package/dist/web/components/flow/modules/operations/config/types.js +1 -0
- package/dist/web/components/flow/modules/operations/control.js +26 -0
- package/dist/web/components/flow/modules/operations/controls-items/add-assignee-btn.js +33 -0
- package/dist/web/components/flow/modules/operations/controls-items/apply-cc-btn.js +12 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/comment/index.js +188 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/comment/style.css +51 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/drawer-form/index.js +64 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/drawer-form/types.js +1 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/drawer-form/view-model.js +83 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/field/index.js +16 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/field/style.css +56 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/index.js +47 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/style.css +60 -0
- package/dist/web/components/flow/modules/operations/controls-items/cancel-apply-btn.js +15 -0
- package/dist/web/components/flow/modules/operations/controls-items/check-list-popup/index.js +11 -0
- package/dist/web/components/flow/modules/operations/controls-items/check-list-popup/style.css +26 -0
- package/dist/web/components/flow/modules/operations/controls-items/flow-task-info-modal.js +98 -0
- package/dist/web/components/flow/modules/operations/controls-items/index.js +18 -0
- package/dist/web/components/flow/modules/operations/controls-items/initiation-btn.js +25 -0
- package/dist/web/components/flow/modules/operations/controls-items/revoke-modal/index.js +50 -0
- package/dist/web/components/flow/modules/operations/controls-items/revoke-modal/style.css +28 -0
- package/dist/web/components/flow/modules/operations/controls-items/roll-back-modal.js +104 -0
- package/dist/web/components/flow/modules/operations/controls-items/types.js +1 -0
- package/dist/web/components/flow/modules/operations/index.js +2 -0
- package/dist/web/components/flow/modules/operations/style.css +20 -0
- package/dist/web/components/flow/modules/operations/view-model.js +137 -0
- package/dist/web/components/flow/services/ideData/instance.js +2 -2
- package/dist/web/components/flow/services/ideData/pageDetail.js +1 -0
- package/dist/web/components/form/select/dropdown-select/h5.js +1 -1
- package/dist/web/components/form/select/dropdown-select/index.css +7 -0
- package/dist/web/components/form/select/index.js +2 -7
- package/dist/web/components/form/textarea/index.js +1 -1
- package/dist/web/components/form/uploader/index.css +19 -0
- package/dist/web/components/form/uploader/index.js +21 -3
- package/dist/web/components/form/uploader/uploader.h5.js +14 -8
- package/dist/web/components/form/uploader/uploader.pc.js +29 -16
- package/dist/web/components/form/uploaderFile/index.css +9 -5
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +23 -21
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +14 -10
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +0 -1
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +1 -1
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +43 -22
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/user-select-h5.js +15 -4
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +2 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +4 -2
- package/dist/web/components/grid/col.js +81 -18
- package/dist/web/components/grid/grid.js +1 -1
- package/dist/web/components/grid/row.js +4 -2
- package/dist/web/components/index.js +1 -1
- package/dist/web/components/listView/index.js +98 -100
- package/dist/web/components/lottery/index.js +122 -123
- package/dist/web/components/richTextView/index.css +2 -0
- package/dist/web/components/swiper/index.js +14 -8
- package/dist/web/components/table/BaseTable.js +3 -3
- package/dist/web/components/table/ExportFileModalByApi/index.js +1 -1
- package/dist/web/components/table/ImportFileModal/index.js +1 -1
- package/dist/web/components/table/ImportFileModalByApi/index.js +1 -1
- package/dist/web/components/wd-bubble/wd-bubble.js +11 -3
- package/dist/web/components/wd-button/wd-button.js +22 -13
- package/dist/web/components/wd-divider/wd-divider.js +10 -7
- package/dist/web/components/wd-icon/wd-icon.js +12 -3
- package/dist/web/components/wd-image/index.js +12 -5
- package/dist/web/components/wd-link/wd-link.js +11 -3
- package/dist/web/components/wd-text/wd-text.js +15 -3
- package/dist/web/utils/hooks/use-cloud-id-temp-url.js +7 -2
- package/dist/web/utils/platform.js +9 -2
- package/dist/web/utils/tool.js +11 -0
- package/dist/web/utils/widget-api/index.js +3 -0
- package/package.json +7 -5
- package/dist/configs/components/auth.json +0 -17
- package/dist/web/components/flow/components/FlowUserSelect/index.css +0 -116
- package/dist/web/components/flow/components/FlowUserSelect/index.js +0 -115
- package/dist/web/components/flow/components/HighlightTextarea/index.css +0 -42
- package/dist/web/components/flow/components/HighlightTextarea/index.js +0 -131
- package/dist/web/components/flow/components/UserSelectModel/UserSelect.js +0 -74
- package/dist/web/components/flow/components/UserSelectModel/UserSelectMobile.css +0 -8
- package/dist/web/components/flow/components/UserSelectModel/UserSelectMobile.js +0 -86
- package/dist/web/components/flow/components/UserSelectModel/index.js +0 -18
- package/dist/web/components/flow/components/WedaUserTransfer/index.css +0 -3
- package/dist/web/components/flow/components/WedaUserTransfer/index.js +0 -162
- package/dist/web/components/flow/modules/control/ApprovalDrawer.css +0 -144
- package/dist/web/components/flow/modules/control/ApprovalDrawer.js +0 -178
- package/dist/web/components/flow/modules/control/ApprovalPopup.css +0 -115
- package/dist/web/components/flow/modules/control/ApprovalPopup.js +0 -241
- package/dist/web/components/flow/modules/control/Control.css +0 -29
- package/dist/web/components/flow/modules/control/Control.js +0 -93
- package/dist/web/components/flow/modules/control/ControlMobile.css +0 -69
- package/dist/web/components/flow/modules/control/ControlMobile.js +0 -133
- package/dist/web/components/flow/modules/control/FlowTaskInfoModal.css +0 -3
- package/dist/web/components/flow/modules/control/FlowTaskInfoModal.js +0 -31
- package/dist/web/components/flow/modules/control/constants/index.js +0 -35
- package/dist/web/components/flow/modules/control/index.js +0 -15
- package/dist/web/components/flow/modules/control/provider/index.js +0 -17
- package/dist/web/components/flow/modules/control/provider/useControlModel.js +0 -256
- package/dist/web/components/flow/modules/control/provider/useMobileModel.js +0 -86
- package/dist/web/components/flow/modules/control/provider/useRevokeAndBackHook.js +0 -82
- package/dist/web/components/flow/modules/control/utils/ControlModelUtils.js +0 -57
- package/dist/web/components/flow/modules/control/utils/index.js +0 -2
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, Status, Text, StatusTip } from 'tea-component';
|
|
3
|
-
import { Popup } from 'react-vant';
|
|
4
|
-
import { UserSelectModel } from '../../components';
|
|
5
|
-
import { useControlContext } from './provider';
|
|
6
|
-
import { ACTION_TYPE } from './constants';
|
|
7
|
-
import { ApprovalPopup } from './ApprovalPopup';
|
|
8
|
-
import { ButtonLayout } from './Control';
|
|
9
|
-
import './ControlMobile.css';
|
|
10
|
-
export const FlowControlMobile = (props) => {
|
|
11
|
-
const { commonFlowData, flowLocalProps, ide } = props;
|
|
12
|
-
const { pageInfo, flowDetail } = commonFlowData;
|
|
13
|
-
const { safeJsonParse, currentPageType } = flowLocalProps;
|
|
14
|
-
const {
|
|
15
|
-
// ControlModel
|
|
16
|
-
submitApplyLoading, showMoreAction, ifSubmitAndCc, ccUsers, onControlChick, onShowMoreVisibleChange, loadingAssign, onBackFlowCenter,
|
|
17
|
-
// RevokeModel
|
|
18
|
-
showRevokeModal, showBackModal, backNodeList, backNode, setShowRevokeModal, doneRevokeFn, doneBackFn, setShowBackModal, getNodeList, setBackNode, onUserSelectModalInfoChange, setUserSelectModelVisible, userSelectApproveField, userSelectModelVisible, userSelectMode, } = useControlContext();
|
|
19
|
-
const onClickRollBack = async () => {
|
|
20
|
-
await getNodeList();
|
|
21
|
-
onShowMoreVisibleChange();
|
|
22
|
-
setShowBackModal(true);
|
|
23
|
-
};
|
|
24
|
-
const onClickAddCcUser = () => {
|
|
25
|
-
setUserSelectModelVisible(true);
|
|
26
|
-
onUserSelectModalInfoChange({ approveField: 'ccUsers', mode: 'multiple' });
|
|
27
|
-
};
|
|
28
|
-
const buttonActionMap = {
|
|
29
|
-
showTurnToPerson: {
|
|
30
|
-
label: '转办',
|
|
31
|
-
action: (e) => onControlChick(ACTION_TYPE.TRANSFER, e),
|
|
32
|
-
},
|
|
33
|
-
showRollBack: {
|
|
34
|
-
label: '回退',
|
|
35
|
-
action: async () => {
|
|
36
|
-
await getNodeList();
|
|
37
|
-
setShowBackModal(true);
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
showAddAssignee: {
|
|
41
|
-
label: '加签',
|
|
42
|
-
action: () => {
|
|
43
|
-
onShowMoreVisibleChange();
|
|
44
|
-
sessionStorage.setItem('selected', JSON.stringify([]));
|
|
45
|
-
sessionStorage.setItem('FlowActionsMobile', JSON.stringify({
|
|
46
|
-
instanceId: flowDetail.instanceId,
|
|
47
|
-
nodeId: flowDetail.currentNodeId,
|
|
48
|
-
taskId: flowDetail.taskId,
|
|
49
|
-
assigneeIds: [],
|
|
50
|
-
}));
|
|
51
|
-
sessionStorage.setItem('last-url', location.href);
|
|
52
|
-
setUserSelectModelVisible(true);
|
|
53
|
-
onUserSelectModalInfoChange({
|
|
54
|
-
approveField: 'assigneeIds',
|
|
55
|
-
mode: 'multiple',
|
|
56
|
-
});
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
const renderButtonGroup = () => {
|
|
61
|
-
var _a;
|
|
62
|
-
if (['CREATE', 'DONE'].includes(currentPageType) && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.showRevoke)) {
|
|
63
|
-
return (React.createElement("div", { className: "mf-progress-mb--footer" },
|
|
64
|
-
React.createElement(Button, { type: "primary", onClick: () => setShowRevokeModal(true) }, "\u64A4\u9500")));
|
|
65
|
-
}
|
|
66
|
-
if (['DRAFT', 'CREATEFLOW', 'TODO'].includes(currentPageType) &&
|
|
67
|
-
(pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.show)) {
|
|
68
|
-
return (React.createElement("div", { className: "mf-progress-mb--footer" }, (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.showSubmitApp) ? (React.createElement(ButtonLayout, { gap: 10 },
|
|
69
|
-
flowDetail.canDelete ? (React.createElement(Button, { type: "link", onClick: () => onControlChick(ACTION_TYPE.SAVE_DRAFT) }, "\u4FDD\u5B58\u8349\u7A3F")) : null,
|
|
70
|
-
ifSubmitAndCc ? (React.createElement(Button, { type: "link", onClick: onClickAddCcUser },
|
|
71
|
-
"+\u6284\u9001\u4EBA(",
|
|
72
|
-
ccUsers.length || 0,
|
|
73
|
-
")")) : null,
|
|
74
|
-
React.createElement(Button, { type: "primary", loading: submitApplyLoading, onClick: () => onControlChick(ACTION_TYPE.SUBMIT) }, ((_a = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons) === null || _a === void 0 ? void 0 : _a[3]) || '提交申请'),
|
|
75
|
-
flowDetail.canDelete ? (React.createElement(Button, { type: "weak", onClick: onBackFlowCenter }, "\u53D6\u6D88")) : null)) : (React.createElement(ButtonLayout, { gap: 10 },
|
|
76
|
-
['showTurnToPerson', 'showRollBack', 'showAddAssignee'].filter((key) => pageInfo[key]).length >= 2 ? (React.createElement(Button, { type: "link", onClick: onShowMoreVisibleChange }, "\u66F4\u591A")) : (['showTurnToPerson', 'showRollBack', 'showAddAssignee']
|
|
77
|
-
.filter((key) => pageInfo[key])
|
|
78
|
-
.map((key, actionIndex) => {
|
|
79
|
-
const { label, action } = buttonActionMap[key];
|
|
80
|
-
return (React.createElement(Button, { key: `actionItem-${actionIndex}`, className: "apa-height-xl tea-mr-4n tea-mt-1n", type: "link", onClick: action }, label));
|
|
81
|
-
})),
|
|
82
|
-
flowDetail.userTaskType === 2 ? (React.createElement(Button, { type: "primary", style: { flex: 3 }, onClick: (e) => onControlChick(ACTION_TYPE.HANDLE, e) }, flowDetail.operationName)) : (React.createElement(React.Fragment, null,
|
|
83
|
-
React.createElement(Button, { onClick: (e) => onControlChick(ACTION_TYPE.REJECT, e) }, (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons) ? pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons[2] : '拒绝'),
|
|
84
|
-
React.createElement(Button, { type: "primary", onClick: (e) => onControlChick(ACTION_TYPE.AGREE, e) }, (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons) ? pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons[1] : '同意')))))));
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
return (
|
|
88
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
89
|
-
React.createElement("div", { ...ide },
|
|
90
|
-
renderButtonGroup(),
|
|
91
|
-
React.createElement(Popup, { className: "cp-mobile-dialog apa-m-overlay approval-progress__more--dialog", visible: showMoreAction, onClose: onShowMoreVisibleChange,
|
|
92
|
-
// disableCloseIcon={true}
|
|
93
|
-
closeIcon: false, position: "bottom" },
|
|
94
|
-
React.createElement("div", { className: "apa-m-overlay__body" },
|
|
95
|
-
React.createElement("div", { className: "approval-progress__more--btns" },
|
|
96
|
-
(pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.showTurnToPerson) && (React.createElement("div", { className: "approval-progress__more--btn", onClick: (e) => {
|
|
97
|
-
onShowMoreVisibleChange();
|
|
98
|
-
onControlChick(ACTION_TYPE.TRANSFER, e);
|
|
99
|
-
} },
|
|
100
|
-
React.createElement("p", { style: { fontSize: 14 } }, "\u8F6C\u529E"),
|
|
101
|
-
React.createElement("p", null,
|
|
102
|
-
React.createElement(Text, { theme: "label" }, "\u9009\u62E9\u8F6C\u529E\u4EBA\u5458")))),
|
|
103
|
-
(pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.showRollBack) && (React.createElement("div", { className: "approval-progress__more--btn", onClick: onClickRollBack },
|
|
104
|
-
React.createElement("p", { style: { fontSize: 14 } }, "\u56DE\u9000"),
|
|
105
|
-
React.createElement("p", null,
|
|
106
|
-
React.createElement(Text, { theme: "label" }, "\u56DE\u9000\u81F3\u6307\u5B9A\u8282\u70B9")))),
|
|
107
|
-
(pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.showAddAssignee) && (React.createElement("div", { className: "approval-progress__more--btn", onClick: buttonActionMap.showAddAssignee.action },
|
|
108
|
-
React.createElement("p", { style: { fontSize: 14 } }, "\u52A0\u7B7E"),
|
|
109
|
-
React.createElement("p", null,
|
|
110
|
-
React.createElement(Text, { theme: "label" }, "\u9009\u62E9\u52A0\u7B7E\u4EBA\u5458"))))),
|
|
111
|
-
React.createElement("div", { className: "approval-progress__more--footer" },
|
|
112
|
-
React.createElement(Text, { theme: "label", onClick: onShowMoreVisibleChange }, "\u53D6\u6D88")))),
|
|
113
|
-
React.createElement(Popup, { className: "confim-popup", visible: showRevokeModal, onClose: () => setShowRevokeModal(false) },
|
|
114
|
-
React.createElement(React.Fragment, null,
|
|
115
|
-
React.createElement("h3", { className: "popup-header" }, "\u64A4\u9500\u6D41\u7A0B"),
|
|
116
|
-
React.createElement("div", { className: "popup-body" }, "\u6D41\u7A0B\u6B63\u5728\u5BA1\u6279\u6D41\u8F6C\u4E2D\uFF0C\u786E\u5B9A\u64A4\u9500\u6D41\u7A0B\uFF1F"),
|
|
117
|
-
React.createElement("div", { className: "popup-footer" },
|
|
118
|
-
React.createElement("span", { onClick: () => setShowRevokeModal(false) }, "\u53D6\u6D88"),
|
|
119
|
-
React.createElement("span", { className: "confirm-btn", onClick: doneRevokeFn }, "\u786E\u5B9A")))),
|
|
120
|
-
React.createElement(Popup, { visible: loadingAssign, className: "assign-modal" },
|
|
121
|
-
React.createElement(StatusTip, { status: "loading", loadingText: "\u52A0\u7B7E\u4E2D...", style: { color: '#fff' } })),
|
|
122
|
-
React.createElement(Popup, { className: "flow-popup", visible: showBackModal, position: "bottom", onClose: () => setShowBackModal(false) },
|
|
123
|
-
React.createElement("h3", { className: "flow-popup-title" },
|
|
124
|
-
React.createElement("span", { className: "left", onClick: () => setShowBackModal(false) }, "\u53D6\u6D88"),
|
|
125
|
-
React.createElement("span", { className: "center" }, "\u8BF7\u9009\u62E9\u56DE\u9000\u8282\u70B9"),
|
|
126
|
-
React.createElement("span", { className: "right", onClick: () => {
|
|
127
|
-
doneBackFn();
|
|
128
|
-
} }, "\u5B8C\u6210")),
|
|
129
|
-
(backNodeList === null || backNodeList === void 0 ? void 0 : backNodeList.length) ? (React.createElement("ul", { className: "list-content" }, backNodeList === null || backNodeList === void 0 ? void 0 : backNodeList.map((item) => (React.createElement("li", { key: item.value, className: backNode === item.value ? 'list-checked' : '', onClick: () => setBackNode(item.value) },
|
|
130
|
-
React.createElement("span", null, item.text)))))) : (React.createElement(Status, { icon: "blank", size: "l", title: "\u6682\u65E0\u53EF\u56DE\u9000\u8282\u70B9" }))),
|
|
131
|
-
userSelectModelVisible ? (React.createElement(UserSelectModel, { visible: true, approveField: userSelectApproveField, mode: userSelectMode, close: () => setUserSelectModelVisible(false), mobileModel: true, values: ccUsers.map((user) => user.value) })) : null,
|
|
132
|
-
React.createElement(ApprovalPopup, { pageInfo: pageInfo, flowDetail: flowDetail, safeJsonParse: safeJsonParse })));
|
|
133
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Modal, SelectMultiple, Button, Form } from 'tea-component';
|
|
3
|
-
// import { history } from 'umi';
|
|
4
|
-
import { useControlContext } from './provider';
|
|
5
|
-
import './FlowTaskInfoModal.css';
|
|
6
|
-
export const FlowTaskInfoModal = () => {
|
|
7
|
-
// const { visible, setVisible, flowTaskInfoList, flowTaskIds, setFlowTaskIds, allInfos } = props;
|
|
8
|
-
const { flowTaskInfoList, flowTaskInfoModalVisible, flowTaskIds, setFlowTaskIds, onCloseFlowTaskInfoModal, } = useControlContext();
|
|
9
|
-
const [options, setOptions] = useState([]);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
const tempOptions = [];
|
|
12
|
-
flowTaskInfoList.forEach((item) => {
|
|
13
|
-
tempOptions.push({
|
|
14
|
-
text: item === null || item === void 0 ? void 0 : item.assigneeName,
|
|
15
|
-
value: item === null || item === void 0 ? void 0 : item.waitFlowTaskId,
|
|
16
|
-
assignee: item === null || item === void 0 ? void 0 : item.assignee,
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
setOptions(tempOptions);
|
|
20
|
-
}, [flowTaskInfoList]);
|
|
21
|
-
return (React.createElement(Modal, { visible: flowTaskInfoModalVisible, caption: '选择下一节点处理人', onClose: onCloseFlowTaskInfoModal },
|
|
22
|
-
React.createElement(Modal.Body, null,
|
|
23
|
-
React.createElement(Form, { style: { marginBottom: '5px' } },
|
|
24
|
-
React.createElement(Form.Item, { label: '选择处理人', className: "flow_center_next_approve-form_item" },
|
|
25
|
-
React.createElement(SelectMultiple, { appearance: "button", size: 'full', searchable: true, matchButtonWidth: true, staging: false, options: options, onChange: (val) => {
|
|
26
|
-
setFlowTaskIds(val);
|
|
27
|
-
}, value: flowTaskIds })))),
|
|
28
|
-
React.createElement(Modal.Footer, null,
|
|
29
|
-
React.createElement(Button, { type: "primary", onClick: onCloseFlowTaskInfoModal }, "\u786E\u5B9A"),
|
|
30
|
-
React.createElement(Button, { type: "weak", onClick: onCloseFlowTaskInfoModal }, "\u53D6\u6D88"))));
|
|
31
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export const ACTION_TYPE = {
|
|
2
|
-
SUBMIT: 'submit',
|
|
3
|
-
AGREE: 'agree',
|
|
4
|
-
REJECT: 'reject',
|
|
5
|
-
TRANSFER: 'transfer',
|
|
6
|
-
HANDLE: 'handle',
|
|
7
|
-
SAVE_DRAFT: 'saveDraft',
|
|
8
|
-
CANCEL_SUBMIT: 'cancelSubmit',
|
|
9
|
-
GO_BACK: 'goBack',
|
|
10
|
-
ADD_ASSIGNEE: 'addAssignee',
|
|
11
|
-
REVOKE: 'revoke',
|
|
12
|
-
SELECT_NEXT_APPROVER: 'selectNextApprover',
|
|
13
|
-
};
|
|
14
|
-
export const ACTION_TYPE_MAP = {
|
|
15
|
-
// 提交1 同意/处理2 驳回3 转办4 保存草稿17
|
|
16
|
-
submit: 1,
|
|
17
|
-
agree: 2,
|
|
18
|
-
handle: 2,
|
|
19
|
-
reject: 3,
|
|
20
|
-
transfer: 4,
|
|
21
|
-
saveDraft: 17,
|
|
22
|
-
};
|
|
23
|
-
export const ACTION_FINISH_MAP = {
|
|
24
|
-
saveDraft: 'afterSavedDraft',
|
|
25
|
-
submit: 'afterSubmit',
|
|
26
|
-
cancelSubmit: 'afterCancelSubmit',
|
|
27
|
-
handle: 'afterHandle',
|
|
28
|
-
agree: 'afterAgree',
|
|
29
|
-
reject: 'afterReject',
|
|
30
|
-
transfer: 'afterTransfer',
|
|
31
|
-
goBack: 'afterGoBack',
|
|
32
|
-
addAssignee: 'afterAddAssignee',
|
|
33
|
-
revoke: 'afterRevoke',
|
|
34
|
-
selectNextApprover: 'afterSelectNextApprover',
|
|
35
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FlowControl } from './Control';
|
|
3
|
-
import { FlowControlMobile } from './ControlMobile';
|
|
4
|
-
import { ControlProvider } from './provider';
|
|
5
|
-
import { createModuleFrame } from '../../frame';
|
|
6
|
-
const ModelFlowControl = (props) => {
|
|
7
|
-
const renderContent = () => {
|
|
8
|
-
if (props.flowLocalProps.isH5) {
|
|
9
|
-
return React.createElement(FlowControlMobile, { ...props });
|
|
10
|
-
}
|
|
11
|
-
return React.createElement(FlowControl, { ...props });
|
|
12
|
-
};
|
|
13
|
-
return React.createElement(ControlProvider, { ...props }, renderContent());
|
|
14
|
-
};
|
|
15
|
-
export default createModuleFrame(ModelFlowControl, 'flow-control');
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useContext } from 'react';
|
|
2
|
-
import { useControlModel } from './useControlModel';
|
|
3
|
-
import { useRevokeAndBackHook, } from './useRevokeAndBackHook';
|
|
4
|
-
import { useMobileModel } from './useMobileModel';
|
|
5
|
-
const Context = createContext({});
|
|
6
|
-
export const ControlProvider = (props) => {
|
|
7
|
-
const control = useControlModel(props);
|
|
8
|
-
const revoke = useRevokeAndBackHook(props, control);
|
|
9
|
-
const mobile = useMobileModel(props, control);
|
|
10
|
-
const value = {
|
|
11
|
-
...control,
|
|
12
|
-
...revoke,
|
|
13
|
-
...mobile,
|
|
14
|
-
};
|
|
15
|
-
return React.createElement(Context.Provider, { value: value }, props.children);
|
|
16
|
-
};
|
|
17
|
-
export const useControlContext = () => useContext(Context);
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { useState, useRef, useEffect } from 'react';
|
|
2
|
-
import { message } from 'tea-component';
|
|
3
|
-
import { postApprovalFlow, postApprovalSign, postFlowTaskList, } from '../../../services';
|
|
4
|
-
import { ACTION_TYPE, ACTION_TYPE_MAP, ACTION_FINISH_MAP } from '../constants';
|
|
5
|
-
import { ControlModelUtils } from '../utils';
|
|
6
|
-
export const useControlModel = (params) => {
|
|
7
|
-
const { commonFlowData, flowLocalProps, ide, reload, setFormType } = params;
|
|
8
|
-
const { flowDetail, pageInfo, ccUserMaps } = commonFlowData;
|
|
9
|
-
const { isWedaIde, callWedaApi } = flowLocalProps;
|
|
10
|
-
const { events } = ide || {};
|
|
11
|
-
const ifSubmitAndCc = (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.showSubmitApp) && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.showCarbonCopy);
|
|
12
|
-
const [approveDrawerVisible, setApproveDrawerVisible] = useState(false);
|
|
13
|
-
const [userModalVisible, setUserModalVisible] = useState(false);
|
|
14
|
-
const [submitApplyLoading, setSubmitApplyLoading] = useState(false);
|
|
15
|
-
const [submitLoading, setSubmitLoading] = useState(false);
|
|
16
|
-
const [handleType, setHandleType] = useState('');
|
|
17
|
-
const [flowTaskInfoModalVisible, setFlowTaskInfoModalVisible] = useState(false); // 下一节点展示人弹窗
|
|
18
|
-
const [flowTaskInfoList, setFlowTaskInfoList] = useState([]); // 审批人列表
|
|
19
|
-
const [allInfos, setAllInfos] = useState([]);
|
|
20
|
-
const [flowTaskIds, setFlowTaskIds] = useState([]);
|
|
21
|
-
const [ccUserModelVisible, setCcUserModelVisible] = useState(false);
|
|
22
|
-
const [ccUsers, setCcUsers] = useState([]);
|
|
23
|
-
/** 流程是否回退 */
|
|
24
|
-
const [hasGoBack, setHasGoBack] = useState(false);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
var _a;
|
|
27
|
-
const ccUsers = (_a = Object.entries(ccUserMaps || {})) === null || _a === void 0 ? void 0 : _a.map(([value, text]) => ({
|
|
28
|
-
text,
|
|
29
|
-
value,
|
|
30
|
-
}));
|
|
31
|
-
setCcUsers(ccUsers);
|
|
32
|
-
}, [ccUserMaps]);
|
|
33
|
-
const pageFormData = useRef({});
|
|
34
|
-
const handleTypeRef = useRef('');
|
|
35
|
-
const onAddCounterSign = async (assigneeIds) => {
|
|
36
|
-
try {
|
|
37
|
-
const res = await postApprovalSign({
|
|
38
|
-
instanceId: flowDetail.instanceId,
|
|
39
|
-
nodeId: flowDetail.currentNodeId,
|
|
40
|
-
taskId: flowDetail.taskId,
|
|
41
|
-
assigneeIds: assigneeIds.map((item) => item.value),
|
|
42
|
-
}, { callWedaApi });
|
|
43
|
-
if (res === null || res === void 0 ? void 0 : res.status) {
|
|
44
|
-
onFinishFlowAction({
|
|
45
|
-
handleType: ACTION_TYPE.ADD_ASSIGNEE,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
console.error(error);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const onControlChick = (type, e) => {
|
|
54
|
-
var _a;
|
|
55
|
-
if (isWedaIde) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
handleTypeRef.current = type;
|
|
59
|
-
(_a = events === null || events === void 0 ? void 0 : events.tap) === null || _a === void 0 ? void 0 : _a.call(events, {
|
|
60
|
-
onGetFormData: (formDataMap) => {
|
|
61
|
-
if (Object.values(formDataMap).some((item) => item === undefined)) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
pageFormData.current = { ...pageFormData.current, ...formDataMap };
|
|
65
|
-
if (type === ACTION_TYPE.SUBMIT) {
|
|
66
|
-
onTriggerFlowEvent({ buttonAction: ACTION_TYPE_MAP.submit });
|
|
67
|
-
}
|
|
68
|
-
else if (type === ACTION_TYPE.SAVE_DRAFT) {
|
|
69
|
-
onSaveDraft();
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
onApproveDrawerVisibleChange();
|
|
73
|
-
setHandleType(type);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
}, {
|
|
77
|
-
originEvent: e,
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
const onApproveDrawerVisibleChange = () => {
|
|
81
|
-
setApproveDrawerVisible(!approveDrawerVisible);
|
|
82
|
-
!approveDrawerVisible && setHandleType('');
|
|
83
|
-
};
|
|
84
|
-
const onUserModalVisibleChange = () => {
|
|
85
|
-
setUserModalVisible(!userModalVisible);
|
|
86
|
-
};
|
|
87
|
-
const onFlowTaskInfoModalVisibleChange = () => {
|
|
88
|
-
setFlowTaskInfoModalVisible(!flowTaskInfoModalVisible);
|
|
89
|
-
};
|
|
90
|
-
const onSaveDraft = () => {
|
|
91
|
-
const params = {
|
|
92
|
-
buttonAction: ACTION_TYPE_MAP[ACTION_TYPE.SAVE_DRAFT],
|
|
93
|
-
ccUserIds: (ccUsers === null || ccUsers === void 0 ? void 0 : ccUsers.length)
|
|
94
|
-
? ccUsers.map(({ value }) => value).join(',')
|
|
95
|
-
: undefined,
|
|
96
|
-
flowCode: flowDetail.flowCode,
|
|
97
|
-
instanceId: flowDetail.instanceId,
|
|
98
|
-
nodeId: flowDetail.currentNodeId,
|
|
99
|
-
taskId: flowDetail.taskId,
|
|
100
|
-
appVersion: flowDetail.flowVersion,
|
|
101
|
-
variableInfos: ControlModelUtils.translateVariableInfos(pageFormData.current, pageInfo) || [],
|
|
102
|
-
};
|
|
103
|
-
params.variableInfos = ControlModelUtils.convertVariableInfosFormat(params.variableInfos);
|
|
104
|
-
postApprovalFlow({ ...params, AppCode: flowDetail.startAppCode }, { callWedaApi })
|
|
105
|
-
.then((res) => {
|
|
106
|
-
if (res) {
|
|
107
|
-
message.success({
|
|
108
|
-
content: '保存草稿成功',
|
|
109
|
-
});
|
|
110
|
-
onFinishFlowAction({ handleType: ACTION_TYPE.SAVE_DRAFT });
|
|
111
|
-
}
|
|
112
|
-
})
|
|
113
|
-
.catch(() => {
|
|
114
|
-
message.error({ content: '保存失败' });
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
const onTriggerFlowEvent = (data) => {
|
|
118
|
-
setSubmitApplyLoading(true);
|
|
119
|
-
if (!pageFormData.current) {
|
|
120
|
-
message.warning({
|
|
121
|
-
content: '请检查申请信息是否填写完整',
|
|
122
|
-
});
|
|
123
|
-
setSubmitApplyLoading(false);
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
setSubmitLoading(true);
|
|
127
|
-
const params = {
|
|
128
|
-
buttonAction: ACTION_TYPE_MAP[handleType],
|
|
129
|
-
ccUserIds: (ccUsers === null || ccUsers === void 0 ? void 0 : ccUsers.length)
|
|
130
|
-
? ccUsers.map(({ value }) => value).join(',')
|
|
131
|
-
: undefined,
|
|
132
|
-
flowCode: flowDetail.flowCode,
|
|
133
|
-
instanceId: flowDetail.instanceId,
|
|
134
|
-
nodeId: flowDetail.currentNodeId,
|
|
135
|
-
taskId: flowDetail.taskId,
|
|
136
|
-
// turnToUserId: data.turnToUserId,
|
|
137
|
-
appVersion: flowDetail.flowVersion,
|
|
138
|
-
variableInfos: ControlModelUtils.translateVariableInfos(pageFormData.current, pageInfo) || [],
|
|
139
|
-
...data,
|
|
140
|
-
};
|
|
141
|
-
params.variableInfos = ControlModelUtils.convertVariableInfosFormat(params.variableInfos);
|
|
142
|
-
postApprovalFlow({ ...params, AppCode: flowDetail === null || flowDetail === void 0 ? void 0 : flowDetail.startAppCode }, { callWedaApi })
|
|
143
|
-
.then((res) => {
|
|
144
|
-
var _a;
|
|
145
|
-
if (res) {
|
|
146
|
-
sessionStorage.removeItem('FlowActionsMobile');
|
|
147
|
-
if (res.toBeSubmittedFlowTaskFlag) {
|
|
148
|
-
handleTypeRef.current = ACTION_TYPE.SELECT_NEXT_APPROVER;
|
|
149
|
-
setApproveDrawerVisible(false);
|
|
150
|
-
setFlowTaskInfoModalVisible(res === null || res === void 0 ? void 0 : res.toBeSubmittedFlowTaskFlag);
|
|
151
|
-
setFlowTaskInfoList((res === null || res === void 0 ? void 0 : res.toBeSubmittedFlowTaskInfo) || []);
|
|
152
|
-
const tempArr = [];
|
|
153
|
-
(_a = res === null || res === void 0 ? void 0 : res.toBeSubmittedFlowTaskInfo) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
|
|
154
|
-
tempArr.push(item.waitFlowTaskId);
|
|
155
|
-
});
|
|
156
|
-
setAllInfos(tempArr);
|
|
157
|
-
// eslint-disable-next-line rulesdir/no-timer
|
|
158
|
-
setTimeout(() => {
|
|
159
|
-
completeFlowTask(tempArr);
|
|
160
|
-
}, 600000);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
setApproveDrawerVisible(false);
|
|
164
|
-
onFinishFlowAction();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
})
|
|
168
|
-
.catch((error) => {
|
|
169
|
-
message.error({ content: error.message || '请求出错' });
|
|
170
|
-
})
|
|
171
|
-
.finally(() => {
|
|
172
|
-
setSubmitLoading(false);
|
|
173
|
-
setSubmitApplyLoading(false);
|
|
174
|
-
});
|
|
175
|
-
};
|
|
176
|
-
const onCloseFlowTaskInfoModal = () => {
|
|
177
|
-
completeFlowTask(allInfos);
|
|
178
|
-
};
|
|
179
|
-
const completeFlowTask = (allUser) => {
|
|
180
|
-
postFlowTaskList({
|
|
181
|
-
flowTaskIds: flowTaskIds.length ? flowTaskIds : allUser,
|
|
182
|
-
}, { callWedaApi }).then((res) => {
|
|
183
|
-
if (res.status) {
|
|
184
|
-
onFlowTaskInfoModalVisibleChange();
|
|
185
|
-
onFinishFlowAction();
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
/** 返回流程中心 */
|
|
190
|
-
const onBackFlowCenter = () => {
|
|
191
|
-
ControlModelUtils.navigateToFlowCenter();
|
|
192
|
-
};
|
|
193
|
-
/** 完成流程动作后的事件 */
|
|
194
|
-
const onFinishFlowAction = async (params) => {
|
|
195
|
-
const { handleType } = params || {};
|
|
196
|
-
const currentHandleType = handleType || handleTypeRef.current;
|
|
197
|
-
const customizeFinishActionName = ACTION_FINISH_MAP === null || ACTION_FINISH_MAP === void 0 ? void 0 : ACTION_FINISH_MAP[currentHandleType];
|
|
198
|
-
const customizeFinishAction = events === null || events === void 0 ? void 0 : events[customizeFinishActionName];
|
|
199
|
-
if (customizeFinishAction) {
|
|
200
|
-
// 当前动作不是加签的话,需要切换URL参数
|
|
201
|
-
if (currentHandleType !== ACTION_TYPE.ADD_ASSIGNEE) {
|
|
202
|
-
// 默认切换页面类型为【我已处理】
|
|
203
|
-
let newPageType = 'DONE';
|
|
204
|
-
// 提交后需要切换页面类型为【我发起的】
|
|
205
|
-
if (currentHandleType === ACTION_TYPE.SUBMIT) {
|
|
206
|
-
newPageType = 'CREATE';
|
|
207
|
-
}
|
|
208
|
-
// 保存草稿后切换页面类型为【草稿箱】
|
|
209
|
-
if (currentHandleType === ACTION_TYPE.SAVE_DRAFT) {
|
|
210
|
-
newPageType = 'DRAFT';
|
|
211
|
-
}
|
|
212
|
-
ControlModelUtils.updateUrlSearch({ pageType: newPageType });
|
|
213
|
-
}
|
|
214
|
-
// 操作类型不是回退的情况才reload数据 回退之后当前流程被销毁 故回退之后不刷新数据
|
|
215
|
-
if (currentHandleType === ACTION_TYPE.GO_BACK) {
|
|
216
|
-
setHasGoBack(true);
|
|
217
|
-
setFormType('read');
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
// 重新加载数据
|
|
221
|
-
reload();
|
|
222
|
-
}
|
|
223
|
-
// 执行自定义事件
|
|
224
|
-
customizeFinishAction === null || customizeFinishAction === void 0 ? void 0 : customizeFinishAction();
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
return {
|
|
228
|
-
userModalVisible,
|
|
229
|
-
approveDrawerVisible,
|
|
230
|
-
submitApplyLoading,
|
|
231
|
-
submitLoading,
|
|
232
|
-
handleType,
|
|
233
|
-
flowTaskInfoModalVisible,
|
|
234
|
-
flowTaskInfoList,
|
|
235
|
-
allInfos,
|
|
236
|
-
flowTaskIds,
|
|
237
|
-
ccUserModelVisible,
|
|
238
|
-
ccUsers,
|
|
239
|
-
ifSubmitAndCc,
|
|
240
|
-
hasGoBack,
|
|
241
|
-
setUserModalVisible,
|
|
242
|
-
setCcUsers,
|
|
243
|
-
setCcUserModelVisible,
|
|
244
|
-
onAddCounterSign,
|
|
245
|
-
onControlChick,
|
|
246
|
-
onApproveDrawerVisibleChange,
|
|
247
|
-
onUserModalVisibleChange,
|
|
248
|
-
onTriggerFlowEvent,
|
|
249
|
-
onFlowTaskInfoModalVisibleChange,
|
|
250
|
-
setFlowTaskIds,
|
|
251
|
-
onSaveDraft,
|
|
252
|
-
onCloseFlowTaskInfoModal,
|
|
253
|
-
onBackFlowCenter,
|
|
254
|
-
onFinishFlowAction,
|
|
255
|
-
};
|
|
256
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
import { postApprovalSign } from '../../../services';
|
|
3
|
-
import { ACTION_TYPE } from '../constants';
|
|
4
|
-
export const useMobileModel = (params, controlModel) => {
|
|
5
|
-
const { safeJsonParse, callWedaApi } = params.flowLocalProps;
|
|
6
|
-
const { setCcUsers, onFinishFlowAction } = controlModel;
|
|
7
|
-
const [showMoreAction, setShowMoreAction] = useState(false);
|
|
8
|
-
const [userSelectModelVisible, setUserSelectModelVisible] = useState(false);
|
|
9
|
-
const [userSelectApproveField, setUserSelectApproveField] = useState('');
|
|
10
|
-
const [userSelectMode, setUserSelectMode] = useState('');
|
|
11
|
-
const [fileList, setFileList] = useState([]);
|
|
12
|
-
const [approvers, setApprovers] = useState([]);
|
|
13
|
-
const [approver, setApprover] = useState('');
|
|
14
|
-
const [opinionUserMap, setOpinionUserMap] = useState({});
|
|
15
|
-
const [highlightPositionMap, setHighlightPositionMap] = useState({});
|
|
16
|
-
const [loadingAssign, setLoadingAssign] = useState(false);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (!userSelectModelVisible) {
|
|
19
|
-
const popupData = sessionStorage.getItem('FlowActionsMobile');
|
|
20
|
-
const hasSignSubmit = sessionStorage.getItem('hasSignSubmit');
|
|
21
|
-
const ccUserFormStorage = safeJsonParse(sessionStorage.getItem('ccUsers'));
|
|
22
|
-
if (popupData) {
|
|
23
|
-
const pageActionData = safeJsonParse(popupData);
|
|
24
|
-
const { opinionUserMap, highlightPositionMap, approver, approvers, fileList, ccUsers, } = pageActionData;
|
|
25
|
-
setApprover(approver || []);
|
|
26
|
-
setApprovers(approvers || []);
|
|
27
|
-
setOpinionUserMap({ ...opinionUserMap });
|
|
28
|
-
setHighlightPositionMap({ ...highlightPositionMap });
|
|
29
|
-
setApprover(approver);
|
|
30
|
-
setApprovers(approvers);
|
|
31
|
-
setFileList(fileList);
|
|
32
|
-
if (ccUsers) {
|
|
33
|
-
setCcUsers(ccUserFormStorage.map((user) => ({
|
|
34
|
-
value: user.UserId,
|
|
35
|
-
text: user.Name,
|
|
36
|
-
})));
|
|
37
|
-
}
|
|
38
|
-
if (hasSignSubmit) {
|
|
39
|
-
setLoadingAssign(true);
|
|
40
|
-
const assigneeIds = pageActionData === null || pageActionData === void 0 ? void 0 : pageActionData.assigneeIds;
|
|
41
|
-
postApprovalSign({ ...pageActionData, assigneeIds }, { callWedaApi }).then((res) => {
|
|
42
|
-
if (res === null || res === void 0 ? void 0 : res.status) {
|
|
43
|
-
setLoadingAssign(false);
|
|
44
|
-
sessionStorage.removeItem('FlowActionsMobile');
|
|
45
|
-
sessionStorage.removeItem('hasSignSubmit');
|
|
46
|
-
onFinishFlowAction({
|
|
47
|
-
handleType: ACTION_TYPE.ADD_ASSIGNEE,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}, [userSelectModelVisible]);
|
|
55
|
-
const onUserSelectModelVisibleChange = () => {
|
|
56
|
-
setUserSelectModelVisible(!userSelectModelVisible);
|
|
57
|
-
};
|
|
58
|
-
const onShowMoreVisibleChange = () => {
|
|
59
|
-
setShowMoreAction(!showMoreAction);
|
|
60
|
-
};
|
|
61
|
-
const onUserSelectModalInfoChange = ({ approveField, mode }) => {
|
|
62
|
-
setUserSelectApproveField(approveField);
|
|
63
|
-
setUserSelectMode(mode);
|
|
64
|
-
};
|
|
65
|
-
return {
|
|
66
|
-
showMoreAction,
|
|
67
|
-
userSelectModelVisible,
|
|
68
|
-
userSelectApproveField,
|
|
69
|
-
userSelectMode,
|
|
70
|
-
approver,
|
|
71
|
-
approvers,
|
|
72
|
-
fileList,
|
|
73
|
-
opinionUserMap,
|
|
74
|
-
highlightPositionMap,
|
|
75
|
-
loadingAssign,
|
|
76
|
-
setUserSelectModelVisible,
|
|
77
|
-
setFileList,
|
|
78
|
-
setApprovers,
|
|
79
|
-
setApprover,
|
|
80
|
-
setOpinionUserMap,
|
|
81
|
-
setHighlightPositionMap,
|
|
82
|
-
onShowMoreVisibleChange,
|
|
83
|
-
onUserSelectModelVisibleChange,
|
|
84
|
-
onUserSelectModalInfoChange,
|
|
85
|
-
};
|
|
86
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { revokeFlow, fetchBackNodeList, rollBackFlow } from '../../../services';
|
|
3
|
-
import { ACTION_TYPE } from '../constants';
|
|
4
|
-
// 撤销/回退逻辑
|
|
5
|
-
export const useRevokeAndBackHook = (params, controlModel) => {
|
|
6
|
-
const { flowDetail } = params.commonFlowData;
|
|
7
|
-
const { callWedaApi, currentPageType } = params.flowLocalProps;
|
|
8
|
-
const { onFinishFlowAction } = controlModel;
|
|
9
|
-
const [showRevokeModal, setShowRevokeModal] = useState(false);
|
|
10
|
-
const [showBackModal, setShowBackModal] = useState(false);
|
|
11
|
-
const [backNodeList, setBackNodeList] = useState([]);
|
|
12
|
-
const [backNode, setBackNode] = useState('');
|
|
13
|
-
const doneRevokeFn = () => {
|
|
14
|
-
// 调用撤销接口
|
|
15
|
-
revokeFlow({
|
|
16
|
-
flowCode: flowDetail.flowCode,
|
|
17
|
-
appVersion: flowDetail.flowVersion,
|
|
18
|
-
instanceId: flowDetail.instanceId,
|
|
19
|
-
revokeType: currentPageType === 'CREATE' ? 2 : 1,
|
|
20
|
-
taskId: currentPageType === 'DONE' ? flowDetail.taskId : undefined,
|
|
21
|
-
}, { callWedaApi }).then((res) => {
|
|
22
|
-
if (res) {
|
|
23
|
-
setShowRevokeModal(false);
|
|
24
|
-
onFinishFlowAction({ handleType: ACTION_TYPE.REVOKE });
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
const getNodeList = () =>
|
|
29
|
-
// 获取回退节点列表
|
|
30
|
-
fetchBackNodeList({
|
|
31
|
-
flowCode: flowDetail.flowCode,
|
|
32
|
-
appVersion: flowDetail.flowVersion,
|
|
33
|
-
instanceId: flowDetail.instanceId,
|
|
34
|
-
}, { callWedaApi }).then((res) => {
|
|
35
|
-
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
36
|
-
let preNodeId = '';
|
|
37
|
-
const options = res.data.map((item) => {
|
|
38
|
-
if (item.lastNode) {
|
|
39
|
-
preNodeId = item.elementId;
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
...item,
|
|
43
|
-
value: item.elementId,
|
|
44
|
-
text: item.elementName,
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
setBackNodeList(options);
|
|
48
|
-
setBackNode(preNodeId);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const doneBackFn = () => {
|
|
52
|
-
var _a;
|
|
53
|
-
// 调用回退接口
|
|
54
|
-
rollBackFlow({
|
|
55
|
-
flowCode: flowDetail.flowCode,
|
|
56
|
-
appVersion: flowDetail.flowVersion,
|
|
57
|
-
instanceId: flowDetail.instanceId,
|
|
58
|
-
taskId: flowDetail.taskId,
|
|
59
|
-
nodeId: flowDetail.currentNodeId,
|
|
60
|
-
sourceType: 1,
|
|
61
|
-
targetNodeId: backNode,
|
|
62
|
-
targetActTaskId: (_a = backNodeList.find((item) => item.value === backNode)) === null || _a === void 0 ? void 0 : _a.actTaskId,
|
|
63
|
-
}, { callWedaApi }).then((res) => {
|
|
64
|
-
if (res) {
|
|
65
|
-
setShowBackModal(false);
|
|
66
|
-
onFinishFlowAction({ handleType: ACTION_TYPE.GO_BACK });
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
return {
|
|
71
|
-
showRevokeModal,
|
|
72
|
-
setShowRevokeModal,
|
|
73
|
-
doneRevokeFn,
|
|
74
|
-
doneBackFn,
|
|
75
|
-
showBackModal,
|
|
76
|
-
setShowBackModal,
|
|
77
|
-
getNodeList,
|
|
78
|
-
backNodeList,
|
|
79
|
-
backNode,
|
|
80
|
-
setBackNode,
|
|
81
|
-
};
|
|
82
|
-
};
|