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,380 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import i18next from 'ztxkutils/dist/i18next';
13
+ import React, { useContext } from 'react';
14
+ import { DATA_TYPE_KEY, getColumnMergeProp } from '../hooks/useParseRecords';
15
+ // import ElectronSealDownload from './electron-seal-download';
16
+ import ElectronSealItemDetail from './electron-seal-item-detail';
17
+ import ElectronSealItem from './electron-seal-item';
18
+ import ElectronSealList from './electron-seal-list';
19
+ import ElectronSealDetail, { NoUseElectronSeal } from './electron-seal-detail';
20
+ import ElectronSealFirstLevelPerson from './electron-seal-firstLevelPerson';
21
+ import ElectronSealSetting from './electron-seal-setting';
22
+ import { currentRecordIsOnlyQunj } from '../utils';
23
+ import { ElectronSignaturesContext } from '..';
24
+ /**
25
+ * 生成电子印章列
26
+ */
27
+ export default function useElectronColumns(options) {
28
+ var request = options.request, records = options.records, dataTypeSort = options.dataTypeSort, allData = options.allData, fmsIsElectronicSealLabel = options.fmsIsElectronicSealLabel, fmsIsElectronicSealPushLabel = options.fmsIsElectronicSealPushLabel, openingContractSealLabel = options.openingContractSealLabel, isDeleteAllFileWhenJustUseQj = options.isDeleteAllFileWhenJustUseQj, isShowOpeningContractSealHand = options.isShowOpeningContractSeal, isShowOpeningContractSealNotRelyQys = options.isShowOpeningContractSealNotRelyQys;
29
+ var isNewQys = useContext(ElectronSignaturesContext).isNewQys;
30
+ var currentDataType = dataTypeSort === null || dataTypeSort === void 0 ? void 0 : dataTypeSort[0];
31
+ var _a = allData[currentDataType] || {}, isStampElectron = _a.isStampElectron, needQys = _a.needQys, currentContractId = _a.currentContractId, appointSignLocation = _a.appointSignLocation, viewSignPage = _a.viewSignPage, isEdit = _a.isEdit;
32
+ var currentOnlyQunj = currentRecordIsOnlyQunj(records === null || records === void 0 ? void 0 : records[0]);
33
+ // 盖电子印章逻辑
34
+ var checkElectronColumn = {
35
+ title: i18next.t('盖电子印章'),
36
+ dataIndex: 'isStampElectron',
37
+ key: 'isStampElectron',
38
+ width: 135,
39
+ align: 'center',
40
+ render: function (text, record, index) {
41
+ var currentOnlyQunj = currentRecordIsOnlyQunj(record);
42
+ if (currentOnlyQunj) {
43
+ return null;
44
+ }
45
+ var _a = getColumnMergeProp({
46
+ record: record,
47
+ index: index,
48
+ records: records,
49
+ dataTypeSort: dataTypeSort,
50
+ }), currentDataType = _a.currentDataType, preDataTypeRecordsLength = _a.preDataTypeRecordsLength;
51
+ var _b = allData[currentDataType] || {}, isEdit = _b.isEdit, onIsStampElectronChange = _b.onIsStampElectronChange, setSameTypeRecords = _b.setRecords, currentDocAttachMap = _b.currentDocAttachMap, fileFieldsNameRef = _b.fileFieldsNameRef, flowStatus = _b.flowStatus, needQys = _b.needQys;
52
+ var _c = (fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) || {}, _d = _c.fmsIsPushBank, fmsIsPushBankKey = _d === void 0 ? 'fmsIsPushBank' : _d, _e = _c.fmsIsElectronicSeal, fmsIsElectronicSealKey = _e === void 0 ? 'fmsIsElectronicSeal' : _e, _f = _c.openingContractSeal, openingContractSealKey = _f === void 0 ? 'openingContractSeal' : _f;
53
+ // 是否显示产融平台复选框
54
+ var isShowFms = (record === null || record === void 0 ? void 0 : record.showFmsIsElectronicSeal) &&
55
+ (record === null || record === void 0 ? void 0 : record[fmsIsElectronicSealKey]) != null &&
56
+ (record === null || record === void 0 ? void 0 : record.attachType) === '001' &&
57
+ (record === null || record === void 0 ? void 0 : record.isElectronicSeal);
58
+ // 20250526 这里的加盖产融章逻辑之前是与是否勾选盖章件有关的
59
+ // 如果产品再次提出这个需求,可以使用这个属性
60
+ // const isDetialShowFms =
61
+ // record?.showFmsIsElectronicSeal &&
62
+ // record?.[fmsIsElectronicSealKey] != null &&
63
+ // record?.attachType === '001';
64
+ // 是否显示推送银行复选框
65
+ var isShowBank = (record === null || record === void 0 ? void 0 : record.showFmsIsPushBank) &&
66
+ (record === null || record === void 0 ? void 0 : record[fmsIsPushBankKey]) != null &&
67
+ (record === null || record === void 0 ? void 0 : record.attachType) === '001' &&
68
+ (record === null || record === void 0 ? void 0 : record.isElectronicSeal);
69
+ // 是否显示户用合同章复选框
70
+ var getShowOpeningContractSeal = isShowOpeningContractSealHand
71
+ ? isShowOpeningContractSealHand(record, {
72
+ dataTypeIndex: index - preDataTypeRecordsLength,
73
+ dataType: currentDataType,
74
+ })
75
+ : false;
76
+ var isShowOpeningContractSeal = isShowOpeningContractSealHand
77
+ ? getShowOpeningContractSeal
78
+ : record === null || record === void 0 ? void 0 : record.showOpeningContractSeal;
79
+ // 20250416这个条件是多余的,如果默认盖电子印章已经勾选了,这个值不会被赋值。
80
+ // 上面的产融和银行,有同样的问题。但是为了防止对现有代码做出改造,还是不做任何处理。
81
+ // record?.[openingContractSealKey] != null &&
82
+ // 户用合同章显示与否,跟附件类型无关。
83
+ // && record?.attachType === '001';
84
+ // 户用合同章的显示与否,只跟自身相关。
85
+ // && record?.isElectronicSeal;
86
+ // 是否盖产融平台
87
+ var fmsIsElectronicSeal = (record === null || record === void 0 ? void 0 : record[fmsIsElectronicSealKey]) + '' === '1' ? true : false;
88
+ // 是否推送银行
89
+ var fmsIsPushBank = (record === null || record === void 0 ? void 0 : record[fmsIsPushBankKey]) + '' === '1' ? true : false;
90
+ // 是否盖户用合同章
91
+ var openingContractSeal = (record === null || record === void 0 ? void 0 : record[openingContractSealKey]) + '' === '1' ? true : false;
92
+ // 是否盖电子印章
93
+ var isElectronicSeal = (record === null || record === void 0 ? void 0 : record.isElectronicSeal) + '' === '1' ? true : false;
94
+ // 处理能否切换是否盖电子印章逻辑
95
+ return !needQys &&
96
+ !isShowOpeningContractSealNotRelyQys ? null : isEdit ? (React.createElement(ElectronSealItem, { disabled: !isEdit, checked: record === null || record === void 0 ? void 0 : record.isElectronicSeal, needQys: needQys, onChange: function (checked) {
97
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
98
+ var dataTypeIndex = index - preDataTypeRecordsLength;
99
+ onIsStampElectronChange(checked, dataTypeIndex);
100
+ }, isShowFms: isShowFms, isShowBank: isShowBank, fmsIsElectronicSealPushLabel: fmsIsElectronicSealPushLabel, fmsIsPushBank: fmsIsPushBank, fmsIsElectronicSealLabel: fmsIsElectronicSealLabel, fmsIsElectronicSeal: fmsIsElectronicSeal, isShowOpeningContractSeal: isShowOpeningContractSeal, openingContractSeal: openingContractSeal, openingContractSealLabel: openingContractSealLabel, onFmsIsElectronicSealChange: function (checked, type) {
101
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
102
+ var dataTypeIndex = index - preDataTypeRecordsLength;
103
+ setSameTypeRecords(function (preRecords) {
104
+ var _a;
105
+ var copyRecords = preRecords.slice();
106
+ var item = copyRecords[dataTypeIndex];
107
+ var key = '';
108
+ var clearItem = {};
109
+ switch (type) {
110
+ case 'fmsElectron':
111
+ key = fmsIsElectronicSealKey;
112
+ break;
113
+ case 'fmsPush':
114
+ key = fmsIsPushBankKey;
115
+ break;
116
+ // 户用合同章的逻辑与盖电子印章的逻辑互斥
117
+ case 'openingContractSeal':
118
+ // 如果当前选中 并且盖电子印章也选中了 那么需要清空盖电子印章的逻辑
119
+ if (checked && item.isElectronicSeal + '' === '1') {
120
+ clearItem.isElectronicSeal = 0;
121
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
122
+ var dataTypeIndex_1 = index - preDataTypeRecordsLength;
123
+ onIsStampElectronChange(false, dataTypeIndex_1);
124
+ }
125
+ key = openingContractSealKey;
126
+ break;
127
+ }
128
+ copyRecords.splice(dataTypeIndex, 1, __assign(__assign(__assign({}, item), clearItem), (_a = {}, _a[key] = checked ? 1 : 0, _a[DATA_TYPE_KEY] = currentDataType, _a)));
129
+ return copyRecords;
130
+ });
131
+ } })) : (React.createElement(ElectronSealItemDetail, { isElectronicSeal: isElectronicSeal, isShowFms: isShowFms, fmsIsElectronicSeal: fmsIsElectronicSeal, fmsIsElectronicSealLabel: fmsIsElectronicSealLabel, isShowBank: isShowBank, fmsIsPushBank: fmsIsPushBank, fmsIsElectronicSealPushLabel: fmsIsElectronicSealPushLabel, isShowOpeningContractSeal: isShowOpeningContractSeal, openingContractSeal: openingContractSeal, openingContractSealLabel: openingContractSealLabel }));
132
+ // (
133
+ // // 这里按照最新的逻辑,不在显示下载按钮,只显示勾选了哪些印章(是否盖电子印章、是否加盖产融平台章、是否盖户用合同章)
134
+ // <ElectronSealDownload
135
+ // docAttachMap={currentDocAttachMap}
136
+ // record={record}
137
+ // fileFieldsNameRef={fileFieldsNameRef}
138
+ // request={request}
139
+ // flowStatus={flowStatus}
140
+ // checked={record?.isElectronicSeal}
141
+ // />
142
+ // );
143
+ },
144
+ };
145
+ // 选择电子印章逻辑
146
+ var selectElectronRender = function (text, record, index) {
147
+ // 需要合并
148
+ var _a = getColumnMergeProp({
149
+ record: record,
150
+ index: index,
151
+ records: records,
152
+ dataTypeSort: dataTypeSort,
153
+ }), props = _a.props, currentDataType = _a.currentDataType;
154
+ var currentOnlyQunj = currentRecordIsOnlyQunj(record);
155
+ if (currentOnlyQunj && isDeleteAllFileWhenJustUseQj) {
156
+ return {
157
+ children: null,
158
+ props: props,
159
+ };
160
+ }
161
+ var _b = allData[currentDataType] || {}, isEdit = _b.isEdit, needQys = _b.needQys, firstLevelPersonName = _b.firstLevelPersonName, currentCheckedElectronicSealIdList = _b.currentCheckedElectronicSealIdList, currentContractId = _b.currentContractId, currentIsCheckedEconomic = _b.currentIsCheckedEconomic, onCheckedEconomicChange = _b.onCheckedEconomicChange, electronList = _b.electronList, onElectronicSealIdChange = _b.onElectronicSealIdChange, isStampElectron = _b.isStampElectron, appointSignLocation = _b.appointSignLocation;
162
+ // 1. 处理当前类型的数据需不需要契约锁
163
+ // 2. 处理当前类型的数据处不处于编辑状态
164
+ return {
165
+ children: !needQys ? (React.createElement(NoUseElectronSeal, null)) : isEdit ? (React.createElement(React.Fragment, null,
166
+ React.createElement(ElectronSealFirstLevelPerson, { firstLevelPersonName: firstLevelPersonName, checked: currentIsCheckedEconomic, isEdit: !!isStampElectron, onChange: function (e) {
167
+ // 如果此时已经选了电子印章的话,更改是否切换一级责任人
168
+ // 将重新调用 指定签署位置的 逻辑(因为指定签署位置 需要传递是否选中一级责任人 如果这个一级责任人是否选中更改了的话 需要重新告诉后端 处理一些逻辑)
169
+ // 前提是已经去契约锁盖过章了(已经产生合同ID了)
170
+ if ((currentCheckedElectronicSealIdList === null || currentCheckedElectronicSealIdList === void 0 ? void 0 : currentCheckedElectronicSealIdList.length) > 0 &&
171
+ currentContractId) {
172
+ appointSignLocation === null || appointSignLocation === void 0 ? void 0 : appointSignLocation({
173
+ otherParams: {
174
+ needYjzrr: e.target.checked,
175
+ },
176
+ isCheckUnStampedSeal: true,
177
+ spinningTip: i18next.t('接口调用中...'),
178
+ });
179
+ }
180
+ else {
181
+ onCheckedEconomicChange(e);
182
+ }
183
+ } }),
184
+ React.createElement(ElectronSealList, { sealList: electronList, value: currentCheckedElectronicSealIdList, onChange: onElectronicSealIdChange, isEdit: !!isStampElectron, style: { marginBottom: '30px' } }))) : (React.createElement(ElectronSealDetail, { sealList: electronList, value: currentCheckedElectronicSealIdList })),
185
+ props: props,
186
+ };
187
+ };
188
+ // 契约锁相关配置
189
+ var electronColumns = isNewQys
190
+ ? [
191
+ checkElectronColumn,
192
+ {
193
+ title: (React.createElement("div", { className: "file-title" },
194
+ React.createElement("div", { className: "file-label" }, i18next.t('选择电子印章')),
195
+ React.createElement("div", { className: "file-upload" }, currentOnlyQunj ? null : !needQys ? null : isStampElectron ? (React.createElement(ElectronSealSetting, { contractId: currentContractId, appointSignLocation: appointSignLocation, viewSignPage: viewSignPage, isEdit: isEdit })) : null))),
196
+ dataIndex: 'electronList',
197
+ key: 'electronList',
198
+ width: 320,
199
+ align: 'center',
200
+ render: selectElectronRender,
201
+ // 新版三段式布局下固定列宽(scroll.x=max-content 时 width 会被内容撑开)
202
+ onHeaderCell: function () { return ({
203
+ style: { width: 320, minWidth: 320, maxWidth: 320 },
204
+ }); },
205
+ onCell: function () { return ({
206
+ // 内容从顶部往下排,避免切换公司时因印章数量不同导致内容垂直居中抖动
207
+ style: {
208
+ width: 320,
209
+ minWidth: 320,
210
+ maxWidth: 320,
211
+ verticalAlign: 'top',
212
+ },
213
+ }); },
214
+ },
215
+ ]
216
+ : // 下面是最初设计的模式
217
+ [
218
+ {
219
+ // title: '电子印章',
220
+ title: (React.createElement("div", { className: "file-title" },
221
+ React.createElement("div", { className: "file-label" }, i18next.t('电子印章')),
222
+ React.createElement("div", { className: "file-upload" }, currentOnlyQunj ? null : !needQys ? null : isStampElectron ? (React.createElement(ElectronSealSetting, { contractId: currentContractId, appointSignLocation: appointSignLocation, viewSignPage: viewSignPage, isEdit: isEdit })) : null))),
223
+ children: [
224
+ checkElectronColumn,
225
+ // {
226
+ // title: '盖电子印章',
227
+ // dataIndex: 'isStampElectron',
228
+ // key: 'isStampElectron',
229
+ // width: 100,
230
+ // align: 'center',
231
+ // render: (text, record, index) => {
232
+ // const currentOnlyQunj = currentRecordIsOnlyQunj(record);
233
+ // if (currentOnlyQunj) {
234
+ // return null;
235
+ // }
236
+ // const { currentDataType, preDataTypeRecordsLength } =
237
+ // getColumnMergeProp({
238
+ // record,
239
+ // index,
240
+ // records,
241
+ // dataTypeSort,
242
+ // });
243
+ // const {
244
+ // isEdit,
245
+ // onIsStampElectronChange,
246
+ // setRecords: setSameTypeRecords,
247
+ // currentDocAttachMap,
248
+ // fileFieldsNameRef,
249
+ // flowStatus,
250
+ // needQys,
251
+ // } = allData[currentDataType] || {};
252
+ // const {
253
+ // fmsIsPushBank: fmsIsPushBankKey = 'fmsIsPushBank',
254
+ // fmsIsElectronicSeal:
255
+ // fmsIsElectronicSealKey = 'fmsIsElectronicSeal',
256
+ // } = fileFieldsNameRef?.current || {};
257
+ // // 是否显示产融平台相关逻辑
258
+ // const isShowFms =
259
+ // record?.showFmsIsElectronicSeal &&
260
+ // record?.[fmsIsElectronicSealKey] != null &&
261
+ // record?.attachType === '001' &&
262
+ // record?.isElectronicSeal;
263
+ // // 是否推送银行
264
+ // const isShowBank =
265
+ // record?.showFmsIsPushBank &&
266
+ // record?.[fmsIsPushBankKey] != null &&
267
+ // record?.attachType === '001' &&
268
+ // record?.isElectronicSeal;
269
+ // // 是否盖产融平台
270
+ // const fmsIsElectronicSeal =
271
+ // record?.[fmsIsElectronicSealKey] + '' === '1' ? true : false;
272
+ // // 是否推送银行
273
+ // const fmsIsPushBank =
274
+ // record?.[fmsIsPushBankKey] + '' === '1' ? true : false;
275
+ // // 处理能否切换是否盖电子印章逻辑
276
+ // return !needQys ? null : isEdit ? (
277
+ // <ElectronSealItem
278
+ // disabled={!isEdit}
279
+ // checked={record?.isElectronicSeal}
280
+ // onChange={(checked) => {
281
+ // // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
282
+ // const dataTypeIndex = index - preDataTypeRecordsLength;
283
+ // onIsStampElectronChange(checked, dataTypeIndex);
284
+ // }}
285
+ // isShowFms={isShowFms}
286
+ // isShowBank={isShowBank}
287
+ // fmsIsElectronicSealPushLabel={fmsIsElectronicSealPushLabel}
288
+ // fmsIsPushBank={fmsIsPushBank}
289
+ // fmsIsElectronicSealLabel={fmsIsElectronicSealLabel}
290
+ // fmsIsElectronicSeal={fmsIsElectronicSeal}
291
+ // onFmsIsElectronicSealChange={(checked, type) => {
292
+ // // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
293
+ // const dataTypeIndex = index - preDataTypeRecordsLength;
294
+ // setSameTypeRecords((preRecords) => {
295
+ // const copyRecords = preRecords.slice();
296
+ // const item = copyRecords[dataTypeIndex];
297
+ // copyRecords.splice(dataTypeIndex, 1, {
298
+ // ...item,
299
+ // [type === 'fmsElectron'
300
+ // ? fmsIsElectronicSealKey
301
+ // : fmsIsPushBankKey]: checked ? 1 : 0,
302
+ // [DATA_TYPE_KEY]: currentDataType,
303
+ // });
304
+ // return copyRecords;
305
+ // });
306
+ // }}
307
+ // />
308
+ // ) : (
309
+ // <ElectronSealDownload
310
+ // docAttachMap={currentDocAttachMap}
311
+ // record={record}
312
+ // fileFieldsNameRef={fileFieldsNameRef}
313
+ // request={request}
314
+ // flowStatus={flowStatus}
315
+ // checked={record?.isElectronicSeal}
316
+ // />
317
+ // );
318
+ // },
319
+ // },
320
+ {
321
+ title: i18next.t('选择电子印章'),
322
+ dataIndex: 'electronList',
323
+ key: 'electronList',
324
+ width: 260,
325
+ align: 'center',
326
+ render: selectElectronRender,
327
+ },
328
+ // 2024-07-30
329
+ // 产品要求去掉每种类型的指定位置 预览盖章效果等字样
330
+ // {
331
+ // title: '电子印章设置',
332
+ // dataIndex: 'isElectronSetting',
333
+ // key: 'isElectronSetting',
334
+ // width: 100,
335
+ // align: 'center',
336
+ // render: (text, record, index) => {
337
+ // // 需要合并
338
+ // const { currentDataType, props } = getColumnMergeProp({
339
+ // record,
340
+ // index,
341
+ // records,
342
+ // dataTypeSort,
343
+ // });
344
+ // const {
345
+ // isStampElectron,
346
+ // needQys,
347
+ // currentContractId,
348
+ // appointSignLocation,
349
+ // viewSignPage,
350
+ // isEdit,
351
+ // } = allData[currentDataType] || {};
352
+ // const currentOnlyQunj = currentRecordIsOnlyQunj(record);
353
+ // if (currentOnlyQunj) {
354
+ // return {
355
+ // children: null,
356
+ // props,
357
+ // };
358
+ // }
359
+ // return {
360
+ // children: !needQys ? (
361
+ // '暂不需要契约锁数据'
362
+ // ) : isStampElectron ? (
363
+ // <ElectronSealSetting
364
+ // contractId={currentContractId}
365
+ // appointSignLocation={appointSignLocation}
366
+ // viewSignPage={viewSignPage}
367
+ // isEdit={isEdit}
368
+ // />
369
+ // ) : null,
370
+ // props,
371
+ // };
372
+ // },
373
+ // },
374
+ ],
375
+ },
376
+ ];
377
+ return {
378
+ electronColumns: electronColumns,
379
+ };
380
+ }
@@ -0,0 +1,20 @@
1
+ import { IElectronSignaturesProps, IElectronSignaturesItem } from '../interface';
2
+ interface IOptions {
3
+ request?: IElectronSignaturesProps['request'];
4
+ needQys?: IElectronSignaturesItem['needQys'];
5
+ deptId?: IElectronSignaturesItem['deptId'];
6
+ secondDepId?: IElectronSignaturesItem['secondDepId'];
7
+ flowId?: IElectronSignaturesItem['flowId'];
8
+ records?: any;
9
+ canEdit?: any;
10
+ }
11
+ /**
12
+ * 获取电子印章远程数据
13
+ */
14
+ export default function useFetchElectronData(options: IOptions): {
15
+ /** 当前印章列表数据 */
16
+ electronList: any;
17
+ /** 当前经济责任人(一级责任人)数据 */
18
+ firstLevelPersonName: string;
19
+ };
20
+ export {};
@@ -0,0 +1,169 @@
1
+ import i18next from 'ztxkutils/dist/i18next';
2
+ import { useCallback, useEffect, useState, useMemo, useRef } from 'react';
3
+ import { message } from '../../../index';
4
+ import useServiceName from '../../../hooks/useServiceName';
5
+ /**
6
+ * 获取电子印章远程数据
7
+ */
8
+ export default function useFetchElectronData(options) {
9
+ var request = options.request, needQys = options.needQys, deptId = options.deptId, secondDepId = options.secondDepId, flowId = options.flowId, records = options.records;
10
+ var _a = (useServiceName() || {}).scmServiceName, scmServiceName = _a === void 0 ? '/zmdms-scm-system' : _a;
11
+ // records里面是否有勾选了电子印章的数据
12
+ var hasElectronMemo = useMemo(function () {
13
+ var _a;
14
+ return (_a = records === null || records === void 0 ? void 0 : records.some) === null || _a === void 0 ? void 0 : _a.call(records, function (record) { return !!record.isElectronicSeal; });
15
+ }, [records]);
16
+ var isFirstRenderRef = useRef(false);
17
+ // 印章列表数据
18
+ var _b = useState(), electronList = _b[0], setElectronList = _b[1];
19
+ // 一级责任人数据
20
+ var _c = useState(), firstLevelPersonName = _c[0], setFirstLevelPersonName = _c[1];
21
+ // 获取电子印章信息 接口层必须传入部门id 和 流程id 才能获取到印章信息
22
+ var getElectronList = useCallback(function (params) {
23
+ var newParam = {
24
+ size: 200,
25
+ };
26
+ if (params.deptId) {
27
+ newParam.deptId = params.deptId;
28
+ }
29
+ if (params.flowId) {
30
+ newParam.flowId = params.flowId;
31
+ }
32
+ if (params.secondDepId) {
33
+ newParam.secondDepId = params.secondDepId;
34
+ }
35
+ return request === null || request === void 0 ? void 0 : request({
36
+ url: "/api" + scmServiceName + "/flowdeptseal/select-seal-info-list",
37
+ params: newParam,
38
+ method: 'GET',
39
+ }).then(function (res) {
40
+ var _a, _b, _c;
41
+ if (res.status === 200 && res.data.code === 200) {
42
+ return ((_c = (_b = (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.sealInfoList) || [];
43
+ }
44
+ else {
45
+ message.error(res.data.msg || i18next.t('出错了'));
46
+ return Promise.reject(res);
47
+ }
48
+ }).catch(function (error) {
49
+ var _a, _b;
50
+ message.error(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('请求失败!'));
51
+ return Promise.reject(error);
52
+ });
53
+ }, [request]);
54
+ // 获取一级责任人名字 通过部门
55
+ var getFirstLevelPerson = useCallback(function (deptId) {
56
+ return request({
57
+ url: "/api" + scmServiceName + "/seal/get-yjzrr-name/" + deptId,
58
+ method: 'GET',
59
+ })
60
+ .then(function (res) {
61
+ var _a;
62
+ if (res.status === 200 && res.data.code === 200) {
63
+ return (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.userName;
64
+ }
65
+ else {
66
+ // 20240920:不需要报错提示
67
+ // if (canEdit) {
68
+ // message.error(res.data.msg || '出错了');
69
+ // }
70
+ return Promise.reject(res);
71
+ }
72
+ })
73
+ .catch(function (error) {
74
+ // 20240920:不需要报错提示
75
+ // if (canEdit) {
76
+ // message.error(error?.response?.data?.msg || '请求失败!');
77
+ // }
78
+ return Promise.reject(error);
79
+ });
80
+ }, [request]);
81
+ // 获取一级责任人名字 通过二级单元
82
+ var getFirstLevelPersonBysecondDepId = useCallback(function (secondDepId) {
83
+ return request({
84
+ url: "/api" + scmServiceName + "/seal/get-yjzrr-name-by-sec-unit/" + secondDepId,
85
+ method: 'GET',
86
+ })
87
+ .then(function (res) {
88
+ var _a;
89
+ if (res.status === 200 && res.data.code === 200) {
90
+ return (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.userName;
91
+ }
92
+ else {
93
+ // 20240920:不需要报错提示
94
+ // if (canEdit) {
95
+ // message.error(res.data.msg || '出错了');
96
+ // }
97
+ return Promise.reject(res);
98
+ }
99
+ })
100
+ .catch(function (error) {
101
+ // 20240920:不需要报错提示
102
+ // if (canEdit) {
103
+ // message.error(error?.response?.data?.msg || '请求失败!');
104
+ // }
105
+ return Promise.reject(error);
106
+ });
107
+ }, [request]);
108
+ // 获取契约锁列表数据
109
+ useEffect(function () {
110
+ // 如果不需要契约锁数据
111
+ if (needQys + '' !== '1') {
112
+ return;
113
+ }
114
+ getElectronList({
115
+ deptId: deptId,
116
+ secondDepId: secondDepId,
117
+ flowId: flowId,
118
+ }).then(function (res) {
119
+ setElectronList(res);
120
+ });
121
+ }, [needQys, deptId, secondDepId, flowId, getElectronList]);
122
+ // 20240920:部门变更了 需要重新获取一级责任人
123
+ // 20250522: 有些流程没有部门id,但是会传入二级单元,根据二级单元获取一级责任人
124
+ useEffect(function () {
125
+ setFirstLevelPersonName('');
126
+ isFirstRenderRef.current = false;
127
+ }, [deptId, secondDepId]);
128
+ useEffect(function () {
129
+ // 如果不需要契约锁数据
130
+ if (needQys + '' !== '1') {
131
+ return;
132
+ }
133
+ if (!isFirstRenderRef.current && hasElectronMemo) {
134
+ isFirstRenderRef.current = true;
135
+ if (deptId) {
136
+ getFirstLevelPerson(deptId)
137
+ .then(function (res) {
138
+ setFirstLevelPersonName(res);
139
+ })
140
+ .catch(function (err) {
141
+ setFirstLevelPersonName('');
142
+ });
143
+ }
144
+ else if (secondDepId) {
145
+ getFirstLevelPersonBysecondDepId(secondDepId)
146
+ .then(function (res) {
147
+ setFirstLevelPersonName(res);
148
+ })
149
+ .catch(function (err) {
150
+ setFirstLevelPersonName('');
151
+ });
152
+ }
153
+ }
154
+ }, [
155
+ getFirstLevelPerson,
156
+ getFirstLevelPersonBysecondDepId,
157
+ needQys,
158
+ deptId,
159
+ secondDepId,
160
+ hasElectronMemo,
161
+ isFirstRenderRef,
162
+ ]);
163
+ return {
164
+ /** 当前印章列表数据 */
165
+ electronList: electronList,
166
+ /** 当前经济责任人(一级责任人)数据 */
167
+ firstLevelPersonName: firstLevelPersonName,
168
+ };
169
+ }
@@ -0,0 +1,3 @@
1
+ export default function useCheckedSealInfoList(request: any): {
2
+ getDeptInfo: (this: any, params: any) => Promise<unknown>;
3
+ };
@@ -0,0 +1,38 @@
1
+ import i18next from 'ztxkutils/dist/i18next';
2
+ /**
3
+ * 验证契约锁是否全部盖章
4
+ */
5
+ import useMemoizedFn from '../../utils/useMemoizedFn';
6
+ import { useContext } from 'react';
7
+ import ZtxkContext from '../../utils/ZtxkContext';
8
+ export default function useCheckedSealInfoList(request) {
9
+ var saasConfig = useContext(ZtxkContext).saasConfig;
10
+ var getDeptInfo = useMemoizedFn(function (params) {
11
+ return new Promise(function (resolve, reject) {
12
+ request({
13
+ url: (saasConfig === null || saasConfig === void 0 ? void 0 : saasConfig.deptDetailApi) || '/api/zmdms-system/dept/detail',
14
+ params: params,
15
+ method: 'GET',
16
+ })
17
+ .then(function (res) {
18
+ var _a;
19
+ if ((res === null || res === void 0 ? void 0 : res.status) === 200 && ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.code) === 200) {
20
+ var result = res.data.data;
21
+ resolve(result || {});
22
+ }
23
+ else {
24
+ // message.error(res.data.msg || '获取部门信息失败!');
25
+ reject(res.data.msg || i18next.t('获取部门信息失败!'));
26
+ }
27
+ })
28
+ .catch(function (error) {
29
+ var _a, _b;
30
+ // message.error(error?.response?.data?.msg || '获取部门信息失败!');
31
+ reject(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('获取部门信息失败!'));
32
+ });
33
+ });
34
+ });
35
+ return {
36
+ getDeptInfo: getDeptInfo,
37
+ };
38
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 附件相关操作 下载 预览 删除
3
+ */
4
+ import React from 'react';
5
+ import { IFileOperationProps } from '../interface';
6
+ declare const _default: React.NamedExoticComponent<IFileOperationProps>;
7
+ export default _default;