ztxkui 3.2.16 → 3.2.17
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.
|
@@ -27,7 +27,7 @@ function request(options) {
|
|
|
27
27
|
return axios({
|
|
28
28
|
baseURL: options.baseURL ? options.baseURL : 'http://192.168.0.83:8000',
|
|
29
29
|
url: options.url,
|
|
30
|
-
headers: __assign({ 'Zmdms-Auth': 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
30
|
+
headers: __assign({ 'Zmdms-Auth': 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25hbWUiOm51bGwsImVtcF9udW1iZXIiOm51bGwsImltdF9pZCI6bnVsbCwicmVhbF9uYW1lIjoi6ZmI5Lqa6ZuEIiwiY2xpZW50X3R5cGUiOiJ3ZWIiLCJkYXRhX3JvbGVfaWQiOiIxMzQzNDkwNjg2MjYwMjI4MDk3LDEzNDU5Nzg1MDUzMDIwNTY5NjIsMTQ2ODAzNTM1MTYyNTI4NTYzNCwxNTQyMDc2MzA4NTc4MDI1NDc0IiwiY2xpZW50X2lkIjoic3dvcmQiLCJ1c2VyX3R5cGUiOiJ3ZWIiLCJyb2xlX2lkIjoiMTEyMzU5ODgxNjczODY3NTIwMSwxNDY3MDE1OTc1NDg0NzYwMDY2LDE0NjgwMzQ0MzcxNTc5NjE3MjksMTQ4MDgyOTMzNzkzOTEzMjQxNyIsInBvc3RfbmFtZSI6bnVsbCwic2NvcGUiOlsiYWxsIl0sImludGVydmlld19pZCI6bnVsbCwiZXhwIjoxNjU5NDkxNzgwLCJvcmdfbmFtZSI6bnVsbCwianRpIjoiNDlmN2UzZmQtZmIzMi00ZTZjLWIwMmUtOTBkMjdlMzY3NjVjIiwibWVtYmVyX2lkIjoxLCJjb21wYW55X2lkIjpudWxsLCJzeXN0ZW1faWQiOm51bGwsImRlcHRfbmFtZSI6bnVsbCwiYXZhdGFyIjoiIiwiZGF0YV9yb2xlX25hbWUiOiJudWxsLGFkbWluLGFkbWluLGFkbWluIiwiYXV0aG9yaXRpZXMiOlsiYWRtaW4iLCJ1c2VyIiwiYWRtaW5pc3RyYXRvciJdLCJyb2xlX25hbWUiOiJhZG1pbmlzdHJhdG9yLHVzZXIsYWRtaW4sYWRtaW4iLCJyZXN1bWVfdGVtcGxhdGUiOm51bGwsImxpY2Vuc2UiOiJwb3dlcmVkIGJ5IHptZG1zIiwicG9zdF9pZCI6IiIsInVzZXJfaWQiOiIxNDEyOTUzODA0MzMzNTU1NzE0Iiwib3JnX2lkIjpudWxsLCJuaWNrX25hbWUiOiLpmYjkuprpm4QiLCJjb21wYW55X25hbWUiOm51bGwsImRlcHRfaWQiOiIiLCJoYW5kbGVfaHJfbmFtZSI6bnVsbCwiYWNjb3VudCI6ImNoZW55eCIsInJlc3VtZV9pZCI6bnVsbH0.dvTb_yy1956xAniua6u2gVdWVa6id4uSDrxT71AgO8g' }, options.headers),
|
|
31
31
|
method: options.method,
|
|
32
32
|
data: options.data,
|
|
33
33
|
params: options.params,
|
|
@@ -25,7 +25,7 @@ function dataURLtoFile(dataurl, filename) {
|
|
|
25
25
|
return new File([u8arr], filename, { type: mime });
|
|
26
26
|
}
|
|
27
27
|
var PrintContainer = function (_a) {
|
|
28
|
-
var children = _a.children, waterText = _a.waterText, onFonsizeChange = _a.onFonsizeChange, hiddenClassName = _a.hiddenClassName, _b = _a.isAddExportPage, isAddExportPage = _b === void 0 ? false : _b, _c = _a.loading, loading = _c === void 0 ? false : _c, _d = _a.pdfName, pdfName = _d === void 0 ? 'pdf文件' : _d, request = _a.request, sealIdList = _a.sealIdList, keywordList = _a.keywordList, _e = _a.showHandSeal, showHandSeal = _e === void 0 ? true : _e, _f = _a.showAutoSeal, showAutoSeal = _f === void 0 ? true : _f, _g = _a.needWatermark, needWatermark = _g === void 0 ? 0 : _g, fileId = _a.fileId, deptId = _a.deptId, flowId = _a.flowId;
|
|
28
|
+
var children = _a.children, waterText = _a.waterText, onFonsizeChange = _a.onFonsizeChange, hiddenClassName = _a.hiddenClassName, _b = _a.isAddExportPage, isAddExportPage = _b === void 0 ? false : _b, _c = _a.loading, loading = _c === void 0 ? false : _c, _d = _a.pdfName, pdfName = _d === void 0 ? 'pdf文件' : _d, request = _a.request, sealIdList = _a.sealIdList, autoSealIdList = _a.autoSealIdList, keywordList = _a.keywordList, _e = _a.showHandSeal, showHandSeal = _e === void 0 ? true : _e, _f = _a.showAutoSeal, showAutoSeal = _f === void 0 ? true : _f, _g = _a.needWatermark, needWatermark = _g === void 0 ? 0 : _g, fileId = _a.fileId, deptId = _a.deptId, flowId = _a.flowId;
|
|
29
29
|
var _h = useState(false), showWater = _h[0], setShowWater = _h[1];
|
|
30
30
|
var _j = useState(false), pdfShowWater = _j[0], setPdfShowWater = _j[1];
|
|
31
31
|
var containerRef = useRef();
|
|
@@ -37,14 +37,21 @@ var PrintContainer = function (_a) {
|
|
|
37
37
|
var _m = useState(), currentViewUrl = _m[0], setCurrentViewUrl = _m[1];
|
|
38
38
|
// 印章列表
|
|
39
39
|
var _o = useState(), _sealIdList = _o[0], setSealIdList = _o[1];
|
|
40
|
+
// 自动盖章印章列表
|
|
41
|
+
var _p = useState(), _autoSealIdList = _p[0], setAutoSealIdList = _p[1];
|
|
40
42
|
// 关键字列表
|
|
41
|
-
var
|
|
43
|
+
var _q = useState(), _keywordList = _q[0], setKeywordList = _q[1];
|
|
42
44
|
// 根据传入参数设置印章 关键字
|
|
43
45
|
useEffect(function () {
|
|
44
46
|
if (sealIdList) {
|
|
45
47
|
setSealIdList(sealIdList);
|
|
46
48
|
}
|
|
47
49
|
}, [sealIdList]);
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
if (autoSealIdList) {
|
|
52
|
+
setAutoSealIdList(autoSealIdList);
|
|
53
|
+
}
|
|
54
|
+
}, [autoSealIdList]);
|
|
48
55
|
useEffect(function () {
|
|
49
56
|
if (keywordList) {
|
|
50
57
|
setKeywordList(keywordList);
|
|
@@ -62,29 +69,42 @@ var PrintContainer = function (_a) {
|
|
|
62
69
|
flowId: flowId,
|
|
63
70
|
deptId: deptId,
|
|
64
71
|
},
|
|
65
|
-
})
|
|
66
|
-
|
|
72
|
+
})
|
|
73
|
+
.then(function (res) {
|
|
74
|
+
var _a, _b, _c;
|
|
67
75
|
var data = res.data, status = res.status;
|
|
68
76
|
if (status === 200 && data.code === 200) {
|
|
69
77
|
var records = (data || {}).data.records;
|
|
70
78
|
if (Array.isArray(records)) {
|
|
71
|
-
var
|
|
79
|
+
var sealInfoList = ((_a = records[0]) === null || _a === void 0 ? void 0 : _a.sealInfoList) || [];
|
|
72
80
|
var __sealIdList_1 = [];
|
|
81
|
+
var __autoSealIdList_1 = [];
|
|
73
82
|
var __keywordList_1 = [];
|
|
74
|
-
|
|
83
|
+
sealInfoList.forEach(function (item, index) {
|
|
84
|
+
// 只要传入的印章 都可以手动盖章
|
|
75
85
|
if (item.sealId != null) {
|
|
76
86
|
__sealIdList_1.push(item.sealId);
|
|
77
87
|
}
|
|
88
|
+
// 有关键字才可以自动盖章
|
|
78
89
|
if (item.keyword != null) {
|
|
90
|
+
__autoSealIdList_1.push(item.sealId);
|
|
79
91
|
__keywordList_1.push(item.keyword);
|
|
80
92
|
}
|
|
81
93
|
});
|
|
82
94
|
setSealIdList(__sealIdList_1);
|
|
83
|
-
|
|
95
|
+
setAutoSealIdList(__autoSealIdList_1);
|
|
96
|
+
setKeywordList(__keywordList_1);
|
|
84
97
|
return;
|
|
85
98
|
}
|
|
86
99
|
message.info('当前部门、流程下未找到对应的印章!');
|
|
87
100
|
}
|
|
101
|
+
else {
|
|
102
|
+
message.error(((_c = (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.msg) || '获取印章失败!');
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
.catch(function (err) {
|
|
106
|
+
var _a, _b;
|
|
107
|
+
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) || '获取印章失败!');
|
|
88
108
|
});
|
|
89
109
|
}
|
|
90
110
|
}, [deptId, flowId, request]);
|
|
@@ -189,6 +209,10 @@ var PrintContainer = function (_a) {
|
|
|
189
209
|
};
|
|
190
210
|
// 确认盖章位置
|
|
191
211
|
var onSurePositionHandle = function () {
|
|
212
|
+
if (!Array.isArray(_sealIdList) || _sealIdList.length === 0) {
|
|
213
|
+
message.info("\u5F53\u524D\u90E8\u95E8\u3001\u6D41\u7A0B\u4E0B\u672A\u914D\u7F6E\u5370\u7AE0\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u914D\u7F6E!");
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
192
216
|
setSpinning(true);
|
|
193
217
|
setTimeout(function () {
|
|
194
218
|
htmlToPdfForExport({
|
|
@@ -293,6 +317,10 @@ var PrintContainer = function (_a) {
|
|
|
293
317
|
};
|
|
294
318
|
// 自动盖章
|
|
295
319
|
var onAutoSealHandle = function () {
|
|
320
|
+
if (!Array.isArray(_autoSealIdList) || _autoSealIdList.length === 0) {
|
|
321
|
+
message.info("\u5F53\u524D\u90E8\u95E8\u3001\u6D41\u7A0B\u4E0B\u672A\u914D\u7F6E\u81EA\u52A8\u76D6\u7AE0\u5173\u952E\u5B57\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u914D\u7F6E!");
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
296
324
|
setSpinning(true);
|
|
297
325
|
setTimeout(function () {
|
|
298
326
|
htmlToPdfForAutoSeal({
|
|
@@ -310,8 +338,8 @@ var PrintContainer = function (_a) {
|
|
|
310
338
|
files.forEach(function (file, i) {
|
|
311
339
|
formData.append("fileList[" + i + "]", file);
|
|
312
340
|
});
|
|
313
|
-
if (Array.isArray(
|
|
314
|
-
|
|
341
|
+
if (Array.isArray(_autoSealIdList) && Array.isArray(_keywordList)) {
|
|
342
|
+
_autoSealIdList.forEach(function (sealId, i) {
|
|
315
343
|
var keyword = _keywordList[i];
|
|
316
344
|
formData.append("sealPositionInfoList[" + i + "].sealId", sealId);
|
|
317
345
|
formData.append("sealPositionInfoList[" + i + "].keyword", keyword);
|
|
@@ -361,14 +389,10 @@ var PrintContainer = function (_a) {
|
|
|
361
389
|
React.createElement(Button, { type: "primary", onClick: onPrintHandle }, "\u6253\u5370"),
|
|
362
390
|
React.createElement(Button, { type: "primary", onClick: onPdfWaterHandle }, !pdfShowWater ? '添加导出PDF水印' : '移除导出PDF水印'),
|
|
363
391
|
React.createElement(Button, { type: "primary", onClick: onPdfHandle }, "\u5BFC\u51FAPDF"),
|
|
364
|
-
showHandSeal &&
|
|
365
|
-
Array.isArray(_sealIdList) &&
|
|
366
|
-
(_sealIdList === null || _sealIdList === void 0 ? void 0 : _sealIdList.length) > 0 && (React.createElement(React.Fragment, null,
|
|
392
|
+
showHandSeal && (React.createElement(React.Fragment, null,
|
|
367
393
|
React.createElement(Button, { type: "primary", onClick: onSurePositionHandle }, "\u786E\u8BA4\u76D6\u7AE0\u4F4D\u7F6E"),
|
|
368
394
|
currentContractId && (React.createElement(Button, { type: "primary", onClick: onSealHandle }, "\u76D6\u7AE0")))),
|
|
369
|
-
showAutoSeal &&
|
|
370
|
-
Array.isArray(_keywordList) &&
|
|
371
|
-
(_keywordList === null || _keywordList === void 0 ? void 0 : _keywordList.length) > 0 && (React.createElement(Button, { type: "primary", onClick: onAutoSealHandle }, "\u81EA\u52A8\u76D6\u7AE0")),
|
|
395
|
+
showAutoSeal && (React.createElement(Button, { type: "primary", onClick: onAutoSealHandle }, "\u81EA\u52A8\u76D6\u7AE0")),
|
|
372
396
|
React.createElement(Button, { type: "primary", onClick: onCloseHandle }, "\u5173\u95ED"))),
|
|
373
397
|
React.createElement("div", { className: "print-container--content", ref: containerRef }, children)));
|
|
374
398
|
};
|