ztxkui 10.0.95 → 10.0.97

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 (150) hide show
  1. package/dist/components/TranslationButton/DownFile.d.ts +7 -0
  2. package/dist/components/TranslationButton/DownFile.js +97 -0
  3. package/dist/components/TranslationButton/PreviewFile.d.ts +5 -0
  4. package/dist/components/TranslationButton/PreviewFile.js +75 -0
  5. package/dist/components/TranslationButton/TranslationButton.d.ts +34 -0
  6. package/dist/components/TranslationButton/TranslationButton.js +247 -0
  7. package/dist/components/TranslationButton/demoComponents/index.d.ts +3 -0
  8. package/dist/components/TranslationButton/demoComponents/index.js +9 -0
  9. package/dist/components/TranslationButton/hooks.d.ts +8 -0
  10. package/dist/components/TranslationButton/hooks.js +143 -0
  11. package/dist/components/TranslationButton/index.d.ts +4 -0
  12. package/dist/components/TranslationButton/index.js +4 -0
  13. package/dist/components/Upload/utils.d.ts +8 -1
  14. package/dist/components/Upload/utils.js +56 -4
  15. package/dist/components/UploadCustom/hooks/useDg.d.ts +6 -0
  16. package/dist/components/UploadCustom/hooks/useDg.js +57 -0
  17. package/dist/components/business/Signatures/components/CodeModal.d.ts +3 -0
  18. package/dist/components/business/Signatures/components/CodeModal.js +159 -0
  19. package/dist/components/electron-signatures/content.d.ts +9 -0
  20. package/dist/components/electron-signatures/content.js +1126 -0
  21. package/dist/components/electron-signatures/demoComponents/data.d.ts +58 -0
  22. package/dist/components/electron-signatures/demoComponents/data.js +1307 -0
  23. package/dist/components/electron-signatures/demoComponents/detail.d.ts +6 -0
  24. package/dist/components/electron-signatures/demoComponents/detail.js +283 -0
  25. package/dist/components/electron-signatures/demoComponents/index.d.ts +2 -0
  26. package/dist/components/electron-signatures/demoComponents/index.js +27 -0
  27. package/dist/components/electron-signatures/demoComponents/index_old.d.ts +3 -0
  28. package/dist/components/electron-signatures/demoComponents/index_old.js +502 -0
  29. package/dist/components/electron-signatures/demoComponents/jgqrd.d.ts +6 -0
  30. package/dist/components/electron-signatures/demoComponents/jgqrd.js +135 -0
  31. package/dist/components/electron-signatures/demoComponents/making.d.ts +6 -0
  32. package/dist/components/electron-signatures/demoComponents/making.js +211 -0
  33. package/dist/components/electron-signatures/demoComponents/makingData.d.ts +663 -0
  34. package/dist/components/electron-signatures/demoComponents/makingData.js +1164 -0
  35. package/dist/components/electron-signatures/demoComponents/newDetail.d.ts +6 -0
  36. package/dist/components/electron-signatures/demoComponents/newDetail.js +283 -0
  37. package/dist/components/electron-signatures/demoComponents/preview.d.ts +3 -0
  38. package/dist/components/electron-signatures/demoComponents/preview.js +9 -0
  39. package/dist/components/electron-signatures/demoComponents/singleQjDetail.d.ts +6 -0
  40. package/dist/components/electron-signatures/demoComponents/singleQjDetail.js +530 -0
  41. package/dist/components/electron-signatures/demoComponents/singleQjMaking.d.ts +6 -0
  42. package/dist/components/electron-signatures/demoComponents/singleQjMaking.js +219 -0
  43. package/dist/components/electron-signatures/demoComponents/test.d.ts +6 -0
  44. package/dist/components/electron-signatures/demoComponents/test.js +119 -0
  45. package/dist/components/electron-signatures/dgComponents/contract-comparison.d.ts +39 -0
  46. package/dist/components/electron-signatures/dgComponents/contract-comparison.js +53 -0
  47. package/dist/components/electron-signatures/dgComponents/file-comparison-btn.d.ts +11 -0
  48. package/dist/components/electron-signatures/dgComponents/file-comparison-btn.js +180 -0
  49. package/dist/components/electron-signatures/dgComponents/new-contract-comparison.d.ts +45 -0
  50. package/dist/components/electron-signatures/dgComponents/new-contract-comparison.js +68 -0
  51. package/dist/components/electron-signatures/dgComponents/useContractColumns.d.ts +21 -0
  52. package/dist/components/electron-signatures/dgComponents/useContractColumns.js +171 -0
  53. package/dist/components/electron-signatures/electron-signatures-fragment.d.ts +8 -0
  54. package/dist/components/electron-signatures/electron-signatures-fragment.js +344 -0
  55. package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.d.ts +52 -0
  56. package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.js +513 -0
  57. package/dist/components/electron-signatures/electronComponents/electron-seal-detail.d.ts +8 -0
  58. package/dist/components/electron-signatures/electronComponents/electron-seal-detail.js +59 -0
  59. package/dist/components/electron-signatures/electronComponents/electron-seal-download.d.ts +16 -0
  60. package/dist/components/electron-signatures/electronComponents/electron-seal-download.js +89 -0
  61. package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.d.ts +9 -0
  62. package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.js +16 -0
  63. package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.d.ts +15 -0
  64. package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.js +16 -0
  65. package/dist/components/electron-signatures/electronComponents/electron-seal-item.d.ts +20 -0
  66. package/dist/components/electron-signatures/electronComponents/electron-seal-item.js +47 -0
  67. package/dist/components/electron-signatures/electronComponents/electron-seal-list.d.ts +11 -0
  68. package/dist/components/electron-signatures/electronComponents/electron-seal-list.js +191 -0
  69. package/dist/components/electron-signatures/electronComponents/electron-seal-setting.d.ts +15 -0
  70. package/dist/components/electron-signatures/electronComponents/electron-seal-setting.js +10 -0
  71. package/dist/components/electron-signatures/electronComponents/last-qys-modal.d.ts +7 -0
  72. package/dist/components/electron-signatures/electronComponents/last-qys-modal.js +42 -0
  73. package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.d.ts +3 -0
  74. package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.js +45 -0
  75. package/dist/components/electron-signatures/electronComponents/useElectronColumns.d.ts +30 -0
  76. package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +380 -0
  77. package/dist/components/electron-signatures/electronComponents/useFetchElectronData.d.ts +20 -0
  78. package/dist/components/electron-signatures/electronComponents/useFetchElectronData.js +169 -0
  79. package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.d.ts +3 -0
  80. package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.js +38 -0
  81. package/dist/components/electron-signatures/fileComponents/file-operation.d.ts +7 -0
  82. package/dist/components/electron-signatures/fileComponents/file-operation.js +67 -0
  83. package/dist/components/electron-signatures/fileComponents/file-type-select.d.ts +12 -0
  84. package/dist/components/electron-signatures/fileComponents/file-type-select.js +10 -0
  85. package/dist/components/electron-signatures/fileComponents/file-upload.d.ts +11 -0
  86. package/dist/components/electron-signatures/fileComponents/file-upload.js +146 -0
  87. package/dist/components/electron-signatures/fileComponents/fileUtils.d.ts +17 -0
  88. package/dist/components/electron-signatures/fileComponents/fileUtils.js +36 -0
  89. package/dist/components/electron-signatures/fileComponents/new-file-operation.d.ts +10 -0
  90. package/dist/components/electron-signatures/fileComponents/new-file-operation.js +73 -0
  91. package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.d.ts +13 -0
  92. package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.js +45 -0
  93. package/dist/components/electron-signatures/fileComponents/useFileColumns.d.ts +38 -0
  94. package/dist/components/electron-signatures/fileComponents/useFileColumns.js +329 -0
  95. package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.d.ts +19 -0
  96. package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.js +72 -0
  97. package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.d.ts +30 -0
  98. package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.js +134 -0
  99. package/dist/components/electron-signatures/hooks/useMergeRecords.d.ts +17 -0
  100. package/dist/components/electron-signatures/hooks/useMergeRecords.js +49 -0
  101. package/dist/components/electron-signatures/hooks/useParseElectronListData.d.ts +49 -0
  102. package/dist/components/electron-signatures/hooks/useParseElectronListData.js +111 -0
  103. package/dist/components/electron-signatures/hooks/useParseElectronSetting.d.ts +102 -0
  104. package/dist/components/electron-signatures/hooks/useParseElectronSetting.js +365 -0
  105. package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.d.ts +40 -0
  106. package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.js +139 -0
  107. package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.d.ts +36 -0
  108. package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.js +48 -0
  109. package/dist/components/electron-signatures/hooks/useParseQunjListData.d.ts +56 -0
  110. package/dist/components/electron-signatures/hooks/useParseQunjListData.js +204 -0
  111. package/dist/components/electron-signatures/hooks/useParseQunjSingleData.d.ts +34 -0
  112. package/dist/components/electron-signatures/hooks/useParseQunjSingleData.js +110 -0
  113. package/dist/components/electron-signatures/hooks/useParseRecords.d.ts +65 -0
  114. package/dist/components/electron-signatures/hooks/useParseRecords.js +165 -0
  115. package/dist/components/electron-signatures/index.d.ts +13 -0
  116. package/dist/components/electron-signatures/index.js +54 -0
  117. package/dist/components/electron-signatures/index_old.d.ts +9 -0
  118. package/dist/components/electron-signatures/index_old.js +966 -0
  119. package/dist/components/electron-signatures/interface.d.ts +849 -0
  120. package/dist/components/electron-signatures/interface.js +57 -0
  121. package/dist/components/electron-signatures/qunjComponents/qunj-apply.d.ts +6 -0
  122. package/dist/components/electron-signatures/qunjComponents/qunj-apply.js +8 -0
  123. package/dist/components/electron-signatures/qunjComponents/qunj-check.d.ts +21 -0
  124. package/dist/components/electron-signatures/qunjComponents/qunj-check.js +41 -0
  125. package/dist/components/electron-signatures/qunjComponents/qunj-detail.d.ts +35 -0
  126. package/dist/components/electron-signatures/qunjComponents/qunj-detail.js +267 -0
  127. package/dist/components/electron-signatures/qunjComponents/qunj-list.d.ts +24 -0
  128. package/dist/components/electron-signatures/qunjComponents/qunj-list.js +346 -0
  129. package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.d.ts +20 -0
  130. package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.js +63 -0
  131. package/dist/components/electron-signatures/qunjComponents/useQunjColumns.d.ts +36 -0
  132. package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +321 -0
  133. package/dist/components/electron-signatures/translateComponents/TranslateButton.d.ts +10 -0
  134. package/dist/components/electron-signatures/translateComponents/TranslateButton.js +44 -0
  135. package/dist/components/electron-signatures/translateComponents/useTranslateCom.d.ts +22 -0
  136. package/dist/components/electron-signatures/translateComponents/useTranslateCom.js +50 -0
  137. package/dist/components/electron-signatures/utils.d.ts +26 -0
  138. package/dist/components/electron-signatures/utils.js +67 -0
  139. package/dist/components/utils/ZtxkContext.d.ts +16 -0
  140. package/dist/components/utils/ZtxkContext.js +4 -0
  141. package/dist/components/utils/useMemoizedFn.d.ts +6 -0
  142. package/dist/components/utils/useMemoizedFn.js +22 -0
  143. package/dist/components/utils/usePrevious.d.ts +3 -0
  144. package/dist/components/utils/usePrevious.js +13 -0
  145. package/dist/index.css +686 -0
  146. package/dist/index.css.map +1 -1
  147. package/dist/index.d.ts +3 -0
  148. package/dist/index.js +105 -87
  149. package/dist/request.js +1 -1
  150. package/package.json +4 -3
@@ -0,0 +1,1126 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ var __rest = (this && this.__rest) || function (s, e) {
49
+ var t = {};
50
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
+ t[p] = s[p];
52
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
+ t[p[i]] = s[p[i]];
56
+ }
57
+ return t;
58
+ };
59
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
60
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
61
+ to[j] = from[i];
62
+ return to;
63
+ };
64
+ import i18next from 'ztxkutils/dist/i18next';
65
+ import React, { memo, useMemo, useState, useImperativeHandle, useRef, useEffect, createContext, } from 'react';
66
+ import { Table } from 'antd';
67
+ import useBaseContext from '../utils/useBaseContext';
68
+ import { Modal, message, Button } from '../../index';
69
+ import ElectronSignaturesFragment from './electron-signatures-fragment';
70
+ import useMemoizedFn from '../utils/useMemoizedFn';
71
+ import useMergeRecords from './hooks/useMergeRecords';
72
+ // 附件相关
73
+ import useFileTypeColumns from './fileComponents/useFileTypeColumns';
74
+ import useFileColumns from './fileComponents/useFileColumns';
75
+ // 电子印章相关
76
+ import useElectronColumns from './electronComponents/useElectronColumns';
77
+ import ElectronSealBatchDownload from './electronComponents/electron-seal-batch-download';
78
+ import useCheckedSealInfoList from './electronComponents/useCheckedSealInfoList';
79
+ import LastQysModal from './electronComponents/last-qys-modal';
80
+ // 群杰相关
81
+ import useQunjColumns from './qunjComponents/useQunjColumns';
82
+ // 达观合同比对
83
+ import useContractColumns from './dgComponents/useContractColumns';
84
+ import FileComparisonBtn from './dgComponents/file-comparison-btn';
85
+ // 翻译组件
86
+ import useTranslateCom from './translateComponents/useTranslateCom';
87
+ import useDg from '../UploadCustom/hooks/useDg';
88
+ import { FLOW_IDS, currentRecordIsOnlyQunj } from './utils';
89
+ import { countIsValidate } from './hooks/useParseQunjListData';
90
+ import FileUpload from './fileComponents/file-upload';
91
+ import { DATA_TYPE_KEY } from './hooks/useParseRecords';
92
+ import useGetDeptInfo from './electronComponents/useGetDeptInfo';
93
+ import dayjs from 'dayjs';
94
+ import isEqual from 'lodash/isEqual';
95
+ import useGetQjVerifyCode from './hooks/useGetQjVerifyCode';
96
+ export var ElectronSignaturesContext = createContext({
97
+ isNewQys: true,
98
+ isQjVerifyCode: true,
99
+ });
100
+ /**
101
+ * 一开始这个组件想设计成 可以传入多中类型的数据 但是发现这种做法会有很多问题
102
+ * 不同的数据类型 共享一个表头 那么其实这样就做不到隐藏某些表头的效果
103
+ */
104
+ var ElectronSignatures = function (props) {
105
+ var _a, _b, _c;
106
+ var request = props.request, isTranslation = props.isTranslation, previewUrl = props.previewUrl, _d = props.isUnControlled, isUnControlled = _d === void 0 ? true : _d, _e = props.contractNumFlowIds, contractNumFlowIds = _e === void 0 ? FLOW_IDS : _e, fileUploadProps = props.fileUploadProps, isShowFileUpload = props.isShowFileUpload, isShowFileUploadIndependence = props.isShowFileUploadIndependence, otherOptions = props.otherOptions, _fileBaseUrl = props.fileBaseUrl, _apiBaseUrl = props.apiBaseUrl, electronHandleRef = props.electronHandleRef, _onValueChange = props.onValueChange, isValidateSuccess = props.isValidateSuccess, refreshCode = props.refreshCode, onCheckedComparison = props.onCheckedComparison, _onFileTypeChangeGetItem = props.onFileTypeChangeGetItem, tableScroll = props.tableScroll, _getCreateTimeHand = props.getCreateTimeHand, isShowElectronBatchBtn = props.isShowElectronBatchBtn, isShowDownloadBatchBtn = props.isShowDownloadBatchBtn, isShowBatchDeleteBtn = props.isShowBatchDeleteBtn, isShowBatchDeleteBtnIndependence = props.isShowBatchDeleteBtnIndependence, beforeBatchDelete = props.beforeBatchDelete, isShowBatchPreviewBtn = props.isShowBatchPreviewBtn, isShowFileComparisonBtn = props.isShowFileComparisonBtn, batchDownloadZipName = props.batchDownloadZipName, isShowDoubleSignedBatchBtn = props.isShowDoubleSignedBatchBtn, _f = props.isShowFileType, isShowFileType = _f === void 0 ? true : _f, _g = props.isShowFileTypeMerge, isShowFileTypeMerge = _g === void 0 ? true : _g,
107
+ // fmsIsElectronicSealLabel = '产业链综合服务平台-客户电子签章',
108
+ _h = props.fmsIsElectronicSealLabel,
109
+ // fmsIsElectronicSealLabel = '产业链综合服务平台-客户电子签章',
110
+ fmsIsElectronicSealLabel = _h === void 0 ? i18next.t('加盖产融章') : _h,
111
+ // fmsIsElectronicSealPushLabel = '推送银行',
112
+ _j = props.fmsIsElectronicSealPushLabel,
113
+ // fmsIsElectronicSealPushLabel = '推送银行',
114
+ fmsIsElectronicSealPushLabel = _j === void 0 ? i18next.t('加盖银行签章') : _j, _k = props.openingContractSealLabel, openingContractSealLabel = _k === void 0 ? i18next.t('盖光盈电子章') : _k, isSingleQj = props.isSingleQj, _l = props.isQjUseModal, isQjUseModal = _l === void 0 ? true : _l, defaultJustNeedQj = props.defaultJustNeedQj, isDeleteAllFileWhenJustUseQj = props.isDeleteAllFileWhenJustUseQj, _m = props.isShowQysWhenNeedNotQys, isShowQysWhenNeedNotQys = _m === void 0 ? true : _m, _o = props.isControlNeedQys, isControlNeedQys = _o === void 0 ? true : _o, isDeletePlaceholderFileData = props.isDeletePlaceholderFileData, isSupportNoAttachQj = props.isSupportNoAttachQj, caseId = props.caseId, _p = props.isChoiseChangeTemplateValid, isChoiseChangeTemplateValid = _p === void 0 ? true : _p, _q = props.isToggleQys, isToggleQys = _q === void 0 ? false : _q, _r = props.isQjVerifyCode, isQjVerifyCode = _r === void 0 ? false : _r, _s = props.isNewQys, isNewQys = _s === void 0 ? false : _s, isNewElectronSealStyle = props.isNewElectronSealStyle, isNewQunjSealStyle = props.isNewQunjSealStyle, _t = props.isShowBatchUseElectronicSealBtn, isShowBatchUseElectronicSealBtn = _t === void 0 ? true : _t, isShowBatchUseOpeningContractSealBtn = props.isShowBatchUseOpeningContractSealBtn, isShowOpeningContractSeal = props.isShowOpeningContractSeal, customButtons = props.customButtons, goWorkflowSeal = props.goWorkflowSeal, isShowSealApply = props.isShowSealApply, otherColumns = props.otherColumns, isShowOpeningContractSealNotRelyQys = props.isShowOpeningContractSealNotRelyQys, isNoWatermarkProcess = props.isNoWatermarkProcess, qunjListRenderFilter = props.qunjListRenderFilter, sealDownloadFlowStatus = props.sealDownloadFlowStatus, resetProps = __rest(props, ["request", "isTranslation", "previewUrl", "isUnControlled", "contractNumFlowIds", "fileUploadProps", "isShowFileUpload", "isShowFileUploadIndependence", "otherOptions", "fileBaseUrl", "apiBaseUrl", "electronHandleRef", "onValueChange", "isValidateSuccess", "refreshCode", "onCheckedComparison", "onFileTypeChangeGetItem", "tableScroll", "getCreateTimeHand", "isShowElectronBatchBtn", "isShowDownloadBatchBtn", "isShowBatchDeleteBtn", "isShowBatchDeleteBtnIndependence", "beforeBatchDelete", "isShowBatchPreviewBtn", "isShowFileComparisonBtn", "batchDownloadZipName", "isShowDoubleSignedBatchBtn", "isShowFileType", "isShowFileTypeMerge", "fmsIsElectronicSealLabel", "fmsIsElectronicSealPushLabel", "openingContractSealLabel", "isSingleQj", "isQjUseModal", "defaultJustNeedQj", "isDeleteAllFileWhenJustUseQj", "isShowQysWhenNeedNotQys", "isControlNeedQys", "isDeletePlaceholderFileData", "isSupportNoAttachQj", "caseId", "isChoiseChangeTemplateValid", "isToggleQys", "isQjVerifyCode", "isNewQys", "isNewElectronSealStyle", "isNewQunjSealStyle", "isShowBatchUseElectronicSealBtn", "isShowBatchUseOpeningContractSealBtn", "isShowOpeningContractSeal", "customButtons", "goWorkflowSeal", "isShowSealApply", "otherColumns", "isShowOpeningContractSealNotRelyQys", "isNoWatermarkProcess", "qunjListRenderFilter", "sealDownloadFlowStatus"]);
115
+ var selectRows = useRef(null);
116
+ // 批量更新时用于合并 onValueChange 调用,避免多次触发外部回调
117
+ var batchUpdateRef = useRef({
118
+ active: false,
119
+ data: {},
120
+ });
121
+ var onValueChange = useMemoizedFn(function (info) {
122
+ if (batchUpdateRef.current.active) {
123
+ // 批量模式:合并数据,延迟通知外部
124
+ Object.keys(info).forEach(function (key) {
125
+ batchUpdateRef.current.data[key] = __assign(__assign({}, batchUpdateRef.current.data[key]), info[key]);
126
+ });
127
+ return;
128
+ }
129
+ _onValueChange && _onValueChange(info);
130
+ });
131
+ /**
132
+ * 批量执行操作,期间的所有 onValueChange 调用会合并为一次外部通知。
133
+ * 适用于批量删除等会触发多次 onValueChange 的场景。
134
+ */
135
+ var batchOnValueChange = useMemoizedFn(function (fn) {
136
+ batchUpdateRef.current = { active: true, data: {} };
137
+ fn();
138
+ var batchedData = batchUpdateRef.current.data;
139
+ batchUpdateRef.current = { active: false, data: {} };
140
+ if (Object.keys(batchedData).length > 0) {
141
+ _onValueChange && _onValueChange(batchedData);
142
+ }
143
+ });
144
+ var onFileTypeChangeGetItem = useMemoizedFn(function (info) {
145
+ if (_onFileTypeChangeGetItem) {
146
+ return _onFileTypeChangeGetItem(info);
147
+ }
148
+ return __assign(__assign({}, info), { templateAttachId: undefined, templateAttachName: undefined, taskId: undefined });
149
+ });
150
+ var getCreateTimeHand = useMemoizedFn(function (record) {
151
+ // 这里方法有点问题做了下替换。后续看是否有问题
152
+ if (_getCreateTimeHand) {
153
+ return _getCreateTimeHand(record);
154
+ }
155
+ return record.createTime;
156
+ });
157
+ // 验证契约锁是否全部盖章
158
+ var getNoSealInfoList = useCheckedSealInfoList(request).getNoSealInfoList;
159
+ // 获得部门信息
160
+ var getDeptInfo = useGetDeptInfo(request).getDeptInfo;
161
+ // 达观操作
162
+ var _u = useDg(request), compareHandle = _u.compareHandle, lookCompareHandle = _u.lookCompareHandle;
163
+ // 存储当前点击的选择比对模板的一些参数
164
+ var dgInfoRef = useRef({});
165
+ var myCompareHandle = useMemoizedFn(function (templateId) {
166
+ return new Promise(function (resolve, reject) {
167
+ var _a = dgInfoRef.current, realIndex = _a.realIndex, attachId = _a.attachId, setRecords = _a.setRecords;
168
+ if (templateId && attachId) {
169
+ compareHandle(templateId, attachId)
170
+ .then(function (res) {
171
+ var _a, _b, _c;
172
+ if ((_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.taskId) {
173
+ setRecords(function (preRecords) {
174
+ var _a;
175
+ var copyRecords = preRecords.slice();
176
+ var item = copyRecords[realIndex];
177
+ copyRecords.splice(realIndex, 1, __assign(__assign({}, item), { taskId: (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.taskId }));
178
+ return copyRecords;
179
+ });
180
+ resolve((_c = res.data.data) === null || _c === void 0 ? void 0 : _c.taskId);
181
+ }
182
+ else {
183
+ reject(i18next.t('调用合同比对接口失败'));
184
+ }
185
+ })
186
+ .catch(function (err) {
187
+ reject(err || i18next.t('调用合同比对接口失败'));
188
+ });
189
+ }
190
+ });
191
+ });
192
+ // 基础地址
193
+ var _v = useBaseContext(), API_BASE_URL = _v.apiBaseUrl, FILE_BASE_URL = _v.fileBaseUrl;
194
+ var apiBaseUrl = _apiBaseUrl || API_BASE_URL;
195
+ var fileBaseUrl = _fileBaseUrl || FILE_BASE_URL;
196
+ // 将配置分级处理
197
+ var allOptions = [];
198
+ // 有些流程可能会没有部门id,只有二级单元id。把他们两个作为一个或条件
199
+ // 对于那些没有传入部门数据和流程数据的参数统统干掉
200
+ // 这样会导致一个bug。那就是首次加载的时候,可能没有数据。但是后续又通过接口拿到了数据。
201
+ // 这里之前是不会有部门、流程的限制的。是因为用印流程他实际也是用了多个类型的附件,但是实际上
202
+ // 他不会有多个类型的附件。会导致多一个空行出来
203
+ if (Array.isArray(otherOptions)) {
204
+ var newOtherOptions = otherOptions.filter(function (item) {
205
+ return (item.deptId || item.secondDepId) && item.flowId ? true : false;
206
+ });
207
+ allOptions = __spreadArray([resetProps], newOtherOptions);
208
+ }
209
+ else if (otherOptions &&
210
+ ((otherOptions === null || otherOptions === void 0 ? void 0 : otherOptions.deptId) || (otherOptions === null || otherOptions === void 0 ? void 0 : otherOptions.secondDepId)) &&
211
+ (otherOptions === null || otherOptions === void 0 ? void 0 : otherOptions.flowId)) {
212
+ allOptions = [resetProps, otherOptions];
213
+ }
214
+ else {
215
+ allOptions = [resetProps];
216
+ }
217
+ // 根据收集到的流程id、权限人id列表,来判断是否请求群杰验证码数据
218
+ var _w = useGetQjVerifyCode({
219
+ allOptions: allOptions,
220
+ request: request,
221
+ isNewQys: isNewQys,
222
+ }), qjVerifyCodeData = _w.qjVerifyCodeData, getQjVerifyCodeHandle = _w.getQjVerifyCodeHandle;
223
+ /**
224
+ * 当前是否是编辑状态
225
+ */
226
+ var currentIsEditMemo = useMemo(function () {
227
+ return ((resetProps === null || resetProps === void 0 ? void 0 : resetProps.canEdit) + '' === '1' || (resetProps === null || resetProps === void 0 ? void 0 : resetProps.canEdit) === true);
228
+ }, [resetProps.canEdit]);
229
+ // 表格是否处于loading中
230
+ var _x = useState(), loading = _x[0], setLoading = _x[1];
231
+ // 当前是否处于仅需要群杰印章的状态
232
+ var _y = useState(defaultJustNeedQj || false), justNeedQj = _y[0], setJustNeedQj = _y[1];
233
+ var _z = useState(''), organizationId = _z[0], setOrganizationId = _z[1];
234
+ /**
235
+ * 通过部门Id获得公司id
236
+ */
237
+ useEffect(function () {
238
+ var _deptId = resetProps.deptId;
239
+ // HR流程是行政组织,没有公司这一个概念
240
+ if (_deptId && !isNoWatermarkProcess) {
241
+ // 调用接口
242
+ getDeptInfo({
243
+ id: _deptId,
244
+ }).then(function (res) {
245
+ setOrganizationId((res === null || res === void 0 ? void 0 : res.companyId) || '');
246
+ });
247
+ }
248
+ // eslint-disable-next-line react-hooks/exhaustive-deps
249
+ }, [resetProps.deptId, isNoWatermarkProcess]);
250
+ useEffect(function () {
251
+ setJustNeedQj(defaultJustNeedQj || false);
252
+ }, [defaultJustNeedQj]);
253
+ // 记录下传入配置的顺序
254
+ // 这里做一下改造,将dataTypeSort作为一个动态变化的值来控制
255
+ var dataTypeString = (_c = (_b = (_a = allOptions === null || allOptions === void 0 ? void 0 : allOptions.map) === null || _a === void 0 ? void 0 : _a.call(allOptions, function (option, index) {
256
+ var dataType = option.dataType;
257
+ return dataType || "" + index;
258
+ })) === null || _b === void 0 ? void 0 : _b.join) === null || _c === void 0 ? void 0 : _c.call(_b, ',');
259
+ var dataTypeSort = useMemo(function () {
260
+ return allOptions.map(function (option, index) {
261
+ var dataType = option.dataType;
262
+ return dataType || "" + index;
263
+ });
264
+ // eslint-disable-next-line react-hooks/exhaustive-deps
265
+ }, [dataTypeString]);
266
+ // const [dataTypeSort] = useState<string[]>(() => {
267
+ // return allOptions.map((option, index) => {
268
+ // const { dataType } = option;
269
+ // return dataType || `${index}`;
270
+ // });
271
+ // });
272
+ // 第一份数据的数据类型
273
+ var firstDataType = resetProps.dataType || dataTypeSort[0];
274
+ // 记录下需要处理的所有数据
275
+ // TODO: 定义allData 类型
276
+ var _0 = useState({}), allData = _0[0], setAllData = _0[1];
277
+ // 收集修改数据
278
+ var onTrackChange = useMemoizedFn(function (dataType, data) {
279
+ setAllData(function (preAllData) {
280
+ var _a, _b;
281
+ if (preAllData[dataType]) {
282
+ var changeData = preAllData[dataType];
283
+ return __assign(__assign({}, preAllData), (_a = {}, _a[dataType] = __assign(__assign({}, changeData), data), _a));
284
+ }
285
+ return __assign(__assign({}, preAllData), (_b = {}, _b[dataType] = data, _b));
286
+ });
287
+ });
288
+ // 合并数据(数据最终还是要在一个表格中显示)
289
+ var _1 = useMergeRecords({
290
+ allData: allData,
291
+ dataTypeSort: dataTypeSort,
292
+ isDeleteAllFileWhenJustUseQj: isDeleteAllFileWhenJustUseQj,
293
+ isDeletePlaceholderFileData: isDeletePlaceholderFileData,
294
+ isSupportNoAttachQj: isSupportNoAttachQj,
295
+ }), mergeRecords = _1.mergeRecords, isHiddenColumns = _1.isHiddenColumns;
296
+ // 附件归属
297
+ var fileTypeColumns = useFileTypeColumns({
298
+ records: mergeRecords,
299
+ dataTypeSort: dataTypeSort,
300
+ allData: allData,
301
+ fileUploadProps: fileUploadProps,
302
+ isShowFileUpload: isShowFileUpload,
303
+ apiBaseUrl: apiBaseUrl,
304
+ }).fileTypeColumns;
305
+ // 是否需要显示达观配置
306
+ var isNeedDg = allOptions === null || allOptions === void 0 ? void 0 : allOptions.find(function (item) { return item.needDg + '' === '1'; });
307
+ // 附件相关
308
+ var fileColumns = useFileColumns({
309
+ records: mergeRecords,
310
+ dataTypeSort: dataTypeSort,
311
+ allData: allData,
312
+ fileUploadProps: fileUploadProps,
313
+ isShowFileUpload: isShowFileUpload,
314
+ apiBaseUrl: apiBaseUrl,
315
+ fileBaseUrl: fileBaseUrl,
316
+ firstDataType: firstDataType,
317
+ onValueChange: onValueChange,
318
+ onFileTypeChangeGetItem: onFileTypeChangeGetItem,
319
+ getCreateTimeHand: getCreateTimeHand,
320
+ isSingleQj: isSingleQj,
321
+ justNeedQj: justNeedQj,
322
+ setJustNeedQj: setJustNeedQj,
323
+ isShowFileType: isShowFileType,
324
+ currentIsEditMemo: currentIsEditMemo,
325
+ isDeleteAllFileWhenJustUseQj: isDeleteAllFileWhenJustUseQj,
326
+ isControlNeedQys: isControlNeedQys,
327
+ organizationId: organizationId,
328
+ onFileReplace: onFileReplace,
329
+ isToggleQys: isToggleQys,
330
+ previewUrl: previewUrl,
331
+ request: request,
332
+ isTranslation: isTranslation,
333
+ isNeedDg: !!isNeedDg,
334
+ }).fileColumns;
335
+ // 智能合同比对
336
+ var contractColumns = useContractColumns({
337
+ records: mergeRecords,
338
+ dataTypeSort: dataTypeSort,
339
+ allData: allData,
340
+ lookCompareHandle: lookCompareHandle,
341
+ dgInfoRef: dgInfoRef,
342
+ myCompareHandle: myCompareHandle,
343
+ onCheckedComparison: onCheckedComparison,
344
+ request: request,
345
+ previewUrl: previewUrl,
346
+ isTranslation: isTranslation,
347
+ }).contractColumns;
348
+ // 生成电子印章列数据
349
+ var electronColumns = useElectronColumns({
350
+ request: request,
351
+ records: mergeRecords,
352
+ dataTypeSort: dataTypeSort,
353
+ allData: allData,
354
+ setLoading: setLoading,
355
+ fmsIsElectronicSealLabel: fmsIsElectronicSealLabel,
356
+ fmsIsElectronicSealPushLabel: fmsIsElectronicSealPushLabel,
357
+ openingContractSealLabel: openingContractSealLabel,
358
+ isDeleteAllFileWhenJustUseQj: isDeleteAllFileWhenJustUseQj,
359
+ isShowOpeningContractSeal: isShowOpeningContractSeal,
360
+ isShowOpeningContractSealNotRelyQys: isShowOpeningContractSealNotRelyQys,
361
+ }).electronColumns;
362
+ // 生成群杰物理章列数据
363
+ var qunjColumns = useQunjColumns({
364
+ request: request,
365
+ records: mergeRecords,
366
+ dataTypeSort: dataTypeSort,
367
+ allData: allData,
368
+ setLoading: setLoading,
369
+ contractNumFlowIds: contractNumFlowIds,
370
+ refreshCode: refreshCode,
371
+ isSingleQj: isSingleQj,
372
+ isQjUseModal: isQjUseModal,
373
+ apiBaseUrl: apiBaseUrl,
374
+ caseId: caseId,
375
+ qjVerifyCodeData: qjVerifyCodeData,
376
+ getQjVerifyCodeHandle: getQjVerifyCodeHandle,
377
+ isShowSealApply: isShowSealApply,
378
+ goWorkflowSeal: goWorkflowSeal,
379
+ qunjListRenderFilter: qunjListRenderFilter,
380
+ }).qunjColumns;
381
+ // 翻译组件
382
+ var translateColumns = useTranslateCom({
383
+ request: request,
384
+ records: mergeRecords,
385
+ dataTypeSort: dataTypeSort,
386
+ allData: allData,
387
+ isTranslation: isTranslation,
388
+ previewUrl: previewUrl,
389
+ }).translateColumns;
390
+ // 组装columns
391
+ var columns = [
392
+ {
393
+ title: i18next.t('序号'),
394
+ dataIndex: 'index',
395
+ key: 'index',
396
+ width: 50,
397
+ align: 'center',
398
+ render: function (text, record, index) { return "" + (index + 1); },
399
+ },
400
+ ];
401
+ // 附件归属类型
402
+ if (isShowFileTypeMerge) {
403
+ columns.push.apply(columns, fileTypeColumns);
404
+ }
405
+ // 附件相关操作
406
+ columns.push.apply(columns, fileColumns);
407
+ // 其他配置
408
+ if (otherColumns) {
409
+ columns.push.apply(columns, otherColumns);
410
+ }
411
+ // 智能合同比对 如果不需要达观 那么肯定不显示
412
+ // 如果设置了 仅需要群杰印章 并且另外一个没有附件
413
+ if (isNeedDg && !isHiddenColumns) {
414
+ columns.push.apply(columns, contractColumns);
415
+ }
416
+ else if (isTranslation) {
417
+ columns.push.apply(columns, translateColumns);
418
+ }
419
+ // 是否需要电子印章配置
420
+ var isNeedQys = allOptions === null || allOptions === void 0 ? void 0 : allOptions.find(function (item) { return item.needQys + '' === '1'; });
421
+ // 是否有选盖章的附件
422
+ var isShowQys = allOptions === null || allOptions === void 0 ? void 0 : allOptions.find(function (item) { var _a, _b; return (_b = (_a = item.fileList) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, function (file) { return (file === null || file === void 0 ? void 0 : file.isElectronicSeal) + '' === '1'; }); });
423
+ // 电子印章
424
+ if ((isNeedQys && !isHiddenColumns) || isShowQysWhenNeedNotQys) {
425
+ // 非编辑状态 并且没有印章
426
+ if (allOptions[0].canEdit + '' === '1') {
427
+ columns.push.apply(columns, electronColumns);
428
+ }
429
+ else if (isShowQys) {
430
+ columns.push.apply(columns, electronColumns);
431
+ }
432
+ else if (isShowQysWhenNeedNotQys) {
433
+ columns.push.apply(columns, electronColumns);
434
+ }
435
+ }
436
+ // 是否需要群杰印章配置
437
+ var isNeedQj = allOptions === null || allOptions === void 0 ? void 0 : allOptions.find(function (item) { return item.needQj + '' === '1'; });
438
+ // 群杰印章
439
+ if (isNeedQj) {
440
+ columns.push.apply(columns, qunjColumns);
441
+ }
442
+ var getAllData = useMemoizedFn(function () {
443
+ var resultData = {};
444
+ Object.keys(allData).forEach(function (key) {
445
+ var _a, _b, _c, _d;
446
+ var data = allData[key];
447
+ var records = data.records || [];
448
+ // 是否 过滤掉无用的附件数据 20241014
449
+ var newRecords = isDeletePlaceholderFileData
450
+ ? records.filter(function (record) { return !currentRecordIsOnlyQunj(record); })
451
+ : records.slice();
452
+ resultData[key] = {
453
+ fileList: newRecords,
454
+ qunjSeal: data.currentQunjSeal,
455
+ electronicSealIdList: data.currentCheckedElectronicSealIdList,
456
+ docAttachMap: data.currentDocAttachMap,
457
+ documentIdList: data.currentDocumentIdList,
458
+ contractId: data.currentContractId,
459
+ /** 用印次数是否合理 */
460
+ isTotalSealNumTooMore: countIsValidate(data.currentQunjSeal, false),
461
+ /** 群杰盖章地点 */
462
+ qunjAddress:
463
+ // 选了章子
464
+ ((_a = data.currentQunjSeal) === null || _a === void 0 ? void 0 : _a.details) &&
465
+ ((_c = (_b = data.currentQunjSeal) === null || _b === void 0 ? void 0 : _b.details) === null || _c === void 0 ? void 0 : _c.length) > 0 &&
466
+ // 并且是外部用印
467
+ ((_d = data.currentQunjSeal) === null || _d === void 0 ? void 0 : _d.isTakeOut) + '' === '1'
468
+ ? data.currentQunjAddress
469
+ : null,
470
+ needQys: data.needQys ? 1 : 0,
471
+ };
472
+ });
473
+ return resultData;
474
+ });
475
+ var modalHandleRef = useRef({});
476
+ // 当前未盖章的印章
477
+ var currentUnSealListRef = useRef({});
478
+ var isClickElectronSureRef = useRef(false);
479
+ useImperativeHandle(electronHandleRef, function () {
480
+ return {
481
+ /** 外部调用此方法时,需要传入合同模板ID */
482
+ compareHandle: myCompareHandle,
483
+ /** 获取所有数据 */
484
+ getAllData: function () {
485
+ return getAllData();
486
+ },
487
+ /** 验证组件是否通过校验 */
488
+ validateElectronTable: function (validateInfo) { return __awaiter(void 0, void 0, void 0, function () {
489
+ var validateAttachType, resultData, submitData, currentData, _a, _b, isQunjKey, _c, qunjSealKey, fileList, hasElectronicSeal, electronicSealFileList, hasQunj, electronicSealIdList, docAttachMap, qunjSeal, contractId, isContranctNum, isEdit, needDg, needQys, needQj, preElectronicSealIdList, qunjChecked, isOnlyQj, isValidateAttachTypeIndex, msg, isValidateDgIndex, msg, isValidateAttachType, msg, msg, checkElectron, electronicSealedFileList_1, isMoreQunjCountIndex, msg, isMoreQunjCount, msg, isCheckTakeOutNoAddress, isCheckTakeOutNoAddressIndex, msg, msg, msg, hasNoWritContranctNum, msg, hasNoCheckedQjSeal, msg, noNumSealName_1, hasNoNumCheckedQjSeal, msg, msg, electronList, selectedSealIds_1, _i, electronList_1, seal, requiredIds, hasMatch, msg;
490
+ var _d, _e, _f, _g, _h, _j, _k;
491
+ return __generator(this, function (_l) {
492
+ validateAttachType = (validateInfo || {}).validateAttachType;
493
+ resultData = getAllData();
494
+ submitData = resultData[firstDataType];
495
+ currentData = allData[firstDataType];
496
+ _a = ((_d = currentData.fileFieldsNameRef) === null || _d === void 0 ? void 0 : _d.current) || {}, _b = _a.isQunj, isQunjKey = _b === void 0 ? 'isQunj' : _b, _c = _a.qunjSeal, qunjSealKey = _c === void 0 ? 'qunjSeal' : _c;
497
+ fileList = submitData.fileList;
498
+ hasElectronicSeal = fileList === null || fileList === void 0 ? void 0 : fileList.some(function (item) { return !!item.isElectronicSeal; });
499
+ electronicSealFileList = (_g = (_f = (_e = fileList === null || fileList === void 0 ? void 0 : fileList.filter) === null || _e === void 0 ? void 0 : _e.call(fileList, function (item) { return !!item.isElectronicSeal; })) === null || _f === void 0 ? void 0 : _f.map) === null || _g === void 0 ? void 0 : _g.call(_f, function (item) { return item.attachId; });
500
+ hasQunj = fileList === null || fileList === void 0 ? void 0 : fileList.some(function (item) { return !!(item === null || item === void 0 ? void 0 : item[isQunjKey]); });
501
+ electronicSealIdList = submitData.electronicSealIdList || [];
502
+ docAttachMap = {};
503
+ try {
504
+ docAttachMap = submitData.docAttachMap
505
+ ? JSON.parse(submitData.docAttachMap)
506
+ : {};
507
+ }
508
+ catch (err) {
509
+ console.log(i18next.t('解析数据失败!!!!!'));
510
+ }
511
+ qunjSeal = submitData.qunjSeal;
512
+ contractId = submitData.contractId;
513
+ isContranctNum = currentData.isContranctNum;
514
+ isEdit = currentData.isEdit;
515
+ needDg = currentData.needDg;
516
+ needQys = currentData.needQys;
517
+ needQj = currentData.needQj;
518
+ preElectronicSealIdList = currentData === null || currentData === void 0 ? void 0 : currentData.clickElectronicSealIdList;
519
+ qunjChecked = currentData.qunjChecked;
520
+ isOnlyQj = fileList.length === 0;
521
+ // 0. 智能合同比对相关验证
522
+ if (isEdit && needDg) {
523
+ if (isChoiseChangeTemplateValid) {
524
+ isValidateAttachTypeIndex = fileList.findIndex(function (item) {
525
+ return (item.attachId &&
526
+ !item.templateAttachId &&
527
+ (validateAttachType
528
+ ? validateAttachType(item)
529
+ : item.attachType === '001'));
530
+ });
531
+ if (isValidateAttachTypeIndex !== -1) {
532
+ msg = i18next.t('第 {{slot0}} 行数据,附件类型为合同本身,需要挑选比对模板!', { slot0: isValidateAttachTypeIndex + 1 });
533
+ message.warning(msg);
534
+ return [2 /*return*/, Promise.reject(msg)];
535
+ }
536
+ }
537
+ isValidateDgIndex = fileList.findIndex(function (item) {
538
+ return (item.attachId &&
539
+ item.templateAttachId &&
540
+ !item.taskId &&
541
+ (validateAttachType
542
+ ? validateAttachType(item)
543
+ : item.attachType === '001'));
544
+ });
545
+ if (isValidateDgIndex !== -1) {
546
+ msg = i18next.t('第 {{slot0}} 行数据,没有生成任务id,请点击开始比对按钮!', { slot0: isValidateDgIndex + 1 });
547
+ message.warning(msg);
548
+ return [2 /*return*/, Promise.reject(msg)];
549
+ }
550
+ isValidateAttachType = fileList.findIndex(function (item) {
551
+ return !item.attachType;
552
+ });
553
+ if (resetProps.isAllowedPatchFileType &&
554
+ isValidateAttachType !== -1) {
555
+ msg = i18next.t('第 {{slot0}} 行数据,没有选择附件类型,请选择!', { slot0: isValidateAttachType + 1 });
556
+ message.warning(msg);
557
+ return [2 /*return*/, Promise.reject(msg)];
558
+ }
559
+ }
560
+ // 1. 指定盖章位置后,又修改了选中印章信息 并且本次一定手动指定了签署位置
561
+ if (isEdit &&
562
+ needQys &&
563
+ !isClickElectronSureRef.current &&
564
+ !isOnlyQj &&
565
+ preElectronicSealIdList &&
566
+ electronicSealIdList.length !== (preElectronicSealIdList === null || preElectronicSealIdList === void 0 ? void 0 : preElectronicSealIdList.length)) {
567
+ Modal.confirm({
568
+ title: i18next.t('当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?'),
569
+ okText: i18next.t('是'),
570
+ okType: 'danger',
571
+ cancelText: i18next.t('否'),
572
+ onOk: function () {
573
+ isClickElectronSureRef.current = true;
574
+ },
575
+ onCancel: function () {
576
+ isClickElectronSureRef.current = false;
577
+ },
578
+ });
579
+ return [2 /*return*/, Promise.reject(i18next.t('当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?'))];
580
+ }
581
+ // 2. 给附件勾选了加盖电子印章 但是未选择电子印章列表
582
+ if (isEdit &&
583
+ needQys &&
584
+ electronicSealIdList.length === 0 &&
585
+ hasElectronicSeal &&
586
+ !isOnlyQj) {
587
+ msg = i18next.t('请勾选加盖电子印章所需要的印章列表!');
588
+ message.warning(msg);
589
+ return [2 /*return*/, Promise.reject(msg)];
590
+ }
591
+ checkElectron = (_h = fileList === null || fileList === void 0 ? void 0 : fileList.find) === null || _h === void 0 ? void 0 : _h.call(fileList, function (item) { return !!(item === null || item === void 0 ? void 0 : item.isElectronicSeal); });
592
+ if (isEdit &&
593
+ needQys &&
594
+ contractId &&
595
+ docAttachMap &&
596
+ electronicSealFileList &&
597
+ checkElectron) {
598
+ electronicSealedFileList_1 = [];
599
+ Object.keys(docAttachMap).forEach(function (key) {
600
+ // const value = docAttachMap[key];
601
+ if (electronicSealFileList.find(function (attachId) { return attachId === key; }) ||
602
+ key !== 'needYjzrr') {
603
+ // 将当前合同下已经盖章的附件 添加到 已盖章附件列表中
604
+ electronicSealedFileList_1.push(key);
605
+ }
606
+ });
607
+ if (!isEqual(electronicSealFileList.sort(), electronicSealedFileList_1.sort())) {
608
+ message.warning(i18next.t('附件盖章信息有变动,请重新确认盖章信息'));
609
+ return [2 /*return*/, Promise.reject(i18next.t('附件盖章信息有变动,请重新确认盖章信息'))];
610
+ }
611
+ }
612
+ // 3. 群杰超过4倍 禁止提交审批
613
+ if (isEdit && needQj && isContranctNum) {
614
+ // 单附件都需要选群杰章 校验逻辑
615
+ if (isSingleQj && hasQunj) {
616
+ isMoreQunjCountIndex = fileList.findIndex(function (file) {
617
+ var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
618
+ // 如果没有勾选,不需要验证
619
+ if (!isQunj) {
620
+ return false;
621
+ }
622
+ var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
623
+ var isMoreQunjCount = countIsValidate(qunjSeal, false);
624
+ if (!isMoreQunjCount) {
625
+ return true;
626
+ }
627
+ return false;
628
+ });
629
+ if (isMoreQunjCountIndex !== -1) {
630
+ msg = i18next.t('第{{slot0}}行数据,您的群杰章用印次数远远超过合理次数范围,请修改。', { slot0: isMoreQunjCountIndex + 1 });
631
+ message.warning(msg);
632
+ return [2 /*return*/, Promise.reject(msg)];
633
+ }
634
+ }
635
+ // 整体盖群杰章校验逻辑
636
+ if (!isSingleQj) {
637
+ isMoreQunjCount = countIsValidate(qunjSeal, false);
638
+ if (!isMoreQunjCount) {
639
+ msg = i18next.t('您的群杰章用印次数远远超过合理次数范围,请修改。');
640
+ message.warning(msg);
641
+ return [2 /*return*/, Promise.reject(msg)];
642
+ }
643
+ }
644
+ }
645
+ isCheckTakeOutNoAddress = function (data) {
646
+ if (data &&
647
+ data.qunjSeal &&
648
+ data.qunjSeal.isTakeOut + '' === '1' &&
649
+ (!data.qunjAddress || data.qunjAddress.length === 0)) {
650
+ return true;
651
+ }
652
+ return false;
653
+ };
654
+ if (isEdit && needQj) {
655
+ // 对于那种每个附件都需要选择群杰用印的逻辑
656
+ if (isSingleQj) {
657
+ isCheckTakeOutNoAddressIndex = fileList.findIndex(function (file) {
658
+ var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
659
+ // 如果没有勾选,不需要验证
660
+ if (!isQunj) {
661
+ return false;
662
+ }
663
+ var isCheckTakeOutNoAddressResult = isCheckTakeOutNoAddress(file);
664
+ if (isCheckTakeOutNoAddressResult) {
665
+ return true;
666
+ }
667
+ return false;
668
+ });
669
+ if (isCheckTakeOutNoAddressIndex !== -1) {
670
+ msg = i18next.t('第{{slot0}}行数据,您的群杰章用选了外部用印,但是没有选择外部用印的地址!', { slot0: isCheckTakeOutNoAddressIndex + 1 });
671
+ message.warning(msg);
672
+ return [2 /*return*/, Promise.reject(msg)];
673
+ }
674
+ }
675
+ else if (isCheckTakeOutNoAddress(submitData)) {
676
+ msg = i18next.t('您的群杰印章选了外部用印,但是没有选择外部用印的地址!');
677
+ message.warning(msg);
678
+ return [2 /*return*/, Promise.reject(msg)];
679
+ }
680
+ }
681
+ // 4. 没有确认盖章
682
+ if (isEdit &&
683
+ needQys &&
684
+ hasElectronicSeal &&
685
+ !contractId &&
686
+ !isOnlyQj) {
687
+ msg = i18next.t('请点击指定签署位置按钮,指定签署位置后方可提交!');
688
+ message.warning(msg);
689
+ return [2 /*return*/, Promise.reject(msg)];
690
+ }
691
+ // 5. 合同份数验证
692
+ if (isEdit && needQj) {
693
+ // 单附件都需要选群杰章 校验逻辑
694
+ if (isSingleQj && hasQunj) {
695
+ // 合同份数校验
696
+ if (isContranctNum) {
697
+ hasNoWritContranctNum = fileList.findIndex(function (file) {
698
+ var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
699
+ // 如果没有勾选,不需要验证
700
+ if (!isQunj) {
701
+ return false;
702
+ }
703
+ var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
704
+ if (!qunjSeal.contranctNum) {
705
+ return true;
706
+ }
707
+ return false;
708
+ });
709
+ if (hasNoWritContranctNum !== -1) {
710
+ msg = i18next.t('第{{slot0}}行数据,没有填写群杰章合同份数。', { slot0: hasNoWritContranctNum + 1 });
711
+ message.warning(msg);
712
+ return [2 /*return*/, Promise.reject(msg)];
713
+ }
714
+ }
715
+ hasNoCheckedQjSeal = fileList.findIndex(function (file) {
716
+ var _a, _b;
717
+ var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
718
+ // 如果没有勾选,不需要验证
719
+ if (!isQunj) {
720
+ return false;
721
+ }
722
+ var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
723
+ if (!((_a = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) ||
724
+ ((_b = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _b === void 0 ? void 0 : _b.length) === 0) {
725
+ return true;
726
+ }
727
+ return false;
728
+ });
729
+ if (hasNoCheckedQjSeal !== -1) {
730
+ msg = i18next.t('第{{slot0}}行数据,勾选了盖群杰章,但是没有选择群杰印章', { slot0: hasNoCheckedQjSeal + 1 });
731
+ message.warning(msg);
732
+ return [2 /*return*/, Promise.reject(msg)];
733
+ }
734
+ noNumSealName_1 = '';
735
+ hasNoNumCheckedQjSeal = fileList.findIndex(function (file) {
736
+ var _a;
737
+ var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
738
+ // 如果没有勾选,不需要验证
739
+ if (!isQunj) {
740
+ return false;
741
+ }
742
+ var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
743
+ if (Array.isArray(qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) &&
744
+ ((_a = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) > 0) {
745
+ var noNumItem = qunjSeal.details.find(function (item) { return !item.sealCount; });
746
+ if (noNumItem) {
747
+ noNumSealName_1 = noNumItem.sealName;
748
+ return true;
749
+ }
750
+ }
751
+ return false;
752
+ });
753
+ if (hasNoNumCheckedQjSeal !== -1) {
754
+ msg = i18next.t('第{{slot0}}行数据,请检查是否选了印章,但是没填用印次数的印章。如:{{noNumSealName}}', {
755
+ slot0: hasNoNumCheckedQjSeal + 1,
756
+ noNumSealName: noNumSealName_1,
757
+ });
758
+ message.warning(msg);
759
+ return [2 /*return*/, Promise.reject(msg)];
760
+ }
761
+ }
762
+ // 整体盖群杰章校验逻辑
763
+ // 20250424 验证逻辑增加必须选择了群杰印章
764
+ if (!isSingleQj &&
765
+ qunjChecked &&
766
+ (qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) &&
767
+ ((_j = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _j === void 0 ? void 0 : _j.length) > 0) {
768
+ // 合同份数为空
769
+ if (isContranctNum && !qunjSeal.contranctNum) {
770
+ message.warning(i18next.t('请填写合同份数!'));
771
+ return [2 /*return*/, Promise.reject(i18next.t('请填写合同份数!'))];
772
+ }
773
+ // 勾选了群杰印章 没有填用印次数
774
+ if (((_k = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _k === void 0 ? void 0 : _k.length) > 0) {
775
+ qunjSeal.details.forEach(function (item) {
776
+ if (!item.sealCount) {
777
+ message.warning(i18next.t('请填写{{slot0}} 的用印次数!', {
778
+ slot0: item.sealName,
779
+ }));
780
+ }
781
+ });
782
+ if (qunjSeal.details.filter(function (item) { return !item.sealCount; }).length > 0) {
783
+ return [2 /*return*/, Promise.reject(i18next.t('请填写用印次数!'))];
784
+ }
785
+ }
786
+ else {
787
+ msg = i18next.t('请选择群杰用印!');
788
+ message.warning(msg);
789
+ return [2 /*return*/, Promise.reject(msg)];
790
+ }
791
+ }
792
+ }
793
+ // 5.1 校验契约锁印章中带有"必须共同使用"标识的印章(mustUseWithOthers + useWithSealIds)
794
+ if (isEdit && needQys && electronicSealIdList.length > 0) {
795
+ electronList = currentData.electronList || [];
796
+ selectedSealIds_1 = new Set(electronicSealIdList.map(function (id) { return id + ''; }));
797
+ for (_i = 0, electronList_1 = electronList; _i < electronList_1.length; _i++) {
798
+ seal = electronList_1[_i];
799
+ if (selectedSealIds_1.has(seal.sealId + '') &&
800
+ seal.mustUseWithOthers &&
801
+ seal.useWithSealIds) {
802
+ requiredIds = seal.useWithSealIds
803
+ .split(',')
804
+ .map(function (id) { return id.trim(); })
805
+ .filter(Boolean);
806
+ hasMatch = requiredIds.some(function (id) {
807
+ return selectedSealIds_1.has(id);
808
+ });
809
+ if (!hasMatch) {
810
+ msg = i18next.t('当前所选的{{sealName}},要求必须和{{requiredSealNames}}其中之一一起使用,请重新勾选印章。', {
811
+ sealName: seal.sealName,
812
+ requiredSealNames: seal.useWithSealNames,
813
+ });
814
+ message.warning(msg);
815
+ return [2 /*return*/, Promise.reject(msg)];
816
+ }
817
+ }
818
+ }
819
+ }
820
+ // 6. 调接口检测 是否存在未确认盖章位置的印章
821
+ if (needQys &&
822
+ isEdit &&
823
+ hasElectronicSeal &&
824
+ electronicSealIdList.length > 0) {
825
+ setLoading({
826
+ spinning: true,
827
+ tip: i18next.t('服务器验证中...'),
828
+ });
829
+ // 调用接口
830
+ return [2 /*return*/, getNoSealInfoList({
831
+ contractId: contractId,
832
+ sealIdList: electronicSealIdList,
833
+ deptId: resetProps.deptId,
834
+ secondDepId: resetProps.secondDepId,
835
+ needYjzrr: docAttachMap.needYjzrr === 'true' ||
836
+ docAttachMap.needYjzrr === true
837
+ ? true
838
+ : false,
839
+ })
840
+ .then(function (res) {
841
+ setLoading({
842
+ spinning: false,
843
+ });
844
+ if (res.length > 0) {
845
+ currentUnSealListRef.current = res;
846
+ modalHandleRef.current.setInfo(true, {
847
+ unSealList: res,
848
+ });
849
+ return Promise.reject(i18next.t('还有印章未通过校验'));
850
+ }
851
+ else {
852
+ return Promise.resolve(true);
853
+ }
854
+ })
855
+ .catch(function (err) {
856
+ setLoading({
857
+ spinning: false,
858
+ });
859
+ return Promise.reject(err);
860
+ })];
861
+ }
862
+ return [2 /*return*/, Promise.resolve(true)];
863
+ });
864
+ }); },
865
+ /** 切换部门时,应该清空电子印章相关数据 */
866
+ changeDeptIdClearQysDataHandler: function (dataType) {
867
+ var clearAllElectronDataHandler = allData[firstDataType].clearAllElectronDataHandler;
868
+ clearAllElectronDataHandler && clearAllElectronDataHandler(dataType);
869
+ },
870
+ };
871
+ });
872
+ var myRowSelection = useMemo(function () { return ({
873
+ type: 'checkbox',
874
+ onChange: function (selectedRowKeys, selectedRows) {
875
+ selectRows.current = selectedRows.map(function (item) {
876
+ var newItem = __assign({}, item);
877
+ return newItem;
878
+ });
879
+ },
880
+ }); }, []);
881
+ var _2 = allData[firstDataType] || {}, sameTypeRecords = _2.records, setSameTypeRecords = _2.setRecords, parseCurrentUploadFile = _2.parseCurrentUploadFile;
882
+ function addFile(info, callback) {
883
+ var _a;
884
+ var file = info.file;
885
+ if (file.status === 'done') {
886
+ var currentData = allData[firstDataType];
887
+ // 附件类型字段对应表
888
+ var _b = ((_a = currentData.fileFieldsNameRef) === null || _a === void 0 ? void 0 : _a.current) || {}, _c = _b.isQunj, isQunjKey_1 = _c === void 0 ? 'isQunj' : _c, _d = _b.qunjSeal, qunjSealKey_1 = _d === void 0 ? 'qunjSeal' : _d;
889
+ setSameTypeRecords(function (preRecords) {
890
+ var copyRecords = (preRecords === null || preRecords === void 0 ? void 0 : preRecords.slice()) || [];
891
+ copyRecords = copyRecords.filter(function (record) { return !currentRecordIsOnlyQunj(record); });
892
+ // 插入一个给开发操作附件的机会
893
+ var newFile = callback(file);
894
+ newFile.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
895
+ // 每个附件都可以添加群杰时控制
896
+ if (isSingleQj) {
897
+ newFile[isQunjKey_1] = 1;
898
+ newFile[qunjSealKey_1] = { isTakeOut: 0 };
899
+ }
900
+ if (parseCurrentUploadFile) {
901
+ newFile = parseCurrentUploadFile(newFile);
902
+ }
903
+ copyRecords.push(newFile);
904
+ return copyRecords;
905
+ });
906
+ }
907
+ }
908
+ function onFileChange(info) {
909
+ addFile(info, function (file) {
910
+ var _a;
911
+ var _b, _c, _d, _e;
912
+ return _a = {
913
+ attachId: (_c = (_b = file === null || file === void 0 ? void 0 : file.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.attachId,
914
+ attachName: (_e = (_d = file === null || file === void 0 ? void 0 : file.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.originalName
915
+ },
916
+ _a[DATA_TYPE_KEY] = firstDataType,
917
+ _a;
918
+ });
919
+ }
920
+ function onFileReplace(info, oldVersionId) {
921
+ addFile(info, function (file) {
922
+ var _a;
923
+ var _b, _c, _d, _e;
924
+ return _a = {
925
+ attachId: (_c = (_b = file === null || file === void 0 ? void 0 : file.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.attachId,
926
+ attachName: (_e = (_d = file === null || file === void 0 ? void 0 : file.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.originalName,
927
+ oldVersionId: oldVersionId
928
+ },
929
+ _a[DATA_TYPE_KEY] = firstDataType,
930
+ _a;
931
+ });
932
+ }
933
+ function onBatchDeleteHandle() {
934
+ var _a;
935
+ if (!selectRows.current || selectRows.current.length === 0) {
936
+ message.warning(i18next.t('请选择要删除的附件!'));
937
+ return;
938
+ }
939
+ var deleteInfo = {};
940
+ for (var _i = 0, _b = selectRows.current; _i < _b.length; _i++) {
941
+ var item = _b[_i];
942
+ var currentDataType = item === null || item === void 0 ? void 0 : item[DATA_TYPE_KEY];
943
+ var _c = allData[currentDataType] || {}, isEdit = _c.isEdit, records = _c.records, setRecords = _c.setRecords;
944
+ if (beforeBatchDelete) {
945
+ if (!beforeBatchDelete(item)) {
946
+ message.warning(i18next.t('{{slot0}}不能删除!', { slot0: item.attachName }));
947
+ return;
948
+ }
949
+ }
950
+ else if (!isEdit) {
951
+ message.warning(i18next.t('存在不能删除的附件!'));
952
+ return;
953
+ }
954
+ if (deleteInfo[currentDataType]) {
955
+ (_a = deleteInfo[currentDataType].deleteList) === null || _a === void 0 ? void 0 : _a.push(item);
956
+ }
957
+ else {
958
+ deleteInfo[currentDataType] = {
959
+ records: records,
960
+ setRecords: setRecords,
961
+ deleteList: [item],
962
+ };
963
+ }
964
+ }
965
+ // 使用 batch 模式,将删除附件、清理电子印章、清理群杰印章的多次 onValueChange 合并为一次
966
+ batchOnValueChange(function () {
967
+ Object.entries(deleteInfo).forEach(function (_a) {
968
+ var _b;
969
+ var _c;
970
+ var dataType = _a[0], _d = _a[1], records = _d.records, setRecords = _d.setRecords, deleteList = _d.deleteList;
971
+ var newRecords = records === null || records === void 0 ? void 0 : records.filter(function (record) {
972
+ return !(deleteList === null || deleteList === void 0 ? void 0 : deleteList.some(function (item) {
973
+ return item.id
974
+ ? item.id === record.id
975
+ : item.attachId === record.attachId;
976
+ }));
977
+ });
978
+ setRecords(function () { return newRecords; });
979
+ // 批量删除后,检查是否需要清理印章信息
980
+ var dataTypeData = allData[dataType] || {};
981
+ // 电子印章:同类型下不再有任何勾选电子印章的附件时,清空共享数据
982
+ var deletedHasElectronicSeal = deleteList === null || deleteList === void 0 ? void 0 : deleteList.some(function (item) { return (item === null || item === void 0 ? void 0 : item.isElectronicSeal) + '' === '1'; });
983
+ if (deletedHasElectronicSeal) {
984
+ var hasElectronicSealFile = newRecords === null || newRecords === void 0 ? void 0 : newRecords.some(function (record) { return (record === null || record === void 0 ? void 0 : record.isElectronicSeal) + '' === '1'; });
985
+ if (!hasElectronicSealFile) {
986
+ var onClearElectronListData = dataTypeData.onClearElectronListData, onClearElectronSetting = dataTypeData.onClearElectronSetting;
987
+ var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
988
+ var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
989
+ onValueChange((_b = {},
990
+ _b[dataType] = __assign(__assign({}, clearElectronListData), clearElectronSetting),
991
+ _b));
992
+ }
993
+ }
994
+ // 群杰印章:整体模式下附件全部删完时才清空共享数据
995
+ // 单附件模式(isSingleQj)群杰数据存在附件 record 上,删除附件即删除数据
996
+ if (!isSingleQj && (!newRecords || newRecords.length === 0)) {
997
+ (_c = dataTypeData.setQunjChecked) === null || _c === void 0 ? void 0 : _c.call(dataTypeData, false);
998
+ }
999
+ });
1000
+ });
1001
+ }
1002
+ function onBatchPreviewHandle() {
1003
+ if (!selectRows.current || selectRows.current.length === 0) {
1004
+ message.warning(i18next.t('请选择要预览的附件!'));
1005
+ return;
1006
+ }
1007
+ var parseFileList = selectRows.current.map(function (file) {
1008
+ var attachId = file.attachId;
1009
+ return {
1010
+ attachId: attachId,
1011
+ attachName: file.attachName,
1012
+ };
1013
+ });
1014
+ var fileObject = {
1015
+ title: i18next.t('批量预览-{{slot0}}...', {
1016
+ slot0: parseFileList
1017
+ .map(function (item) { return item.attachName; })
1018
+ .join(',')
1019
+ .slice(0, 10),
1020
+ }),
1021
+ fileList: parseFileList,
1022
+ };
1023
+ var previewId = Date.now() + '';
1024
+ window.sessionStorage.setItem(previewId, JSON.stringify(fileObject));
1025
+ window.open("/batchPreview/" + previewId + "?hideFrame=1");
1026
+ }
1027
+ var defaultContext = useMemo(function () {
1028
+ return { isNewQys: isNewQys, isQjVerifyCode: isQjVerifyCode };
1029
+ }, [isNewQys, isQjVerifyCode]);
1030
+ return (React.createElement(ElectronSignaturesContext.Provider, { value: defaultContext },
1031
+ allOptions.map(function (options, index) {
1032
+ var mergeOptions = index === 0
1033
+ ? __assign(__assign({}, options), { onValueChange: onValueChange }) : __assign(__assign({ deptId: resetProps.deptId, flowId: resetProps.flowId, secondDepId: resetProps.secondDepId }, options), { onValueChange: onValueChange });
1034
+ return (React.createElement(ElectronSignaturesFragment, __assign({ key: index, dataType: "" + index, onTrackChange: onTrackChange, request: request, isUnControlled: isUnControlled, setLoading: setLoading, apiBaseUrl: apiBaseUrl, fileBaseUrl: fileBaseUrl, isSingleQj: isSingleQj, isSupportNoAttachQj: isSupportNoAttachQj }, mergeOptions)));
1035
+ }),
1036
+ React.createElement(ElectronSealBatchDownload, { request: request, apiBaseUrl: apiBaseUrl, selectRows: selectRows, allData: allData, dataTypeSort: dataTypeSort, isShowElectronBatchBtn: isShowElectronBatchBtn, isShowDownloadBatchBtn: isShowDownloadBatchBtn, isShowDoubleSignedBatchBtn: isShowDoubleSignedBatchBtn, batchDownloadZipName: batchDownloadZipName, firstDataType: firstDataType, organizationId: organizationId, isEdit: currentIsEditMemo, isNeedQys: !!isNeedQys, records: sameTypeRecords, setRecords: setSameTypeRecords, mergeRecords: mergeRecords, onValueChange: onValueChange, isShowBatchUseElectronicSealBtn: isShowBatchUseElectronicSealBtn, isShowBatchUseOpeningContractSealBtn: isShowBatchUseOpeningContractSealBtn, isShowOpeningContractSealNotRelyQys: isShowOpeningContractSealNotRelyQys, sealDownloadFlowStatus: sealDownloadFlowStatus },
1037
+ isShowFileUploadIndependence ||
1038
+ (isShowFileUpload && currentIsEditMemo) ? (React.createElement(FileUpload, __assign({ fileList: sameTypeRecords, apiBaseUrl: apiBaseUrl, onFileChange: onFileChange, multiple: true }, fileUploadProps), i18next.t('添加附件'))) : null,
1039
+ customButtons,
1040
+ isShowFileComparisonBtn ? (React.createElement(FileComparisonBtn, { compareHandle: compareHandle, lookCompareHandle: lookCompareHandle, fileBaseUrl: fileBaseUrl || '', onCompareClick: function () {
1041
+ if (!selectRows.current) {
1042
+ message.warning(i18next.t('请选择数据进行比对!'));
1043
+ return Promise.reject(i18next.t('请选择数据进行比对!'));
1044
+ }
1045
+ // 如果只选择了一条数据,那么可以判断是否有双签件
1046
+ // if (selectRows.current.length === 1) {
1047
+ // const doubleSignedSealInfoDTOListKey =
1048
+ // 'doubleSignedSealInfoDTOList';
1049
+ // const record = selectRows.current[0];
1050
+ // if (
1051
+ // record.doubleSignedSealInfoDTOList &&
1052
+ // record.doubleSignedSealInfoDTOList?.length
1053
+ // ) {
1054
+ // const doubleSignedSealInfoDTOObj =
1055
+ // record[doubleSignedSealInfoDTOListKey]?.[0];
1056
+ // }
1057
+ // } else
1058
+ if (selectRows.current.length !== 2) {
1059
+ message.warning(i18next.t('请选择两条数据进行比对!'));
1060
+ return Promise.resolve(i18next.t('请选择两条数据进行比对!'));
1061
+ }
1062
+ // 如果选了两条数据 那么就可以比对
1063
+ var data = selectRows.current.map(function (file) {
1064
+ var attachId = file.attachId;
1065
+ return {
1066
+ attachId: attachId,
1067
+ attachName: file.attachName,
1068
+ };
1069
+ });
1070
+ return new Promise(function (resolve) {
1071
+ resolve(data);
1072
+ });
1073
+ } })) : null,
1074
+ isShowBatchDeleteBtnIndependence ||
1075
+ (isShowBatchDeleteBtn && currentIsEditMemo) ? (React.createElement(Button, { type: "default", onClick: onBatchDeleteHandle, style: { marginRight: '10px' } }, i18next.t('批量删除'))) : null,
1076
+ isShowBatchPreviewBtn ? (React.createElement(Button, { type: "default", onClick: onBatchPreviewHandle, style: { marginRight: '10px' } }, i18next.t('批量预览'))) : null),
1077
+ React.createElement(Table, { dataSource: mergeRecords, columns: columns, rowKey: function (record) { return record.id || record.attachId; }, className: "zt-table electron-table", bordered: true, pagination: false, loading: loading, rowSelection: myRowSelection, scroll: __assign({ x: 'max-content', y: 500 }, tableScroll) }),
1078
+ React.createElement(LastQysModal, { modalHandleRef: modalHandleRef, appointSignLocation: function (info) {
1079
+ // 未盖章的印章id列表
1080
+ var needReSealList = info.needReSealList;
1081
+ var currentData = allData[firstDataType];
1082
+ var currentCheckedElectronicSealIdList = currentData.currentCheckedElectronicSealIdList;
1083
+ /** 最开始的未盖章的印章列表 (不是id列表) */
1084
+ var currentUnSealListRefValue = currentUnSealListRef.current;
1085
+ var currentUnSealIdListValue = currentUnSealListRefValue.map(function (item) { return item.sealId; });
1086
+ var appointSignLocation = currentData.appointSignLocation;
1087
+ var onElectronicSealIdChange = currentData.onElectronicSealIdChange;
1088
+ if (!Array.isArray(needReSealList)) {
1089
+ modalHandleRef.current.clear();
1090
+ return;
1091
+ }
1092
+ if (needReSealList.length === 0) {
1093
+ var newSealIdList_1 = currentCheckedElectronicSealIdList.filter(function (item) { return !currentUnSealIdListValue.includes(item); });
1094
+ onElectronicSealIdChange(newSealIdList_1);
1095
+ // modalHandleRef.current.clear();
1096
+ // // 如果所有未盖章的都取消了 那么可以认为校验直接通过了
1097
+ // isValidateSuccess && isValidateSuccess();
1098
+ // 重新调用指定盖章位置
1099
+ appointSignLocation === null || appointSignLocation === void 0 ? void 0 : appointSignLocation({
1100
+ callback: function (info) {
1101
+ modalHandleRef.current.clear();
1102
+ // 如果所有未盖章的都取消了 那么可以认为校验直接通过了
1103
+ isValidateSuccess && isValidateSuccess();
1104
+ },
1105
+ isCheckUnStampedSeal: true,
1106
+ otherParams: {
1107
+ sealIdList: newSealIdList_1,
1108
+ },
1109
+ });
1110
+ return;
1111
+ }
1112
+ // 计算出最终选中了的印章
1113
+ var deleteSealItemList = currentUnSealListRefValue.filter(function (item) { return !needReSealList.includes(item.sealId); });
1114
+ var deleteSealIdList = deleteSealItemList.map(function (item) { return item.sealId; });
1115
+ var newSealIdList = currentCheckedElectronicSealIdList.filter(function (item) { return !deleteSealIdList.includes(item); });
1116
+ appointSignLocation === null || appointSignLocation === void 0 ? void 0 : appointSignLocation({
1117
+ callback: function (info) {
1118
+ modalHandleRef.current.clear();
1119
+ },
1120
+ otherParams: {
1121
+ sealIdList: newSealIdList,
1122
+ },
1123
+ });
1124
+ } })));
1125
+ };
1126
+ export default memo(ElectronSignatures);