ztxkui 4.2.23-605 → 4.2.23-607
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/UI/Detail/index.js +4 -1
- package/dist/UI/Table/EditTable.js +1 -3
- package/dist/components/Table/table-menu.js +1 -1
- package/dist/components/electron-signatures/content.js +1 -1
- package/dist/components/electron-signatures/demoComponents/making.js +3 -1
- package/dist/components/electron-signatures/demoComponents/makingData.d.ts +8 -1
- package/dist/components/electron-signatures/demoComponents/makingData.js +11 -3
- package/dist/components/electron-signatures/dgComponents/useContractColumns.js +40 -2
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.js +33 -5
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.js +155 -25
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +13 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.js +11 -2
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.js +9 -0
- package/dist/components/electron-signatures/index.d.ts +4 -0
- package/dist/components/electron-signatures/index.js +17 -4
- package/dist/components/electron-signatures/interface.d.ts +10 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.d.ts +4 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.js +29 -9
- package/dist/components/electron-signatures/qunjComponents/qunj-list.js +186 -3
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +142 -89
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.js +25 -10
- package/dist/components/utils/ZtxkContext.d.ts +16 -0
- package/dist/components/utils/ZtxkContext.js +4 -0
- package/dist/components/utils/useBaseContext.d.ts +4 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.css +351 -3
- package/dist/index.css.map +1 -1
- package/dist/main.js +8 -0
- package/package.json +1 -1
|
@@ -43,12 +43,20 @@ import { getToken } from 'ztxkutils/dist/authority';
|
|
|
43
43
|
import { ElectronSignaturesContext } from '..';
|
|
44
44
|
import { comparePermission } from '../hooks/useGetQjVerifyCode';
|
|
45
45
|
import dayjs from 'dayjs';
|
|
46
|
+
/** 获取公司名称(fallback companyType) */
|
|
47
|
+
function getCompanyName(item) {
|
|
48
|
+
return (item === null || item === void 0 ? void 0 : item.companyTypeName) || (item === null || item === void 0 ? void 0 : item.companyType) || '';
|
|
49
|
+
}
|
|
50
|
+
/** 获取印章简称(fallback sealName) */
|
|
51
|
+
function getSealShortName(item) {
|
|
52
|
+
return (item === null || item === void 0 ? void 0 : item.sealShortName) || (item === null || item === void 0 ? void 0 : item.sealName) || '';
|
|
53
|
+
}
|
|
46
54
|
/**
|
|
47
55
|
* 群杰详情列表
|
|
48
56
|
*/
|
|
49
57
|
var QunjDetail = function (_a) {
|
|
50
58
|
var _b;
|
|
51
|
-
var qunjList = _a.qunjList, qunjSeal = _a.qunjSeal, isContranctNum = _a.isContranctNum, isQunjAddress = _a.isQunjAddress, currentQunjAddress = _a.currentQunjAddress, refreshCode = _a.refreshCode, request = _a.request, isEdit = _a.isEdit, apiBaseUrl = _a.apiBaseUrl, caseId = _a.caseId, wfProcessInstId = _a.wfProcessInstId, verifyUserIds = _a.verifyUserIds, qjVerifyCodeData = _a.qjVerifyCodeData, getQjVerifyCodeHandle = _a.getQjVerifyCodeHandle, flowStatus = _a.flowStatus;
|
|
59
|
+
var qunjList = _a.qunjList, qunjSeal = _a.qunjSeal, isContranctNum = _a.isContranctNum, isQunjAddress = _a.isQunjAddress, currentQunjAddress = _a.currentQunjAddress, refreshCode = _a.refreshCode, request = _a.request, isEdit = _a.isEdit, apiBaseUrl = _a.apiBaseUrl, caseId = _a.caseId, wfProcessInstId = _a.wfProcessInstId, verifyUserIds = _a.verifyUserIds, qjVerifyCodeData = _a.qjVerifyCodeData, getQjVerifyCodeHandle = _a.getQjVerifyCodeHandle, flowStatus = _a.flowStatus, isShowSealApply = _a.isShowSealApply, goWorkflowSeal = _a.goWorkflowSeal;
|
|
52
60
|
// 新版本的群杰验证码是通过接口获取的
|
|
53
61
|
var _c = useState(), vertifyCode = _c[0], setVerifyCode = _c[1];
|
|
54
62
|
var _d = useState(false), isError = _d[0], setIsError = _d[1]; // 接口调用是否报错
|
|
@@ -59,7 +67,7 @@ var QunjDetail = function (_a) {
|
|
|
59
67
|
var code = useMemo(function () {
|
|
60
68
|
return padWithZeroes((qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.code) || (qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.vertifyCode), 6);
|
|
61
69
|
}, [qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.code, qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.vertifyCode]);
|
|
62
|
-
var
|
|
70
|
+
var _g = useContext(ElectronSignaturesContext), isNewQys = _g.isNewQys, isNewQunjSealStyle = _g.isNewQunjSealStyle;
|
|
63
71
|
/**
|
|
64
72
|
* 更新当前组件状态
|
|
65
73
|
*/
|
|
@@ -192,17 +200,27 @@ var QunjDetail = function (_a) {
|
|
|
192
200
|
if (refreshCode) {
|
|
193
201
|
(_a = codeModalRef.current) === null || _a === void 0 ? void 0 : _a.open({ formNo: wfProcessInstId });
|
|
194
202
|
}
|
|
195
|
-
} }, i18next.t('刷新验证码')))
|
|
203
|
+
} }, i18next.t('刷新验证码'))),
|
|
204
|
+
isShowSealApply && goWorkflowSeal && wfProcessInstId ? (React.createElement(Button, { style: { marginLeft: 'auto' }, type: "link", onClick: function () { return goWorkflowSeal(wfProcessInstId); } }, i18next.t('用印增加申请'))) : null),
|
|
196
205
|
(qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.code) || (qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.vertifyCode) ? (React.createElement("div", null,
|
|
197
206
|
React.createElement(Button, { type: "link", onClick: function () {
|
|
198
207
|
querySealStatus();
|
|
199
208
|
} }, i18next.t('查询用印状态')))) : null)),
|
|
200
209
|
React.createElement("div", { className: "qunj-detail--info" },
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
210
|
+
React.createElement("div", { style: {
|
|
211
|
+
display: 'flex',
|
|
212
|
+
alignItems: 'center',
|
|
213
|
+
justifyContent: 'space-between',
|
|
214
|
+
} },
|
|
215
|
+
isContranctNum && (React.createElement("div", null,
|
|
216
|
+
i18next.t('盖章文件数量:'),
|
|
217
|
+
React.createElement("span", null, qunjSeal === null || qunjSeal === void 0 ? void 0 :
|
|
218
|
+
qunjSeal.contranctNum,
|
|
219
|
+
i18next.t('份')))),
|
|
220
|
+
isNewQunjSealStyle && wfProcessInstId ? (React.createElement("div", null,
|
|
221
|
+
"\u6D41\u7A0Bid:",
|
|
222
|
+
' ',
|
|
223
|
+
React.createElement("span", { style: { fontSize: '15px' } }, wfProcessInstId))) : null),
|
|
206
224
|
React.createElement("div", { className: "qunj-detail--address" },
|
|
207
225
|
React.createElement("div", { className: "qunj-detail--type" },
|
|
208
226
|
i18next.t('用印类型:'),
|
|
@@ -218,7 +236,9 @@ var QunjDetail = function (_a) {
|
|
|
218
236
|
var _a;
|
|
219
237
|
var item = (_a = qunjList === null || qunjList === void 0 ? void 0 : qunjList.find) === null || _a === void 0 ? void 0 : _a.call(qunjList, function (qunj) { return (qunj === null || qunj === void 0 ? void 0 : qunj.sealNo) === (detail === null || detail === void 0 ? void 0 : detail.sealNo); });
|
|
220
238
|
return (React.createElement("div", { className: "qunj-detail--item", key: detail === null || detail === void 0 ? void 0 : detail.sealNo },
|
|
221
|
-
React.createElement("div", null,
|
|
239
|
+
React.createElement("div", null, isNewQunjSealStyle
|
|
240
|
+
? getCompanyName(item || detail) + " " + getSealShortName(item || detail)
|
|
241
|
+
: item === null || item === void 0 ? void 0 : item.sealName),
|
|
222
242
|
React.createElement("div", null,
|
|
223
243
|
i18next.t('用印'),
|
|
224
244
|
React.createElement("span", null, detail === null || detail === void 0 ? void 0 : detail.sealCount),
|
|
@@ -10,16 +10,99 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import i18next from 'ztxkutils/dist/i18next';
|
|
13
|
-
import React, { memo, useRef, useMemo } from 'react';
|
|
13
|
+
import React, { memo, useRef, useMemo, useState, useContext, useEffect, } from 'react';
|
|
14
14
|
import { Checkbox, Collapse, InputNumber, Radio, EnhanceSelect, } from '../../../index.build';
|
|
15
|
+
import { ElectronSignaturesContext } from '..';
|
|
16
|
+
import useBaseContext from '../../utils/useBaseContext';
|
|
15
17
|
var defaultQunjAddressList = [
|
|
16
18
|
{ id: '1', name: i18next.t('杭州') },
|
|
17
19
|
{ id: '2', name: i18next.t('长沙') },
|
|
18
20
|
];
|
|
21
|
+
/** 获取公司名称(fallback companyType) */
|
|
22
|
+
function getCompanyName(item) {
|
|
23
|
+
return (item === null || item === void 0 ? void 0 : item.companyTypeName) || (item === null || item === void 0 ? void 0 : item.companyType) || '';
|
|
24
|
+
}
|
|
25
|
+
/** 获取印章简称(fallback sealName) */
|
|
26
|
+
function getSealShortName(item) {
|
|
27
|
+
return (item === null || item === void 0 ? void 0 : item.sealShortName) || (item === null || item === void 0 ? void 0 : item.sealName) || '';
|
|
28
|
+
}
|
|
19
29
|
var QunjList = function (props) {
|
|
20
30
|
var qunjList = props.qunjList, qunjSeal = props.qunjSeal, onChange = props.onChange, isContranctNum = props.isContranctNum, qunjChecked = props.qunjChecked, setQunjChecked = props.setQunjChecked, _a = props.qunjAddressList, qunjAddressList = _a === void 0 ? defaultQunjAddressList : _a, currentQunjAddress = props.currentQunjAddress, onQunjAddressChange = props.onQunjAddressChange, isQunjAddress = props.isQunjAddress, _b = props.isShowChecked, isShowChecked = _b === void 0 ? true : _b, qunjListRenderFilter = props.qunjListRenderFilter;
|
|
31
|
+
var isNewQunjSealStyle = useContext(ElectronSignaturesContext).isNewQunjSealStyle;
|
|
32
|
+
var _c = useBaseContext().qunjSealTabTrigger, qunjSealTabTrigger = _c === void 0 ? 'hover' : _c;
|
|
21
33
|
var contranctNumRef = useRef(null);
|
|
22
|
-
var
|
|
34
|
+
var _d = qunjSeal || {}, contranctNum = _d.contranctNum, isTakeOut = _d.isTakeOut, details = _d.details;
|
|
35
|
+
// ========= 新版:按公司名称分组 =========
|
|
36
|
+
var _e = useMemo(function () {
|
|
37
|
+
if (!Array.isArray(qunjList)) {
|
|
38
|
+
return {
|
|
39
|
+
companyList: [],
|
|
40
|
+
companyMap: {},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
var map = {};
|
|
44
|
+
qunjList.forEach(function (item) {
|
|
45
|
+
var name = getCompanyName(item);
|
|
46
|
+
if (!map[name])
|
|
47
|
+
map[name] = [];
|
|
48
|
+
map[name].push(item);
|
|
49
|
+
});
|
|
50
|
+
return { companyList: Object.keys(map), companyMap: map };
|
|
51
|
+
}, [qunjList]), companyList = _e.companyList, companyMap = _e.companyMap;
|
|
52
|
+
// 新版:当前选中公司
|
|
53
|
+
var _f = useState(companyList[0]), selectedCompany = _f[0], setSelectedCompany = _f[1];
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
if (companyList.length > 0 && !companyList.includes(selectedCompany)) {
|
|
56
|
+
setSelectedCompany(companyList[0]);
|
|
57
|
+
}
|
|
58
|
+
}, [companyList, selectedCompany]);
|
|
59
|
+
// 悬浮延迟切换:停留 300ms 才切换,快速划过(如跨行移动)不触发
|
|
60
|
+
var hoverTimerRef = useRef(null);
|
|
61
|
+
useEffect(function () {
|
|
62
|
+
return function () { return clearTimeout(hoverTimerRef.current); };
|
|
63
|
+
}, []);
|
|
64
|
+
var handleCompanyHover = function (company) {
|
|
65
|
+
if (selectedCompany === company)
|
|
66
|
+
return;
|
|
67
|
+
clearTimeout(hoverTimerRef.current);
|
|
68
|
+
hoverTimerRef.current = setTimeout(function () {
|
|
69
|
+
setSelectedCompany(company);
|
|
70
|
+
}, 300);
|
|
71
|
+
};
|
|
72
|
+
var clearHoverTimer = function () {
|
|
73
|
+
clearTimeout(hoverTimerRef.current);
|
|
74
|
+
};
|
|
75
|
+
// 新版:当前公司印章列表(含盖章地点过滤)
|
|
76
|
+
var currentCompanySeals = useMemo(function () {
|
|
77
|
+
var list = companyMap[selectedCompany] || [];
|
|
78
|
+
list = list.filter(function (item) {
|
|
79
|
+
return isFilterAreaType(currentQunjAddress === null || currentQunjAddress === void 0 ? void 0 : currentQunjAddress.id, item.areaType);
|
|
80
|
+
});
|
|
81
|
+
if (qunjListRenderFilter) {
|
|
82
|
+
list = qunjListRenderFilter(list);
|
|
83
|
+
}
|
|
84
|
+
return list;
|
|
85
|
+
}, [companyMap, selectedCompany, currentQunjAddress, qunjListRenderFilter]);
|
|
86
|
+
// 新版:每个公司选中的印章数量
|
|
87
|
+
var companySelectedCount = useMemo(function () {
|
|
88
|
+
var countMap = {};
|
|
89
|
+
var sealNoToCompany = {};
|
|
90
|
+
Object.keys(companyMap).forEach(function (company) {
|
|
91
|
+
companyMap[company].forEach(function (item) {
|
|
92
|
+
sealNoToCompany[item.sealNo] = company;
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
(details || []).forEach(function (detail) {
|
|
96
|
+
var company = sealNoToCompany[detail.sealNo];
|
|
97
|
+
if (company) {
|
|
98
|
+
countMap[company] = (countMap[company] || 0) + 1;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return countMap;
|
|
102
|
+
}, [companyMap, details]);
|
|
103
|
+
// 新版:已选印章完整列表
|
|
104
|
+
var selectedDetails = details || [];
|
|
105
|
+
// 旧版:按 useType 分组
|
|
23
106
|
var qunjListTypeMemo = useMemo(function () {
|
|
24
107
|
var _a;
|
|
25
108
|
var newData = [];
|
|
@@ -39,6 +122,106 @@ var QunjList = function (props) {
|
|
|
39
122
|
});
|
|
40
123
|
return newData;
|
|
41
124
|
}, [qunjList]);
|
|
125
|
+
// ========= 新版渲染 =========
|
|
126
|
+
if (isNewQunjSealStyle) {
|
|
127
|
+
// 没有印章数据时不显示内容
|
|
128
|
+
if (companyList.length === 0) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
return (React.createElement("div", { className: "qunj-list-new--wrap" },
|
|
132
|
+
React.createElement("div", { className: "qunj-list-new--title" },
|
|
133
|
+
React.createElement("div", { className: "qunj-list-new--left" },
|
|
134
|
+
React.createElement(Radio.Group, { value: isTakeOut, onChange: function (e) {
|
|
135
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({ isTakeOut: e.target.value });
|
|
136
|
+
} },
|
|
137
|
+
React.createElement(Radio, { value: 0 }, i18next.t('内部用印')),
|
|
138
|
+
React.createElement(Radio, { value: 1 }, i18next.t('外部用印'))),
|
|
139
|
+
isQunjAddress && isTakeOut + '' === '1' ? (React.createElement(EnhanceSelect, { style: { width: 70 }, list: qunjAddressList, size: "small", value: currentQunjAddress === null || currentQunjAddress === void 0 ? void 0 : currentQunjAddress.id, onChange: function (value, option, completeData) {
|
|
140
|
+
var _a, _b;
|
|
141
|
+
// 切换盖章地点时,清理非当前地点的已选印章
|
|
142
|
+
var copyDetails = ((_b = (_a = details === null || details === void 0 ? void 0 : details.slice()) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, function (d) { return (__assign({}, d)); })) || [];
|
|
143
|
+
var newDetails = copyDetails.filter(function (qunjItem) {
|
|
144
|
+
return isFilterAreaType(completeData === null || completeData === void 0 ? void 0 : completeData.id, qunjItem.areaType);
|
|
145
|
+
});
|
|
146
|
+
var qunjSealUpdate = {};
|
|
147
|
+
if (copyDetails.length !== newDetails.length) {
|
|
148
|
+
qunjSealUpdate.details = newDetails;
|
|
149
|
+
}
|
|
150
|
+
onQunjAddressChange(completeData, {
|
|
151
|
+
qunjSeal: qunjSealUpdate,
|
|
152
|
+
});
|
|
153
|
+
} })) : null),
|
|
154
|
+
React.createElement("div", { className: "qunj-list-new--right" }, isContranctNum ? (React.createElement("div", { className: "qunj-list-new--contract" },
|
|
155
|
+
React.createElement("span", null, i18next.t('文件份数')),
|
|
156
|
+
React.createElement(InputNumber, { size: "small", value: contranctNum === null ? undefined : contranctNum, onChange: function (e) {
|
|
157
|
+
contranctNumRef.current = e;
|
|
158
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({ contranctNum: contranctNumRef.current });
|
|
159
|
+
}, min: 1 }))) : null)),
|
|
160
|
+
React.createElement("div", { className: "seal-owner-tabs" }, companyList.map(function (company) {
|
|
161
|
+
var count = companySelectedCount[company] || 0;
|
|
162
|
+
return (React.createElement("div", __assign({ key: company, className: "seal-owner-tab " + (selectedCompany === company ? 'seal-owner-tab--active' : ''), title: company }, (qunjSealTabTrigger === 'hover'
|
|
163
|
+
? {
|
|
164
|
+
onMouseEnter: function () { return handleCompanyHover(company); },
|
|
165
|
+
onMouseLeave: clearHoverTimer,
|
|
166
|
+
}
|
|
167
|
+
: { onClick: function () { return setSelectedCompany(company); } })),
|
|
168
|
+
React.createElement("span", { className: "seal-owner-tab--name" }, company),
|
|
169
|
+
count > 0 && (React.createElement("span", { className: "seal-owner-tab--count" }, count))));
|
|
170
|
+
})),
|
|
171
|
+
React.createElement("div", { className: "qunj-seal-list-current" }, currentCompanySeals.map(function (qunjItem) {
|
|
172
|
+
var _a, _b;
|
|
173
|
+
var sealNo = qunjItem.sealNo;
|
|
174
|
+
var copyDetails = ((_b = (_a = details === null || details === void 0 ? void 0 : details.slice()) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, function (d) { return (__assign({}, d)); })) || [];
|
|
175
|
+
var findItem = copyDetails.find(function (d) { return d.sealNo === sealNo; });
|
|
176
|
+
return (React.createElement("div", { className: "qunj-list-new--item", key: sealNo },
|
|
177
|
+
React.createElement(Checkbox, { checked: !!findItem, onChange: function (e) {
|
|
178
|
+
var isChecked = e.target.checked;
|
|
179
|
+
if (isChecked) {
|
|
180
|
+
copyDetails.push(__assign({}, qunjItem));
|
|
181
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
182
|
+
details: copyDetails,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
var index = copyDetails.findIndex(function (d) { return d.sealNo === sealNo; });
|
|
187
|
+
copyDetails.splice(index, 1);
|
|
188
|
+
var data = { details: copyDetails };
|
|
189
|
+
if (copyDetails.length === 0) {
|
|
190
|
+
data.contranctNum = undefined;
|
|
191
|
+
}
|
|
192
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(data);
|
|
193
|
+
}
|
|
194
|
+
} },
|
|
195
|
+
React.createElement("span", { title: qunjItem.sealName }, getSealShortName(qunjItem))),
|
|
196
|
+
React.createElement("div", { className: "qunj-list-new--seal-count" },
|
|
197
|
+
i18next.t('次数'),
|
|
198
|
+
React.createElement(InputNumber, { size: "small", value: findItem === null || findItem === void 0 ? void 0 : findItem.sealCount, min: 1, onChange: function (e) {
|
|
199
|
+
var index = copyDetails.findIndex(function (d) { return d.sealNo === sealNo; });
|
|
200
|
+
if (index === -1) {
|
|
201
|
+
copyDetails.push(__assign(__assign({}, qunjItem), { sealCount: e }));
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
copyDetails[index].sealCount = e;
|
|
205
|
+
}
|
|
206
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
207
|
+
details: copyDetails,
|
|
208
|
+
contranctNum: contranctNum ? contranctNum : 1,
|
|
209
|
+
});
|
|
210
|
+
} }))));
|
|
211
|
+
})),
|
|
212
|
+
React.createElement("div", { className: "seal-selected-summary" },
|
|
213
|
+
React.createElement("div", { className: "seal-selected-title" }, i18next.t('已选印章')),
|
|
214
|
+
selectedDetails.length > 0 ? (selectedDetails.map(function (detail) { return (React.createElement("div", { key: detail.sealNo, className: "seal-selected-item seal-selected-item--qunj", title: detail.sealName },
|
|
215
|
+
React.createElement("span", { className: "seal-selected-name" },
|
|
216
|
+
getCompanyName(detail),
|
|
217
|
+
" ",
|
|
218
|
+
getSealShortName(detail)),
|
|
219
|
+
React.createElement("span", { className: "seal-selected-use-count" },
|
|
220
|
+
i18next.t('用印'),
|
|
221
|
+
detail.sealCount,
|
|
222
|
+
i18next.t('次')))); })) : (React.createElement("div", { className: "seal-selected-empty" }, i18next.t('暂未选择印章'))))));
|
|
223
|
+
}
|
|
224
|
+
// ========= 旧版渲染(按 useType 分组 + 用印申请勾选) =========
|
|
42
225
|
return (React.createElement("div", { className: "qunj-list--wrap" },
|
|
43
226
|
React.createElement("div", { className: "qunj-list--need" },
|
|
44
227
|
isShowChecked ? (React.createElement(Checkbox, { checked: qunjChecked, onChange: function (e) {
|
|
@@ -83,7 +266,7 @@ var QunjList = function (props) {
|
|
|
83
266
|
return (React.createElement(Collapse.Panel, { key: "" + item.useType, header: item.useTypeName }, currentQunjList === null || currentQunjList === void 0 ? void 0 : currentQunjList.map(function (qunjItem) {
|
|
84
267
|
var _a, _b;
|
|
85
268
|
var sealNo = qunjItem.sealNo, sealName = qunjItem.sealName;
|
|
86
|
-
// redux
|
|
269
|
+
// redux数据所有属性都被冻结了,需要"深拷贝"。这里只有一层
|
|
87
270
|
var copyDetails = ((_b = (_a = details === null || details === void 0 ? void 0 : details.slice()) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, function (detail) { return (__assign({}, detail)); })) || [];
|
|
88
271
|
var findItem = copyDetails === null || copyDetails === void 0 ? void 0 : copyDetails.find(function (detailItem) { return detailItem.sealNo === sealNo; });
|
|
89
272
|
return (React.createElement("div", { className: "qunj-list--item", key: sealNo },
|
|
@@ -35,10 +35,12 @@ function WorkflowIdButton(props) {
|
|
|
35
35
|
// 群杰印章的clomuns
|
|
36
36
|
export default function useQunjColumns(options) {
|
|
37
37
|
var records = options.records, dataTypeSort = options.dataTypeSort, allData = options.allData, contractNumFlowIds = options.contractNumFlowIds, refreshCode = options.refreshCode, request = options.request, isSingleQj = options.isSingleQj, isQjUseModal = options.isQjUseModal, apiBaseUrl = options.apiBaseUrl, caseId = options.caseId, qjVerifyCodeData = options.qjVerifyCodeData, getQjVerifyCodeHandle = options.getQjVerifyCodeHandle, isShowSealApply = options.isShowSealApply, goWorkflowSeal = options.goWorkflowSeal, qunjListRenderFilter = options.qunjListRenderFilter;
|
|
38
|
-
var
|
|
39
|
-
var useSealTitle =
|
|
40
|
-
? i18next.t('
|
|
41
|
-
:
|
|
38
|
+
var _a = useContext(ElectronSignaturesContext), isNewQys = _a.isNewQys, isNewQunjSealStyle = _a.isNewQunjSealStyle;
|
|
39
|
+
var useSealTitle = isNewQunjSealStyle
|
|
40
|
+
? i18next.t('选择群杰印章')
|
|
41
|
+
: isNewQys
|
|
42
|
+
? i18next.t('已选群杰印章')
|
|
43
|
+
: i18next.t('申请用章情况');
|
|
42
44
|
var qjColumn = isSingleQj
|
|
43
45
|
? [
|
|
44
46
|
{
|
|
@@ -131,98 +133,149 @@ export default function useQunjColumns(options) {
|
|
|
131
133
|
},
|
|
132
134
|
]
|
|
133
135
|
: isQjUseModal
|
|
134
|
-
? //
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
var qunjSeal = {};
|
|
171
|
-
if (copyDetails.length !== newDetails.length) {
|
|
172
|
-
qunjSeal.details = newDetails;
|
|
173
|
-
}
|
|
174
|
-
onQunjAddressChange &&
|
|
175
|
-
onQunjAddressChange(data, { qunjSeal: qunjSeal });
|
|
176
|
-
}, onQunjSealSingleChange: function (data) {
|
|
177
|
-
onQunjSealChange && onQunjSealChange(data);
|
|
178
|
-
}, qunjListRenderFilter: qunjListRenderFilter }),
|
|
179
|
-
wfProcessInstId ? (React.createElement(WorkflowIdButton, { wfProcessInstId: wfProcessInstId, isShowSealApply: isShowSealApply, isEdit: isEdit, goWorkflowSeal: goWorkflowSeal }, wfProcessInstId)) : (''))),
|
|
180
|
-
props: props,
|
|
181
|
-
};
|
|
136
|
+
? // 新版模式:合并为单列"选择群杰印章";旧版模式:两列(盖群杰印章 + 已选群杰印章)
|
|
137
|
+
isNewQunjSealStyle
|
|
138
|
+
? [
|
|
139
|
+
{
|
|
140
|
+
title: i18next.t('选择群杰印章'),
|
|
141
|
+
dataIndex: 'qunjDetail',
|
|
142
|
+
key: 'qunjDetail',
|
|
143
|
+
width: 326,
|
|
144
|
+
align: 'center',
|
|
145
|
+
// 固定列宽(scroll.x=max-content 时 width 会被内容撑开)
|
|
146
|
+
onHeaderCell: function () { return ({
|
|
147
|
+
style: { width: 326, minWidth: 326, maxWidth: 326 },
|
|
148
|
+
}); },
|
|
149
|
+
onCell: function () { return ({
|
|
150
|
+
// 内容从顶部往下排,避免切换公司时因印章数量不同导致内容垂直居中抖动
|
|
151
|
+
style: {
|
|
152
|
+
width: 326,
|
|
153
|
+
minWidth: 326,
|
|
154
|
+
maxWidth: 326,
|
|
155
|
+
verticalAlign: 'top',
|
|
156
|
+
},
|
|
157
|
+
}); },
|
|
158
|
+
render: function (text, record, index) {
|
|
159
|
+
var _a;
|
|
160
|
+
var _b = getColumnMergeProp({
|
|
161
|
+
record: record,
|
|
162
|
+
index: index,
|
|
163
|
+
records: records,
|
|
164
|
+
dataTypeSort: dataTypeSort,
|
|
165
|
+
}), props = _b.props, currentDataType = _b.currentDataType;
|
|
166
|
+
var _c = allData[currentDataType] || {}, isEdit = _c.isEdit, qunjList = _c.qunjList, isContranctNum = _c.isContranctNum, isQunjAddress = _c.isQunjAddress, currentQunjSeal = _c.currentQunjSeal, onQunjSealChange = _c.onQunjSealChange, qunjChecked = _c.qunjChecked, setQunjChecked = _c.setQunjChecked, qunjAddressList = _c.qunjAddressList, currentQunjAddress = _c.currentQunjAddress, onQunjAddressChange = _c.onQunjAddressChange, needQj = _c.needQj, wfProcessInstId = _c.wfProcessInstId, verifyUserIds = _c.verifyUserIds, flowStatus = _c.flowStatus;
|
|
167
|
+
return {
|
|
168
|
+
children: !needQj ? (React.createElement(NoUseQj, null)) : isEdit ? (React.createElement(QunjList, { qunjList: qunjList, qunjSeal: currentQunjSeal, onChange: onQunjSealChange, isContranctNum: isContranctNum, isQunjAddress: isQunjAddress, qunjAddressList: qunjAddressList, currentQunjAddress: currentQunjAddress, onQunjAddressChange: onQunjAddressChange, qunjChecked: qunjChecked, setQunjChecked: setQunjChecked, qunjListRenderFilter: qunjListRenderFilter })) : ((_a = currentQunjSeal === null || currentQunjSeal === void 0 ? void 0 : currentQunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) !== 0 ? (React.createElement(QunjDetail, { qunjList: qunjList, qunjSeal: currentQunjSeal, isContranctNum: isContranctNum, isQunjAddress: isQunjAddress, currentQunjAddress: currentQunjAddress, isEdit: isEdit, refreshCode: refreshCode, request: request, apiBaseUrl: apiBaseUrl, caseId: caseId, wfProcessInstId: wfProcessInstId, verifyUserIds: verifyUserIds, qjVerifyCodeData: qjVerifyCodeData, getQjVerifyCodeHandle: getQjVerifyCodeHandle, flowStatus: flowStatus, isShowSealApply: isShowSealApply, goWorkflowSeal: goWorkflowSeal })) : (React.createElement(NoUseQj, null)),
|
|
169
|
+
props: props,
|
|
170
|
+
};
|
|
171
|
+
},
|
|
182
172
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
173
|
+
]
|
|
174
|
+
: // 旧版模式:两列(盖群杰印章 + 已选群杰印章)
|
|
175
|
+
[
|
|
176
|
+
{
|
|
177
|
+
title: i18next.t('盖群杰印章'),
|
|
178
|
+
dataIndex: 'isStampQunj',
|
|
179
|
+
key: 'isStampQunj',
|
|
180
|
+
width: 100,
|
|
181
|
+
align: 'center',
|
|
182
|
+
render: function (text, record, index) {
|
|
183
|
+
var _a;
|
|
184
|
+
// 需要合并
|
|
185
|
+
var _b = getColumnMergeProp({
|
|
186
|
+
record: record,
|
|
187
|
+
index: index,
|
|
188
|
+
records: records,
|
|
189
|
+
dataTypeSort: dataTypeSort,
|
|
190
|
+
}), props = _b.props, currentDataType = _b.currentDataType;
|
|
191
|
+
var _c = allData[currentDataType] || {}, isEdit = _c.isEdit, qunjList = _c.qunjList, currentQunjSeal = _c.currentQunjSeal, onQunjSealChange = _c.onQunjSealChange, needQj = _c.needQj, isContranctNum = _c.isContranctNum, qunjChecked = _c.qunjChecked, setQunjChecked = _c.setQunjChecked, currentQunjAddress = _c.currentQunjAddress, onQunjAddressChange = _c.onQunjAddressChange, isQunjAddress = _c.isQunjAddress, wfProcessInstId = _c.wfProcessInstId;
|
|
192
|
+
// 是否显示群杰印章信息 如果非编辑状态下,使用数据中的字段来判断是否选择了群杰印章
|
|
193
|
+
var isShowQunjDetail = !isEdit
|
|
194
|
+
? (currentQunjSeal === null || currentQunjSeal === void 0 ? void 0 : currentQunjSeal.details) &&
|
|
195
|
+
((_a = currentQunjSeal === null || currentQunjSeal === void 0 ? void 0 : currentQunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) !== 0
|
|
196
|
+
: qunjChecked;
|
|
197
|
+
return {
|
|
198
|
+
children: !needQj ? (React.createElement(React.Fragment, null,
|
|
199
|
+
React.createElement(NoUseQj, null),
|
|
200
|
+
wfProcessInstId ? (React.createElement(WorkflowIdButton, { wfProcessInstId: wfProcessInstId, isShowSealApply: isShowSealApply, isEdit: isEdit, goWorkflowSeal: goWorkflowSeal }, wfProcessInstId)) : (''))) : (React.createElement(React.Fragment, null,
|
|
201
|
+
React.createElement(QunjCheck, { disabled: !isEdit, checked: isShowQunjDetail, onChange: function (checked) {
|
|
202
|
+
setQunjChecked && setQunjChecked(checked);
|
|
203
|
+
}, qunjList: qunjList, currentQunjSeal: currentQunjSeal, currentQunjAddress: currentQunjAddress, isContranctNum: isContranctNum, isQunjAddress: isQunjAddress, onQunjAddressSingleChange: function (data) {
|
|
204
|
+
var _a, _b, _c;
|
|
205
|
+
// 如果切换了盖章地点,需要将非当前地点的数据删除
|
|
206
|
+
var copyDetails = ((_c = (_b = (_a = currentQunjSeal === null || currentQunjSeal === void 0 ? void 0 : currentQunjSeal.details) === null || _a === void 0 ? void 0 : _a.slice()) === null || _b === void 0 ? void 0 : _b.map) === null || _c === void 0 ? void 0 : _c.call(_b, function (detail) { return (__assign({}, detail)); })) || [];
|
|
207
|
+
var newDetails = copyDetails.filter(function (qunjItem) {
|
|
208
|
+
return isFilterAreaType(data === null || data === void 0 ? void 0 : data.id, qunjItem.areaType);
|
|
209
|
+
});
|
|
210
|
+
var qunjSeal = {};
|
|
211
|
+
if (copyDetails.length !== newDetails.length) {
|
|
212
|
+
qunjSeal.details = newDetails;
|
|
213
|
+
}
|
|
214
|
+
onQunjAddressChange &&
|
|
215
|
+
onQunjAddressChange(data, { qunjSeal: qunjSeal });
|
|
216
|
+
}, onQunjSealSingleChange: function (data) {
|
|
217
|
+
onQunjSealChange && onQunjSealChange(data);
|
|
218
|
+
}, qunjListRenderFilter: qunjListRenderFilter }),
|
|
219
|
+
wfProcessInstId ? (React.createElement(WorkflowIdButton, { wfProcessInstId: wfProcessInstId, isShowSealApply: isShowSealApply, isEdit: isEdit, goWorkflowSeal: goWorkflowSeal }, wfProcessInstId)) : (''))),
|
|
220
|
+
props: props,
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
title: useSealTitle,
|
|
226
|
+
dataIndex: 'qunjDetail',
|
|
227
|
+
key: 'qunjDetail',
|
|
228
|
+
width: 260,
|
|
229
|
+
align: 'center',
|
|
230
|
+
render: function (text, record, index) {
|
|
231
|
+
var _a;
|
|
232
|
+
// 需要合并
|
|
233
|
+
var _b = getColumnMergeProp({
|
|
234
|
+
record: record,
|
|
235
|
+
index: index,
|
|
236
|
+
records: records,
|
|
237
|
+
dataTypeSort: dataTypeSort,
|
|
238
|
+
}), props = _b.props, currentDataType = _b.currentDataType;
|
|
239
|
+
// 公用信息获取
|
|
240
|
+
var _c = allData[currentDataType] || {}, isEdit = _c.isEdit,
|
|
241
|
+
// 当前流程下的群杰章信息
|
|
242
|
+
qunjList = _c.qunjList,
|
|
243
|
+
// 是否显示合同分数
|
|
244
|
+
isContranctNum = _c.isContranctNum,
|
|
245
|
+
// 是否显示群杰章地址
|
|
246
|
+
isQunjAddress = _c.isQunjAddress, currentQunjSeal = _c.currentQunjSeal, qunjChecked = _c.qunjChecked, currentQunjAddress = _c.currentQunjAddress, wfProcessInstId = _c.wfProcessInstId, verifyUserIds = _c.verifyUserIds, flowStatus = _c.flowStatus;
|
|
247
|
+
// 是否显示群杰印章信息 如果非编辑状态下,使用数据中的字段来判断是否选择了群杰印章
|
|
248
|
+
var isShowQunjDetail = !isEdit
|
|
249
|
+
? (currentQunjSeal === null || currentQunjSeal === void 0 ? void 0 : currentQunjSeal.details) &&
|
|
250
|
+
((_a = currentQunjSeal === null || currentQunjSeal === void 0 ? void 0 : currentQunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) !== 0
|
|
251
|
+
: qunjChecked;
|
|
252
|
+
return {
|
|
253
|
+
children: isShowQunjDetail ? (React.createElement(QunjDetail, { qunjList: qunjList, qunjSeal: currentQunjSeal, isContranctNum: isContranctNum, isQunjAddress: isQunjAddress, currentQunjAddress: currentQunjAddress, isEdit: isEdit, refreshCode: refreshCode, request: request, apiBaseUrl: apiBaseUrl, caseId: caseId, wfProcessInstId: wfProcessInstId, verifyUserIds: verifyUserIds, qjVerifyCodeData: qjVerifyCodeData, getQjVerifyCodeHandle: getQjVerifyCodeHandle, flowStatus: flowStatus })) : null,
|
|
254
|
+
props: props,
|
|
255
|
+
};
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
]
|
|
219
259
|
: [
|
|
220
260
|
{
|
|
221
261
|
title: React.createElement("div", null, i18next.t('群杰用印申请')),
|
|
222
262
|
dataIndex: 'isStampQunj',
|
|
223
263
|
key: 'isStampQunj',
|
|
224
|
-
width:
|
|
264
|
+
width: 330,
|
|
225
265
|
align: 'center',
|
|
266
|
+
// 固定列宽(scroll.x=max-content 时 width 会被内容撑开)
|
|
267
|
+
onHeaderCell: function () { return ({
|
|
268
|
+
style: { width: 330, minWidth: 330, maxWidth: 330 },
|
|
269
|
+
}); },
|
|
270
|
+
onCell: function () { return ({
|
|
271
|
+
// 内容从顶部往下排,避免切换公司时因印章数量不同导致内容垂直居中抖动
|
|
272
|
+
style: {
|
|
273
|
+
width: 330,
|
|
274
|
+
minWidth: 330,
|
|
275
|
+
maxWidth: 330,
|
|
276
|
+
verticalAlign: 'top',
|
|
277
|
+
},
|
|
278
|
+
}); },
|
|
226
279
|
render: function (text, record, index) {
|
|
227
280
|
// 需要合并
|
|
228
281
|
var _a = getColumnMergeProp({
|
|
@@ -1,18 +1,34 @@
|
|
|
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
|
+
};
|
|
1
12
|
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
-
import React from 'react';
|
|
13
|
+
import React, { useContext } from 'react';
|
|
3
14
|
import TranslationButton from './TranslateButton';
|
|
4
15
|
import { getColumnMergeProp } from '../hooks/useParseRecords';
|
|
5
16
|
import { Checkbox } from '../../../index.build';
|
|
17
|
+
import { ElectronSignaturesContext } from '..';
|
|
6
18
|
function useTranslateCom(_a) {
|
|
7
19
|
var isTranslation = _a.isTranslation, previewUrl = _a.previewUrl, request = _a.request, records = _a.records, dataTypeSort = _a.dataTypeSort, allData = _a.allData;
|
|
20
|
+
var isNewQys = useContext(ElectronSignaturesContext).isNewQys;
|
|
8
21
|
var translateColumns = [
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
__assign(__assign({ title: i18next.t('附件扩展功能'), dataIndex: 'translatedFile', key: 'translatedFile', width: 180, align: 'center' }, (isNewQys
|
|
23
|
+
? {
|
|
24
|
+
onHeaderCell: function () { return ({
|
|
25
|
+
style: { width: 180, minWidth: 180, maxWidth: 180 },
|
|
26
|
+
}); },
|
|
27
|
+
onCell: function () { return ({
|
|
28
|
+
style: { width: 180, minWidth: 180, maxWidth: 180 },
|
|
29
|
+
}); },
|
|
30
|
+
}
|
|
31
|
+
: {})), { render: function (text, record, index) {
|
|
16
32
|
var currentDataType = getColumnMergeProp({
|
|
17
33
|
record: record,
|
|
18
34
|
index: index,
|
|
@@ -25,8 +41,7 @@ function useTranslateCom(_a) {
|
|
|
25
41
|
return (React.createElement(React.Fragment, null,
|
|
26
42
|
!record.isHideSaveCustomerReference && isShowSaveTemplate ? (React.createElement(Checkbox, { checked: isCustomerReference, disabled: true }, i18next.t('存样板'))) : null,
|
|
27
43
|
React.createElement(TranslationButton, { request: request, previewUrl: previewUrl, isTranslation: isTranslation, record: record, realIndex: index, setRecords: setSameTypeRecords })));
|
|
28
|
-
},
|
|
29
|
-
},
|
|
44
|
+
} }),
|
|
30
45
|
];
|
|
31
46
|
return {
|
|
32
47
|
translateColumns: translateColumns,
|