zmdms-webui 3.1.7 → 3.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/es/applayoutsider/menu/MainMenu.js +1 -1
  2. package/dist/es/applayoutsider/menu/SubMenu.js +8 -1
  3. package/dist/es/canvastable/canvasTable.js +1 -0
  4. package/dist/es/config/MyStorage.js +11 -5
  5. package/dist/es/config/ZtxkContext.d.ts +10 -0
  6. package/dist/es/config/ZtxkContext.js +2 -0
  7. package/dist/es/config/index.js +1 -0
  8. package/dist/es/config/utils.js +58 -1
  9. package/dist/es/dynamicsetting/dynamicDrawer.js +61 -19
  10. package/dist/es/dynamicsetting/dynamicSetting.js +4 -4
  11. package/dist/es/dynamicsetting/hooks.js +4 -4
  12. package/dist/es/dynamicsetting/index.css +1 -1
  13. package/dist/es/dynamicsetting/index.js +1 -0
  14. package/dist/es/dynamicsetting/interface.d.ts +5 -0
  15. package/dist/es/dynamicsetting/useDynamic.js +5 -1
  16. package/dist/es/dynamicsetting/useSearch.js +26 -6
  17. package/dist/es/dynamicsetting/useTemplate.d.ts +4 -0
  18. package/dist/es/dynamicsetting/useTemplate.js +428 -0
  19. package/dist/es/electronsignatures/content.js +974 -0
  20. package/dist/es/electronsignatures/dgcomponents/contract-comparison.js +2 -2
  21. package/dist/es/electronsignatures/dgcomponents/file-comparison-btn.js +136 -0
  22. package/dist/es/electronsignatures/dgcomponents/new-contract-comparison.js +54 -0
  23. package/dist/es/electronsignatures/dgcomponents/useContractColumns.js +110 -39
  24. package/dist/es/electronsignatures/electron-signatures-fragment.js +11 -3
  25. package/dist/es/electronsignatures/electroncomponents/electron-seal-batch-download.js +179 -67
  26. package/dist/es/electronsignatures/electroncomponents/electron-seal-detail.js +5 -5
  27. package/dist/es/electronsignatures/electroncomponents/electron-seal-item-detail.js +15 -0
  28. package/dist/es/electronsignatures/electroncomponents/electron-seal-item.js +9 -6
  29. package/dist/es/electronsignatures/electroncomponents/useElectronColumns.js +330 -154
  30. package/dist/es/electronsignatures/electroncomponents/useFetchElectronData.js +58 -9
  31. package/dist/es/electronsignatures/electroncomponents/utils.js +119 -28
  32. package/dist/es/electronsignatures/filecomponents/file-operation.js +6 -4
  33. package/dist/es/electronsignatures/filecomponents/new-file-operation.js +56 -0
  34. package/dist/es/electronsignatures/filecomponents/useFileColumns.js +179 -102
  35. package/dist/es/electronsignatures/hooks/useGetQjVerifyCode.js +134 -0
  36. package/dist/es/electronsignatures/hooks/useMergeRecords.js +4 -3
  37. package/dist/es/electronsignatures/hooks/useParseElectronSetting.js +5 -3
  38. package/dist/es/electronsignatures/hooks/useParseIsNeedElectronData.js +21 -2
  39. package/dist/es/electronsignatures/hooks/useParseQunjSingleData.js +6 -1
  40. package/dist/es/electronsignatures/hooks/useParseRecords.js +41 -34
  41. package/dist/es/electronsignatures/index.css +1 -1
  42. package/dist/es/electronsignatures/index.js +18 -833
  43. package/dist/es/electronsignatures/interface.d.ts +129 -5
  44. package/dist/es/electronsignatures/interface.js +9 -4
  45. package/dist/es/electronsignatures/qunjcomponents/qunj-check.js +2 -2
  46. package/dist/es/electronsignatures/qunjcomponents/qunj-detail.js +135 -14
  47. package/dist/es/electronsignatures/qunjcomponents/qunj-list.js +33 -13
  48. package/dist/es/electronsignatures/qunjcomponents/useFetchQunjData.js +8 -3
  49. package/dist/es/electronsignatures/qunjcomponents/useQunjColumns.js +202 -202
  50. package/dist/es/electronsignatures/translatecomponents/TranslateButton.js +27 -0
  51. package/dist/es/electronsignatures/translatecomponents/useTranslateCom.js +35 -0
  52. package/dist/es/form/common-search-list.js +28 -9
  53. package/dist/es/form/form.js +13 -11
  54. package/dist/es/form/useCommonSearch.js +3 -4
  55. package/dist/es/table/components/EnhanceBodyBasicCell.js +9 -0
  56. package/dist/es/table/components/useDragRef.js +6 -0
  57. package/dist/es/table/constant.js +4 -1
  58. package/dist/es/table/hooks/useCtrl.js +44 -0
  59. package/dist/es/table/hooks/useSelectSubtotal.js +376 -0
  60. package/dist/es/table/index.css +1 -1
  61. package/dist/es/table/interface.d.ts +6 -0
  62. package/dist/es/table/table.js +15 -3
  63. package/dist/index.build.d.ts +1 -0
  64. package/dist/index.dark.css +1 -1
  65. package/dist/index.default.css +1 -1
  66. package/dist/index.es.js +1 -0
  67. package/dist/less/components/DynamicSetting/style/index.less +38 -0
  68. package/dist/less/components/ElectronSignatures/style/index.less +37 -5
  69. package/dist/less/components/Table/style/index.less +41 -0
  70. package/package.json +1 -1
  71. package/dist/es/electronsignatures/electroncomponents/electron-seal-download.js +0 -74
@@ -11,7 +11,7 @@ function fileBatchDownload(fileList, otherConfig) {
11
11
  };
12
12
  console.log(fileList);
13
13
  if (Array.isArray(fileList) && fileList.length > 0) {
14
- var _a = otherConfig.showDownloadBtn, showDownloadBtn_1 = _a === void 0 ? true : _a, _b = otherConfig.showPreviewBtn, showPreviewBtn_1 = _b === void 0 ? true : _b, _c = otherConfig.isCompress, isCompress = _c === void 0 ? true : _c, authToken_1 = otherConfig.authToken, apiBaseUrl_1 = otherConfig.apiBaseUrl, zipName = otherConfig.zipName;
14
+ var _a = otherConfig.showDownloadBtn, showDownloadBtn_1 = _a === void 0 ? true : _a, _b = otherConfig.showPreviewBtn, showPreviewBtn_1 = _b === void 0 ? true : _b, _c = otherConfig.isCompress, isCompress = _c === void 0 ? true : _c, authToken_1 = otherConfig.authToken, apiBaseUrl_1 = otherConfig.apiBaseUrl, zipName = otherConfig.zipName, isWater_1 = otherConfig.isWater;
15
15
  // 找出可以下载的文件,以及不可以下载的文件
16
16
  fileList.forEach(function (fileItem, index) {
17
17
  var fileSize = fileItem.fileSize, operationAuth = fileItem.operationAuth;
@@ -45,7 +45,7 @@ function fileBatchDownload(fileList, otherConfig) {
45
45
  : "".concat(zipName, ".zip")
46
46
  : "批量下载附件.zip";
47
47
  // 批量下载默认需要水印
48
- var addWaterMark_1 = true;
48
+ var addWaterMark_1 = typeof isWater_1 === "boolean" ? isWater_1 : true;
49
49
  canDownloadFileList.forEach(function (fileItem) {
50
50
  attachIds_1.push(fileItem.fileId);
51
51
  fileNames_1.push(fileItem.fileName || "");
@@ -81,7 +81,7 @@ function fileBatchDownload(fileList, otherConfig) {
81
81
  downloadFile(fileId, fileName || "\u9644\u4EF6".concat(index + 1), {
82
82
  API_BASEURL: apiBaseUrl_1,
83
83
  authToken: authToken_1,
84
- waterMark: isWatermark,
84
+ waterMark: typeof isWater_1 === "boolean" ? isWater_1 : isWatermark,
85
85
  })
86
86
  .then(function (res) {
87
87
  fileItem._downloadStatus = "fulfilled";
@@ -104,8 +104,8 @@ function fileBatchDownload(fileList, otherConfig) {
104
104
  otherParams: otherParams,
105
105
  };
106
106
  }
107
- function sealFileBatchDownload(request, params, isCompress) {
108
- if (isCompress === void 0) { isCompress = true; }
107
+ function sealFileBatchDownload(request, params, options) {
108
+ var _a = options || {}, _b = _a.isCompress, isCompress = _b === void 0 ? true : _b, _c = _a.isWater, isWater = _c === void 0 ? false : _c;
109
109
  var otherParams = {
110
110
  status: "pending",
111
111
  };
@@ -113,14 +113,26 @@ function sealFileBatchDownload(request, params, isCompress) {
113
113
  if (Array.isArray(fileList) && fileList.length > 0) {
114
114
  if (isCompress) {
115
115
  // 下载打包成PDF的文件。
116
- sealDownloadFileCallBack(request, params, {
117
- callbackAfter: function () {
118
- otherParams.status = "fulfilled";
119
- },
120
- callbackError: function () {
121
- otherParams.status = "rejected";
122
- },
123
- });
116
+ if (isWater) {
117
+ sealWaterDownloadFileCallBack(request, params, {
118
+ callbackAfter: function () {
119
+ otherParams.status = "fulfilled";
120
+ },
121
+ callbackError: function () {
122
+ otherParams.status = "rejected";
123
+ },
124
+ });
125
+ }
126
+ else {
127
+ sealDownloadFileCallBack(request, params, {
128
+ callbackAfter: function () {
129
+ otherParams.status = "fulfilled";
130
+ },
131
+ callbackError: function () {
132
+ otherParams.status = "rejected";
133
+ },
134
+ });
135
+ }
124
136
  }
125
137
  else {
126
138
  // 单个文件下载
@@ -133,20 +145,41 @@ function sealFileBatchDownload(request, params, isCompress) {
133
145
  docAttachMap: params.docAttachMap,
134
146
  qysAttachVOList: [fileItem],
135
147
  };
136
- sealDownloadFileCallBack(request, newParams, {
137
- callbackAfter: function () {
138
- fileItem._downloadStatus = "fulfilled";
139
- if (otherParams.otherList) {
140
- otherParams.otherList[index] = "fulfilled";
141
- }
142
- },
143
- callbackError: function () {
144
- fileItem._downloadStatus = "rejected";
145
- if (otherParams.otherList) {
146
- otherParams.otherList[index] = "rejected";
147
- }
148
- },
149
- });
148
+ if (isWater) {
149
+ newParams.watermarkOrganizationType =
150
+ params.watermarkOrganizationType;
151
+ newParams.watermarkOrganizationId = params.watermarkOrganizationId;
152
+ sealWaterDownloadFileCallBack(request, newParams, {
153
+ callbackAfter: function () {
154
+ fileItem._downloadStatus = "fulfilled";
155
+ if (otherParams.otherList) {
156
+ otherParams.otherList[index] = "fulfilled";
157
+ }
158
+ },
159
+ callbackError: function () {
160
+ fileItem._downloadStatus = "rejected";
161
+ if (otherParams.otherList) {
162
+ otherParams.otherList[index] = "rejected";
163
+ }
164
+ },
165
+ });
166
+ }
167
+ else {
168
+ sealDownloadFileCallBack(request, newParams, {
169
+ callbackAfter: function () {
170
+ fileItem._downloadStatus = "fulfilled";
171
+ if (otherParams.otherList) {
172
+ otherParams.otherList[index] = "fulfilled";
173
+ }
174
+ },
175
+ callbackError: function () {
176
+ fileItem._downloadStatus = "rejected";
177
+ if (otherParams.otherList) {
178
+ otherParams.otherList[index] = "rejected";
179
+ }
180
+ },
181
+ });
182
+ }
150
183
  });
151
184
  }
152
185
  }
@@ -261,6 +294,64 @@ function sealDownloadFileCallBack(request, params, otherOption) {
261
294
  }
262
295
  callbackError && callbackError();
263
296
  });
297
+ }
298
+ /**
299
+ * 批量下载盖章件水印
300
+ */
301
+ function sealWaterDownloadFileCallBack(request, params, otherOption) {
302
+ var _a = otherOption || {}, callbackAfter = _a.callbackAfter, callbackError = _a.callbackError;
303
+ request({
304
+ method: "POST",
305
+ url: "/api/zmdms-resource/seal/batch-download-seal-files-water-mark",
306
+ responseType: "blob",
307
+ data: params,
308
+ })
309
+ .then(function (res) {
310
+ var _a, _b, _c;
311
+ if (!((_a = res.headers) === null || _a === void 0 ? void 0 : _a["content-disposition"])) {
312
+ callbackError && callbackError();
313
+ myMessage.warning("没有可下载的内容");
314
+ return;
315
+ }
316
+ var fileName = res.headers["content-disposition"].split(";");
317
+ var fileNameArray = (_b = fileName[1]) === null || _b === void 0 ? void 0 : _b.split("=");
318
+ var fileNameStr = decodeURIComponent(fileNameArray[1]);
319
+ var blob = new Blob([res.data], {
320
+ type: "application/vnd.ms-excel",
321
+ });
322
+ if (blob.size < 1) {
323
+ callbackError && callbackError();
324
+ myMessage.warning("下载失败,下载的内容为空!");
325
+ return;
326
+ }
327
+ var aLink = document.createElement("a");
328
+ aLink.style.display = "none";
329
+ aLink.href = window.URL.createObjectURL(blob);
330
+ aLink.download = (_c = fileNameStr === null || fileNameStr === void 0 ? void 0 : fileNameStr.replace) === null || _c === void 0 ? void 0 : _c.call(fileNameStr, /["]/g, "");
331
+ document.body.appendChild(aLink);
332
+ aLink.click();
333
+ document.body.removeChild(aLink);
334
+ callbackAfter && callbackAfter();
335
+ })
336
+ .catch(function (err) {
337
+ var _a;
338
+ try {
339
+ var file_2 = new FileReader();
340
+ file_2.readAsText((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data, "utf-8");
341
+ file_2.onload = function () {
342
+ var obj = {};
343
+ try {
344
+ obj = JSON.parse(file_2.result);
345
+ }
346
+ catch (err) { }
347
+ myMessage.warning((obj === null || obj === void 0 ? void 0 : obj.msg) || "没有可下载的内容");
348
+ };
349
+ }
350
+ catch (err) {
351
+ myMessage.warning("下载出错");
352
+ }
353
+ callbackError && callbackError();
354
+ });
264
355
  }
265
356
 
266
- export { fileBatchDownload, nextDownload, preCanDownload, sealDownloadFileCallBack, sealFileBatchDownload };
357
+ export { fileBatchDownload, nextDownload, preCanDownload, sealDownloadFileCallBack, sealFileBatchDownload, sealWaterDownloadFileCallBack };
@@ -4,11 +4,12 @@ import { memo } from 'react';
4
4
  import { downloadFile, getToken, dangerouslyXss, getFileExtension, isImageExtension, previewFile } from 'zmdms-utils';
5
5
  import { downloadWaterFile } from './fileUtils.js';
6
6
  import FileUpload from './file-upload.js';
7
+ import TranslationButtonComponents from '../translatecomponents/TranslateButton.js';
7
8
  import ButtonCom from '../../button/button.js';
8
9
  import { Checkbox, Popconfirm } from 'antd';
9
10
 
10
11
  var FileOperation = function (props) {
11
- var isDownload = props.isDownload, isPreview = props.isPreview, isEdit = props.isEdit, isWater = props.isWater, records = props.records, isDelete = props.isDelete, fileName = props.fileName, _a = props.fileId, fileId = _a === void 0 ? "" : _a, _b = props.preFileId, preFileId = _b === void 0 ? "" : _b, _c = props.preFileName, preFileName = _c === void 0 ? "" : _c, _d = props.apiBaseUrl, apiBaseUrl = _d === void 0 ? "" : _d, _e = props.fileBaseUrl, fileBaseUrl = _e === void 0 ? "" : _e, onDelete = props.onDelete, onWatermarkChange = props.onWatermarkChange, organizationId = props.organizationId, isReplaceFile = props.isReplaceFile, fileList = props.fileList, onFileReplace = props.onFileReplace;
12
+ var isDownload = props.isDownload, isPreview = props.isPreview, isEdit = props.isEdit, isWater = props.isWater, records = props.records, isDelete = props.isDelete, fileName = props.fileName, _a = props.fileId, fileId = _a === void 0 ? "" : _a, _b = props.preFileId, preFileId = _b === void 0 ? "" : _b, _c = props.preFileName, preFileName = _c === void 0 ? "" : _c, _d = props.apiBaseUrl, apiBaseUrl = _d === void 0 ? "" : _d, _e = props.fileBaseUrl, fileBaseUrl = _e === void 0 ? "" : _e, onDelete = props.onDelete, onWatermarkChange = props.onWatermarkChange, organizationId = props.organizationId, isReplaceFile = props.isReplaceFile, fileList = props.fileList, onFileReplace = props.onFileReplace, _f = props.showAddWater, showAddWater = _f === void 0 ? true : _f, request = props.request, previewUrl = props.previewUrl, isTranslation = props.isTranslation, record = props.record, realIndex = props.realIndex, setRecords = props.setRecords, isNeedDg = props.isNeedDg;
12
13
  var previewBtn = function (attachId, previewTitle, fileName) {
13
14
  return (jsx(ButtonCom, __assign({ type: "link", onClick: function () {
14
15
  // 实现批量预览,只针对图片
@@ -34,21 +35,22 @@ var FileOperation = function (props) {
34
35
  function onFileChange(info) {
35
36
  onFileReplace && onFileReplace(info, fileId);
36
37
  }
37
- return (jsxs("div", __assign({ className: "file-operation--wrap" }, { children: [jsx("p", __assign({ className: "file-operation--title" }, { children: fileName })), isEdit && fileId && (jsx("div", __assign({ className: "file-operation--isWater" }, { children: jsx(Checkbox, __assign({ checked: isWater, onChange: function (e) {
38
+ return (jsxs("div", __assign({ className: "file-operation--wrap" }, { children: [jsx("p", __assign({ className: "file-operation--title" }, { children: fileName })), showAddWater && isEdit && fileId && (jsx("div", __assign({ className: "file-operation--isWater" }, { children: jsx(Checkbox, __assign({ checked: isWater, onChange: function (e) {
38
39
  onWatermarkChange && onWatermarkChange(e.target.checked);
39
40
  } }, { children: "\u6DFB\u52A0\u6C34\u5370" })) }))), jsxs("div", __assign({ className: "file-operation--list" }, { children: [isReplaceFile && (jsx(FileUpload, __assign({ fileList: fileList, apiBaseUrl: apiBaseUrl, onFileChange: onFileChange, type: "link" }, { children: "\u66FF\u6362" }))), isDownload && fileId ? (jsx(ButtonCom, __assign({ type: "link", onClick: function () {
40
41
  downloadFile(fileId, fileName || "附件", {
41
42
  API_BASEURL: apiBaseUrl,
42
43
  waterMark: false,
43
44
  });
44
- } }, { children: "\u4E0B\u8F7D" }))) : null, isPreview && fileId && previewBtn(fileId, "预览", fileName), isPreview && preFileId && previewBtn(preFileId, "上一版", preFileName), !isEdit && isDownload && fileId && isWater ? (jsx(ButtonCom, __assign({ type: "link", onClick: function () {
45
+ } }, { children: "\u4E0B\u8F7D" }))) : null, isPreview && fileId && previewBtn(fileId, "预览", fileName), isPreview && preFileId && previewBtn(preFileId, "上一版", preFileName), (!isEdit && isDownload && fileId && isWater) ||
46
+ (!isEdit && !showAddWater) ? (jsx(ButtonCom, __assign({ type: "link", onClick: function () {
45
47
  var token = getToken();
46
48
  downloadWaterFile(fileId, dangerouslyXss(fileName || "附件"), {
47
49
  API_BASEURL: apiBaseUrl,
48
50
  authToken: token ? token : "",
49
51
  organizationId: organizationId,
50
52
  });
51
- } }, { children: "\u4E0B\u8F7D\u6C34\u5370\u7248" }))) : null, isDelete && (fileId || fileName) && (jsx(Popconfirm, __assign({ title: "\u662F\u5426\u5220\u9664\u8BE5\u6761\u6570\u636E?", cancelText: "\u5426", okText: "\u662F", onConfirm: onDelete }, { children: jsx(ButtonCom, __assign({ type: "link" }, { children: "\u5220\u9664" })) })))] }))] })));
53
+ } }, { children: "\u4E0B\u8F7D\u6C34\u5370\u7248" }))) : null, isDelete && (fileId || fileName) && (jsx(Popconfirm, __assign({ title: "\u662F\u5426\u5220\u9664\u8BE5\u6761\u6570\u636E?", cancelText: "\u5426", okText: "\u662F", onConfirm: onDelete }, { children: jsx(ButtonCom, __assign({ type: "link" }, { children: "\u5220\u9664" })) }))), isNeedDg && (jsx(TranslationButtonComponents, { request: request, previewUrl: previewUrl, isTranslation: isTranslation, record: record, realIndex: realIndex, setRecords: setRecords }))] }))] })));
52
54
  };
53
55
  var FileOperation$1 = memo(FileOperation);
54
56
 
@@ -0,0 +1,56 @@
1
+ import { __assign } from '../../_virtual/_tslib.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { memo } from 'react';
4
+ import { getFileExtension, isImageExtension, previewFile } from 'zmdms-utils';
5
+ import FileUpload from './file-upload.js';
6
+ import ButtonCom from '../../button/button.js';
7
+
8
+ var FileOperation = function (props) {
9
+ props.isDownload; var isPreview = props.isPreview; props.isEdit; props.isWater; var records = props.records; props.isDelete; var fileName = props.fileName, _a = props.fileId, fileId = _a === void 0 ? "" : _a, _b = props.preFileId, preFileId = _b === void 0 ? "" : _b, _c = props.preFileName, preFileName = _c === void 0 ? "" : _c, _d = props.apiBaseUrl, apiBaseUrl = _d === void 0 ? "" : _d, _e = props.fileBaseUrl, fileBaseUrl = _e === void 0 ? "" : _e; props.onDelete; props.onWatermarkChange; props.organizationId; var isReplaceFile = props.isReplaceFile, fileList = props.fileList, onFileReplace = props.onFileReplace; props.showAddWater; props.request; props.previewUrl; props.isTranslation; var record = props.record; props.realIndex; props.setRecords; props.isNeedDg; var currentDate = props.currentDate, isWorlflowCompleted = props.isWorlflowCompleted;
10
+ var previewBtn = function (attachId, previewTitle, fileName) {
11
+ return (jsx(ButtonCom, __assign({ type: "link", onClick: function () {
12
+ // 实现批量预览,只针对图片
13
+ var _a = getFileExtension(fileName || ""), fileExtension = _a[1];
14
+ var result = isImageExtension(fileExtension);
15
+ if (result) {
16
+ // const allImage = (Array.isArray(records) ? records : [])
17
+ // .filter(
18
+ // (item) => isImage(item.attachName) && item.attachId !== attachId
19
+ // )
20
+ // .map((item) => item.attachId);
21
+ previewFile(attachId, fileName || "", {
22
+ API_BASEURL: fileBaseUrl,
23
+ fileList: Array.isArray(records) ? records : [],
24
+ });
25
+ return;
26
+ }
27
+ previewFile(attachId, fileName || "", {
28
+ API_BASEURL: fileBaseUrl,
29
+ });
30
+ } }, { children: previewTitle })));
31
+ };
32
+ function onFileChange(info) {
33
+ onFileReplace && onFileReplace(info, fileId);
34
+ }
35
+ // 是否显示有盖章件
36
+ var isShowSeal = (record === null || record === void 0 ? void 0 : record.isElectronicSeal) + "" === "1";
37
+ // 是否显示重要文件
38
+ var isImportant = (record === null || record === void 0 ? void 0 : record.isImportant) + "" === "1";
39
+ // 是否显示水印
40
+ var isWatermark = (record === null || record === void 0 ? void 0 : record.isWatermark) + "" === "1";
41
+ // 待审核
42
+ var unAudited = (record === null || record === void 0 ? void 0 : record.isOther) + "" === "1";
43
+ // 已审核
44
+ var isAudited = (record === null || record === void 0 ? void 0 : record.isOther) + "" === "2";
45
+ // 是否显示有双签件
46
+ var doubleSignedSealInfoDTOListKey = "doubleSignedSealInfoDTOList";
47
+ var isShowSign = (record === null || record === void 0 ? void 0 : record[doubleSignedSealInfoDTOListKey]) &&
48
+ Array.isArray(record === null || record === void 0 ? void 0 : record[doubleSignedSealInfoDTOListKey]) &&
49
+ (record === null || record === void 0 ? void 0 : record[doubleSignedSealInfoDTOListKey].length) > 0;
50
+ return (jsxs("div", __assign({ className: "file-operation--wrap" }, { children: [jsx("div", __assign({ className: "file-operation--title", style: { textAlign: "left" } }, { children: previewBtn(fileId, fileName || "", fileName) })), jsxs("div", __assign({ className: "file-operation--date-container" }, { children: [jsx("div", { children: currentDate }), jsxs("div", __assign({ className: "file-operation--list" }, { children: [isReplaceFile && (jsx(FileUpload, __assign({ fileList: fileList, apiBaseUrl: apiBaseUrl, onFileChange: onFileChange, type: "link" }, { children: "\u66FF\u6362" }))), isPreview &&
51
+ preFileId &&
52
+ previewBtn(preFileId, "上一版", preFileName)] }))] })), isWorlflowCompleted ? (jsxs("div", __assign({ className: "file-operation--label" }, { children: [isImportant ? jsx("span", { children: "\u91CD\u8981" }) : null, isShowSeal ? jsx("span", { children: "\u6709\u76D6\u7AE0\u4EF6" }) : null, isShowSign ? jsx("span", { children: "\u6709\u53CC\u7B7E\u4EF6" }) : null, isWatermark ? jsx("span", { children: "\u6C34\u5370" }) : null, isAudited ? jsx("span", { children: "\u5DF2\u5BA1\u6838" }) : null, unAudited ? jsx("span", { children: "\u672A\u5BA1\u6838" }) : null] }))) : (jsxs("div", __assign({ className: "file-operation--label" }, { children: [isAudited ? jsx("span", { children: "\u5DF2\u5BA1\u6838" }) : null, unAudited ? jsx("span", { children: "\u672A\u5BA1\u6838" }) : null] })))] })));
53
+ };
54
+ var NewFileOperation = memo(FileOperation);
55
+
56
+ export { NewFileOperation as default };
@@ -1,18 +1,21 @@
1
1
  import { __assign } from '../../_virtual/_tslib.js';
2
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
+ import { useContext, useMemo } from 'react';
3
4
  import { DATA_TYPE_KEY, getColumnMergeProp } from '../hooks/useParseRecords.js';
4
5
  import FileTypeSelect from './file-type-select.js';
5
6
  import FileOperation from './file-operation.js';
6
- import { useMemo } from 'react';
7
- import { currentRecordIsOnlyQunj, onlyQunjAttachId } from '../utils.js';
7
+ import NewFileOperation from './new-file-operation.js';
8
+ import { currentRecordIsOnlyQunj, onlyQunjAttachId, isFlowCompleted } from '../utils.js';
8
9
  import dayjs from 'dayjs';
10
+ import { ElectronSignaturesContext } from '../index.js';
9
11
  import ButtonCom from '../../button/button.js';
10
12
 
11
13
  // 创建附件的clomuns
12
14
  function useFileColumns(options) {
13
15
  var records = options.records, dataTypeSort = options.dataTypeSort, allData = options.allData, isShowFileUpload = options.isShowFileUpload, apiBaseUrl = options.apiBaseUrl, fileBaseUrl = options.fileBaseUrl, firstDataType = options.firstDataType,
14
16
  // fileUploadProps,
15
- 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;
17
+ 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;
18
+ var isNewQys = useContext(ElectronSignaturesContext).isNewQys;
16
19
  var _a = allData[firstDataType] || {},
17
20
  // records: sameTypeRecords,
18
21
  setSameTypeRecords = _a.setRecords, onClearElectronListData = _a.onClearElectronListData, onClearElectronSetting = _a.onClearElectronSetting,
@@ -60,115 +63,189 @@ function useFileColumns(options) {
60
63
  } })) : (record === null || record === void 0 ? void 0 : record.attachTypeName);
61
64
  },
62
65
  };
63
- var fileColumns = [
64
- {
65
- title: (jsxs("div", __assign({ className: "file-title" }, { children: [jsx("div", __assign({ className: "file-label" }, { children: "\u9644\u4EF6" })), jsx("div", __assign({ className: "file-upload" }, { children: isShowFileUpload && currentIsEditMemo && needQj ? (isControlNeedQys || needQys ? (jsx(ButtonCom, __assign({ type: "link", className: "file-add--isOnlyQunj", onClick: function () {
66
- var _a, _b, _c;
67
- setJustNeedQj(!justNeedQj);
68
- var newNeedQys = justNeedQj ? 1 : 0;
69
- var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
70
- var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
71
- // 是否组件内部可以更改需要契约锁逻辑
72
- var needQysObj = isControlNeedQys
73
- ? { needQys: newNeedQys }
74
- : {};
75
- if (isSingleQj) {
76
- onValueChange &&
77
- onValueChange((_a = {},
78
- _a[firstDataType] = __assign(__assign(__assign({}, clearElectronListData), clearElectronSetting), needQysObj),
79
- _a));
80
- return;
81
- }
82
- if (isDeleteAllFileWhenJustUseQj) {
83
- // 如果点击仅需要群杰印章信息的话,需要删除掉所有附件信息
66
+ var fileColumns = isNewQys
67
+ ? [
68
+ {
69
+ title: "附件名称",
70
+ dataIndex: "attachName",
71
+ key: "attachName",
72
+ width: 260,
73
+ align: "center",
74
+ render: function (text, record, index) {
75
+ var currentOnlyQunj = currentRecordIsOnlyQunj(record);
76
+ if (currentOnlyQunj) {
77
+ return null;
78
+ }
79
+ var _a = getColumnMergeProp({
80
+ record: record,
81
+ index: index,
82
+ records: records,
83
+ dataTypeSort: dataTypeSort,
84
+ }), currentDataType = _a.currentDataType, preDataTypeRecordsLength = _a.preDataTypeRecordsLength;
85
+ var _b = allData[currentDataType] || {}, isEdit = _b.isEdit, sameTypeRecords = _b.records, setSameTypeRecords = _b.setRecords, fileFieldsNameRef = _b.fileFieldsNameRef, flowStatus = _b.flowStatus;
86
+ var _c = (fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) || {}, oldVersionId = _c.oldVersionId, oldVersionName = _c.oldVersionName;
87
+ // 是否添加水印
88
+ var isWater = (record === null || record === void 0 ? void 0 : record.isWatermark) + "" === "1" ? true : false;
89
+ // 是否替换附件
90
+ var isReplaceFile = (record === null || record === void 0 ? void 0 : record.isReplaceFile) + "" === "1" ? true : false;
91
+ var showAddWater = record === null || record === void 0 ? void 0 : record.showAddWater;
92
+ // 流程是否完结
93
+ var isWorlflowCompleted = isFlowCompleted(flowStatus);
94
+ var date = getCreateTimeHand(record);
95
+ // 如果是内部附件 不展示上传时间
96
+ var currentDate = currentRecordIsOnlyQunj(record) ? ("") : date ? (jsxs(Fragment, { children: [dayjs(date).format("YYYY年MM月DD日"), jsx("span", __assign({ style: { marginLeft: "4px" } }, { children: dayjs(date).format("HH:mm:ss") }))] })) : ("");
97
+ return (jsx(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 () {
98
+ var _a;
99
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
100
+ var dataTypeIndex = index - preDataTypeRecordsLength;
101
+ var copyRecords = sameTypeRecords === null || sameTypeRecords === void 0 ? void 0 : sameTypeRecords.slice();
102
+ if (Array.isArray(copyRecords)) {
103
+ copyRecords.splice(dataTypeIndex, 1);
104
+ if (copyRecords.length === 0) {
84
105
  setSameTypeRecords(defaultOnlyQunjRecords);
106
+ var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
107
+ var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
85
108
  onValueChange &&
86
- onValueChange((_b = {},
87
- _b[firstDataType] = __assign(__assign(__assign({ fileList: defaultOnlyQunjRecords }, clearElectronListData), clearElectronSetting), needQysObj),
88
- _b));
109
+ onValueChange(__assign(__assign((_a = {}, _a[firstDataType] = {
110
+ fileList: defaultOnlyQunjRecords,
111
+ }, _a), clearElectronListData), clearElectronSetting));
89
112
  }
90
113
  else {
91
- onValueChange &&
92
- onValueChange((_c = {},
93
- _c[firstDataType] = __assign(__assign(__assign({}, clearElectronListData), clearElectronSetting), needQysObj),
94
- _c));
114
+ setSameTypeRecords(copyRecords);
95
115
  }
96
- } }, { children: justNeedQj ? "使用电子印章" : "仅使用群杰印章" }))) : null) : null }))] }))),
97
- children: [
98
- {
99
- title: "名称",
100
- dataIndex: "attachName",
101
- key: "attachName",
102
- width: 160,
103
- align: "center",
104
- render: function (text, record, index) {
105
- var currentOnlyQunj = currentRecordIsOnlyQunj(record);
106
- if (currentOnlyQunj) {
107
- return null;
108
- }
109
- var _a = getColumnMergeProp({
110
- record: record,
111
- index: index,
112
- records: records,
113
- dataTypeSort: dataTypeSort,
114
- }), currentDataType = _a.currentDataType, preDataTypeRecordsLength = _a.preDataTypeRecordsLength;
115
- var _b = allData[currentDataType] || {}, isEdit = _b.isEdit, sameTypeRecords = _b.records, setSameTypeRecords = _b.setRecords, fileFieldsNameRef = _b.fileFieldsNameRef;
116
- var _c = (fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) || {}, oldVersionId = _c.oldVersionId, oldVersionName = _c.oldVersionName;
117
- // 是否添加水印
118
- var isWater = (record === null || record === void 0 ? void 0 : record.isWatermark) + "" === "1" ? true : false;
119
- // 是否替换附件
120
- var isReplaceFile = (record === null || record === void 0 ? void 0 : record.isReplaceFile) + "" === "1" ? true : false;
121
- return (jsx(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, onDelete: function () {
116
+ }
117
+ }, onWatermarkChange: function (isChecked) {
118
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
119
+ var dataTypeIndex = index - preDataTypeRecordsLength;
120
+ setSameTypeRecords(function (preRecords) {
122
121
  var _a;
123
- // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
124
- var dataTypeIndex = index - preDataTypeRecordsLength;
125
- var copyRecords = sameTypeRecords === null || sameTypeRecords === void 0 ? void 0 : sameTypeRecords.slice();
126
- if (Array.isArray(copyRecords)) {
127
- copyRecords.splice(dataTypeIndex, 1);
128
- if (copyRecords.length === 0) {
129
- setSameTypeRecords(defaultOnlyQunjRecords);
122
+ var copyRecords = (preRecords === null || preRecords === void 0 ? void 0 : preRecords.slice()) || [];
123
+ var item = copyRecords[dataTypeIndex];
124
+ copyRecords.splice(dataTypeIndex, 1, __assign(__assign({}, item), (_a = { isWatermark: isChecked ? 1 : 0 }, _a[DATA_TYPE_KEY] = currentDataType, _a)));
125
+ return copyRecords;
126
+ });
127
+ }, fileList: records, onFileReplace: onFileReplace, previewUrl: previewUrl, request: request, isTranslation: isTranslation, record: record, setRecords: setSameTypeRecords, realIndex: index, isNeedDg: isNeedDg, currentDate: currentDate }));
128
+ },
129
+ },
130
+ ]
131
+ : // 下面是最初设计的模式
132
+ [
133
+ {
134
+ title: (jsxs("div", __assign({ className: "file-title" }, { children: [jsx("div", __assign({ className: "file-label" }, { children: "\u9644\u4EF6" })), jsx("div", __assign({ className: "file-upload" }, { children: isShowFileUpload && currentIsEditMemo && needQj ? ((isControlNeedQys || needQys) && isToggleQys ? (jsx(ButtonCom, __assign({ type: "link", className: "file-add--isOnlyQunj", onClick: function () {
135
+ var _a, _b, _c;
136
+ setJustNeedQj(!justNeedQj);
137
+ var newNeedQys = justNeedQj ? 1 : 0;
130
138
  var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
131
139
  var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
132
- onValueChange &&
133
- onValueChange(__assign(__assign((_a = {}, _a[firstDataType] = { fileList: defaultOnlyQunjRecords }, _a), clearElectronListData), clearElectronSetting));
134
- }
135
- else {
136
- setSameTypeRecords(copyRecords);
137
- }
140
+ // 是否组件内部可以更改需要契约锁逻辑
141
+ var needQysObj = isControlNeedQys
142
+ ? { needQys: newNeedQys }
143
+ : {};
144
+ if (isSingleQj) {
145
+ onValueChange &&
146
+ onValueChange((_a = {},
147
+ _a[firstDataType] = __assign(__assign(__assign({}, clearElectronListData), clearElectronSetting), needQysObj),
148
+ _a));
149
+ return;
150
+ }
151
+ if (isDeleteAllFileWhenJustUseQj) {
152
+ // 如果点击仅需要群杰印章信息的话,需要删除掉所有附件信息
153
+ setSameTypeRecords(defaultOnlyQunjRecords);
154
+ onValueChange &&
155
+ onValueChange((_b = {},
156
+ _b[firstDataType] = __assign(__assign(__assign({ fileList: defaultOnlyQunjRecords }, clearElectronListData), clearElectronSetting), needQysObj),
157
+ _b));
158
+ }
159
+ else {
160
+ onValueChange &&
161
+ onValueChange((_c = {},
162
+ _c[firstDataType] = __assign(__assign(__assign({}, clearElectronListData), clearElectronSetting), needQysObj),
163
+ _c));
164
+ }
165
+ } }, { children: justNeedQj ? "使用电子印章" : "仅使用群杰印章" }))) : null) : null }))] }))),
166
+ children: [
167
+ {
168
+ title: "名称",
169
+ dataIndex: "attachName",
170
+ key: "attachName",
171
+ width: 160,
172
+ align: "center",
173
+ render: function (text, record, index) {
174
+ var currentOnlyQunj = currentRecordIsOnlyQunj(record);
175
+ if (currentOnlyQunj) {
176
+ return null;
138
177
  }
139
- }, onWatermarkChange: function (isChecked) {
140
- // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
141
- var dataTypeIndex = index - preDataTypeRecordsLength;
142
- setSameTypeRecords(function (preRecords) {
143
- var _a;
144
- var copyRecords = (preRecords === null || preRecords === void 0 ? void 0 : preRecords.slice()) || [];
145
- var item = copyRecords[dataTypeIndex];
146
- copyRecords.splice(dataTypeIndex, 1, __assign(__assign({}, item), (_a = { isWatermark: isChecked ? 1 : 0 }, _a[DATA_TYPE_KEY] = currentDataType, _a)));
147
- return copyRecords;
148
- });
149
- }, fileList: records, onFileReplace: onFileReplace }));
150
- },
151
- },
152
- {
153
- title: "上传时间",
154
- dataIndex: "createTime",
155
- key: "createTime",
156
- width: 112,
157
- align: "center",
158
- render: function (text, record, index) {
159
- var date = getCreateTimeHand(record);
160
- // 如果是内部附件 不展示上传时间
161
- if (currentRecordIsOnlyQunj(record)) {
162
- return "";
163
- }
164
- return date ? (jsxs(Fragment, { children: [jsx("div", { children: dayjs(date).format("YYYY年MM月DD日") }), jsx("div", { children: dayjs(date).format("HH:mm:ss") })] })) : ("");
165
- },
178
+ var _a = getColumnMergeProp({
179
+ record: record,
180
+ index: index,
181
+ records: records,
182
+ dataTypeSort: dataTypeSort,
183
+ }), currentDataType = _a.currentDataType, preDataTypeRecordsLength = _a.preDataTypeRecordsLength;
184
+ var _b = allData[currentDataType] || {}, isEdit = _b.isEdit, sameTypeRecords = _b.records, setSameTypeRecords = _b.setRecords, fileFieldsNameRef = _b.fileFieldsNameRef;
185
+ var _c = (fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) || {}, oldVersionId = _c.oldVersionId, oldVersionName = _c.oldVersionName;
186
+ // 是否添加水印
187
+ var isWater = (record === null || record === void 0 ? void 0 : record.isWatermark) + "" === "1" ? true : false;
188
+ // 是否替换附件
189
+ var isReplaceFile = (record === null || record === void 0 ? void 0 : record.isReplaceFile) + "" === "1" ? true : false;
190
+ var showAddWater = record === null || record === void 0 ? void 0 : record.showAddWater;
191
+ return (jsx(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 () {
192
+ var _a;
193
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
194
+ var dataTypeIndex = index - preDataTypeRecordsLength;
195
+ var copyRecords = sameTypeRecords === null || sameTypeRecords === void 0 ? void 0 : sameTypeRecords.slice();
196
+ if (Array.isArray(copyRecords)) {
197
+ copyRecords.splice(dataTypeIndex, 1);
198
+ if (copyRecords.length === 0) {
199
+ setSameTypeRecords(defaultOnlyQunjRecords);
200
+ var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
201
+ var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
202
+ onValueChange &&
203
+ onValueChange(__assign(__assign((_a = {}, _a[firstDataType] = {
204
+ fileList: defaultOnlyQunjRecords,
205
+ }, _a), clearElectronListData), clearElectronSetting));
206
+ }
207
+ else {
208
+ setSameTypeRecords(copyRecords);
209
+ }
210
+ }
211
+ }, onWatermarkChange: function (isChecked) {
212
+ // 因为数据是按照类型来归类了,那么这个索引的长度 实际应该减去之前的所有数据类型的长度
213
+ var dataTypeIndex = index - preDataTypeRecordsLength;
214
+ setSameTypeRecords(function (preRecords) {
215
+ var _a;
216
+ var copyRecords = (preRecords === null || preRecords === void 0 ? void 0 : preRecords.slice()) || [];
217
+ var item = copyRecords[dataTypeIndex];
218
+ copyRecords.splice(dataTypeIndex, 1, __assign(__assign({}, item), (_a = { isWatermark: isChecked ? 1 : 0 }, _a[DATA_TYPE_KEY] = currentDataType, _a)));
219
+ return copyRecords;
220
+ });
221
+ }, fileList: records, onFileReplace: onFileReplace, previewUrl: previewUrl, request: request, isTranslation: isTranslation, record: record, setRecords: setSameTypeRecords, realIndex: index, isNeedDg: isNeedDg }));
222
+ },
223
+ },
224
+ {
225
+ title: "上传时间",
226
+ dataIndex: "createTime",
227
+ key: "createTime",
228
+ width: 112,
229
+ align: "center",
230
+ render: function (text, record, index) {
231
+ var date = getCreateTimeHand(record);
232
+ // 如果是内部附件 不展示上传时间
233
+ if (currentRecordIsOnlyQunj(record)) {
234
+ return "";
235
+ }
236
+ return date ? (jsxs(Fragment, { children: [jsx("div", { children: dayjs(date).format("YYYY年MM月DD日") }), jsx("div", { children: dayjs(date).format("HH:mm:ss") })] })) : ("");
237
+ },
238
+ },
239
+ ],
166
240
  },
167
- ],
168
- },
169
- ];
241
+ ];
170
242
  if (isShowFileType) {
171
- fileColumns[0].children.unshift(fileTypeColumn);
243
+ if (isNewQys) {
244
+ fileColumns.unshift(fileTypeColumn);
245
+ }
246
+ else {
247
+ fileColumns[0].children.unshift(fileTypeColumn);
248
+ }
172
249
  }
173
250
  return {
174
251
  fileColumns: fileColumns,