@cloudbase/weda-ui 3.4.10 → 3.4.11
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/wd-table.js +1 -1
- package/dist/web/components/calendar/index.js +1 -1
- package/dist/web/components/form/enumSelect/MultipleSelect.js +1 -0
- package/dist/web/components/form/enumSelect/SelectContainer.js +1 -0
- package/dist/web/components/form/input/index.js +11 -5
- package/dist/web/components/form/location/components/LocationPC/Header.js +1 -0
- package/dist/web/components/form/location/index.js +1 -0
- package/dist/web/components/form/select/request.js +14 -2
- package/dist/web/components/form/uploader/uploader.h5.js +1 -1
- package/dist/web/components/form/uploader/uploader.pc.js +3 -2
- package/dist/web/components/form/uploaderFile/index.js +2 -0
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +47 -43
- package/dist/web/components/form/userOrgSelect/common/utils.js +0 -20
- package/dist/web/components/form/userOrgSelect/component/depart-select/depart-select-pc.js +8 -3
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +18 -14
- package/dist/web/components/form/userOrgSelect/component/depart-select/org-modal-pc.js +14 -20
- package/dist/web/components/form/userOrgSelect/component/modal-select-h5.js +1 -1
- package/dist/web/components/form/userOrgSelect/component/org-tree.js +1 -3
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +4 -29
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +7 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +4 -6
- package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +2 -8
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +51 -25
- package/dist/web/components/form-input-hooks/index.js +2 -1
- package/dist/web/components/repeater/index.js +1 -0
- package/dist/web/components/repeater-item/index.js +1 -0
- package/dist/web/components/statusContent/index.js +1 -0
- package/dist/web/components/table/ImportFileModalByApi/uploadCSVFile.js +1 -1
- package/dist/web/components/wd-form/index.js +3 -2
- package/dist/web/components/wd-table/components/FieldRender/index.js +15 -18
- package/dist/web/components/wd-table/wd-table.js +18 -18
- package/dist/web/utils/datasource.js +23 -17
- package/package.json +1 -1
- package/dist/web/components/emptyContent/index.js +0 -46
- package/dist/web/components/flow/components/FlowModuleText/Content.js +0 -6
- package/dist/web/components/flow/components/FlowModuleText/Title.js +0 -16
- package/dist/web/components/flow/components/FlowModuleText/index.js +0 -7
- package/dist/web/components/flow/components/FlowModuleText/utils.js +0 -34
- package/dist/web/components/flow/components/FlowStatusText/index.js +0 -37
- package/dist/web/components/flow/components/HighLightComment/index.js +0 -31
- package/dist/web/components/flow/components/index.js +0 -3
- package/dist/web/components/flow/constants/index.js +0 -65
- package/dist/web/components/flow/frame/getCommonFlowData.js +0 -80
- package/dist/web/components/flow/frame/hooks/index.js +0 -2
- package/dist/web/components/flow/frame/hooks/useCommonFlowRequest.js +0 -148
- package/dist/web/components/flow/frame/hooks/useElementMediaQuery.js +0 -15
- package/dist/web/components/flow/frame/index.js +0 -76
- package/dist/web/components/flow/frame/types.js +0 -277
- package/dist/web/components/flow/frame/utils.js +0 -149
- package/dist/web/components/flow/modules/chart/Chart.js +0 -282
- package/dist/web/components/flow/modules/chart/constants.js +0 -28
- package/dist/web/components/flow/modules/chart/index.css +0 -84
- package/dist/web/components/flow/modules/chart/isString.js +0 -5
- package/dist/web/components/flow/modules/chart/utils.js +0 -111
- package/dist/web/components/flow/modules/operations/controls-items/flow-task-info-modal.js +0 -98
- package/dist/web/components/flow/modules/process/Process.js +0 -73
- package/dist/web/components/flow/modules/process/ProcessMobile.js +0 -81
- package/dist/web/components/flow/modules/process/index.js +0 -14
- package/dist/web/components/flow/modules/process/utils/index.js +0 -32
- package/dist/web/components/flow/services/flow.js +0 -111
- package/dist/web/components/flow/services/ideData/chart.js +0 -88
- package/dist/web/components/flow/services/ideData/index.js +0 -5
- package/dist/web/components/flow/services/ideData/instance.js +0 -23
- package/dist/web/components/flow/services/ideData/pageDetail.js +0 -42
- package/dist/web/components/flow/services/ideData/process.js +0 -27
- package/dist/web/components/flow/services/index.js +0 -2
- package/dist/web/components/flow/services/user.js +0 -23
- package/dist/web/components/flow/services/utils.js +0 -28
- package/dist/web/components/form/userOrgSelect/component/OrgPaths.js +0 -12
- package/dist/web/components/form/userOrgSelect/component/depart-select/departTreeSelect.h5.js +0 -156
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useState } from 'react';
|
|
2
|
-
import { Modal, SelectMultiple, Button, Form, Checkbox } from 'tea-component';
|
|
3
|
-
import { FlowCheckListPopup } from './check-list-popup';
|
|
4
|
-
/**
|
|
5
|
-
* 选择下一节点审批人弹窗
|
|
6
|
-
*/
|
|
7
|
-
export const FlowTaskInfoModal = (props) => {
|
|
8
|
-
const { isH5, visible, flowTaskInfoList, selectedTaskIds, setSelectedTaskIds, onSubmitTaskIds, } = useFlowTaskInfoModel(props);
|
|
9
|
-
const options = flowTaskInfoList.map((item) => ({
|
|
10
|
-
text: item === null || item === void 0 ? void 0 : item.assigneeName,
|
|
11
|
-
value: item === null || item === void 0 ? void 0 : item.waitFlowTaskId,
|
|
12
|
-
}));
|
|
13
|
-
const renderModal = () => {
|
|
14
|
-
return (React.createElement(Modal, { visible: visible, caption: props.label, onClose: () => onSubmitTaskIds(), size: "auto" },
|
|
15
|
-
React.createElement(Modal.Body, null,
|
|
16
|
-
React.createElement(Form, { style: { marginBottom: '5px' } },
|
|
17
|
-
React.createElement(Form.Item, { label: "\u9009\u62E9\u5904\u7406\u4EBA" },
|
|
18
|
-
React.createElement(SelectMultiple, { searchable: true, matchButtonWidth: true, appearance: "button", size: "full", style: { width: 300 }, staging: false, options: options, value: selectedTaskIds, onChange: (value) => setSelectedTaskIds(value) })))),
|
|
19
|
-
React.createElement(Modal.Footer, null,
|
|
20
|
-
React.createElement(Button, { type: "primary", onClick: () => onSubmitTaskIds(false), disabled: !selectedTaskIds.length }, "\u786E\u5B9A"),
|
|
21
|
-
React.createElement(Button, { type: "weak", onClick: () => onSubmitTaskIds() }, "\u53D6\u6D88"))));
|
|
22
|
-
};
|
|
23
|
-
const renderPopup = () => {
|
|
24
|
-
return (React.createElement(FlowCheckListPopup, { visible: visible, onClose: () => onSubmitTaskIds(), title: props.label, overlayStyle: { zIndex: 998 }, height: 550, confirmButtonProps: {
|
|
25
|
-
disabled: !selectedTaskIds.length,
|
|
26
|
-
onClick: () => onSubmitTaskIds(false),
|
|
27
|
-
} },
|
|
28
|
-
React.createElement(Checkbox.Group, { value: selectedTaskIds, onChange: (value) => setSelectedTaskIds(value), layout: "column" }, options.map((option) => (React.createElement(Checkbox, { name: option.value, key: option.value }, option.text))))));
|
|
29
|
-
};
|
|
30
|
-
return React.createElement(React.Fragment, null,
|
|
31
|
-
" ",
|
|
32
|
-
isH5 ? renderPopup() : renderModal());
|
|
33
|
-
};
|
|
34
|
-
/** 下一节点审批人model */
|
|
35
|
-
function useFlowTaskInfoModel(params) {
|
|
36
|
-
const { flowRequest, isH5 } = params.flowFrameCommonProps.flowLocalProps;
|
|
37
|
-
const { onAfterFinishFlowAction } = params.flowControlModel;
|
|
38
|
-
/** 弹框是否可见 */
|
|
39
|
-
const [visible, setVisible] = useState(false);
|
|
40
|
-
/** 审批人列表 */
|
|
41
|
-
const [flowTaskInfoList, setFlowTaskInfoList] = useState([]);
|
|
42
|
-
/** 已选任务数组 */
|
|
43
|
-
const [selectedTaskIds, setSelectedTaskIds] = useState([]);
|
|
44
|
-
const timer = useRef(null);
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
return () => {
|
|
47
|
-
cleanTiming();
|
|
48
|
-
};
|
|
49
|
-
}, []);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
if (params.flowControlModel.triggerFlowTaskInfo) {
|
|
52
|
-
const { toBeSubmittedFlowTaskInfo } = params.flowControlModel.triggerFlowTaskInfo || {};
|
|
53
|
-
setVisible(true);
|
|
54
|
-
setFlowTaskInfoList(toBeSubmittedFlowTaskInfo || []);
|
|
55
|
-
timingSubmit();
|
|
56
|
-
}
|
|
57
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58
|
-
}, [params.flowControlModel.triggerFlowTaskInfo]);
|
|
59
|
-
const cleanTiming = () => {
|
|
60
|
-
clearTimeout(timer.current);
|
|
61
|
-
};
|
|
62
|
-
/** 审批人列表提交 */
|
|
63
|
-
const submitFlowTaskList = async (flowTaskIds) => {
|
|
64
|
-
const result = await flowRequest({
|
|
65
|
-
action: 'SubmitFlowTaskList',
|
|
66
|
-
data: { flowTaskIds },
|
|
67
|
-
});
|
|
68
|
-
if (result === null || result === void 0 ? void 0 : result.status) {
|
|
69
|
-
setVisible(false);
|
|
70
|
-
setSelectedTaskIds([]);
|
|
71
|
-
cleanTiming();
|
|
72
|
-
// 执行完成后自定义动作
|
|
73
|
-
onAfterFinishFlowAction(params.actionKey, params.afterAction);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
/** 定时提交 */
|
|
77
|
-
const timingSubmit = () => {
|
|
78
|
-
// eslint-disable-next-line rulesdir/no-timer
|
|
79
|
-
timer.current = setTimeout(() => {
|
|
80
|
-
submitFlowTaskList();
|
|
81
|
-
}, 600000);
|
|
82
|
-
};
|
|
83
|
-
/** 提交按钮动作 */
|
|
84
|
-
const onSubmitTaskIds = (isCancel = true) => {
|
|
85
|
-
const taskIds = isCancel
|
|
86
|
-
? flowTaskInfoList.map((i) => i === null || i === void 0 ? void 0 : i.waitFlowTaskId)
|
|
87
|
-
: selectedTaskIds;
|
|
88
|
-
submitFlowTaskList(taskIds);
|
|
89
|
-
};
|
|
90
|
-
return {
|
|
91
|
-
isH5,
|
|
92
|
-
selectedTaskIds,
|
|
93
|
-
visible,
|
|
94
|
-
flowTaskInfoList,
|
|
95
|
-
setSelectedTaskIds,
|
|
96
|
-
onSubmitTaskIds,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import moment from 'moment';
|
|
3
|
-
import classNames from '../../../../utils/classnames';
|
|
4
|
-
import { Text, Status, LoadingTip, Card } from 'tea-component';
|
|
5
|
-
import { HighLightComment, FlowModuleText, getModuleTextProps, getModuleContentStyle, } from '../../components';
|
|
6
|
-
import { STATUS } from '../../constants';
|
|
7
|
-
import { getStatusStr, showTwoUserList } from './utils';
|
|
8
|
-
const ApproveProcess = (props) => {
|
|
9
|
-
const { commonFlowData, flowLocalProps, ide, loading } = props;
|
|
10
|
-
const flowModelContentStyle = getModuleContentStyle(ide);
|
|
11
|
-
const { steps } = commonFlowData;
|
|
12
|
-
const { safeJsonParse } = flowLocalProps;
|
|
13
|
-
const renderContent = () => {
|
|
14
|
-
if (loading) {
|
|
15
|
-
return React.createElement(LoadingTip, null);
|
|
16
|
-
}
|
|
17
|
-
if ((steps === null || steps === void 0 ? void 0 : steps.length) === 0) {
|
|
18
|
-
return React.createElement(Status, { icon: "blank", size: "l", title: "\u6682\u65E0\u6D41\u8F6C\u8BB0\u5F55", ...props });
|
|
19
|
-
}
|
|
20
|
-
return (React.createElement("div", { className: classNames('page-process__progress', 'page-process__progress__app-page') },
|
|
21
|
-
React.createElement("div", { className: "approval-progress" }, (steps || []).map((item, index) => {
|
|
22
|
-
var _a, _b, _c, _d, _e, _f;
|
|
23
|
-
const details = item.contentInfo;
|
|
24
|
-
return (React.createElement("div", { className: "approval-progress__item", key: index },
|
|
25
|
-
React.createElement("div", { className: `approval-progress__dot ${!item.status ? '' : item.status}` }),
|
|
26
|
-
React.createElement("div", { className: "approval-progress__content" },
|
|
27
|
-
React.createElement("div", { className: "approval-progress__row tea-mb-2n" },
|
|
28
|
-
item.status === STATUS.DROP ? (React.createElement("div", { className: "approval-progress__dept", style: {
|
|
29
|
-
color: 'rgb(231, 87, 87)',
|
|
30
|
-
...flowModelContentStyle,
|
|
31
|
-
} }, item.result)) : (React.createElement("div", { className: "approval-progress__dept", style: flowModelContentStyle }, item.name)),
|
|
32
|
-
![STATUS.CC, STATUS.DROP].includes(item.status) && (React.createElement("div", { className: "approval-progress__user", style: flowModelContentStyle },
|
|
33
|
-
item.status === STATUS.START ? '发起人' : '审批人',
|
|
34
|
-
"\uFF1A",
|
|
35
|
-
showTwoUserList(item.operaName, item.approvalStrategy))),
|
|
36
|
-
![STATUS.START, STATUS.END, STATUS.CC].includes(item.status) && getStatusStr(item.status)),
|
|
37
|
-
React.createElement("div", { className: "approval-progress__row approval-progress__row--start tea-mb-2n" },
|
|
38
|
-
details.createTime && (React.createElement(Text, { theme: "weak", className: "approval-progress__date" }, moment(details.createTime).format('YYYY-MM-DD HH:mm:ss'))),
|
|
39
|
-
item.status === STATUS.CC && (React.createElement(Text, { theme: "weak", style: { maxWidth: 500 }, overflow: true, tooltip: true },
|
|
40
|
-
"\u6284\u9001\uFF1A", (_b = (_a = details.ccUserInfos) === null || _a === void 0 ? void 0 : _a.map((i) => i.name)) === null || _b === void 0 ? void 0 :
|
|
41
|
-
_b.join('、'))),
|
|
42
|
-
details.ccUsers && (React.createElement(Text, { theme: "weak", style: { maxWidth: 500 }, overflow: true, tooltip: true },
|
|
43
|
-
"\u6284\u9001\uFF1A", (_c = Object.values(details.ccUsers)) === null || _c === void 0 ? void 0 :
|
|
44
|
-
_c.join('、'))),
|
|
45
|
-
item.status === STATUS.TRANS && (React.createElement(Text, { theme: "weak" },
|
|
46
|
-
"\u56DE\u9000\u5230\u6307\u5B9A\u8282\u70B9\uFF1A",
|
|
47
|
-
(details === null || details === void 0 ? void 0 : details.operation)
|
|
48
|
-
? (_d = safeJsonParse(details === null || details === void 0 ? void 0 : details.operation)[1]) === null || _d === void 0 ? void 0 : _d.name
|
|
49
|
-
: '')),
|
|
50
|
-
!!details.operationComment && (React.createElement(Text, { theme: "weak", className: "approval-progress__comment" },
|
|
51
|
-
"\u5BA1\u6279\u610F\u89C1\uFF1A",
|
|
52
|
-
React.createElement(HighLightComment, { details: details })))),
|
|
53
|
-
React.createElement("div", { className: "approval-progress__row", style: {
|
|
54
|
-
flexDirection: 'column',
|
|
55
|
-
alignItems: 'flex-start',
|
|
56
|
-
} },
|
|
57
|
-
item.status === 'countersign' && (React.createElement(Text, { theme: "weak", className: "approval-progress__advice-item" },
|
|
58
|
-
React.createElement("i", { className: "apa-icon apa-icon-label tea-mr-2n" }),
|
|
59
|
-
"\u52A0\u7B7E\uFF1A",
|
|
60
|
-
(details === null || details === void 0 ? void 0 : details.operation)
|
|
61
|
-
? safeJsonParse(details.operation)
|
|
62
|
-
.map((i) => i.name)
|
|
63
|
-
.join(',')
|
|
64
|
-
: '')),
|
|
65
|
-
details.isCC && (React.createElement(Text, { theme: "weak", className: "approval-progress__advice-item" },
|
|
66
|
-
React.createElement("i", { className: "apa-icon apa-icon-trans tea-mr-2n" }),
|
|
67
|
-
"\u6284\u9001\uFF1A", (_f = (_e = details.ccUserInfos) === null || _e === void 0 ? void 0 : _e.map((i) => i.name)) === null || _f === void 0 ? void 0 :
|
|
68
|
-
_f.join('、')))))));
|
|
69
|
-
}))));
|
|
70
|
-
};
|
|
71
|
-
return (React.createElement(Card.Body, { className: "page-process__progress-card", title: React.createElement(FlowModuleText.Title, { ...getModuleTextProps(ide) }) }, renderContent()));
|
|
72
|
-
};
|
|
73
|
-
export default ApproveProcess;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import moment from 'moment';
|
|
3
|
-
import { Text, Status, LoadingTip, Card } from 'tea-component';
|
|
4
|
-
import { HighLightComment, FlowModuleText, getModuleTextProps, getModuleContentStyle, } from '../../components';
|
|
5
|
-
import { STATUS } from '../../constants';
|
|
6
|
-
import { getStatusStr, showTwoUserList } from './utils';
|
|
7
|
-
const ApproveProcessMobile = (props) => {
|
|
8
|
-
const { commonFlowData, flowLocalProps, ide, loading } = props;
|
|
9
|
-
const flowModelContentStyle = getModuleContentStyle(ide);
|
|
10
|
-
const { steps } = commonFlowData;
|
|
11
|
-
const { safeJsonParse } = flowLocalProps;
|
|
12
|
-
const renderContent = () => {
|
|
13
|
-
if (loading) {
|
|
14
|
-
return React.createElement(LoadingTip, null);
|
|
15
|
-
}
|
|
16
|
-
if ((steps === null || steps === void 0 ? void 0 : steps.length) === 0) {
|
|
17
|
-
return React.createElement(Status, { icon: "blank", size: "l", title: "\u6682\u65E0\u6D41\u8F6C\u8BB0\u5F55", ...props });
|
|
18
|
-
}
|
|
19
|
-
if ((steps === null || steps === void 0 ? void 0 : steps.length) > 0) {
|
|
20
|
-
return (React.createElement("div", { className: "page-process__progress process-progress--mb" },
|
|
21
|
-
React.createElement("div", { className: "approval-progress approval-progress-mb" }, (steps || []).map((item, index) => {
|
|
22
|
-
var _a, _b, _c, _d, _e, _f;
|
|
23
|
-
const details = item.contentInfo;
|
|
24
|
-
return (React.createElement("div", { className: "approval-progress__item", key: `${index}_${item === null || item === void 0 ? void 0 : item.name}` },
|
|
25
|
-
React.createElement("div", { className: `approval-progress__dot ${!item.status ? '' : item.status}` }),
|
|
26
|
-
React.createElement("div", { className: "approval-progress__content", style: { width: 'calc(100% - 26px)' } },
|
|
27
|
-
React.createElement("div", { className: "approval-progress__row tea-mb-2n" },
|
|
28
|
-
item.status === STATUS.DROP ? (React.createElement("div", { className: "approval-progress__dept", style: {
|
|
29
|
-
color: 'rgb(231, 87, 87)',
|
|
30
|
-
...flowModelContentStyle,
|
|
31
|
-
} }, item.result)) : (React.createElement("div", { className: "approval-progress__dept", style: flowModelContentStyle }, item.name)),
|
|
32
|
-
![STATUS.START, STATUS.END, STATUS.CC].includes(item.status) && getStatusStr(item.status)),
|
|
33
|
-
React.createElement("div", { className: "approval-progress__row tea-mb-1n" },
|
|
34
|
-
![STATUS.CC].includes(item.status) && (React.createElement(Text, { theme: "weak", className: "tea-mr-4n", style: {
|
|
35
|
-
maxWidth: 'calc(100% - 120px)',
|
|
36
|
-
wordBreak: 'break-all',
|
|
37
|
-
...flowModelContentStyle,
|
|
38
|
-
} },
|
|
39
|
-
item.status === STATUS.START ? '发起人' : '审批人',
|
|
40
|
-
"\uFF1A",
|
|
41
|
-
showTwoUserList(item.operaName, item.approvalStrategy))),
|
|
42
|
-
details.createTime && (React.createElement(Text, { theme: "weak", className: "approval-progress__date" }, moment(details.createTime).format('YYYY-MM-DD HH:mm:ss')))),
|
|
43
|
-
item.status === STATUS.CC && (React.createElement("div", { className: "approval-progress__row approval-progress__row--start tea-mb-1n" },
|
|
44
|
-
React.createElement(Text, { theme: "weak", style: { maxWidth: 200 }, overflow: true, tooltip: true },
|
|
45
|
-
"\u6284\u9001\uFF1A", (_b = (_a = details.ccUserInfos) === null || _a === void 0 ? void 0 : _a.map((i) => i.name)) === null || _b === void 0 ? void 0 :
|
|
46
|
-
_b.join('、')))),
|
|
47
|
-
details.ccUsers && (React.createElement(Text, { theme: "weak", style: { maxWidth: 200 }, overflow: true, tooltip: true },
|
|
48
|
-
"\u6284\u9001\uFF1A", (_c = Object.values(details.ccUsers)) === null || _c === void 0 ? void 0 :
|
|
49
|
-
_c.join('、'))),
|
|
50
|
-
item.status === STATUS.TRANS && (React.createElement("div", { className: "approval-progress__row approval-progress__row--start tea-mb-1n" },
|
|
51
|
-
React.createElement(Text, { theme: "weak" },
|
|
52
|
-
"\u56DE\u9000\u5230\u6307\u5B9A\u8282\u70B9\uFF1A",
|
|
53
|
-
(details === null || details === void 0 ? void 0 : details.operation)
|
|
54
|
-
? (_d = safeJsonParse(details === null || details === void 0 ? void 0 : details.operation)[1]) === null || _d === void 0 ? void 0 : _d.name
|
|
55
|
-
: ''))),
|
|
56
|
-
!!details.operationComment && (React.createElement("div", { className: "approval-progress__row approval-progress__row--start tea-mb-1n" },
|
|
57
|
-
React.createElement(Text, { theme: "weak", className: "approval-progress__comment-mb" },
|
|
58
|
-
"\u5BA1\u6279\u610F\u89C1\uFF1A",
|
|
59
|
-
React.createElement(HighLightComment, { details: details })))),
|
|
60
|
-
React.createElement("div", { className: "approval-progress__row", style: {
|
|
61
|
-
flexDirection: 'column',
|
|
62
|
-
alignItems: 'flex-start',
|
|
63
|
-
} },
|
|
64
|
-
item.status === 'countersign' && (React.createElement(Text, { theme: "weak", className: "approval-progress__advice-item" },
|
|
65
|
-
React.createElement("i", { className: "apa-icon apa-icon-label tea-mr-2n" }),
|
|
66
|
-
"\u52A0\u7B7E\uFF1A",
|
|
67
|
-
(details === null || details === void 0 ? void 0 : details.operation)
|
|
68
|
-
? safeJsonParse(details.operation)
|
|
69
|
-
.map((i) => i.name)
|
|
70
|
-
.join(',')
|
|
71
|
-
: '')),
|
|
72
|
-
details.isCC && (React.createElement(Text, { theme: "weak", className: "approval-progress__advice-item" },
|
|
73
|
-
React.createElement("i", { className: "apa-icon apa-icon-trans tea-mr-2n" }),
|
|
74
|
-
"\u6284\u9001\uFF1A", (_f = (_e = details.ccUserInfos) === null || _e === void 0 ? void 0 : _e.map((i) => i.name)) === null || _f === void 0 ? void 0 :
|
|
75
|
-
_f.join('、')))))));
|
|
76
|
-
}))));
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
return (React.createElement(Card.Body, { className: "page-process__progress-card", title: React.createElement(FlowModuleText.Title, { ...getModuleTextProps(ide) }) }, renderContent()));
|
|
80
|
-
};
|
|
81
|
-
export default ApproveProcessMobile;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createModuleFrame } from '../../frame';
|
|
3
|
-
import ApproveProcess from './Process';
|
|
4
|
-
import ApproveProcessMobile from './ProcessMobile';
|
|
5
|
-
import './index.css';
|
|
6
|
-
const ModelFlowProcess = (props) => {
|
|
7
|
-
const { flowLocalProps } = props;
|
|
8
|
-
const { isH5, isNarrowElement } = flowLocalProps;
|
|
9
|
-
if (isH5 || isNarrowElement) {
|
|
10
|
-
return React.createElement(ApproveProcessMobile, { ...props });
|
|
11
|
-
}
|
|
12
|
-
return React.createElement(ApproveProcess, { ...props });
|
|
13
|
-
};
|
|
14
|
-
export default createModuleFrame(ModelFlowProcess, 'flow-process');
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Tag, Bubble } from 'tea-component';
|
|
3
|
-
import { STATUS_TEXT } from '../../../constants';
|
|
4
|
-
export const getStatusStr = (status) => {
|
|
5
|
-
const { theme, text } = (STATUS_TEXT === null || STATUS_TEXT === void 0 ? void 0 : STATUS_TEXT[status]) || {};
|
|
6
|
-
if (text) {
|
|
7
|
-
return (React.createElement(Tag, { className: "approval-progress__status", theme: theme }, text));
|
|
8
|
-
}
|
|
9
|
-
return null;
|
|
10
|
-
};
|
|
11
|
-
export const showTwoUserList = (operatorName, approvalStrategy) => {
|
|
12
|
-
if (typeof operatorName === 'string') {
|
|
13
|
-
return operatorName || '-';
|
|
14
|
-
}
|
|
15
|
-
if (Array.isArray(operatorName)) {
|
|
16
|
-
const names = operatorName.filter((name) => name);
|
|
17
|
-
if (!names.length) {
|
|
18
|
-
return '-';
|
|
19
|
-
}
|
|
20
|
-
if (names.length < 2) {
|
|
21
|
-
return names[0];
|
|
22
|
-
}
|
|
23
|
-
return (React.createElement(Bubble, { arrowPointAtCenter: true, placement: "top-end", content: names.join('、') }, names === null || names === void 0 ? void 0 :
|
|
24
|
-
names.slice(0, 2).join('、'),
|
|
25
|
-
React.createElement("span", null,
|
|
26
|
-
"\u7B49",
|
|
27
|
-
React.createElement("span", { style: { color: '#2473f2' } },
|
|
28
|
-
names.length,
|
|
29
|
-
"\u4EBA"),
|
|
30
|
-
approvalStrategy === '1' ? '任签' : '加签')));
|
|
31
|
-
}
|
|
32
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { toTransKeyCase } from './utils';
|
|
2
|
-
import { chartMockData, pageDetailMockData, processMockData, instanceMockData, } from './ideData';
|
|
3
|
-
// 获取批办过程接口
|
|
4
|
-
export const fetchInstanceOperation = async (params, { callWedaApi, isWedaIde }) => {
|
|
5
|
-
if (isWedaIde) {
|
|
6
|
-
return toTransKeyCase(processMockData, 'toLowerCase');
|
|
7
|
-
}
|
|
8
|
-
if (!(params === null || params === void 0 ? void 0 : params.instanceId)) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
const result = await callWedaApi({
|
|
12
|
-
action: 'GetInstanceOperation',
|
|
13
|
-
data: toTransKeyCase(params, 'toUpperCase'),
|
|
14
|
-
});
|
|
15
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* 获取流程实例运行图(新版)
|
|
19
|
-
* @param {instanceId: string} params
|
|
20
|
-
*/
|
|
21
|
-
export const fetchProcessInfoList = async (params, { isWedaIde, callWedaApi }) => {
|
|
22
|
-
if (isWedaIde) {
|
|
23
|
-
return toTransKeyCase(chartMockData, 'toLowerCase');
|
|
24
|
-
}
|
|
25
|
-
const result = await callWedaApi({
|
|
26
|
-
action: 'GetProcessCanvasInfo',
|
|
27
|
-
data: toTransKeyCase(params, 'toUpperCase'),
|
|
28
|
-
});
|
|
29
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* 获取流程信息
|
|
33
|
-
* @param {instanceId: string} params
|
|
34
|
-
*/
|
|
35
|
-
export const fetchProcess = async (params, { isWedaIde, callWedaApi }) => {
|
|
36
|
-
if (isWedaIde) {
|
|
37
|
-
return toTransKeyCase(instanceMockData, 'toLowerCase');
|
|
38
|
-
}
|
|
39
|
-
const result = await callWedaApi({
|
|
40
|
-
action: 'DescribeProcessInstance',
|
|
41
|
-
data: toTransKeyCase(params, 'toUpperCase'),
|
|
42
|
-
});
|
|
43
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
44
|
-
};
|
|
45
|
-
// 获取流程信息详情
|
|
46
|
-
export async function getApprovalPageDetail(params, { isWedaIde, callWedaApi }) {
|
|
47
|
-
if (isWedaIde) {
|
|
48
|
-
return toTransKeyCase(pageDetailMockData, 'toLowerCase');
|
|
49
|
-
}
|
|
50
|
-
const result = await callWedaApi({
|
|
51
|
-
action: 'GetApprovalPageDetail',
|
|
52
|
-
data: toTransKeyCase(params, 'toUpperCase'),
|
|
53
|
-
});
|
|
54
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
55
|
-
}
|
|
56
|
-
// 撤销流程接口
|
|
57
|
-
export const revokeFlow = async (params, { callWedaApi }) => {
|
|
58
|
-
const result = await callWedaApi({
|
|
59
|
-
action: 'Revoke',
|
|
60
|
-
data: toTransKeyCase(params, 'toUpperCase'),
|
|
61
|
-
});
|
|
62
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
63
|
-
};
|
|
64
|
-
// 获取回退节点列表
|
|
65
|
-
export const fetchBackNodeList = async (params, { callWedaApi }) => {
|
|
66
|
-
const result = await callWedaApi({
|
|
67
|
-
action: 'GetPreElementList',
|
|
68
|
-
data: toTransKeyCase(params, 'toUpperCase'),
|
|
69
|
-
});
|
|
70
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
71
|
-
};
|
|
72
|
-
// 回退流程接口
|
|
73
|
-
export const rollBackFlow = async (params, { callWedaApi }) => {
|
|
74
|
-
const result = await callWedaApi({
|
|
75
|
-
action: 'RollBack',
|
|
76
|
-
data: toTransKeyCase(params, 'toUpperCase'),
|
|
77
|
-
});
|
|
78
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
79
|
-
};
|
|
80
|
-
// 审批流页面提交
|
|
81
|
-
export const postApprovalFlow = async (params, { callWedaApi }) => {
|
|
82
|
-
const result = await callWedaApi({
|
|
83
|
-
action: 'CompleteTask',
|
|
84
|
-
data: toTransKeyCase(params, 'toUpperCase', 'variableInfos'),
|
|
85
|
-
});
|
|
86
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
87
|
-
};
|
|
88
|
-
// 审批流页面会签
|
|
89
|
-
export const postApprovalSign = async (params, { callWedaApi }) => {
|
|
90
|
-
const result = await callWedaApi({
|
|
91
|
-
action: 'AddCounterSignAssignee',
|
|
92
|
-
data: toTransKeyCase(params, 'toUpperCase'),
|
|
93
|
-
});
|
|
94
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
95
|
-
};
|
|
96
|
-
// 审批人列表提交
|
|
97
|
-
export const postFlowTaskList = async (params, { callWedaApi }) => {
|
|
98
|
-
const result = await callWedaApi({
|
|
99
|
-
action: 'SubmitFlowTaskList',
|
|
100
|
-
data: toTransKeyCase(params, 'toUpperCase'),
|
|
101
|
-
});
|
|
102
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
103
|
-
};
|
|
104
|
-
// 流程催办
|
|
105
|
-
export const postPressTask = async (params, { callWedaApi }) => {
|
|
106
|
-
const result = await callWedaApi({
|
|
107
|
-
action: 'PressTask',
|
|
108
|
-
data: toTransKeyCase(params, 'toUpperCase'),
|
|
109
|
-
});
|
|
110
|
-
return toTransKeyCase(result, 'toLowerCase');
|
|
111
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
export const chartMockData = {
|
|
2
|
-
Nodes: [
|
|
3
|
-
{
|
|
4
|
-
visited: true,
|
|
5
|
-
Id: 2,
|
|
6
|
-
ElementId: 'approvalNode1656317642548',
|
|
7
|
-
Name: '经理审批',
|
|
8
|
-
DataType: 17,
|
|
9
|
-
Status: 1,
|
|
10
|
-
Conf: [
|
|
11
|
-
{
|
|
12
|
-
Name: '张三',
|
|
13
|
-
Status: 2,
|
|
14
|
-
OpTime: 1656502417000,
|
|
15
|
-
Comment: '',
|
|
16
|
-
AttachmentInfo: '[]',
|
|
17
|
-
NewProcessors: 'true',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
visited: true,
|
|
23
|
-
Id: 3,
|
|
24
|
-
ElementId: 'approvalNode1656317679079',
|
|
25
|
-
Name: '总监审批',
|
|
26
|
-
DataType: 17,
|
|
27
|
-
Status: 3,
|
|
28
|
-
Conf: [
|
|
29
|
-
{ Name: '王五', Status: 0, OpTime: 0 },
|
|
30
|
-
{ Name: '李四', Status: 0, OpTime: 0 },
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
visited: true,
|
|
35
|
-
Id: 4,
|
|
36
|
-
ElementId: 'approvalNode1656317682440',
|
|
37
|
-
Name: '人事审批',
|
|
38
|
-
DataType: 17,
|
|
39
|
-
Status: 2,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
visited: true,
|
|
43
|
-
Id: 1,
|
|
44
|
-
ElementId: 'startNode',
|
|
45
|
-
Name: '开始',
|
|
46
|
-
DataType: 1,
|
|
47
|
-
Status: 1,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
visited: true,
|
|
51
|
-
Id: 5,
|
|
52
|
-
ElementId: 'endNode',
|
|
53
|
-
Name: '结束',
|
|
54
|
-
DataType: 13,
|
|
55
|
-
Status: 2,
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
Edges: [
|
|
59
|
-
{
|
|
60
|
-
Label: '同意',
|
|
61
|
-
Type: 2,
|
|
62
|
-
Source: 'approvalNode1656317679079',
|
|
63
|
-
Target: 'approvalNode1656317682440',
|
|
64
|
-
Status: 2,
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
Label: '同意c',
|
|
68
|
-
Type: 2,
|
|
69
|
-
Source: 'approvalNode1656317682440',
|
|
70
|
-
Target: 'endNode',
|
|
71
|
-
Status: 2,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
Label: '同意',
|
|
75
|
-
Type: 2,
|
|
76
|
-
Source: 'approvalNode1656317642548',
|
|
77
|
-
Target: 'approvalNode1656317679079',
|
|
78
|
-
Status: 2,
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
Label: '',
|
|
82
|
-
Type: 2,
|
|
83
|
-
Source: 'startNode',
|
|
84
|
-
Target: 'approvalNode1656317642548',
|
|
85
|
-
Status: 2,
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { chartMockData } from './chart';
|
|
2
|
-
import { instanceMockData } from './instance';
|
|
3
|
-
import { pageDetailMockData } from './pageDetail';
|
|
4
|
-
import { processMockData } from './process';
|
|
5
|
-
export { chartMockData, processMockData, instanceMockData, pageDetailMockData };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const instanceMockData = {
|
|
2
|
-
InstanceId: '1540637032124833793',
|
|
3
|
-
Name: '示例流程名称',
|
|
4
|
-
Description: '',
|
|
5
|
-
StartedBy: '示例流程发起人',
|
|
6
|
-
CurrentApprover: '1538836331989536769',
|
|
7
|
-
StartTime: 1656151467000,
|
|
8
|
-
IsCompleted: false,
|
|
9
|
-
StartAppCode: '1',
|
|
10
|
-
StartAppName: '',
|
|
11
|
-
CurrentNodeId: 'approvalNode1655879748434',
|
|
12
|
-
CurrentNodeName: '审批节点',
|
|
13
|
-
CurrentNodeType: 17,
|
|
14
|
-
TaskId: '1540637033316016132',
|
|
15
|
-
FlowCode: '1540158815012335618',
|
|
16
|
-
FlowVersion: '10.0',
|
|
17
|
-
Flag: 0,
|
|
18
|
-
CanApprove: true,
|
|
19
|
-
CanDelete: true,
|
|
20
|
-
TenantZoneId: '',
|
|
21
|
-
OperationName: '[{"branchName":"同意","branchType":1,"edgeId":"approvalNode1655879748434_to_updateRecord1656037357881"},{"branchName":"拒绝","branchType":2,"edgeId":""}]',
|
|
22
|
-
UserTaskType: 1,
|
|
23
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export const pageDetailMockData = {
|
|
2
|
-
PageUrl: '',
|
|
3
|
-
VariableInfos: {
|
|
4
|
-
ObjectListMap: [],
|
|
5
|
-
ObjectMap: [],
|
|
6
|
-
},
|
|
7
|
-
AppCode: '1',
|
|
8
|
-
Show: true,
|
|
9
|
-
ShowSubmitApp: false,
|
|
10
|
-
ShowCarbonCopy: true,
|
|
11
|
-
ShowTurnToPerson: true,
|
|
12
|
-
ShowAddAssignee: true,
|
|
13
|
-
ShowRollBack: true,
|
|
14
|
-
ShowRevoke: false,
|
|
15
|
-
OutEntityCodes: [],
|
|
16
|
-
Buttons: {
|
|
17
|
-
1: '同意',
|
|
18
|
-
2: '拒绝',
|
|
19
|
-
},
|
|
20
|
-
DataSourceInputParams: [
|
|
21
|
-
{
|
|
22
|
-
recordId: '0a4ec1f962b6ddaa0c9312965714b19e',
|
|
23
|
-
entityCode: 'hongqi_x2spbdq',
|
|
24
|
-
flag: true,
|
|
25
|
-
paramCode: '165587975739916917',
|
|
26
|
-
scope: 'GLOBAL',
|
|
27
|
-
name: 'startNodeoutputKey#165587975739916917',
|
|
28
|
-
fieldValueMap: {
|
|
29
|
-
owner: '1538836331989536769',
|
|
30
|
-
createdAt: 1656151466297,
|
|
31
|
-
createBy: '1538836331989536769',
|
|
32
|
-
test: 'trigger-two_usertask',
|
|
33
|
-
updateBy: '1538836331989536769',
|
|
34
|
-
_id: '0a4ec1f962b6ddaa0c9312965714b19e',
|
|
35
|
-
age: 10,
|
|
36
|
-
updatedAt: 1656151466297,
|
|
37
|
-
},
|
|
38
|
-
appCode: 1,
|
|
39
|
-
fieldType: 'OBJECT',
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export const processMockData = {
|
|
2
|
-
ElementInfos: [
|
|
3
|
-
{
|
|
4
|
-
Id: '1542109022301507586',
|
|
5
|
-
Name: '经理审批',
|
|
6
|
-
OperaName: ['张三'],
|
|
7
|
-
Result: 'true',
|
|
8
|
-
ContentInfo: {
|
|
9
|
-
Action: 2,
|
|
10
|
-
AttachmentInfo: '[]',
|
|
11
|
-
OperationComment: '',
|
|
12
|
-
CreateTime: 1656502417000,
|
|
13
|
-
OpinionUserMap: {},
|
|
14
|
-
HighlightPositionList: '{}',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
Name: '总监审批',
|
|
19
|
-
OperaName: ['王五', '李四'],
|
|
20
|
-
Result: '待审批',
|
|
21
|
-
ApprovalStrategy: '1',
|
|
22
|
-
ContentInfo: {
|
|
23
|
-
CreateTime: 1656502417000,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const getWedaUserList = async (params, { callWedaApi, IS_WEDA_IDE }) => {
|
|
2
|
-
if (IS_WEDA_IDE) {
|
|
3
|
-
return [];
|
|
4
|
-
}
|
|
5
|
-
const result = await callWedaApi({
|
|
6
|
-
action: 'DescribeWedaUserList',
|
|
7
|
-
data: {
|
|
8
|
-
UserType: 'internalUser',
|
|
9
|
-
...params,
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
return result;
|
|
13
|
-
};
|
|
14
|
-
export const getUserQuery = async (params, { callWedaApi, IS_WEDA_IDE }) => {
|
|
15
|
-
if (IS_WEDA_IDE) {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
const result = await callWedaApi({
|
|
19
|
-
action: 'SearchUser',
|
|
20
|
-
data: params,
|
|
21
|
-
});
|
|
22
|
-
return result;
|
|
23
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const transKey = (str, method) => {
|
|
2
|
-
const firstChar = method === 'toLowerCase'
|
|
3
|
-
? str.charAt(0).toLowerCase()
|
|
4
|
-
: str.charAt(0).toUpperCase();
|
|
5
|
-
return `${firstChar}${str.slice(1)}`;
|
|
6
|
-
};
|
|
7
|
-
const isArray = (value) => Array.isArray(value);
|
|
8
|
-
const isObject = (value) => Object.prototype.toString.call(value) === '[object Object]';
|
|
9
|
-
/**
|
|
10
|
-
* 将对象的key的首字母转换为大写或者小写
|
|
11
|
-
*/
|
|
12
|
-
export function toTransKeyCase(target, method, ignoreKeyValue) {
|
|
13
|
-
const result = {};
|
|
14
|
-
if (isArray(target)) {
|
|
15
|
-
return target === null || target === void 0 ? void 0 : target.map((item) => toTransKeyCase(item, method));
|
|
16
|
-
}
|
|
17
|
-
if (isObject(target)) {
|
|
18
|
-
return Object.keys(target).reduce((acc, key) => {
|
|
19
|
-
const finalKey = transKey(key, method);
|
|
20
|
-
acc[finalKey] =
|
|
21
|
-
ignoreKeyValue && ignoreKeyValue === key
|
|
22
|
-
? target[key]
|
|
23
|
-
: toTransKeyCase(target[key], method);
|
|
24
|
-
return acc;
|
|
25
|
-
}, result);
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|