ztxkui 10.0.94 → 10.0.96
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.
- package/dist/components/PrintContainer/print-container.js +19 -14
- package/dist/components/PrintContainer/sealHooks.js +8 -6
- package/dist/components/PrintContainer/service.d.ts +1 -0
- package/dist/components/PrintContainer/service.js +2 -2
- package/dist/components/TranslationButton/DownFile.d.ts +7 -0
- package/dist/components/TranslationButton/DownFile.js +95 -0
- package/dist/components/TranslationButton/PreviewFile.d.ts +5 -0
- package/dist/components/TranslationButton/PreviewFile.js +73 -0
- package/dist/components/TranslationButton/TranslationButton.d.ts +34 -0
- package/dist/components/TranslationButton/TranslationButton.js +245 -0
- package/dist/components/TranslationButton/demoComponents/index.d.ts +3 -0
- package/dist/components/TranslationButton/demoComponents/index.js +9 -0
- package/dist/components/TranslationButton/hooks.d.ts +8 -0
- package/dist/components/TranslationButton/hooks.js +139 -0
- package/dist/components/TranslationButton/index.d.ts +4 -0
- package/dist/components/TranslationButton/index.js +4 -0
- package/dist/components/Upload/utils.d.ts +9 -2
- package/dist/components/Upload/utils.js +62 -8
- package/dist/components/UploadCustom/hooks/useDg.d.ts +6 -0
- package/dist/components/UploadCustom/hooks/useDg.js +55 -0
- package/dist/components/business/Signatures/components/CodeModal.d.ts +3 -0
- package/dist/components/business/Signatures/components/CodeModal.js +157 -0
- package/dist/components/business/Signatures/components/CompareResult.js +3 -1
- package/dist/components/business/Signatures/components/DetailTable.js +5 -4
- package/dist/components/business/Signatures/index.js +33 -31
- package/dist/components/electron-signatures/content.d.ts +9 -0
- package/dist/components/electron-signatures/content.js +1126 -0
- package/dist/components/electron-signatures/demoComponents/data.d.ts +58 -0
- package/dist/components/electron-signatures/demoComponents/data.js +1307 -0
- package/dist/components/electron-signatures/demoComponents/detail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/detail.js +283 -0
- package/dist/components/electron-signatures/demoComponents/index.d.ts +2 -0
- package/dist/components/electron-signatures/demoComponents/index.js +27 -0
- package/dist/components/electron-signatures/demoComponents/index_old.d.ts +3 -0
- package/dist/components/electron-signatures/demoComponents/index_old.js +502 -0
- package/dist/components/electron-signatures/demoComponents/jgqrd.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/jgqrd.js +135 -0
- package/dist/components/electron-signatures/demoComponents/making.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/making.js +211 -0
- package/dist/components/electron-signatures/demoComponents/makingData.d.ts +663 -0
- package/dist/components/electron-signatures/demoComponents/makingData.js +1164 -0
- package/dist/components/electron-signatures/demoComponents/newDetail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/newDetail.js +283 -0
- package/dist/components/electron-signatures/demoComponents/preview.d.ts +3 -0
- package/dist/components/electron-signatures/demoComponents/preview.js +9 -0
- package/dist/components/electron-signatures/demoComponents/singleQjDetail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/singleQjDetail.js +530 -0
- package/dist/components/electron-signatures/demoComponents/singleQjMaking.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/singleQjMaking.js +219 -0
- package/dist/components/electron-signatures/demoComponents/test.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/test.js +119 -0
- package/dist/components/electron-signatures/dgComponents/contract-comparison.d.ts +39 -0
- package/dist/components/electron-signatures/dgComponents/contract-comparison.js +53 -0
- package/dist/components/electron-signatures/dgComponents/file-comparison-btn.d.ts +11 -0
- package/dist/components/electron-signatures/dgComponents/file-comparison-btn.js +180 -0
- package/dist/components/electron-signatures/dgComponents/new-contract-comparison.d.ts +45 -0
- package/dist/components/electron-signatures/dgComponents/new-contract-comparison.js +68 -0
- package/dist/components/electron-signatures/dgComponents/useContractColumns.d.ts +21 -0
- package/dist/components/electron-signatures/dgComponents/useContractColumns.js +171 -0
- package/dist/components/electron-signatures/electron-signatures-fragment.d.ts +8 -0
- package/dist/components/electron-signatures/electron-signatures-fragment.js +344 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.d.ts +52 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.js +513 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.d.ts +8 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.js +59 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-download.d.ts +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-download.js +89 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.d.ts +9 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.js +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.d.ts +15 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.js +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item.d.ts +20 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item.js +47 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.d.ts +11 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.js +191 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-setting.d.ts +15 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-setting.js +10 -0
- package/dist/components/electron-signatures/electronComponents/last-qys-modal.d.ts +7 -0
- package/dist/components/electron-signatures/electronComponents/last-qys-modal.js +42 -0
- package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.js +43 -0
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.d.ts +30 -0
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +380 -0
- package/dist/components/electron-signatures/electronComponents/useFetchElectronData.d.ts +20 -0
- package/dist/components/electron-signatures/electronComponents/useFetchElectronData.js +167 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.js +35 -0
- package/dist/components/electron-signatures/fileComponents/file-operation.d.ts +7 -0
- package/dist/components/electron-signatures/fileComponents/file-operation.js +67 -0
- package/dist/components/electron-signatures/fileComponents/file-type-select.d.ts +12 -0
- package/dist/components/electron-signatures/fileComponents/file-type-select.js +10 -0
- package/dist/components/electron-signatures/fileComponents/file-upload.d.ts +11 -0
- package/dist/components/electron-signatures/fileComponents/file-upload.js +146 -0
- package/dist/components/electron-signatures/fileComponents/fileUtils.d.ts +17 -0
- package/dist/components/electron-signatures/fileComponents/fileUtils.js +36 -0
- package/dist/components/electron-signatures/fileComponents/new-file-operation.d.ts +10 -0
- package/dist/components/electron-signatures/fileComponents/new-file-operation.js +73 -0
- package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.d.ts +13 -0
- package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.js +43 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.d.ts +38 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.js +329 -0
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.d.ts +19 -0
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.js +72 -0
- package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.d.ts +30 -0
- package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.js +132 -0
- package/dist/components/electron-signatures/hooks/useMergeRecords.d.ts +17 -0
- package/dist/components/electron-signatures/hooks/useMergeRecords.js +49 -0
- package/dist/components/electron-signatures/hooks/useParseElectronListData.d.ts +49 -0
- package/dist/components/electron-signatures/hooks/useParseElectronListData.js +111 -0
- package/dist/components/electron-signatures/hooks/useParseElectronSetting.d.ts +102 -0
- package/dist/components/electron-signatures/hooks/useParseElectronSetting.js +363 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.d.ts +40 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.js +139 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.d.ts +36 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.js +48 -0
- package/dist/components/electron-signatures/hooks/useParseQunjListData.d.ts +56 -0
- package/dist/components/electron-signatures/hooks/useParseQunjListData.js +204 -0
- package/dist/components/electron-signatures/hooks/useParseQunjSingleData.d.ts +34 -0
- package/dist/components/electron-signatures/hooks/useParseQunjSingleData.js +110 -0
- package/dist/components/electron-signatures/hooks/useParseRecords.d.ts +65 -0
- package/dist/components/electron-signatures/hooks/useParseRecords.js +165 -0
- package/dist/components/electron-signatures/index.d.ts +13 -0
- package/dist/components/electron-signatures/index.js +54 -0
- package/dist/components/electron-signatures/index_old.d.ts +9 -0
- package/dist/components/electron-signatures/index_old.js +966 -0
- package/dist/components/electron-signatures/interface.d.ts +849 -0
- package/dist/components/electron-signatures/interface.js +57 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-apply.d.ts +6 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-apply.js +8 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-check.d.ts +21 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-check.js +41 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.d.ts +35 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.js +267 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-list.d.ts +24 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-list.js +346 -0
- package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.d.ts +20 -0
- package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.js +61 -0
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.d.ts +36 -0
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +321 -0
- package/dist/components/electron-signatures/translateComponents/TranslateButton.d.ts +10 -0
- package/dist/components/electron-signatures/translateComponents/TranslateButton.js +44 -0
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.d.ts +22 -0
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.js +50 -0
- package/dist/components/electron-signatures/utils.d.ts +26 -0
- package/dist/components/electron-signatures/utils.js +67 -0
- package/dist/components/utils/ZtxkContext.d.ts +18 -0
- package/dist/components/utils/ZtxkContext.js +5 -0
- package/dist/components/utils/useMemoizedFn.d.ts +6 -0
- package/dist/components/utils/useMemoizedFn.js +22 -0
- package/dist/components/utils/usePrevious.d.ts +3 -0
- package/dist/components/utils/usePrevious.js +13 -0
- package/dist/hooks/useServiceName.d.ts +1 -0
- package/dist/index.css +686 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +105 -87
- package/dist/request.js +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TranslationButton } from '../../../index';
|
|
4
|
+
import request from '../../../request';
|
|
5
|
+
var Demo = function () {
|
|
6
|
+
return (React.createElement("div", null,
|
|
7
|
+
React.createElement(TranslationButton, { request: request, attachId: "8121178081808801831", attachName: i18next.t('现货价格政策功能方案初稿9-27.docx'), tid: "88", previewUrl: "/document-translation-preview" })));
|
|
8
|
+
};
|
|
9
|
+
export default Demo;
|
|
@@ -0,0 +1,139 @@
|
|
|
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 { useState, useEffect, useRef } from 'react';
|
|
50
|
+
import { message } from 'ztxkui';
|
|
51
|
+
function getTranslateProgress(request, currentTid) {
|
|
52
|
+
return request === null || request === void 0 ? void 0 : request({
|
|
53
|
+
url: "/api/zmdms-resource/fanyi/query-trans-progress/" + currentTid,
|
|
54
|
+
method: 'GET',
|
|
55
|
+
}).then(function (res) {
|
|
56
|
+
var _a, _b, _c, _d, _e;
|
|
57
|
+
if (res.status === 200) {
|
|
58
|
+
var status_1 = (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.status;
|
|
59
|
+
if (status_1 === 314) {
|
|
60
|
+
return Promise.resolve(__assign({ flag: true }, (_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.data));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return Promise.resolve({
|
|
64
|
+
flag: false,
|
|
65
|
+
percent: Number((_e = (_d = res === null || res === void 0 ? void 0 : res.data) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.percent),
|
|
66
|
+
});
|
|
67
|
+
}).catch(function (err) {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
message.error(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('接口调用失败!'));
|
|
70
|
+
return Promise.reject(false);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
export function usePercent(_a) {
|
|
74
|
+
var _this = this;
|
|
75
|
+
var request = _a.request, currentTid = _a.currentTid;
|
|
76
|
+
var _b = useState(0), percent = _b[0], setPercent = _b[1];
|
|
77
|
+
var _c = useState(false), pending = _c[0], setPending = _c[1];
|
|
78
|
+
var timerRef = useRef();
|
|
79
|
+
var requestRef = useRef(request);
|
|
80
|
+
requestRef.current = request;
|
|
81
|
+
var currentTidRef = useRef(currentTid);
|
|
82
|
+
currentTidRef.current = currentTid;
|
|
83
|
+
useEffect(function () {
|
|
84
|
+
return function () {
|
|
85
|
+
return clearTimeout(timerRef.current);
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
88
|
+
useEffect(function () {
|
|
89
|
+
if (currentTid) {
|
|
90
|
+
handleTranslateProgress().then(function (isCompleted) {
|
|
91
|
+
if (!isCompleted) {
|
|
92
|
+
queryTranslateProgress();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
97
|
+
}, [currentTid]);
|
|
98
|
+
// 处理翻译进度结果
|
|
99
|
+
var handleTranslateProgress = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
100
|
+
var _a, flag, percent;
|
|
101
|
+
return __generator(this, function (_b) {
|
|
102
|
+
switch (_b.label) {
|
|
103
|
+
case 0: return [4 /*yield*/, getTranslateProgress(requestRef.current, currentTidRef.current)];
|
|
104
|
+
case 1:
|
|
105
|
+
_a = _b.sent(), flag = _a.flag, percent = _a.percent;
|
|
106
|
+
setPending(!flag);
|
|
107
|
+
setPercent(percent);
|
|
108
|
+
return [2 /*return*/, flag];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}); };
|
|
112
|
+
// 轮询翻译进度
|
|
113
|
+
var queryTranslateProgress = function () {
|
|
114
|
+
timerRef.current = setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
115
|
+
var isCompleted;
|
|
116
|
+
return __generator(this, function (_a) {
|
|
117
|
+
switch (_a.label) {
|
|
118
|
+
case 0: return [4 /*yield*/, handleTranslateProgress()];
|
|
119
|
+
case 1:
|
|
120
|
+
isCompleted = _a.sent();
|
|
121
|
+
if (!isCompleted) {
|
|
122
|
+
queryTranslateProgress();
|
|
123
|
+
}
|
|
124
|
+
return [2 /*return*/];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}); }, 2000);
|
|
128
|
+
};
|
|
129
|
+
function startTranslate() {
|
|
130
|
+
setPercent(0);
|
|
131
|
+
setPending(true);
|
|
132
|
+
queryTranslateProgress();
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
startTranslate: startTranslate,
|
|
136
|
+
percent: percent,
|
|
137
|
+
isTranslating: pending,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
@@ -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,
|
|
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
|
*/
|
|
@@ -37,5 +40,9 @@ interface IOtherOption {
|
|
|
37
40
|
/**
|
|
38
41
|
* 批量下载
|
|
39
42
|
*/
|
|
40
|
-
export declare function sealDownloadFileCallBack(request: any, params: any, otherOption?: IOtherOption): void;
|
|
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,8 +105,16 @@ export function fileBatchDownload(fileList, otherConfig) {
|
|
|
105
105
|
otherParams: otherParams,
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
export function sealFileBatchDownload(request, params,
|
|
109
|
-
|
|
108
|
+
export function sealFileBatchDownload(request, params, options, scmServiceName) {
|
|
109
|
+
var _a;
|
|
110
|
+
if (options === void 0) { options = true; }
|
|
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;
|
|
110
118
|
var otherParams = {
|
|
111
119
|
status: 'pending',
|
|
112
120
|
};
|
|
@@ -114,14 +122,14 @@ export function sealFileBatchDownload(request, params, isCompress) {
|
|
|
114
122
|
if (Array.isArray(fileList) && fileList.length > 0) {
|
|
115
123
|
if (isCompress) {
|
|
116
124
|
// 下载打包成PDF的文件。
|
|
117
|
-
|
|
125
|
+
downloadCallback(request, params, {
|
|
118
126
|
callbackAfter: function () {
|
|
119
127
|
otherParams.status = 'fulfilled';
|
|
120
128
|
},
|
|
121
129
|
callbackError: function () {
|
|
122
130
|
otherParams.status = 'rejected';
|
|
123
131
|
},
|
|
124
|
-
});
|
|
132
|
+
}, scmServiceName);
|
|
125
133
|
}
|
|
126
134
|
else {
|
|
127
135
|
// 单个文件下载
|
|
@@ -133,8 +141,10 @@ export function sealFileBatchDownload(request, params, isCompress) {
|
|
|
133
141
|
var newParams = {
|
|
134
142
|
docAttachMap: params.docAttachMap,
|
|
135
143
|
qysAttachVOList: [fileItem],
|
|
144
|
+
watermarkOrganizationType: params.watermarkOrganizationType,
|
|
145
|
+
watermarkOrganizationId: params.watermarkOrganizationId,
|
|
136
146
|
};
|
|
137
|
-
|
|
147
|
+
downloadCallback(request, newParams, {
|
|
138
148
|
callbackAfter: function () {
|
|
139
149
|
fileItem._downloadStatus = 'fulfilled';
|
|
140
150
|
if (otherParams.otherList) {
|
|
@@ -147,7 +157,7 @@ export function sealFileBatchDownload(request, params, isCompress) {
|
|
|
147
157
|
otherParams.otherList[index] = 'rejected';
|
|
148
158
|
}
|
|
149
159
|
},
|
|
150
|
-
});
|
|
160
|
+
}, scmServiceName);
|
|
151
161
|
});
|
|
152
162
|
}
|
|
153
163
|
}
|
|
@@ -208,11 +218,55 @@ export function nextDownload(donwloadReuslt, callback) {
|
|
|
208
218
|
/**
|
|
209
219
|
* 批量下载
|
|
210
220
|
*/
|
|
211
|
-
export function sealDownloadFileCallBack(request, params, otherOption) {
|
|
221
|
+
export function sealDownloadFileCallBack(request, params, otherOption, scmServiceName) {
|
|
222
|
+
if (scmServiceName === void 0) { scmServiceName = '/zmdms-scm-system'; }
|
|
223
|
+
var _a = otherOption || {}, callbackAfter = _a.callbackAfter, callbackError = _a.callbackError;
|
|
224
|
+
request({
|
|
225
|
+
method: 'POST',
|
|
226
|
+
url: "/api" + scmServiceName + "/seal/batch-download-seal-files",
|
|
227
|
+
responseType: 'blob',
|
|
228
|
+
data: params,
|
|
229
|
+
})
|
|
230
|
+
.then(function (res) {
|
|
231
|
+
var _a, _b, _c;
|
|
232
|
+
if (!((_a = res.headers) === null || _a === void 0 ? void 0 : _a['content-disposition'])) {
|
|
233
|
+
callbackError && callbackError();
|
|
234
|
+
message.warning('没有可下载的内容');
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
var fileName = res.headers['content-disposition'].split(';');
|
|
238
|
+
var fileNameArray = (_b = fileName[1]) === null || _b === void 0 ? void 0 : _b.split('=');
|
|
239
|
+
var fileNameStr = decodeURIComponent(fileNameArray[1]);
|
|
240
|
+
var blob = new Blob([res.data], {
|
|
241
|
+
type: 'application/vnd.ms-excel',
|
|
242
|
+
});
|
|
243
|
+
if (blob.size < 1) {
|
|
244
|
+
callbackError && callbackError();
|
|
245
|
+
message.warning('下载失败,下载的内容为空!');
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
var aLink = document.createElement('a');
|
|
249
|
+
aLink.style.display = 'none';
|
|
250
|
+
aLink.href = window.URL.createObjectURL(blob);
|
|
251
|
+
aLink.download = (_c = fileNameStr === null || fileNameStr === void 0 ? void 0 : fileNameStr.replace) === null || _c === void 0 ? void 0 : _c.call(fileNameStr, /["]/g, '');
|
|
252
|
+
document.body.appendChild(aLink);
|
|
253
|
+
aLink.click();
|
|
254
|
+
document.body.removeChild(aLink);
|
|
255
|
+
callbackAfter && callbackAfter();
|
|
256
|
+
})
|
|
257
|
+
.catch(function (err) {
|
|
258
|
+
callbackError && callbackError();
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* 批量下载盖章件水印
|
|
263
|
+
*/
|
|
264
|
+
export function sealWaterDownloadFileCallBack(request, params, otherOption, scmServiceName) {
|
|
265
|
+
if (scmServiceName === void 0) { scmServiceName = '/zmdms-scm-system'; }
|
|
212
266
|
var _a = otherOption || {}, callbackAfter = _a.callbackAfter, callbackError = _a.callbackError;
|
|
213
267
|
request({
|
|
214
268
|
method: 'POST',
|
|
215
|
-
url:
|
|
269
|
+
url: "/api" + scmServiceName + "/seal/batch-download-seal-files-water-mark",
|
|
216
270
|
responseType: 'blob',
|
|
217
271
|
data: params,
|
|
218
272
|
})
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
import { message } from '../../../index';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
export default function useDg(request) {
|
|
5
|
+
// 开始比对
|
|
6
|
+
var compareHandle = useCallback(function (templateId, fileId) {
|
|
7
|
+
return request === null || request === void 0 ? void 0 : request({
|
|
8
|
+
url: "/api/zmdms-resource/seal/create-compare-task/" + templateId + "/" + fileId,
|
|
9
|
+
method: 'GET',
|
|
10
|
+
}).then(function (res) {
|
|
11
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
12
|
+
message.success(i18next.t('操作成功'));
|
|
13
|
+
return res;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
message.error(res.data.msg || i18next.t('出错了'));
|
|
17
|
+
return Promise.reject(res.data.msg || i18next.t('出错了'));
|
|
18
|
+
}
|
|
19
|
+
}).catch(function (error) {
|
|
20
|
+
var _a, _b, _c, _d;
|
|
21
|
+
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('请求失败!'));
|
|
22
|
+
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('请求失败!'));
|
|
23
|
+
});
|
|
24
|
+
}, [request]);
|
|
25
|
+
// 查看比对结果
|
|
26
|
+
var lookCompareHandle = useCallback(function (taskId) {
|
|
27
|
+
return request === null || request === void 0 ? void 0 : request({
|
|
28
|
+
url: "/api/zmdms-resource/seal/query-compare-task/" + taskId,
|
|
29
|
+
method: 'GET',
|
|
30
|
+
}).then(function (res) {
|
|
31
|
+
var _a;
|
|
32
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
33
|
+
if ((_a = res.data.data[0]) === null || _a === void 0 ? void 0 : _a.url) {
|
|
34
|
+
// 比对文件预览
|
|
35
|
+
window.open(res.data.data[0].url);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
message.info(i18next.t('文件比对中,请稍后再试!'));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
message.error(res.data.msg || i18next.t('出错了'));
|
|
43
|
+
}
|
|
44
|
+
}).catch(function (error) {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
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('请求失败!'));
|
|
47
|
+
});
|
|
48
|
+
}, [request]);
|
|
49
|
+
return {
|
|
50
|
+
/** 开始比对 */
|
|
51
|
+
compareHandle: compareHandle,
|
|
52
|
+
/** 查看比对结果 */
|
|
53
|
+
lookCompareHandle: lookCompareHandle,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
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 { useForm } from '../../../ProForm';
|
|
52
|
+
var CodeModal = function (props, ref) {
|
|
53
|
+
var details = props.details, request = props.request;
|
|
54
|
+
var _a = useState(false), visible = _a[0], setVisible = _a[1];
|
|
55
|
+
var _b = useState(), code = _b[0], setCode = _b[1];
|
|
56
|
+
var form = useForm()[0];
|
|
57
|
+
var items = useMemo(function () {
|
|
58
|
+
return [
|
|
59
|
+
{
|
|
60
|
+
name: 'title',
|
|
61
|
+
label: i18next.t('流程标题'),
|
|
62
|
+
isRequired: true,
|
|
63
|
+
width: 'halfAll',
|
|
64
|
+
render: function () {
|
|
65
|
+
return React.createElement(Input, { placeholder: i18next.t('请输入流程标题') });
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'formNo',
|
|
70
|
+
label: i18next.t('流程ID'),
|
|
71
|
+
isRequired: true,
|
|
72
|
+
width: 'halfAll',
|
|
73
|
+
render: function () {
|
|
74
|
+
return React.createElement(Input, { placeholder: i18next.t('请输入流程ID') });
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'applicantEmpNumber',
|
|
79
|
+
label: i18next.t('用印人工号'),
|
|
80
|
+
isRequired: true,
|
|
81
|
+
width: 'halfAll',
|
|
82
|
+
render: function () {
|
|
83
|
+
return React.createElement(Input, { placeholder: i18next.t('请输入用印人工号') });
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
}, []);
|
|
88
|
+
var onCancel = function () {
|
|
89
|
+
setVisible(false);
|
|
90
|
+
};
|
|
91
|
+
var onOk = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
92
|
+
var params, result, data, err_1;
|
|
93
|
+
var _a, _b;
|
|
94
|
+
return __generator(this, function (_c) {
|
|
95
|
+
switch (_c.label) {
|
|
96
|
+
case 0:
|
|
97
|
+
_c.trys.push([0, 2, , 3]);
|
|
98
|
+
return [4 /*yield*/, form.validateFields()];
|
|
99
|
+
case 1:
|
|
100
|
+
_c.sent();
|
|
101
|
+
params = form.getFieldsValue();
|
|
102
|
+
if (Array.isArray(details)) {
|
|
103
|
+
result = details.map(function (item) {
|
|
104
|
+
return {
|
|
105
|
+
sealNo: item.sealNo,
|
|
106
|
+
sealCount: item.sealCount,
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
data = __assign(__assign({}, params), {
|
|
110
|
+
// 20240407 添加工号参数(额外参数)
|
|
111
|
+
fingerNo: params.applicantEmpNumber, details: result });
|
|
112
|
+
request({
|
|
113
|
+
url: '/api/zmdms-resource/seal/get-verify-code',
|
|
114
|
+
method: 'POST',
|
|
115
|
+
data: data,
|
|
116
|
+
})
|
|
117
|
+
.then(function (res) {
|
|
118
|
+
var _a, _b;
|
|
119
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
120
|
+
setCode((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.vertifyCode);
|
|
121
|
+
message.info(i18next.t('验证码已获取成功'));
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
message.error(((_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('获取验证码失败'));
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
.catch(function (err) {
|
|
128
|
+
var _a, _b;
|
|
129
|
+
console.log(err);
|
|
130
|
+
message.error(((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('获取验证码失败'));
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return [3 /*break*/, 3];
|
|
134
|
+
case 2:
|
|
135
|
+
err_1 = _c.sent();
|
|
136
|
+
console.log(err_1);
|
|
137
|
+
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]);
|
|
138
|
+
return [3 /*break*/, 3];
|
|
139
|
+
case 3: return [2 /*return*/];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}); };
|
|
143
|
+
useImperativeHandle(ref, function () {
|
|
144
|
+
return {
|
|
145
|
+
open: function (params) {
|
|
146
|
+
setVisible(true);
|
|
147
|
+
form.setFieldsValue(params);
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
return (React.createElement(Modal, { visible: visible, loading: false, width: "70%", title: i18next.t('信息补充'), onCancel: onCancel, onOk: onOk },
|
|
152
|
+
React.createElement(ProForm, { form: form, items: items }),
|
|
153
|
+
React.createElement("p", null,
|
|
154
|
+
i18next.t('验证码:'),
|
|
155
|
+
code)));
|
|
156
|
+
};
|
|
157
|
+
export default memo(forwardRef(CodeModal));
|
|
@@ -6,10 +6,12 @@ import React, { useState } from 'react';
|
|
|
6
6
|
// redux
|
|
7
7
|
// ztxkui公共组件
|
|
8
8
|
import { Button, message } from '../../../../index';
|
|
9
|
+
import useServiceName from '../../../../hooks/useServiceName';
|
|
9
10
|
var CompareResult = function (_a) {
|
|
10
11
|
var record = _a.record, index = _a.index, request = _a.request;
|
|
11
12
|
// 设置查看比对结果按钮的loading状态
|
|
12
13
|
var _b = useState(false), resultLoading = _b[0], setResultLoading = _b[1];
|
|
14
|
+
var _c = (useServiceName() || {}).scmServiceName, scmServiceName = _c === void 0 ? '/zmdms-scm-system' : _c;
|
|
13
15
|
var viewCompareResult = function () {
|
|
14
16
|
console.log('查看比对结果', index, record);
|
|
15
17
|
setResultLoading(true);
|
|
@@ -18,7 +20,7 @@ var CompareResult = function (_a) {
|
|
|
18
20
|
if (task_id) {
|
|
19
21
|
// 比对任务状态查询
|
|
20
22
|
request({
|
|
21
|
-
url: "/api/
|
|
23
|
+
url: "/api" + scmServiceName + "/seal/query-compare-task/" + task_id,
|
|
22
24
|
method: 'GET',
|
|
23
25
|
})
|
|
24
26
|
.then(function (res) {
|
|
@@ -33,12 +33,13 @@ var DetailTable = function (_a) {
|
|
|
33
33
|
var authToken = token || '';
|
|
34
34
|
var isOnlyQj = "" + ((_b = records === null || records === void 0 ? void 0 : records[0]) === null || _b === void 0 ? void 0 : _b.attachId) === '123456789';
|
|
35
35
|
var selectRows = useRef(null);
|
|
36
|
-
var
|
|
36
|
+
var _d = React.useContext(ZtxkContext), downWaterConfig = _d.downWaterConfig, serviceNames = _d.serviceNames;
|
|
37
|
+
var _e = (serviceNames || {}).scmServiceName, scmServiceName = _e === void 0 ? '/zmdms-scm-system' : _e;
|
|
37
38
|
/** 下载水印附件 */
|
|
38
39
|
var downFileFn = function (_record) {
|
|
39
40
|
try {
|
|
40
41
|
var xhr_1 = new XMLHttpRequest();
|
|
41
|
-
var apiUrl = "/
|
|
42
|
+
var apiUrl = scmServiceName + "/seal/download-watermark-attach/" + (_record === null || _record === void 0 ? void 0 : _record.attachId) + "?Zmdms-Auth=bearer " + token;
|
|
42
43
|
if (downWaterConfig === null || downWaterConfig === void 0 ? void 0 : downWaterConfig.api) {
|
|
43
44
|
apiUrl = (downWaterConfig === null || downWaterConfig === void 0 ? void 0 : downWaterConfig.api) + "/" + (_record === null || _record === void 0 ? void 0 : _record.attachId) + "?Zmdms-Auth=bearer " + token + "&addWaterMark=true&watermarkOrganizationType=12&watermarkOrganizationId=" + organizationId;
|
|
44
45
|
}
|
|
@@ -355,7 +356,7 @@ var DetailTable = function (_a) {
|
|
|
355
356
|
})) {
|
|
356
357
|
return;
|
|
357
358
|
}
|
|
358
|
-
sealBatchDownloadRef.current = sealFileBatchDownload(request, params);
|
|
359
|
+
sealBatchDownloadRef.current = sealFileBatchDownload(request, params, true, scmServiceName);
|
|
359
360
|
}
|
|
360
361
|
else {
|
|
361
362
|
// 根据相关信息生成下载的链接
|
|
@@ -364,7 +365,7 @@ var DetailTable = function (_a) {
|
|
|
364
365
|
})) {
|
|
365
366
|
return;
|
|
366
367
|
}
|
|
367
|
-
sealNoCompressBatchDownloadRef.current = sealFileBatchDownload(request, params, false);
|
|
368
|
+
sealNoCompressBatchDownloadRef.current = sealFileBatchDownload(request, params, false, scmServiceName);
|
|
368
369
|
}
|
|
369
370
|
// request({
|
|
370
371
|
// method: 'POST',
|