@cloudbase/weda-ui 3.4.9 → 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,65 +0,0 @@
|
|
|
1
|
-
export const STATUS_NUMBER_MAPPING = {
|
|
2
|
-
1: 'START',
|
|
3
|
-
2: 'PASS',
|
|
4
|
-
3: 'DOWN',
|
|
5
|
-
4: 'TURN',
|
|
6
|
-
5: 'REVOKE',
|
|
7
|
-
6: 'TRANS',
|
|
8
|
-
7: 'COUNTERSIGN',
|
|
9
|
-
8: 'STOP',
|
|
10
|
-
9: 'SKIP_PASS',
|
|
11
|
-
10: 'SKIP_DOWN',
|
|
12
|
-
11: 'PENDING',
|
|
13
|
-
12: 'END',
|
|
14
|
-
13: 'HANDLED',
|
|
15
|
-
14: 'HANDLING',
|
|
16
|
-
15: 'CC',
|
|
17
|
-
16: 'DROP', // 作废
|
|
18
|
-
};
|
|
19
|
-
export const STATUS = {
|
|
20
|
-
START: 'start',
|
|
21
|
-
PASS: 'pass',
|
|
22
|
-
DOWN: 'down',
|
|
23
|
-
TURN: 'trun',
|
|
24
|
-
REVOKE: 'revoke',
|
|
25
|
-
TRANS: 'trans',
|
|
26
|
-
COUNTERSIGN: 'countersign',
|
|
27
|
-
STOP: 'stop',
|
|
28
|
-
SKIP_PASS: 'skip_pass',
|
|
29
|
-
SKIP_DOWN: 'skip_down',
|
|
30
|
-
PENDING: 'pending',
|
|
31
|
-
END: 'end',
|
|
32
|
-
HANDLED: 'handled',
|
|
33
|
-
HANDLING: 'handling',
|
|
34
|
-
CC: 'cc',
|
|
35
|
-
DROP: 'DROP', // 作废
|
|
36
|
-
};
|
|
37
|
-
export const STATUS_TEXT = {
|
|
38
|
-
pass: { theme: 'success', text: '审批通过' },
|
|
39
|
-
trun: { theme: 'primary', text: '已转办' },
|
|
40
|
-
down: { theme: 'error', text: '驳回' },
|
|
41
|
-
pending: { theme: 'warning', text: '待审批' },
|
|
42
|
-
trans: { theme: 'default', text: '回退' },
|
|
43
|
-
revoke: { theme: 'default', text: '撤销' },
|
|
44
|
-
skip_pass: { theme: 'success', text: '跳过(同意)' },
|
|
45
|
-
skip_down: { theme: 'error', text: '跳过(驳回)' },
|
|
46
|
-
end: { theme: 'error', text: '结束' },
|
|
47
|
-
countersign: { theme: 'default', text: '加签' },
|
|
48
|
-
stop: { theme: 'error', text: '终止' },
|
|
49
|
-
handled: { theme: 'success', text: '已处理' },
|
|
50
|
-
handling: { theme: 'warning', text: '待处理' },
|
|
51
|
-
};
|
|
52
|
-
export const PAGE_TYPE = {
|
|
53
|
-
/** 待我处理 */
|
|
54
|
-
TO_DO: 'TODO',
|
|
55
|
-
/** 我创建的 */
|
|
56
|
-
CREATE: 'CREATE',
|
|
57
|
-
/** 我已处理 */
|
|
58
|
-
DONE: 'DONE',
|
|
59
|
-
/** 抄送我的 */
|
|
60
|
-
COPY: 'CC',
|
|
61
|
-
/** 草稿箱 */
|
|
62
|
-
DRAFT: 'DRAFT',
|
|
63
|
-
/** 新建流程 */
|
|
64
|
-
CREATEFLOW: 'CREATEFLOW',
|
|
65
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import to from 'await-to-js';
|
|
2
|
-
import { fetchProcess, getApprovalPageDetail, fetchInstanceOperation, } from '../services';
|
|
3
|
-
import { PAGE_TYPE } from '../constants';
|
|
4
|
-
import { IFlowDetailProps, IPageInfoProps, } from './types';
|
|
5
|
-
import { CommonFlowDataUtils } from './utils';
|
|
6
|
-
export async function getCommonFlowData(config, flowTaskId) {
|
|
7
|
-
const { currentPageType } = config;
|
|
8
|
-
const pageTypeParams = currentPageType === PAGE_TYPE.CREATEFLOW
|
|
9
|
-
? PAGE_TYPE.TO_DO
|
|
10
|
-
: currentPageType;
|
|
11
|
-
const flowDetail = await getProcessInstance(config, pageTypeParams, flowTaskId);
|
|
12
|
-
const pageInfo = await getPageInfo(config, flowDetail, pageTypeParams);
|
|
13
|
-
const flowSteps = await fetchFlowSteps(config, flowDetail);
|
|
14
|
-
return {
|
|
15
|
-
flowDetail,
|
|
16
|
-
...pageInfo,
|
|
17
|
-
...flowSteps,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export async function getProcessInstance(config, pageTypeParams, flowTaskId) {
|
|
21
|
-
const { isWedaIde, callWedaApi } = config;
|
|
22
|
-
const params = {
|
|
23
|
-
flowTaskId,
|
|
24
|
-
pageType: pageTypeParams,
|
|
25
|
-
};
|
|
26
|
-
const options = { isWedaIde, callWedaApi };
|
|
27
|
-
const [err, res] = await to(fetchProcess(params, options));
|
|
28
|
-
if (!err) {
|
|
29
|
-
return res;
|
|
30
|
-
}
|
|
31
|
-
return new IFlowDetailProps();
|
|
32
|
-
}
|
|
33
|
-
export async function getPageInfo(config, flowDetail, pageType) {
|
|
34
|
-
const params = {
|
|
35
|
-
instanceId: flowDetail === null || flowDetail === void 0 ? void 0 : flowDetail.instanceId,
|
|
36
|
-
flowCode: flowDetail === null || flowDetail === void 0 ? void 0 : flowDetail.flowCode,
|
|
37
|
-
nodeId: flowDetail === null || flowDetail === void 0 ? void 0 : flowDetail.currentNodeId,
|
|
38
|
-
id: flowDetail === null || flowDetail === void 0 ? void 0 : flowDetail.ccId,
|
|
39
|
-
appVersion: flowDetail === null || flowDetail === void 0 ? void 0 : flowDetail.flowVersion,
|
|
40
|
-
isCompleted: flowDetail === null || flowDetail === void 0 ? void 0 : flowDetail.isCompleted,
|
|
41
|
-
pageType,
|
|
42
|
-
taskId: flowDetail === null || flowDetail === void 0 ? void 0 : flowDetail.taskId,
|
|
43
|
-
};
|
|
44
|
-
const [err, res] = await to(getApprovalPageDetail(params, config));
|
|
45
|
-
if (!err) {
|
|
46
|
-
const initialValues = CommonFlowDataUtils.translateObjectMap(res);
|
|
47
|
-
const objectListValues = CommonFlowDataUtils.translateObjectListMap(res);
|
|
48
|
-
const { isReadonly } = CommonFlowDataUtils.getFormState(config);
|
|
49
|
-
const flowLoadData = {
|
|
50
|
-
initialValues: initialValues || {},
|
|
51
|
-
objectListValues: objectListValues || {},
|
|
52
|
-
formType: isReadonly ? 'read' : 'create',
|
|
53
|
-
};
|
|
54
|
-
return {
|
|
55
|
-
pageInfo: res,
|
|
56
|
-
flowLoadData,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
pageInfo: new IPageInfoProps(),
|
|
61
|
-
flowLoadData: { initialValues: {}, formType: 'read' },
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
export async function fetchFlowSteps(config, flowDetail) {
|
|
65
|
-
var _a;
|
|
66
|
-
const [err, res] = await to(fetchInstanceOperation({ instanceId: flowDetail.instanceId }, config));
|
|
67
|
-
if (!err) {
|
|
68
|
-
const processData = (res === null || res === void 0 ? void 0 : res.elementInfos) || [];
|
|
69
|
-
const steps = CommonFlowDataUtils.transProcessData(processData, config.safeJsonParse);
|
|
70
|
-
const ccUserMaps = ((_a = processData === null || processData === void 0 ? void 0 : processData[0]) === null || _a === void 0 ? void 0 : _a.ccUserMaps) || {};
|
|
71
|
-
return {
|
|
72
|
-
steps,
|
|
73
|
-
ccUserMaps,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
steps: [],
|
|
78
|
-
ccUserMaps: {},
|
|
79
|
-
};
|
|
80
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
-
import EventEmitter from 'eventemitter3'; // eslint-disable-line
|
|
3
|
-
/** 流程通用接口请求hook */
|
|
4
|
-
export function useCommonFlowRequest({ moduleName, request, onListen, }) {
|
|
5
|
-
const flowRequestRef = useRef();
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
flowRequestRef.current = CommonRequestInstance.getFlow();
|
|
8
|
-
flowRequestRef.current.initModule(moduleName);
|
|
9
|
-
flowRequestRef.current.listen(moduleName, onListen);
|
|
10
|
-
flowRequestRef.current.request(requestData, moduleName);
|
|
11
|
-
return () => {
|
|
12
|
-
var _a;
|
|
13
|
-
(_a = flowRequestRef.current) === null || _a === void 0 ? void 0 : _a.destroyModule(moduleName);
|
|
14
|
-
};
|
|
15
|
-
}, []);
|
|
16
|
-
const requestData = async () => {
|
|
17
|
-
var _a;
|
|
18
|
-
const data = await request();
|
|
19
|
-
(_a = flowRequestRef.current) === null || _a === void 0 ? void 0 : _a.requestSuccess(data);
|
|
20
|
-
};
|
|
21
|
-
const reload = () => {
|
|
22
|
-
flowRequestRef.current.reload(requestData, moduleName);
|
|
23
|
-
};
|
|
24
|
-
return { reload };
|
|
25
|
-
}
|
|
26
|
-
const EVENT_NAME = 'flow-send-data';
|
|
27
|
-
/**
|
|
28
|
-
* 流程各个组件的请求控制中心
|
|
29
|
-
* @description
|
|
30
|
-
* - 管理五个流程组件中公用的后端流程数据,只进行一次请求,将请求结果发送到流程中五个组件内部
|
|
31
|
-
*/
|
|
32
|
-
class CommonRequestInstance {
|
|
33
|
-
constructor() {
|
|
34
|
-
/** 请求状态 */
|
|
35
|
-
Object.defineProperty(this, "requestState", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
configurable: true,
|
|
38
|
-
writable: true,
|
|
39
|
-
value: 'init'
|
|
40
|
-
});
|
|
41
|
-
/** 数据接收状态 */
|
|
42
|
-
Object.defineProperty(this, "receivedState", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
configurable: true,
|
|
45
|
-
writable: true,
|
|
46
|
-
value: {}
|
|
47
|
-
});
|
|
48
|
-
/** 模块卸载状态 */
|
|
49
|
-
Object.defineProperty(this, "moduleMountState", {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
configurable: true,
|
|
52
|
-
writable: true,
|
|
53
|
-
value: {}
|
|
54
|
-
});
|
|
55
|
-
/** 消息通知实体 */
|
|
56
|
-
Object.defineProperty(this, "messageHub", {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
configurable: true,
|
|
59
|
-
writable: true,
|
|
60
|
-
value: new EventEmitter()
|
|
61
|
-
});
|
|
62
|
-
/** 公用数据缓存 */
|
|
63
|
-
Object.defineProperty(this, "cacheData", {
|
|
64
|
-
enumerable: true,
|
|
65
|
-
configurable: true,
|
|
66
|
-
writable: true,
|
|
67
|
-
value: void 0
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
static getFlow() {
|
|
71
|
-
if (!CommonRequestInstance.flow) {
|
|
72
|
-
CommonRequestInstance.flow = new CommonRequestInstance();
|
|
73
|
-
}
|
|
74
|
-
return CommonRequestInstance.flow;
|
|
75
|
-
}
|
|
76
|
-
/** 初始化模块信息,为模块卸载状态注册初始化标记 */
|
|
77
|
-
initModule(moduleName) {
|
|
78
|
-
this.moduleMountState[moduleName] = true;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* 模块销毁
|
|
82
|
-
* @description 模块对应的UI组件卸载之后,需要标记到`moduleMountState`中,当所有模块对应组件都被卸载,则将此实例属性重置
|
|
83
|
-
*/
|
|
84
|
-
destroyModule(moduleName) {
|
|
85
|
-
this.moduleMountState[moduleName] = false;
|
|
86
|
-
this.receivedState[moduleName] = false;
|
|
87
|
-
const allUnmount = Object.values(this.moduleMountState).every((state) => !state);
|
|
88
|
-
if (allUnmount) {
|
|
89
|
-
this.requestState = 'init';
|
|
90
|
-
this.moduleMountState = {};
|
|
91
|
-
this.receivedState = {};
|
|
92
|
-
}
|
|
93
|
-
this.messageHub.removeAllListeners();
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* 流程请求控制
|
|
97
|
-
* @description
|
|
98
|
-
* - 当请求状态是loading,执行return 避免重复请求
|
|
99
|
-
* - 当请求状态是loaded,发送已请求的缓存数据
|
|
100
|
-
*/
|
|
101
|
-
request(callback, moduleName) {
|
|
102
|
-
if (this.requestState === 'loaded') {
|
|
103
|
-
if (!this.receivedState[moduleName]) {
|
|
104
|
-
this.send(this.cacheData);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
if (this.requestState === 'loading') {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
this.requestState = 'loading';
|
|
113
|
-
callback === null || callback === void 0 ? void 0 : callback();
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* 重新请求数据
|
|
117
|
-
*/
|
|
118
|
-
reload(callback, moduleName) {
|
|
119
|
-
this.requestState = 'reload';
|
|
120
|
-
this.receivedState = {};
|
|
121
|
-
this.request(callback, moduleName);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* 数据请求成功后的回调
|
|
125
|
-
*/
|
|
126
|
-
requestSuccess(data) {
|
|
127
|
-
this.cacheData = data;
|
|
128
|
-
this.send(data);
|
|
129
|
-
this.requestState = 'loaded';
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* 向各个模块发送数据
|
|
133
|
-
*/
|
|
134
|
-
send(data) {
|
|
135
|
-
this.messageHub.emit(EVENT_NAME, data);
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* 模块接收数据
|
|
139
|
-
*/
|
|
140
|
-
listen(moduleName, callback) {
|
|
141
|
-
this.messageHub.on(EVENT_NAME, (data) => {
|
|
142
|
-
if (!this.receivedState[moduleName]) {
|
|
143
|
-
callback === null || callback === void 0 ? void 0 : callback(data);
|
|
144
|
-
this.receivedState[moduleName] = true;
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
export function useElementMediaQuery(element, maxWidth = 768) {
|
|
3
|
-
const [isNarrowElement, setIsNarrowElement] = useState(false);
|
|
4
|
-
useEffect(() => {
|
|
5
|
-
if (element) {
|
|
6
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
const width = (_b = (_a = entries === null || entries === void 0 ? void 0 : entries[0]) === null || _a === void 0 ? void 0 : _a.contentRect) === null || _b === void 0 ? void 0 : _b.width;
|
|
9
|
-
setIsNarrowElement(width < maxWidth);
|
|
10
|
-
});
|
|
11
|
-
resizeObserver.observe(element);
|
|
12
|
-
}
|
|
13
|
-
}, [element]);
|
|
14
|
-
return isNarrowElement;
|
|
15
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React, { useState, useRef, useMemo } from 'react';
|
|
2
|
-
import { ConfigProvider } from 'tea-component';
|
|
3
|
-
import { useMediaQuery } from '@react-hookz/web';
|
|
4
|
-
import { useGlobalContext } from '../../../utils/hooks/context';
|
|
5
|
-
import { globalContextConnect } from '../../../utils/hooks/globalConnect';
|
|
6
|
-
import { safeJsonParse } from '../../../utils/tool';
|
|
7
|
-
import { PAGE_TYPE } from '../constants';
|
|
8
|
-
import { getCommonFlowData } from './getCommonFlowData';
|
|
9
|
-
import { ICommonFlowDataProps } from './types';
|
|
10
|
-
import { CommonFlowDataUtils, FlowRequest } from './utils';
|
|
11
|
-
import { useCommonFlowRequest, useElementMediaQuery, } from './hooks';
|
|
12
|
-
export * from './types';
|
|
13
|
-
export { CommonFlowDataUtils } from './utils';
|
|
14
|
-
/**
|
|
15
|
-
* 各个模块 通用的高阶函数 返回一个Container组件,包含一些公共属性和逻辑
|
|
16
|
-
*/
|
|
17
|
-
export function createModuleFrame(Component, moduleName) {
|
|
18
|
-
const BaseModuleContainer = (props) => {
|
|
19
|
-
const { events } = props;
|
|
20
|
-
const [loading, setLoading] = useState(false);
|
|
21
|
-
const [commonFlowData, setCommonFlowData] = useState(new ICommonFlowDataProps());
|
|
22
|
-
const containerRef = useRef();
|
|
23
|
-
const isH5 = useMediaQuery('(max-width: 1024px)');
|
|
24
|
-
const isNarrowElement = useElementMediaQuery(containerRef.current, 768);
|
|
25
|
-
const { IS_WEDA_IDE, callWedaApi } = useGlobalContext();
|
|
26
|
-
const { currentPageType, flowTaskId } = useMemo(() => {
|
|
27
|
-
return CommonFlowDataUtils.getCurrentFlowPageQuery(IS_WEDA_IDE);
|
|
28
|
-
}, [location.hash]);
|
|
29
|
-
const { reload } = useCommonFlowRequest({
|
|
30
|
-
moduleName,
|
|
31
|
-
request: async () => {
|
|
32
|
-
var _a;
|
|
33
|
-
setLoading(true);
|
|
34
|
-
const data = await getCommonFlowData({
|
|
35
|
-
...flowLocalProps,
|
|
36
|
-
currentPageType: CommonFlowDataUtils.getCurrentFlowPageQuery(IS_WEDA_IDE)
|
|
37
|
-
.currentPageType,
|
|
38
|
-
}, flowTaskId);
|
|
39
|
-
setLoading(false);
|
|
40
|
-
// 当页面类型为TODO时判断任务状态,如果大于1说明当前任务不是待办状态
|
|
41
|
-
if (currentPageType === PAGE_TYPE.TO_DO &&
|
|
42
|
-
data.flowDetail.taskStatus > 1) {
|
|
43
|
-
// 将url参数中的pageType更新成Done
|
|
44
|
-
CommonFlowDataUtils.updateUrlSearch({ pageType: PAGE_TYPE.DONE });
|
|
45
|
-
// 设置表单状态为只读
|
|
46
|
-
data.flowLoadData.formType = 'read';
|
|
47
|
-
}
|
|
48
|
-
(_a = events === null || events === void 0 ? void 0 : events.flowLoad) === null || _a === void 0 ? void 0 : _a.call(events, data.flowLoadData);
|
|
49
|
-
return data;
|
|
50
|
-
},
|
|
51
|
-
onListen: (data) => {
|
|
52
|
-
setCommonFlowData(data);
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
const setFormType = (type) => {
|
|
56
|
-
var _a;
|
|
57
|
-
(_a = events === null || events === void 0 ? void 0 : events.flowLoad) === null || _a === void 0 ? void 0 : _a.call(events, {
|
|
58
|
-
...commonFlowData.flowLoadData,
|
|
59
|
-
formType: type,
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
const flowLocalProps = {
|
|
63
|
-
isH5,
|
|
64
|
-
isNarrowElement,
|
|
65
|
-
isWedaIde: IS_WEDA_IDE,
|
|
66
|
-
currentPageType,
|
|
67
|
-
callWedaApi,
|
|
68
|
-
safeJsonParse,
|
|
69
|
-
flowRequest: new FlowRequest().request(callWedaApi, IS_WEDA_IDE),
|
|
70
|
-
};
|
|
71
|
-
return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
72
|
-
React.createElement("div", { ...props, ref: containerRef },
|
|
73
|
-
React.createElement(Component, { ide: props, flowLocalProps: flowLocalProps, commonFlowData: commonFlowData, loading: loading, reload: reload, setFormType: setFormType }))));
|
|
74
|
-
};
|
|
75
|
-
return globalContextConnect(BaseModuleContainer);
|
|
76
|
-
}
|
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
/** 流程通用数据属性 来源于接口 */
|
|
2
|
-
export class ICommonFlowDataProps {
|
|
3
|
-
constructor() {
|
|
4
|
-
Object.defineProperty(this, "flowDetail", {
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true,
|
|
8
|
-
value: new IFlowDetailProps()
|
|
9
|
-
});
|
|
10
|
-
Object.defineProperty(this, "pageInfo", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
configurable: true,
|
|
13
|
-
writable: true,
|
|
14
|
-
value: new IPageInfoProps()
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(this, "steps", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true,
|
|
20
|
-
value: void 0
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(this, "ccUserMaps", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
configurable: true,
|
|
25
|
-
writable: true,
|
|
26
|
-
value: void 0
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(this, "flowLoadData", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true,
|
|
32
|
-
value: void 0
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export class IFlowDetailProps {
|
|
37
|
-
constructor() {
|
|
38
|
-
Object.defineProperty(this, "instanceId", {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
configurable: true,
|
|
41
|
-
writable: true,
|
|
42
|
-
value: ''
|
|
43
|
-
});
|
|
44
|
-
Object.defineProperty(this, "name", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true,
|
|
47
|
-
writable: true,
|
|
48
|
-
value: ''
|
|
49
|
-
});
|
|
50
|
-
Object.defineProperty(this, "description", {
|
|
51
|
-
enumerable: true,
|
|
52
|
-
configurable: true,
|
|
53
|
-
writable: true,
|
|
54
|
-
value: ''
|
|
55
|
-
});
|
|
56
|
-
Object.defineProperty(this, "startedBy", {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
configurable: true,
|
|
59
|
-
writable: true,
|
|
60
|
-
value: ''
|
|
61
|
-
});
|
|
62
|
-
Object.defineProperty(this, "startUserId", {
|
|
63
|
-
enumerable: true,
|
|
64
|
-
configurable: true,
|
|
65
|
-
writable: true,
|
|
66
|
-
value: ''
|
|
67
|
-
});
|
|
68
|
-
Object.defineProperty(this, "currentApprover", {
|
|
69
|
-
enumerable: true,
|
|
70
|
-
configurable: true,
|
|
71
|
-
writable: true,
|
|
72
|
-
value: ''
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(this, "startTime", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
configurable: true,
|
|
77
|
-
writable: true,
|
|
78
|
-
value: 0
|
|
79
|
-
});
|
|
80
|
-
Object.defineProperty(this, "isCompleted", {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
configurable: true,
|
|
83
|
-
writable: true,
|
|
84
|
-
value: void 0
|
|
85
|
-
});
|
|
86
|
-
Object.defineProperty(this, "startAppCode", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
configurable: true,
|
|
89
|
-
writable: true,
|
|
90
|
-
value: ''
|
|
91
|
-
});
|
|
92
|
-
Object.defineProperty(this, "startAppName", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
configurable: true,
|
|
95
|
-
writable: true,
|
|
96
|
-
value: ''
|
|
97
|
-
});
|
|
98
|
-
Object.defineProperty(this, "currentNodeId", {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
configurable: true,
|
|
101
|
-
writable: true,
|
|
102
|
-
value: ''
|
|
103
|
-
});
|
|
104
|
-
Object.defineProperty(this, "currentNodeName", {
|
|
105
|
-
enumerable: true,
|
|
106
|
-
configurable: true,
|
|
107
|
-
writable: true,
|
|
108
|
-
value: ''
|
|
109
|
-
});
|
|
110
|
-
Object.defineProperty(this, "currentNodeType", {
|
|
111
|
-
enumerable: true,
|
|
112
|
-
configurable: true,
|
|
113
|
-
writable: true,
|
|
114
|
-
value: 1
|
|
115
|
-
});
|
|
116
|
-
Object.defineProperty(this, "taskId", {
|
|
117
|
-
enumerable: true,
|
|
118
|
-
configurable: true,
|
|
119
|
-
writable: true,
|
|
120
|
-
value: ''
|
|
121
|
-
});
|
|
122
|
-
Object.defineProperty(this, "flowCode", {
|
|
123
|
-
enumerable: true,
|
|
124
|
-
configurable: true,
|
|
125
|
-
writable: true,
|
|
126
|
-
value: ''
|
|
127
|
-
});
|
|
128
|
-
Object.defineProperty(this, "flowVersion", {
|
|
129
|
-
enumerable: true,
|
|
130
|
-
configurable: true,
|
|
131
|
-
writable: true,
|
|
132
|
-
value: ''
|
|
133
|
-
});
|
|
134
|
-
Object.defineProperty(this, "flag", {
|
|
135
|
-
enumerable: true,
|
|
136
|
-
configurable: true,
|
|
137
|
-
writable: true,
|
|
138
|
-
value: 0
|
|
139
|
-
});
|
|
140
|
-
Object.defineProperty(this, "canApprove", {
|
|
141
|
-
enumerable: true,
|
|
142
|
-
configurable: true,
|
|
143
|
-
writable: true,
|
|
144
|
-
value: void 0
|
|
145
|
-
});
|
|
146
|
-
Object.defineProperty(this, "canDelete", {
|
|
147
|
-
enumerable: true,
|
|
148
|
-
configurable: true,
|
|
149
|
-
writable: true,
|
|
150
|
-
value: void 0
|
|
151
|
-
});
|
|
152
|
-
Object.defineProperty(this, "tenantZoneId", {
|
|
153
|
-
enumerable: true,
|
|
154
|
-
configurable: true,
|
|
155
|
-
writable: true,
|
|
156
|
-
value: void 0
|
|
157
|
-
});
|
|
158
|
-
Object.defineProperty(this, "operationName", {
|
|
159
|
-
enumerable: true,
|
|
160
|
-
configurable: true,
|
|
161
|
-
writable: true,
|
|
162
|
-
value: '[]'
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(this, "userTaskType", {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
configurable: true,
|
|
167
|
-
writable: true,
|
|
168
|
-
value: 1
|
|
169
|
-
});
|
|
170
|
-
Object.defineProperty(this, "ccId", {
|
|
171
|
-
enumerable: true,
|
|
172
|
-
configurable: true,
|
|
173
|
-
writable: true,
|
|
174
|
-
value: ''
|
|
175
|
-
});
|
|
176
|
-
Object.defineProperty(this, "endTime", {
|
|
177
|
-
enumerable: true,
|
|
178
|
-
configurable: true,
|
|
179
|
-
writable: true,
|
|
180
|
-
value: 0
|
|
181
|
-
});
|
|
182
|
-
Object.defineProperty(this, "taskStatus", {
|
|
183
|
-
enumerable: true,
|
|
184
|
-
configurable: true,
|
|
185
|
-
writable: true,
|
|
186
|
-
value: void 0
|
|
187
|
-
});
|
|
188
|
-
Object.defineProperty(this, "currentApproverName", {
|
|
189
|
-
enumerable: true,
|
|
190
|
-
configurable: true,
|
|
191
|
-
writable: true,
|
|
192
|
-
value: void 0
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
export class IPageInfoProps {
|
|
197
|
-
constructor() {
|
|
198
|
-
Object.defineProperty(this, "pageUrl", {
|
|
199
|
-
enumerable: true,
|
|
200
|
-
configurable: true,
|
|
201
|
-
writable: true,
|
|
202
|
-
value: ''
|
|
203
|
-
});
|
|
204
|
-
Object.defineProperty(this, "variableInfos", {
|
|
205
|
-
enumerable: true,
|
|
206
|
-
configurable: true,
|
|
207
|
-
writable: true,
|
|
208
|
-
value: void 0
|
|
209
|
-
});
|
|
210
|
-
Object.defineProperty(this, "appCode", {
|
|
211
|
-
enumerable: true,
|
|
212
|
-
configurable: true,
|
|
213
|
-
writable: true,
|
|
214
|
-
value: ''
|
|
215
|
-
});
|
|
216
|
-
Object.defineProperty(this, "show", {
|
|
217
|
-
enumerable: true,
|
|
218
|
-
configurable: true,
|
|
219
|
-
writable: true,
|
|
220
|
-
value: void 0
|
|
221
|
-
});
|
|
222
|
-
Object.defineProperty(this, "showRevoke", {
|
|
223
|
-
enumerable: true,
|
|
224
|
-
configurable: true,
|
|
225
|
-
writable: true,
|
|
226
|
-
value: void 0
|
|
227
|
-
});
|
|
228
|
-
Object.defineProperty(this, "showSubmitApp", {
|
|
229
|
-
enumerable: true,
|
|
230
|
-
configurable: true,
|
|
231
|
-
writable: true,
|
|
232
|
-
value: void 0
|
|
233
|
-
});
|
|
234
|
-
Object.defineProperty(this, "showCarbonCopy", {
|
|
235
|
-
enumerable: true,
|
|
236
|
-
configurable: true,
|
|
237
|
-
writable: true,
|
|
238
|
-
value: void 0
|
|
239
|
-
});
|
|
240
|
-
Object.defineProperty(this, "showTurnToPerson", {
|
|
241
|
-
enumerable: true,
|
|
242
|
-
configurable: true,
|
|
243
|
-
writable: true,
|
|
244
|
-
value: void 0
|
|
245
|
-
});
|
|
246
|
-
Object.defineProperty(this, "showAddAssignee", {
|
|
247
|
-
enumerable: true,
|
|
248
|
-
configurable: true,
|
|
249
|
-
writable: true,
|
|
250
|
-
value: void 0
|
|
251
|
-
});
|
|
252
|
-
Object.defineProperty(this, "showRollBack", {
|
|
253
|
-
enumerable: true,
|
|
254
|
-
configurable: true,
|
|
255
|
-
writable: true,
|
|
256
|
-
value: void 0
|
|
257
|
-
});
|
|
258
|
-
Object.defineProperty(this, "buttons", {
|
|
259
|
-
enumerable: true,
|
|
260
|
-
configurable: true,
|
|
261
|
-
writable: true,
|
|
262
|
-
value: {}
|
|
263
|
-
});
|
|
264
|
-
Object.defineProperty(this, "dataSourceInputParams", {
|
|
265
|
-
enumerable: true,
|
|
266
|
-
configurable: true,
|
|
267
|
-
writable: true,
|
|
268
|
-
value: void 0
|
|
269
|
-
});
|
|
270
|
-
Object.defineProperty(this, "outEntityCodes", {
|
|
271
|
-
enumerable: true,
|
|
272
|
-
configurable: true,
|
|
273
|
-
writable: true,
|
|
274
|
-
value: void 0
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
}
|