zmdms-webui 1.3.7 → 1.3.9

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 (50) hide show
  1. package/dist/es/electronsignatures/dgcomponents/contract-comparison.js +50 -0
  2. package/dist/es/electronsignatures/dgcomponents/useContractColumns.js +53 -0
  3. package/dist/es/electronsignatures/dgcomponents/useDg.js +57 -0
  4. package/dist/es/electronsignatures/electron-signatures-fragment.js +322 -0
  5. package/dist/es/electronsignatures/electroncomponents/electron-seal-batch-download.js +370 -0
  6. package/dist/es/electronsignatures/electroncomponents/electron-seal-detail.js +35 -0
  7. package/dist/es/electronsignatures/electroncomponents/electron-seal-download.js +74 -0
  8. package/dist/es/electronsignatures/electroncomponents/electron-seal-firstLevelPerson.js +17 -0
  9. package/dist/es/electronsignatures/electroncomponents/electron-seal-item.js +21 -0
  10. package/dist/es/electronsignatures/electroncomponents/electron-seal-list.js +42 -0
  11. package/dist/es/electronsignatures/electroncomponents/electron-seal-setting.js +12 -0
  12. package/dist/es/electronsignatures/electroncomponents/last-qys-modal.js +44 -0
  13. package/dist/es/electronsignatures/electroncomponents/useCheckedSealInfoList.js +43 -0
  14. package/dist/es/electronsignatures/electroncomponents/useElectronColumns.js +181 -0
  15. package/dist/es/electronsignatures/electroncomponents/useFetchElectronData.js +118 -0
  16. package/dist/es/electronsignatures/electroncomponents/useGetDeptInfo.js +37 -0
  17. package/dist/es/electronsignatures/electroncomponents/utils.js +266 -0
  18. package/dist/es/electronsignatures/filecomponents/file-operation.js +55 -0
  19. package/dist/es/electronsignatures/filecomponents/file-type-select.js +11 -0
  20. package/dist/es/electronsignatures/filecomponents/file-upload.js +130 -0
  21. package/dist/es/electronsignatures/filecomponents/fileUtils.js +38 -0
  22. package/dist/es/electronsignatures/filecomponents/useFetchFileTypeData.js +46 -0
  23. package/dist/es/electronsignatures/filecomponents/useFileColumns.js +178 -0
  24. package/dist/es/electronsignatures/filecomponents/useFileTypeColumns.js +76 -0
  25. package/dist/es/electronsignatures/hooks/useMergeRecords.js +51 -0
  26. package/dist/es/electronsignatures/hooks/useParseElectronListData.js +113 -0
  27. package/dist/es/electronsignatures/hooks/useParseElectronSetting.js +327 -0
  28. package/dist/es/electronsignatures/hooks/useParseIsNeedElectronData.js +111 -0
  29. package/dist/es/electronsignatures/hooks/useParseIsNeedQunjData.js +50 -0
  30. package/dist/es/electronsignatures/hooks/useParseQunjListData.js +182 -0
  31. package/dist/es/electronsignatures/hooks/useParseQunjSingleData.js +96 -0
  32. package/dist/es/electronsignatures/hooks/useParseRecords.js +141 -0
  33. package/dist/es/electronsignatures/index.css +1 -0
  34. package/dist/es/electronsignatures/index.d.ts +6 -0
  35. package/dist/es/electronsignatures/index.js +836 -0
  36. package/dist/es/electronsignatures/interface.d.ts +500 -0
  37. package/dist/es/electronsignatures/interface.js +53 -0
  38. package/dist/es/electronsignatures/qunjcomponents/code-modal.js +111 -0
  39. package/dist/es/electronsignatures/qunjcomponents/qunj-check.js +15 -0
  40. package/dist/es/electronsignatures/qunjcomponents/qunj-detail.js +65 -0
  41. package/dist/es/electronsignatures/qunjcomponents/qunj-list.js +121 -0
  42. package/dist/es/electronsignatures/qunjcomponents/useFetchQunjData.js +58 -0
  43. package/dist/es/electronsignatures/qunjcomponents/useQunjColumns.js +251 -0
  44. package/dist/es/electronsignatures/utils.js +55 -0
  45. package/dist/es/table/components/EnhanceBodyCell.js +3 -1
  46. package/dist/index.build.d.ts +1 -0
  47. package/dist/index.dark.css +1 -1
  48. package/dist/index.default.css +1 -1
  49. package/dist/index.es.js +1 -0
  50. package/package.json +4 -3
@@ -0,0 +1,370 @@
1
+ import { __assign } from '../../_virtual/_tslib.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { memo, useRef } from 'react';
4
+ import { preCanDownload, fileBatchDownload, nextDownload, sealFileBatchDownload } from './utils.js';
5
+ import { DATA_TYPE_KEY } from '../hooks/useParseRecords.js';
6
+ import { getToken } from 'zmdms-utils';
7
+ import { isFlowCompleted } from '../utils.js';
8
+ import ButtonCom from '../../button/button.js';
9
+ import { Dropdown, message } from 'antd';
10
+
11
+ /**
12
+ * 下载电子印章相关逻辑
13
+ */
14
+ var ElectronSealBatchDownload = function (props) {
15
+ var request = props.request, apiBaseUrl = props.apiBaseUrl, selectRows = props.selectRows, allData = props.allData, isShowDownloadBatchBtn = props.isShowDownloadBatchBtn, isShowElectronBatchBtn = props.isShowElectronBatchBtn, isShowDoubleSignedBatchBtn = props.isShowDoubleSignedBatchBtn, batchDownloadZipName = props.batchDownloadZipName, children = props.children, firstDataType = props.firstDataType;
16
+ /**
17
+ * @author 陈亚雄
18
+ * @description 批量下载
19
+ */
20
+ var batchDownloadRef = useRef(null);
21
+ var noCompressBatchDownloadRef = useRef(null);
22
+ var onAllDownloadHandle = function (isCompress) {
23
+ if (isCompress === void 0) { isCompress = true; }
24
+ var selectFiles = selectRows.current;
25
+ var authToken = getToken() || "";
26
+ if (Array.isArray(selectFiles) && selectFiles.length > 0) {
27
+ var list_1 = [];
28
+ try {
29
+ var listResult_1 = {};
30
+ selectFiles.forEach(function (item) {
31
+ var key = item === null || item === void 0 ? void 0 : item[DATA_TYPE_KEY];
32
+ if (!listResult_1[key]) {
33
+ listResult_1[key] = [item];
34
+ }
35
+ else {
36
+ listResult_1[key].push(item);
37
+ }
38
+ });
39
+ Object.keys(listResult_1).forEach(function (key) {
40
+ var checkedRecords = listResult_1[key];
41
+ var _a = allData[key], records = _a.records, fileFieldsNameRef = _a.fileFieldsNameRef;
42
+ var _b = (fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) || {}, attachId = _b.attachId, attachName = _b.attachName;
43
+ checkedRecords.forEach(function (checkedRecord) {
44
+ if (records.find(function (record) { return record[attachId] === checkedRecord[attachId]; })) {
45
+ list_1.push({
46
+ fileName: checkedRecord[attachName],
47
+ fileId: checkedRecord[attachId],
48
+ isWatermark: false,
49
+ });
50
+ }
51
+ });
52
+ });
53
+ }
54
+ catch (err) {
55
+ list_1 = selectFiles.map(function (item) { return ({
56
+ fileName: item.attachName,
57
+ fileId: item.attachId,
58
+ isWatermark: false,
59
+ }); });
60
+ }
61
+ if (isCompress) {
62
+ // 根据相关信息生成下载的链接
63
+ if (!preCanDownload(batchDownloadRef.current, function () {
64
+ batchDownloadRef.current = null;
65
+ })) {
66
+ return;
67
+ }
68
+ batchDownloadRef.current = fileBatchDownload(list_1, {
69
+ authToken: authToken,
70
+ apiBaseUrl: apiBaseUrl || window.location.origin,
71
+ isCompress: isCompress,
72
+ zipName: batchDownloadZipName,
73
+ });
74
+ nextDownload(batchDownloadRef.current, function () {
75
+ batchDownloadRef.current = null;
76
+ });
77
+ }
78
+ else {
79
+ // 根据相关信息生成下载的链接
80
+ if (!preCanDownload(noCompressBatchDownloadRef.current, function () {
81
+ noCompressBatchDownloadRef.current = null;
82
+ })) {
83
+ return;
84
+ }
85
+ noCompressBatchDownloadRef.current = fileBatchDownload(list_1, {
86
+ authToken: authToken,
87
+ apiBaseUrl: apiBaseUrl || window.location.origin,
88
+ isCompress: isCompress,
89
+ zipName: batchDownloadZipName,
90
+ });
91
+ nextDownload(noCompressBatchDownloadRef.current, function () {
92
+ noCompressBatchDownloadRef.current = null;
93
+ });
94
+ }
95
+ }
96
+ else {
97
+ message.info("请选择需要下载的附件!");
98
+ }
99
+ };
100
+ /** 批量下载盖章件 */
101
+ var sealBatchDownloadRef = useRef(null);
102
+ var sealNoCompressBatchDownloadRef = useRef(null);
103
+ var batchDownload = function (isCompress) {
104
+ if (isCompress === void 0) { isCompress = true; }
105
+ var list = selectRows.current;
106
+ // 计算能下载盖章件的数据
107
+ if (Array.isArray(list) && list.length > 0) {
108
+ var listResult_2 = {};
109
+ list.forEach(function (item) {
110
+ var key = item === null || item === void 0 ? void 0 : item[DATA_TYPE_KEY];
111
+ if (!listResult_2[key]) {
112
+ listResult_2[key] = [item];
113
+ }
114
+ else {
115
+ listResult_2[key].push(item);
116
+ }
117
+ });
118
+ var canDownloadFileList_1 = {};
119
+ Object.keys(listResult_2).forEach(function (key) {
120
+ var checkedRecords = listResult_2[key];
121
+ var _a = allData[key], records = _a.records, currentDocAttachMap = _a.currentDocAttachMap, fileFieldsNameRef = _a.fileFieldsNameRef, flowStatus = _a.flowStatus;
122
+ var _b = (fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) || {}, attachId = _b.attachId, attachName = _b.attachName, isElectronicSeal = _b.isElectronicSeal;
123
+ // 这里加上流程状态是50时,才能下载盖章件的逻辑
124
+ if (currentDocAttachMap && isFlowCompleted(flowStatus)) {
125
+ var resultRecords = checkedRecords.map(function (record) {
126
+ var currentRecord = records.find(function (item) { return (item === null || item === void 0 ? void 0 : item[attachId]) === (record === null || record === void 0 ? void 0 : record[attachId]); });
127
+ if (currentRecord) {
128
+ return currentRecord;
129
+ }
130
+ return record;
131
+ });
132
+ var qysAttachVOList = resultRecords
133
+ .filter(function (record) {
134
+ return (record === null || record === void 0 ? void 0 : record[isElectronicSeal || "isElectronicSeal"]) + "" === "1";
135
+ })
136
+ .map(function (item) { return ({
137
+ fileName: item === null || item === void 0 ? void 0 : item[attachName],
138
+ attachId: item === null || item === void 0 ? void 0 : item[attachId],
139
+ }); });
140
+ if (qysAttachVOList.length !== 0) {
141
+ canDownloadFileList_1[key] = {
142
+ params: {
143
+ docAttachMap: currentDocAttachMap,
144
+ qysAttachVOList: qysAttachVOList,
145
+ },
146
+ };
147
+ }
148
+ }
149
+ });
150
+ var keys = Object.keys(canDownloadFileList_1);
151
+ if (keys.length === 0) {
152
+ message.info("请选择可以下载的盖章件的数据!");
153
+ return;
154
+ }
155
+ keys.forEach(function (key) {
156
+ var _a, _b;
157
+ var params = canDownloadFileList_1[key].params;
158
+ if (isCompress) {
159
+ // 根据相关信息生成下载的链接
160
+ if (!sealBatchDownloadRef.current) {
161
+ sealBatchDownloadRef.current = (_a = {},
162
+ _a[key] = null,
163
+ _a);
164
+ }
165
+ if (!preCanDownload(sealBatchDownloadRef.current[key], function () {
166
+ if (sealBatchDownloadRef.current) {
167
+ sealBatchDownloadRef.current[key] = null;
168
+ }
169
+ })) {
170
+ return;
171
+ }
172
+ sealBatchDownloadRef.current[key] = sealFileBatchDownload(request, params);
173
+ }
174
+ else {
175
+ // 根据相关信息生成下载的链接
176
+ if (!sealNoCompressBatchDownloadRef.current) {
177
+ sealNoCompressBatchDownloadRef.current = (_b = {},
178
+ _b[key] = null,
179
+ _b);
180
+ }
181
+ if (!preCanDownload(sealNoCompressBatchDownloadRef.current[key], function () {
182
+ if (sealNoCompressBatchDownloadRef.current) {
183
+ sealNoCompressBatchDownloadRef.current[key] = null;
184
+ }
185
+ })) {
186
+ return;
187
+ }
188
+ sealNoCompressBatchDownloadRef.current[key] =
189
+ sealFileBatchDownload(request, params, false);
190
+ }
191
+ });
192
+ }
193
+ else {
194
+ message.info("请选择需要下载的盖章件!");
195
+ }
196
+ };
197
+ /** 批量下载双签件 */
198
+ var sealDoubleBatchDownloadRef = useRef(null);
199
+ var sealDoubleNoCompressBatchDownloadRef = useRef(null);
200
+ var batchDoubleDownload = function (isCompress) {
201
+ if (isCompress === void 0) { isCompress = true; }
202
+ var list = selectRows.current;
203
+ // 计算能下载盖章件的数据
204
+ if (Array.isArray(list) && list.length > 0) {
205
+ var listResult_3 = {};
206
+ list.forEach(function (item) {
207
+ var key = item === null || item === void 0 ? void 0 : item[DATA_TYPE_KEY];
208
+ if (!listResult_3[key]) {
209
+ listResult_3[key] = [item];
210
+ }
211
+ else {
212
+ listResult_3[key].push(item);
213
+ }
214
+ });
215
+ var canDownloadFileList_2 = {};
216
+ Object.keys(listResult_3).forEach(function (key) {
217
+ var checkedRecords = listResult_3[key];
218
+ var _a = allData[key], records = _a.records, fileFieldsNameRef = _a.fileFieldsNameRef, flowStatus = _a.flowStatus;
219
+ var _b = (fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) || {}, attachId = _b.attachId, _doubleSignedSealInfoDTOList = _b.doubleSignedSealInfoDTOList;
220
+ var doubleSignedSealInfoDTOListKey = _doubleSignedSealInfoDTOList || "doubleSignedSealInfoDTOList";
221
+ // 这里加上流程状态是50时,才能下载双签件的逻辑
222
+ if (isFlowCompleted(flowStatus)) {
223
+ var resultRecords = checkedRecords.map(function (record) {
224
+ var currentRecord = records.find(function (item) { return (item === null || item === void 0 ? void 0 : item[attachId]) === (record === null || record === void 0 ? void 0 : record[attachId]); });
225
+ if (currentRecord) {
226
+ return currentRecord;
227
+ }
228
+ return record;
229
+ });
230
+ var qysAttachVOList = resultRecords.filter(function (record) {
231
+ return (record === null || record === void 0 ? void 0 : record[doubleSignedSealInfoDTOListKey]) &&
232
+ Array.isArray(record === null || record === void 0 ? void 0 : record[doubleSignedSealInfoDTOListKey]) &&
233
+ (record === null || record === void 0 ? void 0 : record[doubleSignedSealInfoDTOListKey].length) > 0;
234
+ });
235
+ if (qysAttachVOList.length !== 0) {
236
+ // 这里每个附件的双签件 都有一个合同模板信息
237
+ qysAttachVOList.forEach(function (record) {
238
+ var _a, _b, _c;
239
+ var key = record[attachId];
240
+ var doubleSignedSealInfoDTOObj = (_a = record[doubleSignedSealInfoDTOListKey]) === null || _a === void 0 ? void 0 : _a[0];
241
+ canDownloadFileList_2[key] = {
242
+ params: {
243
+ docAttachMap: doubleSignedSealInfoDTOObj === null || doubleSignedSealInfoDTOObj === void 0 ? void 0 : doubleSignedSealInfoDTOObj.docAttachMap,
244
+ qysAttachVOList: (_c = (_b = doubleSignedSealInfoDTOObj === null || doubleSignedSealInfoDTOObj === void 0 ? void 0 : doubleSignedSealInfoDTOObj.qysAttachVOList) === null || _b === void 0 ? void 0 : _b.map) === null || _c === void 0 ? void 0 : _c.call(_b, function (item) { return (__assign(__assign({}, item), { fileName: item.fileName || item.attachName })); }),
245
+ },
246
+ };
247
+ });
248
+ }
249
+ }
250
+ });
251
+ var keys = Object.keys(canDownloadFileList_2);
252
+ if (keys.length === 0) {
253
+ message.info("请选择可以下载的双签件的数据!");
254
+ return;
255
+ }
256
+ keys.forEach(function (key) {
257
+ var _a, _b;
258
+ var params = canDownloadFileList_2[key].params;
259
+ if (isCompress) {
260
+ // 根据相关信息生成下载的链接
261
+ if (!sealDoubleBatchDownloadRef.current) {
262
+ sealDoubleBatchDownloadRef.current = (_a = {},
263
+ _a[key] = null,
264
+ _a);
265
+ }
266
+ if (!preCanDownload(sealDoubleBatchDownloadRef.current[key], function () {
267
+ if (sealDoubleBatchDownloadRef.current) {
268
+ sealDoubleBatchDownloadRef.current[key] = null;
269
+ }
270
+ })) {
271
+ return;
272
+ }
273
+ sealDoubleBatchDownloadRef.current[key] =
274
+ sealFileBatchDownload(request, params);
275
+ }
276
+ else {
277
+ // 根据相关信息生成下载的链接
278
+ if (!sealDoubleNoCompressBatchDownloadRef.current) {
279
+ sealDoubleNoCompressBatchDownloadRef.current = (_b = {},
280
+ _b[key] = null,
281
+ _b);
282
+ }
283
+ if (!preCanDownload(sealDoubleNoCompressBatchDownloadRef.current[key], function () {
284
+ if (sealDoubleNoCompressBatchDownloadRef.current) {
285
+ sealDoubleNoCompressBatchDownloadRef.current[key] =
286
+ null;
287
+ }
288
+ })) {
289
+ return;
290
+ }
291
+ sealDoubleNoCompressBatchDownloadRef.current[key] =
292
+ sealFileBatchDownload(request, params, false);
293
+ }
294
+ });
295
+ }
296
+ else {
297
+ message.info("请选择需要下载的盖章件!");
298
+ }
299
+ };
300
+ // 流程完结才能显示批量导出按钮
301
+ var isShowDownloadBtn = function () {
302
+ var _a, _b;
303
+ if (((_a = Object.keys(allData)) === null || _a === void 0 ? void 0 : _a.length) > 1 ||
304
+ isFlowCompleted((_b = allData === null || allData === void 0 ? void 0 : allData[firstDataType]) === null || _b === void 0 ? void 0 : _b.flowStatus)) {
305
+ return true;
306
+ }
307
+ return false;
308
+ };
309
+ return (jsxs("div", __assign({ className: "batch-download--container", style: { marginBottom: 10 } }, { children: [children, isShowDownloadBatchBtn ? (jsx(Dropdown, __assign({ menu: {
310
+ items: [
311
+ {
312
+ label: "压缩",
313
+ key: "compress",
314
+ },
315
+ {
316
+ label: "不压缩",
317
+ key: "no-compress",
318
+ },
319
+ ],
320
+ onClick: function (e) {
321
+ if (e.key === "compress") {
322
+ onAllDownloadHandle();
323
+ }
324
+ else {
325
+ onAllDownloadHandle(false);
326
+ }
327
+ },
328
+ }, placement: "bottomLeft" }, { children: jsx(ButtonCom, __assign({ type: "primary", style: { marginRight: "10px" } }, { children: "\u6279\u91CF\u4E0B\u8F7D\u539F\u4EF6" })) }))) : null, isShowElectronBatchBtn && isShowDownloadBtn() ? (jsx(Dropdown, __assign({ menu: {
329
+ items: [
330
+ {
331
+ label: "压缩",
332
+ key: "compress",
333
+ },
334
+ {
335
+ label: "不压缩",
336
+ key: "no-compress",
337
+ },
338
+ ],
339
+ onClick: function (e) {
340
+ if (e.key === "compress") {
341
+ batchDownload();
342
+ }
343
+ else {
344
+ batchDownload(false);
345
+ }
346
+ },
347
+ }, placement: "bottomLeft" }, { children: jsx(ButtonCom, __assign({ type: "primary", style: { marginRight: "10px" } }, { children: "\u6279\u91CF\u4E0B\u8F7D\u7535\u5B50\u7B7E\u7AE0\u4EF6" })) }))) : null, isShowDoubleSignedBatchBtn && isShowDownloadBtn() ? (jsx(Dropdown, __assign({ menu: {
348
+ items: [
349
+ {
350
+ label: "压缩",
351
+ key: "compress",
352
+ },
353
+ {
354
+ label: "不压缩",
355
+ key: "no-compress",
356
+ },
357
+ ],
358
+ onClick: function (e) {
359
+ if (e.key === "compress") {
360
+ batchDoubleDownload();
361
+ }
362
+ else {
363
+ batchDoubleDownload(false);
364
+ }
365
+ },
366
+ }, placement: "bottomLeft" }, { children: jsx(ButtonCom, __assign({ type: "primary", style: { marginRight: "10px" } }, { children: "\u6279\u91CF\u4E0B\u8F7D\u53CC\u7B7E\u4EF6" })) }))) : null] })));
367
+ };
368
+ var ElectronSealBatchDownload$1 = memo(ElectronSealBatchDownload);
369
+
370
+ export { ElectronSealBatchDownload$1 as default };
@@ -0,0 +1,35 @@
1
+ import { __assign } from '../../_virtual/_tslib.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { memo } from 'react';
4
+
5
+ var NoUseElectronSeal = function () {
6
+ return (jsx("div", __assign({ style: {
7
+ height: '100%',
8
+ display: 'flex',
9
+ alignItems: 'center',
10
+ justifyContent: 'center',
11
+ } }, { children: "\u672C\u6B21\u6D41\u7A0B\u65E0\u7535\u5B50\u5370\u7AE0" })));
12
+ };
13
+ /**
14
+ * 电子签章选择列表
15
+ */
16
+ var ElectronSealDetail = function (_a) {
17
+ var sealList = _a.sealList, value = _a.value;
18
+ // 电子印章数据没有加载完成或者加载出错
19
+ if (!Array.isArray(sealList)) {
20
+ return null;
21
+ }
22
+ // 本流程、部门下没有配置电子印章数据
23
+ if (sealList.length === 0) {
24
+ return jsx(NoUseElectronSeal, {});
25
+ }
26
+ // 整理数据 以ownerName维度,拆分数据
27
+ return Array.isArray(value) && value.length > 0 ? (jsx("div", __assign({ className: "electron-seal-detail--wrap" }, { children: value === null || value === void 0 ? void 0 : value.map(function (id) {
28
+ var _a;
29
+ var completeItem = (_a = sealList === null || sealList === void 0 ? void 0 : sealList.find) === null || _a === void 0 ? void 0 : _a.call(sealList, function (sealItem) { return sealItem.sealId === id; });
30
+ return (jsx("div", __assign({ className: "electron-seal-detail--wrap__item" }, { children: completeItem === null || completeItem === void 0 ? void 0 : completeItem.sealName }), id));
31
+ }) }))) : (jsx(NoUseElectronSeal, {}));
32
+ };
33
+ var ElectronSealDetail$1 = memo(ElectronSealDetail);
34
+
35
+ export { NoUseElectronSeal, ElectronSealDetail$1 as default };
@@ -0,0 +1,74 @@
1
+ import { __assign } from '../../_virtual/_tslib.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { memo, useRef } from 'react';
4
+ import { Switch } from 'antd';
5
+ import { preCanDownload, sealFileBatchDownload } from './utils.js';
6
+ import { isFlowCompleted } from '../utils.js';
7
+ import ButtonCom from '../../button/button.js';
8
+
9
+ /**
10
+ * 下载电子印章相关逻辑
11
+ */
12
+ var ElectronSealDownload = function (props) {
13
+ var request = props.request, docAttachMap = props.docAttachMap, record = props.record, fileFieldsNameRef = props.fileFieldsNameRef, flowStatus = props.flowStatus, checked = props.checked;
14
+ var _a = (fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) || {}, attachId = _a.attachId, attachName = _a.attachName, _isElectronicSeal = _a.isElectronicSeal, _doubleSignedSealInfoDTOList = _a.doubleSignedSealInfoDTOList, _b = _a.fmsIsPushBank, fmsIsPushBank = _b === void 0 ? "fmsIsPushBank" : _b, _c = _a.fmsIsElectronicSeal, fmsIsElectronicSeal = _c === void 0 ? "fmsIsElectronicSeal" : _c;
15
+ // 电子签章件key值
16
+ var isElectronicSealKey = _isElectronicSeal || "isElectronicSeal";
17
+ var doubleSignedSealInfoDTOListKey = _doubleSignedSealInfoDTOList || "doubleSignedSealInfoDTOList";
18
+ // 下载电子印章件
19
+ var sealNoCompressBatchDownloadRef = useRef(null);
20
+ var onDownLoadHand = function () {
21
+ var qysAttachVOList = [
22
+ {
23
+ fileName: record === null || record === void 0 ? void 0 : record[attachName],
24
+ attachId: record === null || record === void 0 ? void 0 : record[attachId],
25
+ },
26
+ ];
27
+ var params = {
28
+ docAttachMap: docAttachMap,
29
+ qysAttachVOList: qysAttachVOList,
30
+ };
31
+ if (!preCanDownload(sealNoCompressBatchDownloadRef.current, function () {
32
+ sealNoCompressBatchDownloadRef.current = null;
33
+ })) {
34
+ return;
35
+ }
36
+ sealNoCompressBatchDownloadRef.current = sealFileBatchDownload(request, params, false);
37
+ };
38
+ // 下载双签件
39
+ var sealDoubleElectronicSealDownloadRef = useRef({});
40
+ var onDoubleElectronicSealDownLoadHand = function () {
41
+ var doubleSignedSealInfoDTOList = record === null || record === void 0 ? void 0 : record[doubleSignedSealInfoDTOListKey];
42
+ if (Array.isArray(doubleSignedSealInfoDTOList)) {
43
+ doubleSignedSealInfoDTOList.forEach(function (item, index) {
44
+ var _a;
45
+ var docAttachMap = item.docAttachMap, qysAttachVOList = item.qysAttachVOList;
46
+ var params = {
47
+ docAttachMap: docAttachMap,
48
+ qysAttachVOList: (_a = qysAttachVOList === null || qysAttachVOList === void 0 ? void 0 : qysAttachVOList.map) === null || _a === void 0 ? void 0 : _a.call(qysAttachVOList, function (item) { return (__assign(__assign({}, item), { fileName: item.fileName || item.attachName })); }),
49
+ };
50
+ if (!preCanDownload(sealDoubleElectronicSealDownloadRef.current[index], function () {
51
+ sealDoubleElectronicSealDownloadRef.current[index] = null;
52
+ })) {
53
+ return;
54
+ }
55
+ sealDoubleElectronicSealDownloadRef.current[index] =
56
+ sealFileBatchDownload(request, params, false);
57
+ });
58
+ }
59
+ };
60
+ // 是否显示下载电子印章件
61
+ var isElectronicSeal = (record === null || record === void 0 ? void 0 : record[isElectronicSealKey]) + "" === "1";
62
+ // 是否显示下载双签件
63
+ var isDoubleElectronicSeal = (record === null || record === void 0 ? void 0 : record[doubleSignedSealInfoDTOListKey]) &&
64
+ Array.isArray(record === null || record === void 0 ? void 0 : record[doubleSignedSealInfoDTOListKey]) &&
65
+ (record === null || record === void 0 ? void 0 : record[doubleSignedSealInfoDTOListKey].length) > 0;
66
+ return (jsxs("div", __assign({ style: { display: "flex", flexDirection: "column" } }, { children: [isElectronicSeal && isFlowCompleted(flowStatus) ? (jsx(ButtonCom, __assign({ type: "link", onClick: onDownLoadHand }, { children: "\u4E0B\u8F7D\u7535\u5B50\u7B7E\u7AE0\u4EF6" }))) : null, isDoubleElectronicSeal && isFlowCompleted(flowStatus) ? (jsx(ButtonCom, __assign({ type: "link", onClick: onDoubleElectronicSealDownLoadHand }, { children: (record === null || record === void 0 ? void 0 : record[fmsIsPushBank]) + "" === "1" &&
67
+ (record === null || record === void 0 ? void 0 : record[fmsIsElectronicSeal]) + "" === "1"
68
+ ? "下载三签件"
69
+ : "下载双签件" }))) : null, (isElectronicSeal || isDoubleElectronicSeal) &&
70
+ !isFlowCompleted(flowStatus) ? (jsx("div", { children: jsx(Switch, { disabled: true, checked: checked }) })) : null] })));
71
+ };
72
+ var ElectronSealDownload$1 = memo(ElectronSealDownload);
73
+
74
+ export { ElectronSealDownload$1 as default };
@@ -0,0 +1,17 @@
1
+ import { __assign } from '../../_virtual/_tslib.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { memo } from 'react';
4
+ import { Checkbox } from 'antd';
5
+
6
+ var ElectronSealFirstLevelPerson = function (_a) {
7
+ var firstLevelPersonName = _a.firstLevelPersonName, checked = _a.checked, onChange = _a.onChange, isEdit = _a.isEdit;
8
+ // const title = `是否加盖经济责任人手签章${
9
+ // firstLevelPersonName ? `(经济责任人: ${firstLevelPersonName})` : ''
10
+ // }`;
11
+ // 20240923 文字修改
12
+ var title = "\u52A0\u76D6\u7ECF\u6D4E\u8D23\u4EFB\u4EBA\u4E2A\u4EBA\u7B7E\u540D".concat(firstLevelPersonName ? "\uFF08".concat(firstLevelPersonName, "\uFF09") : '');
13
+ return firstLevelPersonName ? (jsx("div", __assign({ className: "electron-seal--first-level-person", title: title }, { children: jsx(Checkbox, __assign({ checked: checked, onChange: onChange, disabled: !isEdit }, { children: title })) }))) : null;
14
+ };
15
+ var ElectronSealFirstLevelPerson$1 = memo(ElectronSealFirstLevelPerson);
16
+
17
+ export { ElectronSealFirstLevelPerson$1 as default };
@@ -0,0 +1,21 @@
1
+ import { __rest, __assign } from '../../_virtual/_tslib.js';
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
+ import { memo } from 'react';
4
+ import { Switch, Checkbox } from 'antd';
5
+
6
+ /**
7
+ * 是否盖电子印章相关逻辑
8
+ */
9
+ var ElectronSealItem = function (props) {
10
+ var fmsIsElectronicSeal = props.fmsIsElectronicSeal, fmsIsElectronicSealLabel = props.fmsIsElectronicSealLabel, fmsIsPushBank = props.fmsIsPushBank, fmsIsElectronicSealPushLabel = props.fmsIsElectronicSealPushLabel, onFmsIsElectronicSealChange = props.onFmsIsElectronicSealChange, isShowFms = props.isShowFms, isShowBank = props.isShowBank, resetProps = __rest(props, ["fmsIsElectronicSeal", "fmsIsElectronicSealLabel", "fmsIsPushBank", "fmsIsElectronicSealPushLabel", "onFmsIsElectronicSealChange", "isShowFms", "isShowBank"]);
11
+ return (jsxs(Fragment, { children: [jsx(Switch, __assign({}, resetProps)), isShowFms ? (jsxs("div", __assign({ className: "electron-seal--any" }, { children: [jsx(Checkbox, __assign({ checked: fmsIsElectronicSeal, disabled: resetProps.disabled, onChange: function (e) {
12
+ onFmsIsElectronicSealChange &&
13
+ onFmsIsElectronicSealChange(e.target.checked, 'fmsElectron');
14
+ } }, { children: fmsIsElectronicSealLabel })), isShowBank ? (jsx(Checkbox, __assign({ checked: fmsIsPushBank, disabled: resetProps.disabled, onChange: function (e) {
15
+ onFmsIsElectronicSealChange &&
16
+ onFmsIsElectronicSealChange(e.target.checked, 'fmsPush');
17
+ } }, { children: fmsIsElectronicSealPushLabel }))) : null] }))) : null] }));
18
+ };
19
+ var ElectronSealItem$1 = memo(ElectronSealItem);
20
+
21
+ export { ElectronSealItem$1 as default };
@@ -0,0 +1,42 @@
1
+ import { __rest, __assign } from '../../_virtual/_tslib.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { memo, useMemo } from 'react';
4
+ import MemoDifferences from '../../collapse/collapse.js';
5
+ import { Checkbox } from 'antd';
6
+
7
+ /**
8
+ * 电子签章选择列表
9
+ */
10
+ var ElectronSealList = function (_a) {
11
+ var sealList = _a.sealList, onChange = _a.onChange, isEdit = _a.isEdit, resetProp = __rest(_a, ["sealList", "onChange", "isEdit"]);
12
+ // 整理数据 以ownerName维度,拆分数据
13
+ var sealListMemo = useMemo(function () {
14
+ if (!Array.isArray(sealList)) {
15
+ return {
16
+ ownerNameList: [],
17
+ result: {},
18
+ };
19
+ }
20
+ var ownerNameList = Array.from(new Set(sealList.map(function (item) { return item.ownerName; })));
21
+ var result = {};
22
+ ownerNameList.forEach(function (ownerName) {
23
+ result[ownerName] = sealList.filter(function (item) { return item.ownerName === ownerName; });
24
+ });
25
+ return {
26
+ ownerNameList: ownerNameList,
27
+ result: result,
28
+ };
29
+ }, [sealList]);
30
+ var ownerNameList = sealListMemo.ownerNameList, result = sealListMemo.result;
31
+ return ownerNameList.length === 0 ? null : (jsx(Checkbox.Group, __assign({ onChange: function (e) {
32
+ onChange && onChange(e);
33
+ }, disabled: !isEdit, className: "electron-seal-list--wrap" }, resetProp, { children: jsx(MemoDifferences, __assign({ defaultActiveKey: ownerNameList.map(function (item, index) { return index; }), style: { width: "100%" } }, { children: ownerNameList.map(function (ownerName, index) {
34
+ var _a;
35
+ return (jsx(MemoDifferences.Panel, __assign({ header: ownerName }, { children: (_a = result[ownerName]) === null || _a === void 0 ? void 0 : _a.map(function (item) {
36
+ return (jsx(Checkbox, __assign({ value: item.sealId }, { children: item.sealName }), item.sealId));
37
+ }) }), index));
38
+ }) })) })));
39
+ };
40
+ var ElectronSealList$1 = memo(ElectronSealList);
41
+
42
+ export { ElectronSealList$1 as default };
@@ -0,0 +1,12 @@
1
+ import { __assign } from '../../_virtual/_tslib.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { memo } from 'react';
4
+ import ButtonCom from '../../button/button.js';
5
+
6
+ var ElectronSealSetting = function (_a) {
7
+ _a.records; _a.setLoading; var contractId = _a.contractId, appointSignLocation = _a.appointSignLocation, viewSignPage = _a.viewSignPage, isEdit = _a.isEdit;
8
+ return (jsxs("div", __assign({ className: "electron-seal-setting--wrap" }, { children: [isEdit ? (jsx(ButtonCom, __assign({ type: "link", onClick: function () { return appointSignLocation === null || appointSignLocation === void 0 ? void 0 : appointSignLocation(); } }, { children: "\u6307\u5B9A\u7B7E\u7F72\u4F4D\u7F6E" }))) : null, contractId ? (jsx(ButtonCom, __assign({ type: "link", onClick: viewSignPage }, { children: "\u9884\u89C8\u76D6\u7AE0\u6548\u679C" }))) : !isEdit ? (jsx("div", { children: "\u5408\u540Cid\u672A\u751F\u6210" })) : null] })));
9
+ };
10
+ var ElectronSealSetting$1 = memo(ElectronSealSetting);
11
+
12
+ export { ElectronSealSetting$1 as default };
@@ -0,0 +1,44 @@
1
+ import { __assign } from '../../_virtual/_tslib.js';
2
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
+ import { memo, useState, useImperativeHandle } from 'react';
4
+ import ModalComponent from '../../modal/modal.js';
5
+ import ButtonCom from '../../button/button.js';
6
+ import { Checkbox } from 'antd';
7
+
8
+ /**
9
+ * 最终电子印章验证框
10
+ */
11
+ var LastQysModal = function (props) {
12
+ var modalHandleRef = props.modalHandleRef, appointSignLocation = props.appointSignLocation;
13
+ var _a = useState(), visible = _a[0], setVisible = _a[1];
14
+ var _b = useState([]), unSealList = _b[0], setUnSealList = _b[1];
15
+ var _c = useState([]), needReSealList = _c[0], setNeedReSealList = _c[1];
16
+ useImperativeHandle(modalHandleRef, function () {
17
+ return {
18
+ setInfo: function (visible, info) {
19
+ setVisible(visible);
20
+ setUnSealList(info.unSealList);
21
+ setNeedReSealList(info.unSealList.map(function (item) { return item.sealId; }));
22
+ },
23
+ clear: function () {
24
+ setVisible(false);
25
+ setUnSealList([]);
26
+ setNeedReSealList([]);
27
+ },
28
+ };
29
+ });
30
+ return (jsx(ModalComponent, __assign({ title: "\u4E0B\u5217\u5370\u7AE0\u672A\u786E\u8BA4\u76D6\u7AE0\u4F4D\u7F6E\uFF0C\u5982\u4E0D\u9700\u8981\u8BF7\u53D6\u6D88\u52FE\u9009\u3002", width: 800, closable: false, open: visible, onCancel: function () {
31
+ setVisible(false);
32
+ }, footer: jsx(Fragment, { children: jsx(ButtonCom, __assign({ type: "primary", onClick: function () {
33
+ appointSignLocation({
34
+ needReSealList: needReSealList,
35
+ });
36
+ } }, { children: needReSealList.length > 0 ? "指定签署位置" : "确定" })) }) }, { children: jsx(Checkbox.Group, __assign({ defaultValue: unSealList.map(function (item) { return item.sealId; }), value: needReSealList, onChange: function (e) {
37
+ setNeedReSealList(e);
38
+ }, className: "flex-checkbox-group" }, { children: unSealList.map(function (item) {
39
+ return (jsx(Checkbox, __assign({ value: item.sealId, style: { width: "100%", margin: "0 8px" } }, { children: item.sealName }), item.sealId));
40
+ }) })) })));
41
+ };
42
+ var LastQysModal$1 = memo(LastQysModal);
43
+
44
+ export { LastQysModal$1 as default };