ztxkui 4.2.23-338-beta → 4.2.23-339-beta

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.
Files changed (43) hide show
  1. package/dist/components/WorkflowPrintContainer/component/Gragh/Gragh.d.ts +9 -0
  2. package/dist/components/WorkflowPrintContainer/component/Gragh/Gragh.js +63 -0
  3. package/dist/components/WorkflowPrintContainer/component/Header.d.ts +12 -0
  4. package/dist/components/WorkflowPrintContainer/component/Header.js +106 -0
  5. package/dist/components/WorkflowPrintContainer/component/ProcessDetail.d.ts +18 -0
  6. package/dist/components/WorkflowPrintContainer/component/ProcessDetail.js +240 -0
  7. package/dist/components/WorkflowPrintContainer/component/Upload/index.d.ts +20 -0
  8. package/dist/components/WorkflowPrintContainer/component/Upload/index.js +59 -0
  9. package/dist/components/WorkflowPrintContainer/component/association/component/TableList.d.ts +10 -0
  10. package/dist/components/WorkflowPrintContainer/component/association/component/TableList.js +74 -0
  11. package/dist/components/WorkflowPrintContainer/component/association/index.d.ts +9 -0
  12. package/dist/components/WorkflowPrintContainer/component/association/index.js +91 -0
  13. package/dist/components/WorkflowPrintContainer/component/attention/component/TableList.d.ts +9 -0
  14. package/dist/components/WorkflowPrintContainer/component/attention/component/TableList.js +35 -0
  15. package/dist/components/WorkflowPrintContainer/component/attention/index.d.ts +10 -0
  16. package/dist/components/WorkflowPrintContainer/component/attention/index.js +94 -0
  17. package/dist/components/WorkflowPrintContainer/component/audit/component/TableList.d.ts +8 -0
  18. package/dist/components/WorkflowPrintContainer/component/audit/component/TableList.js +52 -0
  19. package/dist/components/WorkflowPrintContainer/component/audit/index.d.ts +7 -0
  20. package/dist/components/WorkflowPrintContainer/component/audit/index.js +87 -0
  21. package/dist/components/WorkflowPrintContainer/component/previewTable/component/TableList.d.ts +9 -0
  22. package/dist/components/WorkflowPrintContainer/component/previewTable/component/TableList.js +52 -0
  23. package/dist/components/WorkflowPrintContainer/component/previewTable/index.d.ts +11 -0
  24. package/dist/components/WorkflowPrintContainer/component/previewTable/index.js +59 -0
  25. package/dist/components/WorkflowPrintContainer/component/send/component/TableList.d.ts +9 -0
  26. package/dist/components/WorkflowPrintContainer/component/send/component/TableList.js +43 -0
  27. package/dist/components/WorkflowPrintContainer/component/send/index.d.ts +9 -0
  28. package/dist/components/WorkflowPrintContainer/component/send/index.js +91 -0
  29. package/dist/components/WorkflowPrintContainer/component/trail/component/TableList.d.ts +12 -0
  30. package/dist/components/WorkflowPrintContainer/component/trail/component/TableList.js +281 -0
  31. package/dist/components/WorkflowPrintContainer/component/trail/index.d.ts +11 -0
  32. package/dist/components/WorkflowPrintContainer/component/trail/index.js +56 -0
  33. package/dist/components/WorkflowPrintContainer/images.d.ts +2 -0
  34. package/dist/components/WorkflowPrintContainer/images.js +2 -0
  35. package/dist/components/WorkflowPrintContainer/index.d.ts +2 -0
  36. package/dist/components/WorkflowPrintContainer/index.js +2 -0
  37. package/dist/components/WorkflowPrintContainer/service.d.ts +14 -0
  38. package/dist/components/WorkflowPrintContainer/service.js +101 -0
  39. package/dist/components/WorkflowPrintContainer/usePagination.d.ts +14 -0
  40. package/dist/components/WorkflowPrintContainer/usePagination.js +22 -0
  41. package/dist/components/WorkflowPrintContainer/workflow-print-container.d.ts +100 -0
  42. package/dist/components/WorkflowPrintContainer/workflow-print-container.js +301 -0
  43. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ request: any;
4
+ processInstId: string;
5
+ refresh?: number;
6
+ onClickNode?: (node: any) => void;
7
+ }
8
+ declare const _default: React.NamedExoticComponent<IProps>;
9
+ export default _default;
@@ -0,0 +1,63 @@
1
+ import { graph } from '../../service';
2
+ import React, { memo, useEffect, useCallback } from 'react';
3
+ var Gragh = function (_a) {
4
+ var request = _a.request, processInstId = _a.processInstId, refresh = _a.refresh, onClickNode = _a.onClickNode;
5
+ function clear() {
6
+ // 获取 div 标签
7
+ var processgraph = window.document.getElementById('processgraph');
8
+ // 需要删除dom下的所有子元素,否则流程图会累加
9
+ // 获取 div 标签下的所有子节点
10
+ var pObjs = processgraph.childNodes;
11
+ for (var i = pObjs.length - 1; i >= 0; i--) {
12
+ // 一定要倒序,正序是删不干净的,可自行尝试
13
+ processgraph.removeChild(pObjs[i]);
14
+ }
15
+ }
16
+ var initGraph = function (data) {
17
+ var minY = 0;
18
+ var minX = 0;
19
+ var states = data === null || data === void 0 ? void 0 : data.states;
20
+ for (var key in states) {
21
+ minY = states[key].y < minY ? states[key].y : minY;
22
+ minX = states[key].x < minX ? states[key].x : minX;
23
+ }
24
+ for (var key in states) {
25
+ states[key].y = states[key].y - minY;
26
+ states[key].x = states[key].x - minX + 300;
27
+ }
28
+ };
29
+ var getProcessGraph = useCallback(function (request, params) {
30
+ graph(request, params)
31
+ .then(function (res) {
32
+ if (res.data.data) {
33
+ clear();
34
+ initGraph(res.data.data);
35
+ var win = window;
36
+ var nui = win.nui;
37
+ nui.parse();
38
+ var processImg_1 = nui.get('processgraph');
39
+ processImg_1.setCallback(function () {
40
+ processImg_1.load(res.data.data);
41
+ });
42
+ processImg_1.setClickCallback(function (id, name) {
43
+ onClickNode && onClickNode({ id: id, name: name });
44
+ });
45
+ processImg_1.load(res.data.data);
46
+ }
47
+ })
48
+ .catch(function (err) { });
49
+ }, [onClickNode]);
50
+ useEffect(function () {
51
+ clear();
52
+ if (processInstId) {
53
+ getProcessGraph(request, { procInstId: processInstId });
54
+ }
55
+ }, [processInstId, refresh, getProcessGraph, request]);
56
+ return (React.createElement("div", { style: {
57
+ width: '100%',
58
+ border: '2px solid #f0f0f0',
59
+ height: '600px',
60
+ } },
61
+ React.createElement("div", { id: "processgraph", className: "nui-bps-processgraph" })));
62
+ };
63
+ export default memo(Gragh);
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ data: any;
4
+ showStatus?: boolean;
5
+ showProcessStatus?: boolean;
6
+ showPrintDate?: boolean;
7
+ titleStyle?: any;
8
+ offsetHeight?: number;
9
+ priority?: any;
10
+ }
11
+ declare const _default: React.NamedExoticComponent<IProps>;
12
+ export default _default;
@@ -0,0 +1,106 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import React, { memo } from 'react';
13
+ import { DONE, TO_DO, TO_TAKE, REJECT_TO_EDIT, DRAWBACK_TO_EDIT, REJECTED, CANCELED, TERMINATED, NOT_STARTED, PROCESS_DISCARD, SUSPENDED, PROCESS_DONE, PROCESS_DRAWBACK, PROCESS_REJECTED, IN_APPROVAL, } from '../workflow-print-container';
14
+ import dayjs from 'dayjs';
15
+ import ZtIcon from '../../ZtIcon';
16
+ import { Divider } from 'antd';
17
+ import { lbpmDiscardStatus, lbpmProcessStatus } from '../images';
18
+ var Header = function (_a) {
19
+ var data = _a.data, _b = _a.showStatus, showStatus = _b === void 0 ? false : _b, _c = _a.showProcessStatus, showProcessStatus = _c === void 0 ? false : _c, showPrintDate = _a.showPrintDate, titleStyle = _a.titleStyle, _d = _a.offsetHeight, offsetHeight = _d === void 0 ? 0 : _d, priority = _a.priority;
20
+ //审批状态
21
+ var getDealType = function (taskStatus) {
22
+ if (DONE === taskStatus) {
23
+ return ['status-pass', '本环节已审批通过'];
24
+ }
25
+ else if (TO_DO === taskStatus || TO_TAKE === taskStatus) {
26
+ return ['status-ing', '审批中'];
27
+ }
28
+ else if (REJECT_TO_EDIT === taskStatus) {
29
+ return ['status-reject', '已驳回至起草,待修改表单'];
30
+ }
31
+ else if (DRAWBACK_TO_EDIT === taskStatus) {
32
+ return ['status-reject', '已撤回至起草,待修改表单'];
33
+ }
34
+ else if (REJECTED === taskStatus) {
35
+ return ['status-reject', '已驳回至上一环节'];
36
+ }
37
+ else if (CANCELED === taskStatus) {
38
+ return ['status-terminated', '已取消'];
39
+ }
40
+ else if (TERMINATED === taskStatus) {
41
+ return ['status-terminated', '已废弃'];
42
+ }
43
+ return ['status-terminated', '未知'];
44
+ };
45
+ // 流程状态
46
+ var getProcessType = function (processStatus) {
47
+ if (NOT_STARTED === processStatus) {
48
+ return ['status-terminated', '未启动'];
49
+ }
50
+ else if (IN_APPROVAL === processStatus) {
51
+ return ['status-ing', '审批中'];
52
+ }
53
+ else if (PROCESS_REJECTED === processStatus) {
54
+ return ['status-reject', '已驳回'];
55
+ }
56
+ else if (PROCESS_DRAWBACK === processStatus) {
57
+ return ['status-reject', '已撤回'];
58
+ }
59
+ else if (SUSPENDED === processStatus) {
60
+ return ['status-terminated', '已挂起'];
61
+ }
62
+ else if (PROCESS_DONE === processStatus) {
63
+ return ['status-pass', '已办结'];
64
+ }
65
+ else if (PROCESS_DISCARD === processStatus) {
66
+ return ['status-terminated', '已废弃'];
67
+ }
68
+ return ['status-terminated', '未知'];
69
+ };
70
+ var getPriorityStatus = function (priority) {
71
+ if ('60' === String(priority)) {
72
+ return ['priority-common', '一般'];
73
+ }
74
+ else if ('80' === String(priority)) {
75
+ return ['priority-impatient', '急'];
76
+ }
77
+ else if ('100' === String(priority)) {
78
+ return ['priority-emergent', '紧急'];
79
+ }
80
+ return ['priority-common', '一般'];
81
+ };
82
+ return (React.createElement(React.Fragment, null,
83
+ React.createElement("div", { id: "wf-wrapper", className: "wf-wrapper", style: titleStyle
84
+ ? __assign({}, titleStyle) : { position: 'relative' } },
85
+ React.createElement("div", { className: "wf-task-header-container" },
86
+ React.createElement("div", { className: "wf-task-header" },
87
+ React.createElement(ZtIcon, { type: "iconwenjian1", style: { fontSize: '24px', marginRight: '10px' } }),
88
+ React.createElement("div", { className: "title" }, ((data === null || data === void 0 ? void 0 : data.taskName) ? data === null || data === void 0 ? void 0 : data.taskName : '') + "\u8BE6\u60C5"),
89
+ showStatus ? (React.createElement("div", { className: getDealType(data.status)[0] }, getDealType(data.status)[1])) : null,
90
+ showProcessStatus ? (React.createElement("div", { className: getProcessType(data.processInstState)[0] }, getProcessType(data.processInstState)[1])) : null,
91
+ priority ? (React.createElement("div", { className: getPriorityStatus(priority)[0] }, getPriorityStatus(priority)[1])) : null),
92
+ React.createElement("div", null, (data === null || data === void 0 ? void 0 : data.processTypeName) ? data === null || data === void 0 ? void 0 : data.processTypeName : '')),
93
+ React.createElement("div", { className: "wf-task-process-status" },
94
+ React.createElement("div", { className: "lbpm-process-status", style: { backgroundImage: "url(" + lbpmProcessStatus + ")" } }),
95
+ 7 === (data === null || data === void 0 ? void 0 : data.processInstState) ? (React.createElement("div", { className: "lbpm-flow-info" },
96
+ React.createElement("div", { className: "lbpm-process-status", style: { backgroundImage: "url(" + lbpmProcessStatus + ")" } }))) : 8 === (data === null || data === void 0 ? void 0 : data.processInstState) ? (React.createElement("div", { className: "lbpm-flow-info" },
97
+ React.createElement("div", { className: "lbpm-discard-status", style: { backgroundImage: "url(" + lbpmDiscardStatus + ")" } }))) : null),
98
+ showPrintDate ? (React.createElement("div", { className: "print-date", style: { top: offsetHeight - 16 } },
99
+ "\u6253\u5370\u65E5\u671F:",
100
+ dayjs().format('YYYY-MM-DD'))) : null),
101
+ React.createElement(Divider, { style: {
102
+ margin: '0 0 0 0',
103
+ marginTop: offsetHeight,
104
+ } })));
105
+ };
106
+ export default memo(Header);
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ request: any;
4
+ OuterComponent: React.ComponentType<any>;
5
+ type?: string;
6
+ data: any;
7
+ approve?: string;
8
+ toEdit?: boolean;
9
+ refresh?: number;
10
+ refreshGragh?: number;
11
+ showBizForm: boolean;
12
+ getAttachIds?: (attachIds: any) => void;
13
+ showCfg?: any;
14
+ editOpinionAuth?: boolean;
15
+ iframeRefresh?: any;
16
+ }
17
+ declare const _default: React.NamedExoticComponent<IProps>;
18
+ export default _default;
@@ -0,0 +1,240 @@
1
+ import React, { memo, useState, useEffect, useCallback, Suspense } from 'react';
2
+ import { Tabs } from 'antd';
3
+ import AssociationList from './association';
4
+ import TrailList from './trail';
5
+ import SendAroundList from './send';
6
+ import { fetchAttachList, fetchPreviewData } from '../service';
7
+ import Collapse from '../../Collapse';
8
+ import ZtUpload from './Upload';
9
+ import Gragh from './Gragh/Gragh';
10
+ import PreviewList from './previewTable';
11
+ import AttentionList from './attention';
12
+ import AuditList from './audit';
13
+ var Panel = Collapse.Panel;
14
+ var TabPane = Tabs.TabPane;
15
+ var ProcessDetail = function (_a) {
16
+ var request = _a.request, OuterComponent = _a.OuterComponent, type = _a.type, data = _a.data, approve = _a.approve, toEdit = _a.toEdit, showBizForm = _a.showBizForm, refresh = _a.refresh, refreshGragh = _a.refreshGragh, getAttachIds = _a.getAttachIds, _b = _a.showCfg, showCfg = _b === void 0 ? {} : _b, _c = _a.editOpinionAuth, editOpinionAuth = _c === void 0 ? false : _c, _d = _a.iframeRefresh, iframeRefresh = _d === void 0 ? 1 : _d;
17
+ var detailShown = showCfg.detailShown, approvalRecordsShown = showCfg.approvalRecordsShown, relatedProcessesShown = showCfg.relatedProcessesShown, attachShown = showCfg.attachShown, circulationRecordsShown = showCfg.circulationRecordsShown;
18
+ var _e = useState([]), attachData = _e[0], setAttachData = _e[1];
19
+ // UPDATE:获取当前路由对应得按钮权限
20
+ // 第二个参数:btnAuthCode,为在菜单管理配置对应按钮的code
21
+ // const {
22
+ // btnAuth,
23
+ // authResult: [
24
+ // attachAddBtnAuth,
25
+ // attachDelBtnAuth,
26
+ // attachDownloadBtnAuth,
27
+ // associationAddBtnAuth,
28
+ // attentionAddBtnAuth,
29
+ // ],
30
+ // } = useBtnAuth('/workflow/taskList', btnAuthCode);
31
+ var originFileList = [];
32
+ var _f = useState(originFileList), fileList = _f[0], setFileList = _f[1];
33
+ var _g = useState(0), sendTotal = _g[0], setSendTotal = _g[1];
34
+ var _h = useState(1), attentionType = _h[0], setAttentionType = _h[1];
35
+ var _j = useState(1), attentionRefresh = _j[0], setAttentionRefresh = _j[1];
36
+ var _k = useState(1), associationRefresh = _k[0], setAssociationRefresh = _k[1];
37
+ var _l = useState(false), attentionLoading = _l[0], setAttentionLoading = _l[1];
38
+ var _m = useState(false), isAttentionModalVisible = _m[0], setIsAttentionModalVisible = _m[1];
39
+ var _o = useState(320), iframeHeight = _o[0], setIframeHeight = _o[1];
40
+ var _p = useState(''), queryId = _p[0], setQueryId = _p[1];
41
+ var _q = useState(''), queryCode = _q[0], setQueryCode = _q[1];
42
+ var _r = useState(0), refreshContacts = _r[0], setRefreshContacts = _r[1];
43
+ var _s = useState(false), isAssocitionModalVisible = _s[0], setIsAssocitionModalVisible = _s[1];
44
+ var onCloseAssocitionModalHandle = useCallback(function () { return setIsAssocitionModalVisible(false); }, []);
45
+ var onRefreshAssocitionModalHandle = useCallback(function () { return setAssociationRefresh(associationRefresh + 1); }, [associationRefresh]);
46
+ var callRefreshContacts = function () {
47
+ setRefreshContacts(function (value) { return value + 1; });
48
+ };
49
+ useEffect(function () {
50
+ if (Array.isArray(attachData)) {
51
+ var attachList_1 = [];
52
+ attachData.forEach(function (element) {
53
+ var item = Object.assign({
54
+ percent: 100,
55
+ size: element.attachSize,
56
+ response: {
57
+ code: 200,
58
+ success: true,
59
+ data: Object.assign({
60
+ attachId: element.id,
61
+ size: element.attachSize,
62
+ }, element),
63
+ msg: '操作成功',
64
+ },
65
+ }, element);
66
+ item.status = 'done';
67
+ item.name = element.originalName;
68
+ attachList_1.push(item);
69
+ });
70
+ setFileList(attachList_1);
71
+ }
72
+ }, [attachData]);
73
+ useEffect(function () {
74
+ var uids = [];
75
+ if (fileList && fileList.length > 0) {
76
+ fileList.forEach(function (item) {
77
+ var _a, _b;
78
+ uids.push((_b = (_a = item === null || item === void 0 ? void 0 : item.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.attachId);
79
+ });
80
+ }
81
+ getAttachIds && getAttachIds(uids);
82
+ }, [fileList, getAttachIds]);
83
+ function handleCancelAttention() {
84
+ setIsAttentionModalVisible(false);
85
+ }
86
+ /**附件数据获取 */
87
+ useEffect(function () {
88
+ if (data === null || data === void 0 ? void 0 : data.processInstId) {
89
+ fetchAttachList(request, {
90
+ processInstId: data === null || data === void 0 ? void 0 : data.processInstId,
91
+ taskId: type === 'notice' ? '' : data === null || data === void 0 ? void 0 : data.id,
92
+ }).then(function (res) {
93
+ var _a;
94
+ setAttachData((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data);
95
+ });
96
+ }
97
+ }, [data === null || data === void 0 ? void 0 : data.processInstId, type, data === null || data === void 0 ? void 0 : data.id, request]);
98
+ /**
99
+ * 预览附件回调
100
+ */
101
+ var onPreviewCallback = useCallback(function (file) {
102
+ fetchPreviewData({
103
+ params: { id: file.fileId },
104
+ });
105
+ return true;
106
+ }, []);
107
+ function showAttentionModal() {
108
+ setRefreshContacts(function (value) { return value + 1; });
109
+ setQueryId(data === null || data === void 0 ? void 0 : data.processInstId);
110
+ setQueryCode('ATTENTION');
111
+ setIsAttentionModalVisible(true);
112
+ }
113
+ var _t = useState([]), targetKeys = _t[0], setTargetKeys = _t[1];
114
+ var _u = useState([]), empKeys = _u[0], setEmpKeys = _u[1];
115
+ var onTargetKeys = useCallback(function (empKeys, selectPerson) {
116
+ setEmpKeys(empKeys);
117
+ setTargetKeys(selectPerson);
118
+ }, [setEmpKeys, setTargetKeys]);
119
+ function swapColumns(parentName, columnIndexA, columnIndexB, header) {
120
+ var _a;
121
+ if (header === void 0) { header = false; }
122
+ var parent = document === null || document === void 0 ? void 0 : document.querySelector("." + parentName);
123
+ var table = parent === null || parent === void 0 ? void 0 : parent.querySelector('table');
124
+ if (table instanceof HTMLTableElement) {
125
+ if (header) {
126
+ for (var i = 0; i < 1; i++) {
127
+ var row = table === null || table === void 0 ? void 0 : table.rows[i];
128
+ if (row.cells.length > columnIndexA &&
129
+ row.cells.length > columnIndexB) {
130
+ var temp = row.cells[columnIndexA];
131
+ row.insertBefore(row.cells[columnIndexB], row.cells[columnIndexA]);
132
+ row.insertBefore(temp, row.cells[columnIndexB + 1]);
133
+ }
134
+ }
135
+ }
136
+ else {
137
+ for (var i = 1; i < ((_a = table === null || table === void 0 ? void 0 : table.rows) === null || _a === void 0 ? void 0 : _a.length); i++) {
138
+ var row = table === null || table === void 0 ? void 0 : table.rows[i];
139
+ if (row.cells.length > columnIndexA &&
140
+ row.cells.length > columnIndexB) {
141
+ var temp = row.cells[columnIndexA];
142
+ row.insertBefore(row.cells[columnIndexB], row.cells[columnIndexA]);
143
+ row.insertBefore(temp, row.cells[columnIndexB + 1]);
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+ // 不修改附件组件的情况下更改其文件名的默认宽度
150
+ useEffect(function () {
151
+ // 获取第一个class为'flow-attachment'的元素
152
+ var flowAttachment = document.querySelector('.flow-attachment');
153
+ // swapColumns('flow-attachment', 1, 3, true);
154
+ // swapColumns('flow-attachment', 1, 2, true);
155
+ // 在该元素下查找第一个colgroup
156
+ var colgroup = flowAttachment === null || flowAttachment === void 0 ? void 0 : flowAttachment.querySelector('colgroup');
157
+ // 在colgroup内查找所有的col元素
158
+ var cols = colgroup === null || colgroup === void 0 ? void 0 : colgroup.querySelectorAll('col');
159
+ // 设置col元素的宽度为50%
160
+ if (cols && cols.length >= 3) {
161
+ cols[0].style.width = '50%';
162
+ cols[1].style.width = '10%';
163
+ cols[2].style.width = '15%';
164
+ }
165
+ }, []);
166
+ // // 附件加载完之后继续交换数据列
167
+ // useEffect(() => {
168
+ // if (!fileList || fileList.length === 0) {
169
+ // return;
170
+ // }
171
+ // setTimeout(() => {
172
+ // swapColumns('flow-attachment', 1, 3);
173
+ // swapColumns('flow-attachment', 1, 2);
174
+ // }, 500);
175
+ // }, [fileList]);
176
+ // 不修改关联流程的情况下更改其关联流程ID和关联流程名称的默认宽度
177
+ // useEffect(() => {
178
+ // // 获取第一个class为'flow-association'的元素
179
+ // const flowAssociation = document.querySelector('.flow-association');
180
+ // // 在该元素下查找第一个colgroup
181
+ // const colgroup = flowAssociation?.querySelector('colgroup');
182
+ // // 在colgroup内查找所有的col元素
183
+ // const cols = colgroup?.querySelectorAll('col');
184
+ // // 检查是否有至少三个col元素,并设置第三个col的宽度为50%
185
+ // if (cols && cols.length >= 3) {
186
+ // cols[0].style.width = `50%`;
187
+ // cols[1].style.width = '10%';
188
+ // cols[2].style.width = '10%';
189
+ // }
190
+ // }, []);
191
+ return (React.createElement(React.Fragment, null,
192
+ showBizForm && detailShown ? (React.createElement("div", null,
193
+ React.createElement(Suspense, { fallback: React.createElement("div", null, "Loading...") },
194
+ React.createElement(OuterComponent, null)))) : null,
195
+ (approvalRecordsShown ||
196
+ relatedProcessesShown ||
197
+ attachShown ||
198
+ circulationRecordsShown) && (React.createElement(Tabs, { defaultActiveKey: "1", type: "card", className: "workflow-info" },
199
+ React.createElement(TabPane, { tab: "\u57FA\u672C\u4FE1\u606F", key: "1" },
200
+ React.createElement(Collapse, { showHeaderBefore: true, showBackground: true, defaultActiveKey: ['1', '2', '3', '4', '5'] },
201
+ approvalRecordsShown && (React.createElement(Panel, { header: (data === null || data === void 0 ? void 0 : data.nextTip)
202
+ ? '审批记录 — 当前正在审批:' + (data === null || data === void 0 ? void 0 : data.nextTip)
203
+ : '审批记录', key: "2" },
204
+ React.createElement("div", { style: { paddingTop: '10px', paddingBottom: '10px' } },
205
+ React.createElement(TrailList, { request: request, appCode: data === null || data === void 0 ? void 0 : data.appCode, processInstId: data === null || data === void 0 ? void 0 : data.processInstId, taskId: data.id, refresh: refresh, editOpinionAuth: editOpinionAuth })))),
206
+ attachShown && (React.createElement(Panel, { header: "\u6D41\u7A0B\u9644\u4EF6", key: "3" },
207
+ React.createElement("div", { className: "flow-attachment", style: { paddingTop: '10px', paddingBottom: '10px' } },
208
+ React.createElement(ZtUpload, { request: request, processInstId: data === null || data === void 0 ? void 0 : data.processInstId, showUploadBtn: false, showDownloadBtn: true, taskId: data === null || data === void 0 ? void 0 : data.id, showPreviewBtn: false, showDeleteBtn: false, isAutoDelete: false, fileList: fileList,
209
+ // apiBaseUrl=""
210
+ // onDownLoadCallbackAfter={onDownloadCallback}
211
+ // onPreviewCallbackBefore={onPreviewCallback}
212
+ showAllDownloadBtn: true })))),
213
+ relatedProcessesShown && (React.createElement(Panel, { header: "\u5173\u8054\u6D41\u7A0B", key: "4" },
214
+ React.createElement("div", { className: "flow-association", style: { paddingTop: '10px', paddingBottom: '10px' } },
215
+ React.createElement(AssociationList, { request: request, processInstId: data === null || data === void 0 ? void 0 : data.processInstId, refresh: associationRefresh, disable: approve !== 'approve' || (data === null || data === void 0 ? void 0 : data.status) !== 0 })))),
216
+ circulationRecordsShown && (React.createElement(Panel, { header: "\u4F20\u9605\u8BB0\u5F55(" + sendTotal + ")", key: "5" },
217
+ React.createElement(SendAroundList, { request: request, processInstId: data === null || data === void 0 ? void 0 : data.processInstId, disable: approve !== 'approve' || (data === null || data === void 0 ? void 0 : data.status) !== 0, setSendTotal: setSendTotal }))))),
218
+ React.createElement(TabPane, { tab: "\u5176\u4ED6\u4FE1\u606F", key: "2" },
219
+ React.createElement(Collapse, { showHeaderBefore: true, showBackground: true, defaultActiveKey: ['1', '2'] },
220
+ React.createElement(Panel, { header: "\u6D41\u7A0B\u56FE", key: "1" },
221
+ React.createElement(Tabs, { defaultActiveKey: "1", type: "card", style: { paddingTop: '10px', paddingBottom: '10px' } },
222
+ React.createElement(TabPane, { tab: "\u6D41\u7A0B\u56FE", key: "1" },
223
+ React.createElement("div", { style: { paddingTop: '10px', paddingBottom: '10px' } },
224
+ React.createElement(Gragh, { request: request, processInstId: data === null || data === void 0 ? void 0 : data.processInstId, refresh: refreshGragh }))),
225
+ (data === null || data === void 0 ? void 0 : data.status) === 0 ||
226
+ (data === null || data === void 0 ? void 0 : data.status) === 2 ||
227
+ (data === null || data === void 0 ? void 0 : data.status) === 7 ||
228
+ (data === null || data === void 0 ? void 0 : data.status) === 7 ? (React.createElement(TabPane, { tab: "\u5269\u4F59\u5BA1\u6279\u73AF\u8282", key: "2" },
229
+ React.createElement("div", { style: { paddingTop: '10px', paddingBottom: '10px' } },
230
+ React.createElement(PreviewList, { request: request, processInstId: data === null || data === void 0 ? void 0 : data.processInstId, taskId: data === null || data === void 0 ? void 0 : data.id, refresh: attentionRefresh, callRefreshContacts: callRefreshContacts, disable: approve !== 'approve' || (data === null || data === void 0 ? void 0 : data.status) !== 0 })))) : (React.createElement(TabPane, { tab: "\u5168\u90E8\u5BA1\u6279\u73AF\u8282\u9884\u6F14", key: "2" },
231
+ React.createElement("div", { style: { paddingTop: '10px', paddingBottom: '10px' } },
232
+ React.createElement(PreviewList, { request: request, processInstId: data === null || data === void 0 ? void 0 : data.processInstId, taskId: data === null || data === void 0 ? void 0 : data.id, refresh: attentionRefresh, callRefreshContacts: callRefreshContacts, disable: approve !== 'approve' || (data === null || data === void 0 ? void 0 : data.status) !== 0 })))))),
233
+ React.createElement(Panel, { header: "\u81EA\u52A8\u6284\u9001", key: "3" },
234
+ React.createElement("div", { style: { paddingTop: '10px', paddingBottom: '10px' } },
235
+ React.createElement(AttentionList, { request: request, processInstId: data === null || data === void 0 ? void 0 : data.processInstId, refresh: attentionRefresh, callRefreshContacts: callRefreshContacts, disable: approve !== 'approve' || (data === null || data === void 0 ? void 0 : data.status) !== 0 }))),
236
+ React.createElement(Panel, { header: "\u6D41\u7A0B\u64CD\u4F5C", key: "4" },
237
+ React.createElement("div", { style: { paddingTop: '10px', paddingBottom: '10px' } },
238
+ React.createElement(AuditList, { request: request, processInstId: data === null || data === void 0 ? void 0 : data.processInstId })))))))));
239
+ };
240
+ export default memo(ProcessDetail);
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { UploadProps } from 'antd/lib/upload';
3
+ interface IProps extends UploadProps {
4
+ request?: any;
5
+ showTable?: boolean;
6
+ showUploadBtn?: boolean;
7
+ processInstId: string;
8
+ taskId: string;
9
+ showDownloadBtn?: boolean;
10
+ showAllDownloadBtn?: boolean;
11
+ showPreviewBtn?: boolean;
12
+ showDeleteBtn?: boolean;
13
+ fileList?: any[];
14
+ isAutoDelete?: boolean;
15
+ /**回调 */
16
+ callback?: (fileList: any) => void;
17
+ onDeleteCallback?: (index: number, file: any) => void;
18
+ }
19
+ declare const ZtUpload: React.FC<IProps>;
20
+ export default ZtUpload;
@@ -0,0 +1,59 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React, { useMemo, useEffect, useState } from 'react';
24
+ import { getToken } from 'ztxkutils/dist/authority';
25
+ import Upload from '../../../Upload';
26
+ import { fetchAttachList } from '../../service';
27
+ var ZtUpload = function (_a) {
28
+ var request = _a.request, _b = _a.showTable, showTable = _b === void 0 ? true : _b, showUploadBtn = _a.showUploadBtn, showDownloadBtn = _a.showDownloadBtn, showAllDownloadBtn = _a.showAllDownloadBtn, showPreviewBtn = _a.showPreviewBtn, taskId = _a.taskId, showDeleteBtn = _a.showDeleteBtn, processInstId = _a.processInstId, isAutoDelete = _a.isAutoDelete, fileList = _a.fileList, callback = _a.callback, onDeleteCallback = _a.onDeleteCallback, restProps = __rest(_a, ["request", "showTable", "showUploadBtn", "showDownloadBtn", "showAllDownloadBtn", "showPreviewBtn", "taskId", "showDeleteBtn", "processInstId", "isAutoDelete", "fileList", "callback", "onDeleteCallback"]);
29
+ var _c = useState({}), listRecord = _c[0], setListRecord = _c[1];
30
+ var records = listRecord.records, current = listRecord.current, size = listRecord.size, total = listRecord.total, extra = listRecord.extra;
31
+ /**
32
+ * @description 默认要带上用户公司、部门、最近时间
33
+ * UPDATE:这个是列表表单默认的查询条件
34
+ * 设置个性化查询参数,第二个参数为表单的name字段
35
+ */
36
+ var currentParams = useMemo(function () { return ({
37
+ processInstId: processInstId,
38
+ taskId: taskId,
39
+ }); }, [processInstId, taskId]);
40
+ /**
41
+ * @description 发起列表请求
42
+ * 当表单数据发生改变时,页码发生改变时
43
+ */
44
+ useEffect(function () {
45
+ if (currentParams.processInstId) {
46
+ fetchAttachList(request, __assign({ size: size,
47
+ current: current }, currentParams)).then(function (res) {
48
+ var _a;
49
+ setListRecord((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data);
50
+ });
51
+ }
52
+ }, [currentParams, size, current, request]);
53
+ return (React.createElement(Upload, __assign({ method: "post", headers: {
54
+ 'Zmdms-Auth': getToken() || '',
55
+ }, data: {
56
+ system: process.env.REACT_APP_SYSTEM_CODE,
57
+ }, showTable: showTable, showUploadBtn: showUploadBtn, showDownloadBtn: showDownloadBtn, showAllDownloadBtn: showAllDownloadBtn, showPreviewBtn: showPreviewBtn, showDeleteBtn: showDeleteBtn, isAutoDelete: isAutoDelete, callback: callback, onDeleteCallback: onDeleteCallback, originFileList: fileList }, restProps, { apiBaseUrl: '', fileBaseUrl: '' })));
58
+ };
59
+ export default ZtUpload;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ records: any[];
4
+ extra?: any;
5
+ onReload: () => void;
6
+ disable: boolean;
7
+ params?: any;
8
+ }
9
+ declare const _default: React.NamedExoticComponent<IProps>;
10
+ export default _default;
@@ -0,0 +1,74 @@
1
+ import Table from '../../../../Table';
2
+ import React, { memo } from 'react';
3
+ import { Button } from 'antd';
4
+ var TableList = function (_a) {
5
+ /**
6
+ * @description 模态框需要的外部参数
7
+ * UPDATE:针对拥有弹框的模块
8
+ */
9
+ // const modalParams = useMemo(
10
+ // () => ({
11
+ // companyId: params.companyId,
12
+ // depId: params.depId,
13
+ // memberId: params.memberId,
14
+ // status: 50,
15
+ // }),
16
+ // [params.companyId, params.depId, params.memberId]
17
+ // );
18
+ var records = _a.records, onReload = _a.onReload, extra = _a.extra, disable = _a.disable, params = _a.params;
19
+ // UPDATE:表格配置项
20
+ // 与以往不同的是,由于需要满足个性化配置功能,所以每个配置都需要提供一个key值,来做比对选中
21
+ var columns = [
22
+ {
23
+ title: '序号',
24
+ width: 62,
25
+ align: 'center',
26
+ render: function (text, record, index) { return "" + (index + 1); },
27
+ },
28
+ {
29
+ title: '流程名称',
30
+ dataIndex: 'associatedProcessInstName',
31
+ key: 'associatedProcessInstName',
32
+ render: function (text, record, index) { return (React.createElement(Button, { type: "link" }, text)); },
33
+ },
34
+ {
35
+ title: '流程ID',
36
+ width: 80,
37
+ align: 'center',
38
+ dataIndex: 'associatedProcessInstId',
39
+ key: 'associatedProcessInstId',
40
+ },
41
+ // {
42
+ // title: '流程模板',
43
+ // width: 300,
44
+ // dataIndex: 'associatedProcessDefName',
45
+ // key: 'associatedProcessDefName',
46
+ // },
47
+ {
48
+ title: '流程申请人',
49
+ width: 120,
50
+ align: 'center',
51
+ dataIndex: 'associatedProcessApplyPersonName',
52
+ key: 'associatedProcessApplyPersonName',
53
+ },
54
+ {
55
+ title: '流程申请时间',
56
+ width: 140,
57
+ align: 'center',
58
+ dataIndex: 'associatedProcessApplyTime',
59
+ key: 'associatedProcessApplyTime',
60
+ },
61
+ ];
62
+ // // UPDATE:需要跳转的页面,在对应文件配置
63
+ // function goDetailHandle(id) {
64
+ // const patchPage = createPage.getProcessDetail(id);
65
+ // history.push(patchPage.path, '_blank');
66
+ // }
67
+ return (React.createElement("div", null,
68
+ React.createElement(Table, { columns: columns,
69
+ // showColumnDynamicKey="flow-ssociation"
70
+ dataSource: records, rowKey: "id",
71
+ // showColumnDynamic
72
+ initColumns: columns })));
73
+ };
74
+ export default memo(TableList);
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ request?: any;
4
+ processInstId: string;
5
+ refresh: number;
6
+ disable: boolean;
7
+ }
8
+ declare const _default: React.NamedExoticComponent<IProps>;
9
+ export default _default;