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
@@ -24,7 +24,10 @@ export interface IResultType {
24
24
  otherParams: IParams;
25
25
  }
26
26
  export declare function fileBatchDownload(fileList: IFileItem[], otherConfig: IConfig): IResultType;
27
- export declare function sealFileBatchDownload(request: any, params: any, isCompress?: boolean, scmServiceName?: string): Partial<IResultType>;
27
+ export declare function sealFileBatchDownload(request: any, params: any, options?: {
28
+ isCompress: boolean;
29
+ isWater?: boolean;
30
+ } | boolean, scmServiceName?: string): Partial<IResultType>;
28
31
  /**
29
32
  * 是否可以下载
30
33
  */
@@ -38,4 +41,8 @@ interface IOtherOption {
38
41
  * 批量下载
39
42
  */
40
43
  export declare function sealDownloadFileCallBack(request: any, params: any, otherOption?: IOtherOption, scmServiceName?: string): void;
44
+ /**
45
+ * 批量下载盖章件水印
46
+ */
47
+ export declare function sealWaterDownloadFileCallBack(request: any, params: any, otherOption?: IOtherOption, scmServiceName?: string): void;
41
48
  export {};
@@ -105,9 +105,16 @@ export function fileBatchDownload(fileList, otherConfig) {
105
105
  otherParams: otherParams,
106
106
  };
107
107
  }
108
- export function sealFileBatchDownload(request, params, isCompress, scmServiceName) {
109
- if (isCompress === void 0) { isCompress = true; }
108
+ export function sealFileBatchDownload(request, params, options, scmServiceName) {
109
+ var _a;
110
+ if (options === void 0) { options = true; }
110
111
  if (scmServiceName === void 0) { scmServiceName = '/zmdms-scm-system'; }
112
+ // 兼容旧签名:第3个参数既支持 boolean(旧用法)也支持 options 对象
113
+ var isCompress = typeof options === 'boolean' ? options : (_a = options === null || options === void 0 ? void 0 : options.isCompress) !== null && _a !== void 0 ? _a : true;
114
+ var isWater = typeof options === 'boolean' ? false : options === null || options === void 0 ? void 0 : options.isWater;
115
+ var downloadCallback = isWater
116
+ ? sealWaterDownloadFileCallBack
117
+ : sealDownloadFileCallBack;
111
118
  var otherParams = {
112
119
  status: 'pending',
113
120
  };
@@ -115,7 +122,7 @@ export function sealFileBatchDownload(request, params, isCompress, scmServiceNam
115
122
  if (Array.isArray(fileList) && fileList.length > 0) {
116
123
  if (isCompress) {
117
124
  // 下载打包成PDF的文件。
118
- sealDownloadFileCallBack(request, params, {
125
+ downloadCallback(request, params, {
119
126
  callbackAfter: function () {
120
127
  otherParams.status = 'fulfilled';
121
128
  },
@@ -134,8 +141,10 @@ export function sealFileBatchDownload(request, params, isCompress, scmServiceNam
134
141
  var newParams = {
135
142
  docAttachMap: params.docAttachMap,
136
143
  qysAttachVOList: [fileItem],
144
+ watermarkOrganizationType: params.watermarkOrganizationType,
145
+ watermarkOrganizationId: params.watermarkOrganizationId,
137
146
  };
138
- sealDownloadFileCallBack(request, newParams, {
147
+ downloadCallback(request, newParams, {
139
148
  callbackAfter: function () {
140
149
  fileItem._downloadStatus = 'fulfilled';
141
150
  if (otherParams.otherList) {
@@ -249,3 +258,46 @@ export function sealDownloadFileCallBack(request, params, otherOption, scmServic
249
258
  callbackError && callbackError();
250
259
  });
251
260
  }
261
+ /**
262
+ * 批量下载盖章件水印
263
+ */
264
+ export function sealWaterDownloadFileCallBack(request, params, otherOption, scmServiceName) {
265
+ if (scmServiceName === void 0) { scmServiceName = '/zmdms-scm-system'; }
266
+ var _a = otherOption || {}, callbackAfter = _a.callbackAfter, callbackError = _a.callbackError;
267
+ request({
268
+ method: 'POST',
269
+ url: "/api" + scmServiceName + "/seal/batch-download-seal-files-water-mark",
270
+ responseType: 'blob',
271
+ data: params,
272
+ })
273
+ .then(function (res) {
274
+ var _a, _b, _c;
275
+ if (!((_a = res.headers) === null || _a === void 0 ? void 0 : _a['content-disposition'])) {
276
+ callbackError && callbackError();
277
+ message.warning('没有可下载的内容');
278
+ return;
279
+ }
280
+ var fileName = res.headers['content-disposition'].split(';');
281
+ var fileNameArray = (_b = fileName[1]) === null || _b === void 0 ? void 0 : _b.split('=');
282
+ var fileNameStr = decodeURIComponent(fileNameArray[1]);
283
+ var blob = new Blob([res.data], {
284
+ type: 'application/vnd.ms-excel',
285
+ });
286
+ if (blob.size < 1) {
287
+ callbackError && callbackError();
288
+ message.warning('下载失败,下载的内容为空!');
289
+ return;
290
+ }
291
+ var aLink = document.createElement('a');
292
+ aLink.style.display = 'none';
293
+ aLink.href = window.URL.createObjectURL(blob);
294
+ aLink.download = (_c = fileNameStr === null || fileNameStr === void 0 ? void 0 : fileNameStr.replace) === null || _c === void 0 ? void 0 : _c.call(fileNameStr, /["]/g, '');
295
+ document.body.appendChild(aLink);
296
+ aLink.click();
297
+ document.body.removeChild(aLink);
298
+ callbackAfter && callbackAfter();
299
+ })
300
+ .catch(function (err) {
301
+ callbackError && callbackError();
302
+ });
303
+ }
@@ -0,0 +1,6 @@
1
+ export default function useDg(request: any): {
2
+ /** 开始比对 */
3
+ compareHandle: (templateId: string, fileId: string) => any;
4
+ /** 查看比对结果 */
5
+ lookCompareHandle: (taskId: string) => any;
6
+ };
@@ -0,0 +1,57 @@
1
+ import i18next from 'ztxkutils/dist/i18next';
2
+ import { message } from '../../../index';
3
+ import { useCallback } from 'react';
4
+ import useServiceName from '../../../hooks/useServiceName';
5
+ export default function useDg(request) {
6
+ var _a = (useServiceName() || {}).scmServiceName, scmServiceName = _a === void 0 ? '/zmdms-scm-system' : _a;
7
+ // 开始比对
8
+ var compareHandle = useCallback(function (templateId, fileId) {
9
+ return request === null || request === void 0 ? void 0 : request({
10
+ url: "/api" + scmServiceName + "/seal/create-compare-task/" + templateId + "/" + fileId,
11
+ method: 'GET',
12
+ }).then(function (res) {
13
+ if (res.status === 200 && res.data.code === 200) {
14
+ message.success(i18next.t('操作成功'));
15
+ return res;
16
+ }
17
+ else {
18
+ message.error(res.data.msg || i18next.t('出错了'));
19
+ return Promise.reject(res.data.msg || i18next.t('出错了'));
20
+ }
21
+ }).catch(function (error) {
22
+ var _a, _b, _c, _d;
23
+ 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('请求失败!'));
24
+ return Promise.reject(((_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.msg) || i18next.t('请求失败!'));
25
+ });
26
+ }, [request]);
27
+ // 查看比对结果
28
+ var lookCompareHandle = useCallback(function (taskId) {
29
+ return request === null || request === void 0 ? void 0 : request({
30
+ url: "/api" + scmServiceName + "/seal/query-compare-task/" + taskId,
31
+ method: 'GET',
32
+ }).then(function (res) {
33
+ var _a;
34
+ if (res.status === 200 && res.data.code === 200) {
35
+ if ((_a = res.data.data[0]) === null || _a === void 0 ? void 0 : _a.url) {
36
+ // 比对文件预览
37
+ window.open(res.data.data[0].url);
38
+ }
39
+ else {
40
+ message.info(i18next.t('文件比对中,请稍后再试!'));
41
+ }
42
+ }
43
+ else {
44
+ message.error(res.data.msg || i18next.t('出错了'));
45
+ }
46
+ }).catch(function (error) {
47
+ var _a, _b;
48
+ 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('请求失败!'));
49
+ });
50
+ }, [request]);
51
+ return {
52
+ /** 开始比对 */
53
+ compareHandle: compareHandle,
54
+ /** 查看比对结果 */
55
+ lookCompareHandle: lookCompareHandle,
56
+ };
57
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<unknown>>>;
3
+ export default _default;
@@ -0,0 +1,159 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ import i18next from 'ztxkutils/dist/i18next';
49
+ import React, { useState, useMemo, memo, forwardRef, useImperativeHandle, } from 'react';
50
+ import { Modal, ProForm, Input, message } from '../../../../index';
51
+ import useServiceName from '../../../../hooks/useServiceName';
52
+ import { useForm } from '../../../ProForm';
53
+ var CodeModal = function (props, ref) {
54
+ var details = props.details, request = props.request;
55
+ var _a = (useServiceName() || {}).scmServiceName, scmServiceName = _a === void 0 ? '/zmdms-scm-system' : _a;
56
+ var _b = useState(false), visible = _b[0], setVisible = _b[1];
57
+ var _c = useState(), code = _c[0], setCode = _c[1];
58
+ var form = useForm()[0];
59
+ var items = useMemo(function () {
60
+ return [
61
+ {
62
+ name: 'title',
63
+ label: i18next.t('流程标题'),
64
+ isRequired: true,
65
+ width: 'halfAll',
66
+ render: function () {
67
+ return React.createElement(Input, { placeholder: i18next.t('请输入流程标题') });
68
+ },
69
+ },
70
+ {
71
+ name: 'formNo',
72
+ label: i18next.t('流程ID'),
73
+ isRequired: true,
74
+ width: 'halfAll',
75
+ render: function () {
76
+ return React.createElement(Input, { placeholder: i18next.t('请输入流程ID') });
77
+ },
78
+ },
79
+ {
80
+ name: 'applicantEmpNumber',
81
+ label: i18next.t('用印人工号'),
82
+ isRequired: true,
83
+ width: 'halfAll',
84
+ render: function () {
85
+ return React.createElement(Input, { placeholder: i18next.t('请输入用印人工号') });
86
+ },
87
+ },
88
+ ];
89
+ }, []);
90
+ var onCancel = function () {
91
+ setVisible(false);
92
+ };
93
+ var onOk = function () { return __awaiter(void 0, void 0, void 0, function () {
94
+ var params, result, data, err_1;
95
+ var _a, _b;
96
+ return __generator(this, function (_c) {
97
+ switch (_c.label) {
98
+ case 0:
99
+ _c.trys.push([0, 2, , 3]);
100
+ return [4 /*yield*/, form.validateFields()];
101
+ case 1:
102
+ _c.sent();
103
+ params = form.getFieldsValue();
104
+ if (Array.isArray(details)) {
105
+ result = details.map(function (item) {
106
+ return {
107
+ sealNo: item.sealNo,
108
+ sealCount: item.sealCount,
109
+ };
110
+ });
111
+ data = __assign(__assign({}, params), {
112
+ // 20240407 添加工号参数(额外参数)
113
+ fingerNo: params.applicantEmpNumber, details: result });
114
+ request({
115
+ url: "/api" + scmServiceName + "/seal/get-verify-code",
116
+ method: 'POST',
117
+ data: data,
118
+ })
119
+ .then(function (res) {
120
+ var _a, _b;
121
+ if (res.status === 200 && res.data.code === 200) {
122
+ setCode((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.vertifyCode);
123
+ message.info(i18next.t('验证码已获取成功'));
124
+ }
125
+ else {
126
+ message.error(((_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('获取验证码失败'));
127
+ }
128
+ })
129
+ .catch(function (err) {
130
+ var _a, _b;
131
+ console.log(err);
132
+ message.error(((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('获取验证码失败'));
133
+ });
134
+ }
135
+ return [3 /*break*/, 3];
136
+ case 2:
137
+ err_1 = _c.sent();
138
+ console.log(err_1);
139
+ message.error((_b = (_a = err_1 === null || err_1 === void 0 ? void 0 : err_1.errorFields) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.errors[0]);
140
+ return [3 /*break*/, 3];
141
+ case 3: return [2 /*return*/];
142
+ }
143
+ });
144
+ }); };
145
+ useImperativeHandle(ref, function () {
146
+ return {
147
+ open: function (params) {
148
+ setVisible(true);
149
+ form.setFieldsValue(params);
150
+ },
151
+ };
152
+ });
153
+ return (React.createElement(Modal, { visible: visible, loading: false, width: "70%", title: i18next.t('信息补充'), onCancel: onCancel, onOk: onOk },
154
+ React.createElement(ProForm, { form: form, items: items }),
155
+ React.createElement("p", null,
156
+ i18next.t('验证码:'),
157
+ code)));
158
+ };
159
+ export default memo(forwardRef(CodeModal));
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { IElectronSignaturesProps } from './interface';
3
+ interface IElectronSignaturesContext {
4
+ isQjVerifyCode?: boolean;
5
+ isNewQys?: boolean;
6
+ }
7
+ export declare const ElectronSignaturesContext: React.Context<IElectronSignaturesContext>;
8
+ declare const _default: React.NamedExoticComponent<IElectronSignaturesProps>;
9
+ export default _default;