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,329 @@
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 FileUpload from './file-upload';
16
+ import FileTypeSelect from './file-type-select';
17
+ import FileOperation from './file-operation';
18
+ import NewFileOperation from './new-file-operation';
19
+ import { Button } from '../../../index';
20
+ import { useMemo } from 'react';
21
+ import { onlyQunjAttachId, currentRecordIsOnlyQunj } from '../utils';
22
+ import dayjs from 'dayjs';
23
+ import { ElectronSignaturesContext } from '..';
24
+ import { isFlowCompleted } from '../utils';
25
+ /**
26
+ * 删除附件后,检查同类型下是否还有勾选了电子印章的附件。
27
+ * 如果被删除的附件勾选了电子印章,且删除后同类型不再有任何勾选电子印章的附件,
28
+ * 则清空共享的电子印章信息(印章列表、合同id、签署位置等)。
29
+ *
30
+ * 群杰印章不在此处处理:
31
+ * - 单附件模式(isSingleQj):群杰数据存在附件 record 上,删除附件即删除数据。
32
+ * - 整体模式(!isSingleQj):所有附件共用群杰信息,只有附件全部删完时才清空
33
+ * (在 copyRecords.length === 0 分支中处理)。
34
+ *
35
+ * 参考 useParseIsNeedElectronData 中 onIsStampElectronChange 的清理模式。
36
+ */
37
+ function clearElectronDataWhenNoSealFile(deletedRecord, remainingRecords, allData, currentDataType, onValueChange) {
38
+ var _a;
39
+ // 被删除的附件没有勾选电子印章,不影响电子印章信息
40
+ if ((deletedRecord === null || deletedRecord === void 0 ? void 0 : deletedRecord.isElectronicSeal) + '' !== '1') {
41
+ return;
42
+ }
43
+ // 同类型下是否还有勾选电子印章的附件
44
+ var hasElectronicSealFile = remainingRecords === null || remainingRecords === void 0 ? void 0 : remainingRecords.some(function (record) { return (record === null || record === void 0 ? void 0 : record.isElectronicSeal) + '' === '1'; });
45
+ if (hasElectronicSealFile) {
46
+ return;
47
+ }
48
+ // 没有任何附件需要盖电子印章了,清空共享的电子印章信息
49
+ var _b = allData[currentDataType] || {}, onClearElectronListData = _b.onClearElectronListData, onClearElectronSetting = _b.onClearElectronSetting;
50
+ var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
51
+ var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
52
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange((_a = {},
53
+ _a[currentDataType] = __assign(__assign({}, clearElectronListData), clearElectronSetting),
54
+ _a));
55
+ }
56
+ // 创建附件的clomuns
57
+ export default function useFileColumns(options) {
58
+ var records = options.records, dataTypeSort = options.dataTypeSort, allData = options.allData, isShowFileUpload = options.isShowFileUpload, apiBaseUrl = options.apiBaseUrl, fileBaseUrl = options.fileBaseUrl, firstDataType = options.firstDataType,
59
+ // fileUploadProps,
60
+ onValueChange = options.onValueChange, onFileTypeChangeGetItem = options.onFileTypeChangeGetItem, getCreateTimeHand = options.getCreateTimeHand, isSingleQj = options.isSingleQj, justNeedQj = options.justNeedQj, setJustNeedQj = options.setJustNeedQj, isShowFileType = options.isShowFileType, currentIsEditMemo = options.currentIsEditMemo, isDeleteAllFileWhenJustUseQj = options.isDeleteAllFileWhenJustUseQj, isControlNeedQys = options.isControlNeedQys, organizationId = options.organizationId, onFileReplace = options.onFileReplace, isToggleQys = options.isToggleQys, previewUrl = options.previewUrl, request = options.request, isTranslation = options.isTranslation, isNeedDg = options.isNeedDg;
61
+ var isNewQys = useContext(ElectronSignaturesContext).isNewQys;
62
+ var _a = allData[firstDataType] || {},
63
+ // records: sameTypeRecords,
64
+ setSameTypeRecords = _a.setRecords, onClearElectronListData = _a.onClearElectronListData, onClearElectronSetting = _a.onClearElectronSetting,
65
+ // parseCurrentUploadFile,
66
+ needQj = _a.needQj, needQys = _a.needQys;
67
+ var defaultOnlyQunjRecords = useMemo(function () {
68
+ var _a;
69
+ return [
70
+ (_a = {
71
+ attachId: onlyQunjAttachId
72
+ },
73
+ _a[DATA_TYPE_KEY] = firstDataType,
74
+ _a),
75
+ ];
76
+ }, [firstDataType]);
77
+ var fileTypeColumn = {
78
+ title: i18next.t('类型'),
79
+ dataIndex: 'attachType',
80
+ key: 'attachType',
81
+ width: 108,
82
+ align: 'center',
83
+ // 固定列宽(scroll.x=max-content 时 width 会被内容撑开)
84
+ onHeaderCell: function () { return ({
85
+ className: 'file-type-col',
86
+ style: { width: 108, minWidth: 108, maxWidth: 108 },
87
+ }); },
88
+ onCell: function () { return ({
89
+ className: 'file-type-col',
90
+ style: { width: 108, minWidth: 108, maxWidth: 108 },
91
+ }); },
92
+ render: function (text, record, index) {
93
+ var currentOnlyQunj = currentRecordIsOnlyQunj(record);
94
+ if (currentOnlyQunj) {
95
+ return null;
96
+ }
97
+ var _a = getColumnMergeProp({
98
+ record: record,
99
+ index: index,
100
+ records: records,
101
+ dataTypeSort: dataTypeSort,
102
+ }), currentDataType = _a.currentDataType, preDataTypeRecordsLength = _a.preDataTypeRecordsLength;
103
+ var _b = allData[currentDataType] || {}, fileTypeFetchList = _b.fileTypeFetchList, isEdit = _b.isEdit, isAllowedPatchFileType = _b.isAllowedPatchFileType, setSameTypeRecords = _b.setRecords;
104
+ return isEdit && isAllowedPatchFileType ? (React.createElement(FileTypeSelect, { list: fileTypeFetchList, value: record === null || record === void 0 ? void 0 : record.attachType, onChange: function (value, option, completeData) {
105
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
106
+ var dataTypeIndex = index - preDataTypeRecordsLength;
107
+ setSameTypeRecords(function (preRecords) {
108
+ var _a;
109
+ var copyRecords = (preRecords === null || preRecords === void 0 ? void 0 : preRecords.slice()) || [];
110
+ var item = copyRecords[dataTypeIndex];
111
+ var newItem = onFileTypeChangeGetItem(__assign(__assign({}, item), (_a = { attachType: completeData === null || completeData === void 0 ? void 0 : completeData.dictKey, attachTypeName: completeData === null || completeData === void 0 ? void 0 : completeData.dictValue }, _a[DATA_TYPE_KEY] = currentDataType, _a)));
112
+ copyRecords.splice(dataTypeIndex, 1, newItem);
113
+ return copyRecords;
114
+ });
115
+ } })) : (record === null || record === void 0 ? void 0 : record.attachTypeName);
116
+ },
117
+ };
118
+ var fileColumns = isNewQys
119
+ ? [
120
+ {
121
+ title: i18next.t('附件名称'),
122
+ dataIndex: 'attachName',
123
+ key: 'attachName',
124
+ width: 220,
125
+ align: 'center',
126
+ render: function (text, record, index) {
127
+ var currentOnlyQunj = currentRecordIsOnlyQunj(record);
128
+ if (currentOnlyQunj) {
129
+ return null;
130
+ }
131
+ var _a = getColumnMergeProp({
132
+ record: record,
133
+ index: index,
134
+ records: records,
135
+ dataTypeSort: dataTypeSort,
136
+ }), currentDataType = _a.currentDataType, preDataTypeRecordsLength = _a.preDataTypeRecordsLength;
137
+ var _b = allData[currentDataType] || {}, isEdit = _b.isEdit, sameTypeRecords = _b.records, setSameTypeRecords = _b.setRecords, fileFieldsNameRef = _b.fileFieldsNameRef, flowStatus = _b.flowStatus;
138
+ var _c = (fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) || {}, oldVersionId = _c.oldVersionId, oldVersionName = _c.oldVersionName;
139
+ // 是否添加水印
140
+ var isWater = (record === null || record === void 0 ? void 0 : record.isWatermark) + '' === '1' ? true : false;
141
+ // 是否替换附件
142
+ var isReplaceFile = (record === null || record === void 0 ? void 0 : record.isReplaceFile) + '' === '1' ? true : false;
143
+ var showAddWater = record === null || record === void 0 ? void 0 : record.showAddWater;
144
+ // 流程是否完结
145
+ var isWorlflowCompleted = isFlowCompleted(flowStatus);
146
+ var date = getCreateTimeHand(record);
147
+ // 如果是内部附件 不展示上传时间
148
+ var currentDate = currentRecordIsOnlyQunj(record) ? ('') : date ? (React.createElement(React.Fragment, null,
149
+ dayjs(date).format(i18next.t('YYYY年MM月DD日')),
150
+ React.createElement("span", { style: { marginLeft: '4px' } }, dayjs(date).format('HH:mm:ss')))) : ('');
151
+ return (React.createElement(NewFileOperation, { fileName: text, fileId: record.attachId, preFileId: record === null || record === void 0 ? void 0 : record[oldVersionId || ''], preFileName: record === null || record === void 0 ? void 0 : record[oldVersionName || ''], isDownload: true, isDelete: isEdit && isShowFileUpload, isPreview: true, isEdit: isEdit, isWater: isWater, apiBaseUrl: apiBaseUrl, fileBaseUrl: fileBaseUrl, records: sameTypeRecords, organizationId: organizationId, isReplaceFile: isReplaceFile, showAddWater: showAddWater, isWorlflowCompleted: isWorlflowCompleted, onDelete: function () {
152
+ var _a;
153
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
154
+ var dataTypeIndex = index - preDataTypeRecordsLength;
155
+ var copyRecords = sameTypeRecords === null || sameTypeRecords === void 0 ? void 0 : sameTypeRecords.slice();
156
+ if (Array.isArray(copyRecords)) {
157
+ // 记录被删除的附件,用于判断是否需要清理电子印章信息
158
+ var deletedRecord = copyRecords[dataTypeIndex];
159
+ copyRecords.splice(dataTypeIndex, 1);
160
+ if (copyRecords.length === 0) {
161
+ setSameTypeRecords(defaultOnlyQunjRecords);
162
+ var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
163
+ var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
164
+ // 所有附件删完时,同时清理群杰印章共享数据
165
+ var setQunjChecked = (allData[currentDataType] || {}).setQunjChecked;
166
+ setQunjChecked === null || setQunjChecked === void 0 ? void 0 : setQunjChecked(false);
167
+ onValueChange &&
168
+ onValueChange(__assign(__assign((_a = {}, _a[firstDataType] = {
169
+ fileList: defaultOnlyQunjRecords,
170
+ }, _a), clearElectronListData), clearElectronSetting));
171
+ }
172
+ else {
173
+ setSameTypeRecords(copyRecords);
174
+ // 同类型的附件共用电子印章信息,只有当被删除的附件勾选了电子印章
175
+ // 且删除后同类型下不再有任何勾选电子印章的附件时,才清理电子印章信息
176
+ clearElectronDataWhenNoSealFile(deletedRecord, copyRecords, allData, currentDataType, onValueChange);
177
+ }
178
+ }
179
+ }, onWatermarkChange: function (isChecked) {
180
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
181
+ var dataTypeIndex = index - preDataTypeRecordsLength;
182
+ setSameTypeRecords(function (preRecords) {
183
+ var _a;
184
+ var copyRecords = (preRecords === null || preRecords === void 0 ? void 0 : preRecords.slice()) || [];
185
+ var item = copyRecords[dataTypeIndex];
186
+ copyRecords.splice(dataTypeIndex, 1, __assign(__assign({}, item), (_a = { isWatermark: isChecked ? 1 : 0 }, _a[DATA_TYPE_KEY] = currentDataType, _a)));
187
+ return copyRecords;
188
+ });
189
+ }, fileList: records, onFileReplace: onFileReplace, previewUrl: previewUrl, request: request, isTranslation: isTranslation, record: record, setRecords: setSameTypeRecords, realIndex: index, isNeedDg: isNeedDg, currentDate: currentDate }));
190
+ },
191
+ },
192
+ ]
193
+ : // 下面是最初设计的模式
194
+ [
195
+ {
196
+ title: (React.createElement("div", { className: "file-title" },
197
+ React.createElement("div", { className: "file-label" }, i18next.t('附件')),
198
+ React.createElement("div", { className: "file-upload" }, isShowFileUpload && currentIsEditMemo && needQj ? ((isControlNeedQys || needQys) && isToggleQys ? (React.createElement(Button, { type: "link", className: "file-add--isOnlyQunj", onClick: function () {
199
+ var _a, _b, _c;
200
+ setJustNeedQj(!justNeedQj);
201
+ var newNeedQys = justNeedQj ? 1 : 0;
202
+ var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
203
+ var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
204
+ // 是否组件内部可以更改需要契约锁逻辑
205
+ var needQysObj = isControlNeedQys
206
+ ? { needQys: newNeedQys }
207
+ : {};
208
+ if (isSingleQj) {
209
+ onValueChange &&
210
+ onValueChange((_a = {},
211
+ _a[firstDataType] = __assign(__assign(__assign({}, clearElectronListData), clearElectronSetting), needQysObj),
212
+ _a));
213
+ return;
214
+ }
215
+ if (isDeleteAllFileWhenJustUseQj) {
216
+ // 如果点击仅需要群杰印章信息的话,需要删除掉所有附件信息
217
+ setSameTypeRecords(defaultOnlyQunjRecords);
218
+ onValueChange &&
219
+ onValueChange((_b = {},
220
+ _b[firstDataType] = __assign(__assign(__assign({ fileList: defaultOnlyQunjRecords }, clearElectronListData), clearElectronSetting), needQysObj),
221
+ _b));
222
+ }
223
+ else {
224
+ onValueChange &&
225
+ onValueChange((_c = {},
226
+ _c[firstDataType] = __assign(__assign(__assign({}, clearElectronListData), clearElectronSetting), needQysObj),
227
+ _c));
228
+ }
229
+ } }, justNeedQj
230
+ ? i18next.t('使用电子印章')
231
+ : i18next.t('仅使用群杰印章'))) : null) : null))),
232
+ children: [
233
+ {
234
+ title: i18next.t('名称'),
235
+ dataIndex: 'attachName',
236
+ key: 'attachName',
237
+ width: 160,
238
+ align: 'center',
239
+ render: function (text, record, index) {
240
+ var currentOnlyQunj = currentRecordIsOnlyQunj(record);
241
+ if (currentOnlyQunj) {
242
+ return null;
243
+ }
244
+ var _a = getColumnMergeProp({
245
+ record: record,
246
+ index: index,
247
+ records: records,
248
+ dataTypeSort: dataTypeSort,
249
+ }), currentDataType = _a.currentDataType, preDataTypeRecordsLength = _a.preDataTypeRecordsLength;
250
+ var _b = allData[currentDataType] || {}, isEdit = _b.isEdit, sameTypeRecords = _b.records, setSameTypeRecords = _b.setRecords, fileFieldsNameRef = _b.fileFieldsNameRef;
251
+ var _c = (fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) || {}, oldVersionId = _c.oldVersionId, oldVersionName = _c.oldVersionName;
252
+ // 是否添加水印
253
+ var isWater = (record === null || record === void 0 ? void 0 : record.isWatermark) + '' === '1' ? true : false;
254
+ // 是否替换附件
255
+ var isReplaceFile = (record === null || record === void 0 ? void 0 : record.isReplaceFile) + '' === '1' ? true : false;
256
+ var showAddWater = record === null || record === void 0 ? void 0 : record.showAddWater;
257
+ return (React.createElement(FileOperation, { fileName: text, fileId: record.attachId, preFileId: record === null || record === void 0 ? void 0 : record[oldVersionId || ''], preFileName: record === null || record === void 0 ? void 0 : record[oldVersionName || ''], isDownload: true, isDelete: isEdit && isShowFileUpload, isPreview: true, isEdit: isEdit, isWater: isWater, apiBaseUrl: apiBaseUrl, fileBaseUrl: fileBaseUrl, records: sameTypeRecords, organizationId: organizationId, isReplaceFile: isReplaceFile, showAddWater: showAddWater, onDelete: function () {
258
+ var _a;
259
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
260
+ var dataTypeIndex = index - preDataTypeRecordsLength;
261
+ var copyRecords = sameTypeRecords === null || sameTypeRecords === void 0 ? void 0 : sameTypeRecords.slice();
262
+ if (Array.isArray(copyRecords)) {
263
+ // 记录被删除的附件,用于判断是否需要清理电子印章信息
264
+ var deletedRecord = copyRecords[dataTypeIndex];
265
+ copyRecords.splice(dataTypeIndex, 1);
266
+ if (copyRecords.length === 0) {
267
+ setSameTypeRecords(defaultOnlyQunjRecords);
268
+ var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
269
+ var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
270
+ // 所有附件删完时,同时清理群杰印章共享数据
271
+ var setQunjChecked = (allData[currentDataType] || {}).setQunjChecked;
272
+ setQunjChecked === null || setQunjChecked === void 0 ? void 0 : setQunjChecked(false);
273
+ onValueChange &&
274
+ onValueChange(__assign(__assign((_a = {}, _a[firstDataType] = {
275
+ fileList: defaultOnlyQunjRecords,
276
+ }, _a), clearElectronListData), clearElectronSetting));
277
+ }
278
+ else {
279
+ setSameTypeRecords(copyRecords);
280
+ // 同类型的附件共用电子印章信息,只有当被删除的附件勾选了电子印章
281
+ // 且删除后同类型下不再有任何勾选电子印章的附件时,才清理电子印章信息
282
+ clearElectronDataWhenNoSealFile(deletedRecord, copyRecords, allData, currentDataType, onValueChange);
283
+ }
284
+ }
285
+ }, onWatermarkChange: function (isChecked) {
286
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
287
+ var dataTypeIndex = index - preDataTypeRecordsLength;
288
+ setSameTypeRecords(function (preRecords) {
289
+ var _a;
290
+ var copyRecords = (preRecords === null || preRecords === void 0 ? void 0 : preRecords.slice()) || [];
291
+ var item = copyRecords[dataTypeIndex];
292
+ copyRecords.splice(dataTypeIndex, 1, __assign(__assign({}, item), (_a = { isWatermark: isChecked ? 1 : 0 }, _a[DATA_TYPE_KEY] = currentDataType, _a)));
293
+ return copyRecords;
294
+ });
295
+ }, fileList: records, onFileReplace: onFileReplace, previewUrl: previewUrl, request: request, isTranslation: isTranslation, record: record, setRecords: setSameTypeRecords, realIndex: index, isNeedDg: isNeedDg }));
296
+ },
297
+ },
298
+ {
299
+ title: i18next.t('上传时间'),
300
+ dataIndex: 'createTime',
301
+ key: 'createTime',
302
+ width: 112,
303
+ align: 'center',
304
+ render: function (text, record, index) {
305
+ var date = getCreateTimeHand(record);
306
+ // 如果是内部附件 不展示上传时间
307
+ if (currentRecordIsOnlyQunj(record)) {
308
+ return '';
309
+ }
310
+ return date ? (React.createElement(React.Fragment, null,
311
+ React.createElement("div", null, dayjs(date).format(i18next.t('YYYY年MM月DD日'))),
312
+ React.createElement("div", null, dayjs(date).format('HH:mm:ss')))) : ('');
313
+ },
314
+ },
315
+ ],
316
+ },
317
+ ];
318
+ if (isShowFileType) {
319
+ if (isNewQys) {
320
+ fileColumns.unshift(fileTypeColumn);
321
+ }
322
+ else {
323
+ fileColumns[0].children.unshift(fileTypeColumn);
324
+ }
325
+ }
326
+ return {
327
+ fileColumns: fileColumns,
328
+ };
329
+ }
@@ -0,0 +1,19 @@
1
+ import type { ColumnsType } from 'antd/es/table';
2
+ import { ITrackAllData, IFileItem, IFileUploadProps, IElectronSignaturesItemPublic } from '../interface';
3
+ interface IOptions {
4
+ /** 所有数据类型合并之后的数据 */
5
+ records: IFileItem[];
6
+ /** 所有数据类型的排序规则 */
7
+ dataTypeSort: string[];
8
+ /** 所有数据类型的相关操作 */
9
+ allData: ITrackAllData;
10
+ fileUploadProps?: IFileUploadProps;
11
+ /** 是否显示上传附件按钮 */
12
+ isShowFileUpload?: IElectronSignaturesItemPublic['isShowFileUpload'];
13
+ apiBaseUrl?: IElectronSignaturesItemPublic['apiBaseUrl'];
14
+ fileBaseUrl?: IElectronSignaturesItemPublic['fileBaseUrl'];
15
+ }
16
+ export default function useFileTypeColumns(options: IOptions): {
17
+ fileTypeColumns: ColumnsType<any>;
18
+ };
19
+ export {};
@@ -0,0 +1,72 @@
1
+ import i18next from 'ztxkutils/dist/i18next';
2
+ import React from 'react';
3
+ import { DATA_TYPE_KEY, getColumnMergeProp } from '../hooks/useParseRecords';
4
+ // 附件归属类型
5
+ export default function useFileTypeColumns(options) {
6
+ var allData = options.allData, records = options.records, dataTypeSort = options.dataTypeSort;
7
+ var fileTypeColumns = [
8
+ {
9
+ title: i18next.t('附件归属'),
10
+ dataIndex: 'attachBelongTo',
11
+ key: 'attachBelongTo',
12
+ width: 70,
13
+ align: 'center',
14
+ // 固定列宽(scroll.x=max-content 时 width 会被内容撑开)
15
+ onHeaderCell: function () { return ({
16
+ className: 'file-belong-col',
17
+ style: { width: 70, minWidth: 70, maxWidth: 70 },
18
+ }); },
19
+ onCell: function () { return ({
20
+ className: 'file-belong-col',
21
+ style: { width: 70, minWidth: 70, maxWidth: 70 },
22
+ }); },
23
+ render: function (text, record, index) {
24
+ var _a = getColumnMergeProp({
25
+ record: record,
26
+ index: index,
27
+ records: records,
28
+ dataTypeSort: dataTypeSort,
29
+ }), props = _a.props, currentDataType = _a.currentDataType, preDataTypeRecordsLength = _a.preDataTypeRecordsLength;
30
+ var _b = allData[currentDataType] || {}, dataTypeName = _b.dataTypeName, isBgColor = _b.isBgColor, fileSplitRules = _b.fileSplitRules;
31
+ // 新的合并规则
32
+ var newProps = props;
33
+ var newDataTypeName = dataTypeName;
34
+ // 根据附件信息来拆分附件
35
+ if (fileSplitRules) {
36
+ // 需要重新计算合并的规则
37
+ // 1. 找到属于同种类型的数据
38
+ var dataTypeRecords = records === null || records === void 0 ? void 0 : records.filter(function (record) { return (record === null || record === void 0 ? void 0 : record[DATA_TYPE_KEY]) === currentDataType; });
39
+ // 2. 找到当前数据的拆分规则
40
+ var fileSplitRule_1 = fileSplitRules(record);
41
+ // 3. 找到同种类型的数据中 属于 同种拆分规则的数据
42
+ var fileSplitRuleFiles = dataTypeRecords.filter(function (record) {
43
+ return fileSplitRule_1.key === fileSplitRules(record).key;
44
+ });
45
+ // 4. 同类型 同拆分规则数据的长度
46
+ var fileSplitRuleFilesLength = fileSplitRuleFiles.length;
47
+ // 这里默认同种类型的数据 属于相同拆分规则的数据 已经按顺序组合好了
48
+ // 所有之前数据的长度
49
+ // 找到首次出现该拆分类型的数据索引
50
+ var firstFindFileSPlitRuleIndex = dataTypeRecords.findIndex(function (record) { return fileSplitRule_1.key === fileSplitRules(record).key; });
51
+ newProps = {
52
+ rowSpan: index === preDataTypeRecordsLength + firstFindFileSPlitRuleIndex
53
+ ? fileSplitRuleFilesLength
54
+ : 0,
55
+ };
56
+ newDataTypeName = fileSplitRule_1.name;
57
+ }
58
+ // 处理能否切换是否盖电子印章逻辑
59
+ return {
60
+ children: (React.createElement("div", { className: "file-add--wrap", style: { backgroundColor: isBgColor ? '#63F163' : '' } },
61
+ React.createElement("div", { className: "file-add--fragment" }),
62
+ React.createElement("div", { className: "file-add--btn" },
63
+ React.createElement("div", { className: "file-add--text" }, newDataTypeName)))),
64
+ props: newProps,
65
+ };
66
+ },
67
+ },
68
+ ];
69
+ return {
70
+ fileTypeColumns: fileTypeColumns,
71
+ };
72
+ }
@@ -0,0 +1,30 @@
1
+ export interface IQjVerifyCode {
2
+ /**
3
+ * 流程id
4
+ */
5
+ processId: string;
6
+ /**
7
+ * 验证码
8
+ */
9
+ qjVerificationCode: string;
10
+ /**
11
+ * 接口是否获取失败
12
+ */
13
+ isError?: boolean;
14
+ [key: string]: any;
15
+ }
16
+ /**
17
+ * 根据规则获取群杰验证码
18
+ */
19
+ export default function useGetQjVerifyCode(options: any): {
20
+ qjVerifyCodeData: IQjVerifyCode[];
21
+ getQjVerifyCodeHandle: (queryParams: any) => any;
22
+ };
23
+ /**
24
+ * @returns 根据token获取用户信息
25
+ */
26
+ export declare function getUserInfoByToken(): unknown;
27
+ /**
28
+ * 权限比对
29
+ */
30
+ export declare function comparePermission(permission?: string): boolean;
@@ -0,0 +1,134 @@
1
+ import i18next from 'ztxkutils/dist/i18next';
2
+ import { useCallback, useEffect, useMemo, useState } from 'react';
3
+ import { getToken, jwtDecode } from 'ztxkutils/dist/authority';
4
+ import { message } from '../../../index';
5
+ import useServiceName from '../../../hooks/useServiceName';
6
+ /**
7
+ * 根据规则获取群杰验证码
8
+ */
9
+ export default function useGetQjVerifyCode(options) {
10
+ var allOptions = options.allOptions, request = options.request, isNewQys = options.isNewQys;
11
+ var _a = (useServiceName() || {}).scmServiceName, scmServiceName = _a === void 0 ? '/zmdms-scm-system' : _a;
12
+ var _b = useState([]), qjVerifyCodeData = _b[0], setQjVerifyCodeData = _b[1];
13
+ // 根据allOptions解析出需要的参数
14
+ var params = useMemo(function () {
15
+ if (!isNewQys) {
16
+ return [];
17
+ }
18
+ if (Array.isArray(allOptions)) {
19
+ return allOptions
20
+ .filter(function (item) { return item.wfProcessInstId; })
21
+ .map(function (option) { return ({
22
+ verifyUserIds: option.verifyUserIds,
23
+ wfProcessInstId: option.wfProcessInstId,
24
+ isAuth: comparePermission(option.verifyUserIds),
25
+ }); });
26
+ }
27
+ if (allOptions && allOptions.wfProcessInstId) {
28
+ return [
29
+ {
30
+ verifyUserIds: allOptions.verifyUserIds,
31
+ wfProcessInstId: allOptions.wfProcessInstId,
32
+ isAuth: comparePermission(allOptions.verifyUserIds),
33
+ },
34
+ ];
35
+ }
36
+ return [];
37
+ }, [allOptions, isNewQys]);
38
+ // 根据解析出来的参数,和当前用户信息,获取最终查询参数
39
+ var queryParams = useMemo(function () {
40
+ if (!isNewQys) {
41
+ return '';
42
+ }
43
+ if (params) {
44
+ return params
45
+ .filter(function (item) { return item.isAuth && item.wfProcessInstId; })
46
+ .map(function (item) { return item.wfProcessInstId; })
47
+ .join(',');
48
+ }
49
+ return '';
50
+ }, [params, isNewQys]);
51
+ var getQjVerifyCodeHandle = useCallback(function (queryParams) {
52
+ return request({
53
+ url: "/api" + scmServiceName + "/qjverificationcode/get-verify-code-by-processids?processIds=" + queryParams,
54
+ method: 'get',
55
+ })
56
+ .then(function (res) {
57
+ if (res.status === 200 && res.data.code === 200) {
58
+ return res;
59
+ }
60
+ return Promise.reject(res);
61
+ })
62
+ .catch(function (error) {
63
+ var _a, _b;
64
+ 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('群杰验证码请求失败!'));
65
+ return Promise.reject(error);
66
+ });
67
+ // eslint-disable-next-line react-hooks/exhaustive-deps
68
+ }, []);
69
+ // 发出请求
70
+ useEffect(function () {
71
+ if (queryParams && isNewQys) {
72
+ getQjVerifyCodeHandle(queryParams)
73
+ .then(function (res) {
74
+ if (res.status === 200 && res.data.code === 200) {
75
+ setQjVerifyCodeData(res.data.data);
76
+ }
77
+ else {
78
+ // 接口请求失败时,将数据拆分一下,让各自的列表自行去重复上传
79
+ var list = queryParams.split(',');
80
+ setQjVerifyCodeData(list.map(function (item) {
81
+ return {
82
+ processId: item,
83
+ qjVerificationCode: '',
84
+ isError: true,
85
+ };
86
+ }));
87
+ }
88
+ })
89
+ .catch(function (error) {
90
+ var _a, _b;
91
+ // 接口请求失败时,将数据拆分一下,让各自的列表自行去重复上传
92
+ var list = queryParams.split(',');
93
+ setQjVerifyCodeData(list.map(function (item) {
94
+ return {
95
+ processId: item,
96
+ qjVerificationCode: '',
97
+ isError: true,
98
+ };
99
+ }));
100
+ 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('群杰验证码请求失败!'));
101
+ return Promise.reject(error);
102
+ });
103
+ }
104
+ // eslint-disable-next-line react-hooks/exhaustive-deps
105
+ }, [queryParams, isNewQys]);
106
+ return {
107
+ qjVerifyCodeData: qjVerifyCodeData,
108
+ getQjVerifyCodeHandle: getQjVerifyCodeHandle,
109
+ };
110
+ }
111
+ /**
112
+ * @returns 根据token获取用户信息
113
+ */
114
+ export function getUserInfoByToken() {
115
+ var token = getToken();
116
+ if (token) {
117
+ var userInfo = jwtDecode(token);
118
+ return userInfo;
119
+ }
120
+ return null;
121
+ }
122
+ /**
123
+ * 权限比对
124
+ */
125
+ export function comparePermission(permission) {
126
+ var userInfo = getUserInfoByToken();
127
+ if (userInfo && permission) {
128
+ var user_id = userInfo.user_id;
129
+ if (permission.includes(user_id)) {
130
+ return true;
131
+ }
132
+ }
133
+ return false;
134
+ }
@@ -0,0 +1,17 @@
1
+ import { IFileItem, ITrackAllData } from '../interface';
2
+ interface IOptions {
3
+ allData: ITrackAllData;
4
+ dataTypeSort: string[];
5
+ isDeleteAllFileWhenJustUseQj?: boolean;
6
+ isDeletePlaceholderFileData?: boolean;
7
+ isSupportNoAttachQj?: boolean;
8
+ }
9
+ /**
10
+ * 将各级获取到的附件数据拉平成一个整体
11
+ */
12
+ export default function useMergeRecords(options: IOptions): {
13
+ mergeRecords: IFileItem[];
14
+ isQunjOnlyChecked: boolean;
15
+ isHiddenColumns: boolean;
16
+ };
17
+ export {};
@@ -0,0 +1,49 @@
1
+ import { useMemo } from 'react';
2
+ import { currentRecordIsOnlyQunj } from '../utils';
3
+ /**
4
+ * 将各级获取到的附件数据拉平成一个整体
5
+ */
6
+ export default function useMergeRecords(options) {
7
+ var allData = options.allData, dataTypeSort = options.dataTypeSort, isDeleteAllFileWhenJustUseQj = options.isDeleteAllFileWhenJustUseQj, isDeletePlaceholderFileData = options.isDeletePlaceholderFileData, isSupportNoAttachQj = options.isSupportNoAttachQj;
8
+ var mergeRecords = useMemo(function () {
9
+ var allRecords = [];
10
+ dataTypeSort.forEach(function (dataType) {
11
+ var _a;
12
+ var records = ((_a = allData === null || allData === void 0 ? void 0 : allData[dataType]) === null || _a === void 0 ? void 0 : _a.records) || [];
13
+ // 这里不清楚为什么要过滤掉群杰印章的占位符??? 这里加个新属性,标识可以无附件时添加群杰印章
14
+ if (isDeletePlaceholderFileData && !isSupportNoAttachQj) {
15
+ records = records.filter(function (record) { return !currentRecordIsOnlyQunj(record); });
16
+ }
17
+ allRecords = allRecords.concat(records);
18
+ });
19
+ return allRecords;
20
+ }, [allData, dataTypeSort, isDeletePlaceholderFileData, isSupportNoAttachQj]);
21
+ // 是否仅选中群杰印章
22
+ var isQunjOnlyChecked = useMemo(function () {
23
+ return mergeRecords.some(function (record) { return currentRecordIsOnlyQunj(record); });
24
+ }, [mergeRecords]);
25
+ // 是否能隐藏非群杰印章模块
26
+ var isHiddenColumns = useMemo(function () {
27
+ // 如果没数据的话,不显示契约锁吗?
28
+ if (mergeRecords.length === 0) {
29
+ return false;
30
+ }
31
+ if (!isDeleteAllFileWhenJustUseQj) {
32
+ return false;
33
+ }
34
+ if (Array.isArray(mergeRecords)) {
35
+ if (mergeRecords.length === 1) {
36
+ return mergeRecords.every(function (record) { return currentRecordIsOnlyQunj(record); });
37
+ }
38
+ if (mergeRecords.length === 2) {
39
+ return mergeRecords.every(function (record) { return currentRecordIsOnlyQunj(record); });
40
+ }
41
+ }
42
+ return false;
43
+ }, [mergeRecords, isDeleteAllFileWhenJustUseQj]);
44
+ return {
45
+ mergeRecords: mergeRecords,
46
+ isQunjOnlyChecked: isQunjOnlyChecked,
47
+ isHiddenColumns: isHiddenColumns,
48
+ };
49
+ }