ztxkui 3.5.4 → 3.5.7
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/DemoCom/PrintContainerDemo.js +54 -28
- package/dist/UploadDemo.js +4 -2
- package/dist/components/PrintContainer/lodop.d.ts +12 -0
- package/dist/components/PrintContainer/lodop.js +43 -0
- package/dist/components/PrintContainer/print-container.d.ts +3 -1
- package/dist/components/PrintContainer/print-container.js +82 -32
- package/dist/components/business/Signatures/components/QunjSeal.js +3 -3
- package/dist/components/business/Signatures/components/SealCheckbox.d.ts +1 -0
- package/dist/components/business/Signatures/components/SealCheckbox.js +2 -2
- package/dist/components/business/Signatures/index.js +17 -17
- package/dist/index.js +84 -114
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
17
17
|
// redux
|
|
18
18
|
// ztxkui公共组件
|
|
19
19
|
import { PrintContainer } from '../index';
|
|
20
|
+
// import Table, { ColumnsType } from 'components/Table';
|
|
20
21
|
// 路由配置
|
|
21
22
|
// store
|
|
22
23
|
// 自定义组件
|
|
@@ -44,41 +45,66 @@ var dataSource1 = new Array(10).fill('1').map(function (item, index) { return ({
|
|
|
44
45
|
id: "" + index,
|
|
45
46
|
}); });
|
|
46
47
|
var PrintContainerDemo = function () {
|
|
47
|
-
|
|
48
|
+
// const [dataSource, setDataSource] = useState([]);
|
|
49
|
+
var _a = useState([]), setDataSource = _a[1];
|
|
48
50
|
var _b = useState(true), loading = _b[0], setLoading = _b[1];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
];
|
|
51
|
+
// const columns: ColumnsType<any> = [
|
|
52
|
+
// {
|
|
53
|
+
// title: '测试一',
|
|
54
|
+
// width: 100,
|
|
55
|
+
// dataIndex: 'test1',
|
|
56
|
+
// key: 'test1',
|
|
57
|
+
// },
|
|
58
|
+
// {
|
|
59
|
+
// title: '测试一',
|
|
60
|
+
// width: 100,
|
|
61
|
+
// dataIndex: 'test2',
|
|
62
|
+
// key: 'test2',
|
|
63
|
+
// },
|
|
64
|
+
// {
|
|
65
|
+
// title: '测试一',
|
|
66
|
+
// width: 100,
|
|
67
|
+
// dataIndex: 'test3',
|
|
68
|
+
// key: 'test3',
|
|
69
|
+
// },
|
|
70
|
+
// {
|
|
71
|
+
// title: '测试一',
|
|
72
|
+
// width: 100,
|
|
73
|
+
// dataIndex: 'test4',
|
|
74
|
+
// key: 'test4',
|
|
75
|
+
// },
|
|
76
|
+
// ];
|
|
75
77
|
useEffect(function () {
|
|
76
78
|
setTimeout(function () {
|
|
77
79
|
setLoading(false);
|
|
78
80
|
setDataSource(dataSource1);
|
|
79
81
|
}, 1000);
|
|
80
82
|
}, []);
|
|
81
|
-
return (React.createElement(PrintContainer, { isAddExportPage: true, loading: loading, request: request, deptId: "1527122794329313281", flowId: "scm_print_thd", fileId: "1551837561144905730", keywordList: keywordList, imgWaterBg: water
|
|
83
|
+
return (React.createElement(PrintContainer, { isAddExportPage: true, loading: loading, request: request, deptId: "1527122794329313281", flowId: "scm_print_thd", fileId: "1551837561144905730", keywordList: keywordList, imgWaterBg: water, showPrintMessage: true,
|
|
84
|
+
// onPrintBeforeCallback={() => {
|
|
85
|
+
// setLoading(true);
|
|
86
|
+
// return new Promise((resolve, reject) => {
|
|
87
|
+
// setTimeout(() => {
|
|
88
|
+
// setLoading(false);
|
|
89
|
+
// // 这样子会导致不会执行
|
|
90
|
+
// // reject(false);
|
|
91
|
+
// // 这样子会执行
|
|
92
|
+
// resolve(true);
|
|
93
|
+
// }, 2000);
|
|
94
|
+
// });
|
|
95
|
+
// }}
|
|
96
|
+
onPrintCallback: function () {
|
|
97
|
+
setLoading(true);
|
|
98
|
+
return new Promise(function (resolve, reject) {
|
|
99
|
+
setTimeout(function () {
|
|
100
|
+
setLoading(false);
|
|
101
|
+
// 这样子不会执行
|
|
102
|
+
// reject(false);
|
|
103
|
+
// 这样子会执行
|
|
104
|
+
resolve(true);
|
|
105
|
+
}, 0);
|
|
106
|
+
});
|
|
107
|
+
} },
|
|
82
108
|
React.createElement("div", null,
|
|
83
109
|
React.createElement("div", { className: "html2canvas-container-page simple-print" },
|
|
84
110
|
React.createElement("div", { className: "print-header" },
|
package/dist/UploadDemo.js
CHANGED
|
@@ -39,10 +39,11 @@ import Upload from 'components/Upload';
|
|
|
39
39
|
import { useState, useEffect, useCallback, useRef } from 'react';
|
|
40
40
|
import { UploadSingle } from './index';
|
|
41
41
|
var originFileList = [];
|
|
42
|
-
var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
42
|
+
var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25hbWUiOm51bGwsImVtcF9udW1iZXIiOm51bGwsImltdF9pZCI6bnVsbCwicmVhbF9uYW1lIjoi6ZmI5Lqa6ZuEIiwiY2xpZW50X3R5cGUiOiJ3ZWIiLCJkYXRhX3JvbGVfaWQiOiIxMzQ1OTc4NTA1MzAyMDU2OTYyLDE0NjgwMzUzNTE2MjUyODU2MzQsMTU0MjA3NjMwODU3ODAyNTQ3NCIsImNsaWVudF9pZCI6InN3b3JkIiwidXNlcl90eXBlIjoid2ViIiwicm9sZV9pZCI6IjExMjM1OTg4MTY3Mzg2NzUyMDEsMTQ2NzAxNTk3NTQ4NDc2MDA2NiwxNDY4MDM0NDM3MTU3OTYxNzI5LDE0ODA4MjkzMzc5MzkxMzI0MTciLCJwb3N0X25hbWUiOm51bGwsInNjb3BlIjpbImFsbCJdLCJpbnRlcnZpZXdfaWQiOm51bGwsImV4cCI6MTY2MDk4OTYwNCwib3JnX25hbWUiOm51bGwsImp0aSI6IjUwYWNmZDUzLWQwODMtNDdjYy05YWY5LWUzMWQxYTk1NDBmZiIsIm1lbWJlcl9pZCI6MSwiY29tcGFueV9pZCI6bnVsbCwic3lzdGVtX2lkIjpudWxsLCJkZXB0X25hbWUiOm51bGwsImF2YXRhciI6IiIsImRhdGFfcm9sZV9uYW1lIjoiYWRtaW4sYWRtaW4sYWRtaW4iLCJhdXRob3JpdGllcyI6WyJhZG1pbiIsInVzZXIiLCJhZG1pbmlzdHJhdG9yIl0sInJvbGVfbmFtZSI6ImFkbWluaXN0cmF0b3IsdXNlcixhZG1pbixhZG1pbiIsInJlc3VtZV90ZW1wbGF0ZSI6bnVsbCwibGljZW5zZSI6InBvd2VyZWQgYnkgem1kbXMiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjE0MTI5NTM4MDQzMzM1NTU3MTQiLCJvcmdfaWQiOm51bGwsIm5pY2tfbmFtZSI6IumZiOS6mumbhCIsImNvbXBhbnlfbmFtZSI6bnVsbCwiZGVwdF9pZCI6IiIsImhhbmRsZV9ocl9uYW1lIjpudWxsLCJhY2NvdW50IjoiY2hlbnl4IiwicmVzdW1lX2lkIjpudWxsfQ.eIZkNEbrItNuZ9YXo3tNhwnenZVOyVGXWh2Z5rOWC74";
|
|
43
43
|
function UploadDemo() {
|
|
44
44
|
var _this = this;
|
|
45
45
|
var _a = useState(originFileList), fileList = _a[0], setFileList = _a[1];
|
|
46
|
+
var _b = useState([]), fileList1 = _b[0], setFileList1 = _b[1];
|
|
46
47
|
var upload = useRef();
|
|
47
48
|
var uploadTableRef = useRef();
|
|
48
49
|
useEffect(function () {
|
|
@@ -139,6 +140,7 @@ function UploadDemo() {
|
|
|
139
140
|
});
|
|
140
141
|
console.log(successFileList);
|
|
141
142
|
setFileList(filelist);
|
|
143
|
+
setFileList1(filelist);
|
|
142
144
|
}
|
|
143
145
|
}, []);
|
|
144
146
|
var checkHandle = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -208,7 +210,7 @@ function UploadDemo() {
|
|
|
208
210
|
showPreviewIcon: true,
|
|
209
211
|
showDownloadIcon: true,
|
|
210
212
|
showRemoveIcon: true,
|
|
211
|
-
}, apiBaseUrl: "http://192.168.0.83:8888", fileBaseUrl: "http://192.168.0.83:88", showTable: false, showTip: false, originFileList:
|
|
213
|
+
}, apiBaseUrl: "http://192.168.0.83:8888", fileBaseUrl: "http://192.168.0.83:88", showTable: false, showTip: false, originFileList: fileList1, maxCount: 1, callback: uploadCallbackFn, onDeleteCallback: function (index, file) {
|
|
212
214
|
console.log(index, file);
|
|
213
215
|
}, authToken: token }),
|
|
214
216
|
React.createElement("button", { onClick: checkHandle }, "\u68C0\u67E5"),
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getLodop } from './utils';
|
|
2
|
+
/**
|
|
3
|
+
* 创建打印任务
|
|
4
|
+
* @param {*} taskName 任务名称
|
|
5
|
+
* @param {*} width 纸张宽度
|
|
6
|
+
* @param {*} height 纸张高度
|
|
7
|
+
*/
|
|
8
|
+
var createTask = function (_a) {
|
|
9
|
+
var taskName = _a.taskName, width = _a.width, height = _a.height;
|
|
10
|
+
var config = Object.assign({}, {
|
|
11
|
+
taskName: taskName,
|
|
12
|
+
width: width,
|
|
13
|
+
height: height,
|
|
14
|
+
});
|
|
15
|
+
var LODOP = getLodop();
|
|
16
|
+
// 打印检查安装,必装
|
|
17
|
+
CheckIsInstall(LODOP);
|
|
18
|
+
// 任务名称
|
|
19
|
+
LODOP.PRINT_INIT(config.taskName);
|
|
20
|
+
// 展示模式
|
|
21
|
+
LODOP.SET_SHOW_MODE('NP_NO_RESULT', true);
|
|
22
|
+
// 纸张大小 intOrient,intPageWidth,intPageHeight,strPageName
|
|
23
|
+
LODOP.SET_PRINT_PAGESIZE(0, width, height, 'Note');
|
|
24
|
+
return LODOP;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* 打印检查安装,必装
|
|
28
|
+
*/
|
|
29
|
+
var CheckIsInstall = function (LODOP) {
|
|
30
|
+
try {
|
|
31
|
+
if (LODOP.VERSION) {
|
|
32
|
+
if (LODOP.CVERSION) {
|
|
33
|
+
// alert('当前有WEB打印服务C-Lodop可用!\n C-Lodop版本:' + LODOP.CVERSION + '(内含Lodop' + LODOP.VERSION + ')') } else { alert('本机已成功安装了Lodop控件!\n 版本号:' + LODOP.VERSION)
|
|
34
|
+
// Vue.prototype.$message('当前有WEB打印服务C-Lodop可用' + LODOP.CVERSION)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
console.log('安装lodop');
|
|
40
|
+
window.open('http://www.lodop.net/download.html');
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export { createTask };
|
|
@@ -38,8 +38,10 @@ export interface IProps {
|
|
|
38
38
|
flowId?: string;
|
|
39
39
|
/** 水印图片 */
|
|
40
40
|
imgWaterBg?: string;
|
|
41
|
+
/** 点击打印前端的回调函数 */
|
|
42
|
+
onPrintBeforeCallback?: () => Promise<any> | void;
|
|
41
43
|
/** 点击打印的回调函数 */
|
|
42
|
-
onPrintCallback?: () => void;
|
|
44
|
+
onPrintCallback?: () => Promise<any> | void;
|
|
43
45
|
/** 是否添加点击打印提示 */
|
|
44
46
|
showPrintMessage?: boolean;
|
|
45
47
|
}
|
|
@@ -75,7 +75,7 @@ function downloadFontTTF(_a) {
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
var PrintContainer = function (_a) {
|
|
78
|
-
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, imgWaterBg = _a.imgWaterBg, onPrintCallback = _a.onPrintCallback, showPrintMessage = _a.showPrintMessage;
|
|
78
|
+
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, imgWaterBg = _a.imgWaterBg, onPrintCallback = _a.onPrintCallback, showPrintMessage = _a.showPrintMessage, onPrintBeforeCallback = _a.onPrintBeforeCallback;
|
|
79
79
|
var _h = useState(false), showWater = _h[0], setShowWater = _h[1];
|
|
80
80
|
var containerRef = useRef();
|
|
81
81
|
var allDomRef = useRef();
|
|
@@ -230,39 +230,89 @@ var PrintContainer = function (_a) {
|
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
232
|
// 打印
|
|
233
|
-
var onPrintHandle = function () {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
233
|
+
var onPrintHandle = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
234
|
+
var result, err_1, isOkSure_1;
|
|
235
|
+
return __generator(this, function (_a) {
|
|
236
|
+
switch (_a.label) {
|
|
237
|
+
case 0:
|
|
238
|
+
result = true;
|
|
239
|
+
if (!onPrintBeforeCallback) return [3 /*break*/, 4];
|
|
240
|
+
_a.label = 1;
|
|
241
|
+
case 1:
|
|
242
|
+
_a.trys.push([1, 3, , 4]);
|
|
243
|
+
return [4 /*yield*/, onPrintBeforeCallback()];
|
|
244
|
+
case 2:
|
|
245
|
+
result = _a.sent();
|
|
246
|
+
return [3 /*break*/, 4];
|
|
247
|
+
case 3:
|
|
248
|
+
err_1 = _a.sent();
|
|
249
|
+
result = null;
|
|
250
|
+
return [3 /*break*/, 4];
|
|
251
|
+
case 4:
|
|
252
|
+
if (!result) {
|
|
253
|
+
return [2 /*return*/];
|
|
254
|
+
}
|
|
255
|
+
if (showPrintMessage) {
|
|
256
|
+
isOkSure_1 = false;
|
|
257
|
+
Modal.confirm({
|
|
258
|
+
title: '打印提示',
|
|
259
|
+
content: '点击确认按钮后,将作为一次成功的打印,并记录到系统!你确认要打印吗?',
|
|
260
|
+
okText: '确认',
|
|
261
|
+
onOk: function () {
|
|
262
|
+
if (onPrintCallback) {
|
|
263
|
+
var result_1 = onPrintCallback();
|
|
264
|
+
if (result_1 instanceof Promise) {
|
|
265
|
+
var startTime_1 = Date.now();
|
|
266
|
+
result_1.then(function (res) {
|
|
267
|
+
if (res) {
|
|
268
|
+
if (Date.now() - startTime_1 > 1000) {
|
|
269
|
+
isOkSure_1 = true;
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
setTimeout(function () {
|
|
273
|
+
printCurrentDom({
|
|
274
|
+
hiddenClassNames: __spreadArray([
|
|
275
|
+
'.print-container--header'
|
|
276
|
+
], (hiddenClassName || [])),
|
|
277
|
+
});
|
|
278
|
+
}, 1000);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
isOkSure_1 = true;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
isOkSure_1 = true;
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
afterClose: function () {
|
|
292
|
+
if (isOkSure_1) {
|
|
293
|
+
setTimeout(function () {
|
|
294
|
+
printCurrentDom({
|
|
295
|
+
hiddenClassNames: __spreadArray([
|
|
296
|
+
'.print-container--header'
|
|
297
|
+
], (hiddenClassName || [])),
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
},
|
|
252
302
|
});
|
|
253
303
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
};
|
|
304
|
+
else {
|
|
305
|
+
onPrintCallback && onPrintCallback();
|
|
306
|
+
printCurrentDom({
|
|
307
|
+
hiddenClassNames: __spreadArray([
|
|
308
|
+
'.print-container--header'
|
|
309
|
+
], (hiddenClassName || [])),
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
return [2 /*return*/];
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
}); };
|
|
266
316
|
// 生成pdf
|
|
267
317
|
var onPdfHandle = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
268
318
|
var html2canvasDom;
|
|
@@ -26,11 +26,11 @@ var QunjSeal = function (_a) {
|
|
|
26
26
|
var value = _a.value, onChange = _a.onChange, isEdit = _a.isEdit, showContranctNum = _a.showContranctNum, sealList = _a.sealList, handleRef = _a.handleRef, checked = _a.checked, form = _a.form, setQunjSeal = _a.setQunjSeal;
|
|
27
27
|
useEffect(function () {
|
|
28
28
|
if (value) {
|
|
29
|
-
var _value = __assign(__assign(__assign({}, value), { isTakeOut: "" + value.isTakeOut === '1' ? 1 : 0 }), (value.contranctNum ? {} : { contranctNum: 1 }));
|
|
29
|
+
var _value = __assign(__assign(__assign({}, value), { isTakeOut: "" + value.isTakeOut === '1' ? 1 : 0 }), (value.contranctNum || !showContranctNum ? {} : { contranctNum: 1 }));
|
|
30
30
|
form.setFieldsValue(_value);
|
|
31
31
|
setQunjSeal(_value);
|
|
32
32
|
}
|
|
33
|
-
}, [value, form, setQunjSeal]);
|
|
33
|
+
}, [value, form, setQunjSeal, showContranctNum]);
|
|
34
34
|
var onSealCheckboxHandle = function (values) {
|
|
35
35
|
form.setFieldsValue({
|
|
36
36
|
values: values,
|
|
@@ -47,7 +47,7 @@ var QunjSeal = function (_a) {
|
|
|
47
47
|
overflowY: 'auto',
|
|
48
48
|
overflowX: 'hidden',
|
|
49
49
|
} },
|
|
50
|
-
React.createElement(SealCheckboxGroup, { sealList: sealList, onChange: onSealCheckboxHandle, handleRef: handleRef, isEdit: isEdit })));
|
|
50
|
+
React.createElement(SealCheckboxGroup, { sealList: sealList, onChange: onSealCheckboxHandle, handleRef: handleRef, isEdit: isEdit, showContranctNum: showContranctNum })));
|
|
51
51
|
};
|
|
52
52
|
return (React.createElement(Form, { form: form, onValuesChange: onValuesChangeHandle }, checked ? (React.createElement(React.Fragment, null,
|
|
53
53
|
React.createElement("div", { style: {
|
|
@@ -66,7 +66,7 @@ var SealCheckbox = function (_a) {
|
|
|
66
66
|
React.createElement("div", { style: { marginLeft: '50px' } }, "\u6B21"))));
|
|
67
67
|
};
|
|
68
68
|
var SealCheckboxGroup = function (_a) {
|
|
69
|
-
var value = _a.value, onChange = _a.onChange, sealList = _a.sealList, handleRef = _a.handleRef, isEdit = _a.isEdit;
|
|
69
|
+
var value = _a.value, onChange = _a.onChange, sealList = _a.sealList, handleRef = _a.handleRef, isEdit = _a.isEdit, showContranctNum = _a.showContranctNum;
|
|
70
70
|
var onChangeHandle = function (_value, index, sealNo, type) {
|
|
71
71
|
var _a, _b, _c, _d;
|
|
72
72
|
var contractNum = (_b = (_a = handleRef === null || handleRef === void 0 ? void 0 : handleRef.current) === null || _a === void 0 ? void 0 : _a.getData().qunjSeal) === null || _b === void 0 ? void 0 : _b.contranctNum;
|
|
@@ -90,7 +90,7 @@ var SealCheckboxGroup = function (_a) {
|
|
|
90
90
|
}
|
|
91
91
|
var totalSealNum = sumBy(valueArr, 'sealCount');
|
|
92
92
|
onChange && onChange(valueArr);
|
|
93
|
-
if (typeof contractNum === 'number') {
|
|
93
|
+
if (typeof contractNum === 'number' && showContranctNum) {
|
|
94
94
|
if (totalSealNum > contractNum * 4) {
|
|
95
95
|
(_c = handleRef === null || handleRef === void 0 ? void 0 : handleRef.current) === null || _c === void 0 ? void 0 : _c.getData('4');
|
|
96
96
|
message.warning('您的用印次数远超超过合理次数范围,请修改。');
|
|
@@ -107,18 +107,12 @@ var Sinatures = function (_a) {
|
|
|
107
107
|
var _r = useState(false), loading = _r[0], setLoading = _r[1];
|
|
108
108
|
/** 是否加盖群杰印章 */
|
|
109
109
|
var needQjSealFn = function (e) {
|
|
110
|
+
var _value = __assign(__assign({ isTakeOut: 0 }, (showContranctNum ? { contranctNum: 1 } : {})), { details: [] });
|
|
110
111
|
if (!e.target.checked) {
|
|
111
|
-
|
|
112
|
-
isTakeOut: 0,
|
|
113
|
-
contranctNum: 1,
|
|
114
|
-
details: [],
|
|
115
|
-
});
|
|
116
|
-
qunjSealChangeHandle({
|
|
117
|
-
isTakeOut: 0,
|
|
118
|
-
contranctNum: 1,
|
|
119
|
-
details: [],
|
|
120
|
-
});
|
|
112
|
+
_value.contranctNum = null;
|
|
121
113
|
}
|
|
114
|
+
form.setFieldsValue(_value);
|
|
115
|
+
qunjSealChangeHandle(_value);
|
|
122
116
|
setChecked(e.target.checked);
|
|
123
117
|
};
|
|
124
118
|
/** 查询用印状态 */
|
|
@@ -224,7 +218,6 @@ var Sinatures = function (_a) {
|
|
|
224
218
|
};
|
|
225
219
|
/** 指定签署位置 */
|
|
226
220
|
var checkSealFn = function () {
|
|
227
|
-
setLoading(true);
|
|
228
221
|
// 已勾选的要加盖电子印章的附件id列表
|
|
229
222
|
var checkedElecSealIds = records
|
|
230
223
|
.filter(function (item) { return item.isElectronicSeal; })
|
|
@@ -233,6 +226,7 @@ var Sinatures = function (_a) {
|
|
|
233
226
|
message.info('请勾选电子印章!');
|
|
234
227
|
return;
|
|
235
228
|
}
|
|
229
|
+
setLoading(true);
|
|
236
230
|
var params = {
|
|
237
231
|
attachIdList: [],
|
|
238
232
|
sealIdList: innerElectronicSeal,
|
|
@@ -384,7 +378,7 @@ var Sinatures = function (_a) {
|
|
|
384
378
|
title: '保存为模版',
|
|
385
379
|
key: 'templateAttachId',
|
|
386
380
|
dataIndex: 'templateAttachId',
|
|
387
|
-
width:
|
|
381
|
+
width: 110,
|
|
388
382
|
render: function (text, record, index) {
|
|
389
383
|
return NEED_SAVE_TEMPLATE.includes("" + flowId) ? (React.createElement(Switch, { checked: record.isCustomerReference, disabled: !isEdit, onChange: function (value) {
|
|
390
384
|
return onSwitchChangeHandle(value, 'isCustomerReference', index);
|
|
@@ -408,12 +402,13 @@ var Sinatures = function (_a) {
|
|
|
408
402
|
title: '电子印章',
|
|
409
403
|
key: 'needQys',
|
|
410
404
|
dataIndex: 'needQys',
|
|
405
|
+
width: 610,
|
|
411
406
|
children: [
|
|
412
407
|
{
|
|
413
408
|
title: '盖电子印章',
|
|
414
409
|
key: 'isElectronicSeal',
|
|
415
410
|
dataIndex: 'isElectronicSeal',
|
|
416
|
-
width:
|
|
411
|
+
width: 110,
|
|
417
412
|
render: function (text, record, index) {
|
|
418
413
|
return (React.createElement(Switch, { checked: text, disabled: !isEdit, onChange: function (value) {
|
|
419
414
|
return onSwitchChangeHandle(value, 'isElectronicSeal', index);
|
|
@@ -424,7 +419,7 @@ var Sinatures = function (_a) {
|
|
|
424
419
|
title: '选择电子印章',
|
|
425
420
|
key: 'electronicSeal',
|
|
426
421
|
dataIndex: 'electronicSeal',
|
|
427
|
-
width:
|
|
422
|
+
width: 320,
|
|
428
423
|
render: function (value, row, index) {
|
|
429
424
|
// 是否有勾选加盖电子印章
|
|
430
425
|
var hasElectronicSeal = records === null || records === void 0 ? void 0 : records.some(function (item) { return !!item.isElectronicSeal; });
|
|
@@ -440,10 +435,15 @@ var Sinatures = function (_a) {
|
|
|
440
435
|
title: '电子印章设置',
|
|
441
436
|
key: 'setElectronicSeal',
|
|
442
437
|
dataIndex: 'setElectronicSeal',
|
|
443
|
-
width:
|
|
438
|
+
width: 180,
|
|
444
439
|
render: function (value, row, index) {
|
|
445
440
|
var Comp = function () {
|
|
446
|
-
return records.length !== 0 ? (React.createElement("div", { style: {
|
|
441
|
+
return records.length !== 0 ? (React.createElement("div", { style: {
|
|
442
|
+
height: '100%',
|
|
443
|
+
paddingTop: '23px',
|
|
444
|
+
display: 'flex',
|
|
445
|
+
flexDirection: 'column',
|
|
446
|
+
} },
|
|
447
447
|
React.createElement(Button, { type: "link", style: __assign({}, (checkSealVisible && isEdit
|
|
448
448
|
? {}
|
|
449
449
|
: { display: 'none' })), size: "small", loading: loading, onClick: checkSealFn }, "\u6307\u5B9A\u7B7E\u7F72\u4F4D\u7F6E"),
|
|
@@ -639,7 +639,7 @@ var Sinatures = function (_a) {
|
|
|
639
639
|
return false;
|
|
640
640
|
}
|
|
641
641
|
// 超过4倍禁止提交审批
|
|
642
|
-
if (isEdit && needQj && isTotalSealNumTooMore) {
|
|
642
|
+
if (isEdit && needQj && isTotalSealNumTooMore && showContranctNum) {
|
|
643
643
|
message.warning('您的用印次数远超超过合理次数范围,请修改。');
|
|
644
644
|
return false;
|
|
645
645
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,117 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
// <DragSort />
|
|
86
|
-
// </Route>
|
|
87
|
-
// <Route exact path="/sinatures">
|
|
88
|
-
// <SinaturesDemo />
|
|
89
|
-
// </Route>
|
|
90
|
-
// <Route exact path="/test">
|
|
91
|
-
// <div>
|
|
92
|
-
// <h1>
|
|
93
|
-
// <Link to="/select">select</Link>
|
|
94
|
-
// </h1>
|
|
95
|
-
// <h1>
|
|
96
|
-
// <Link to="/tree-select">tree select</Link>
|
|
97
|
-
// </h1>
|
|
98
|
-
// <h1>
|
|
99
|
-
// <Link to="/tree">tree</Link>
|
|
100
|
-
// </h1>
|
|
101
|
-
// <h1>
|
|
102
|
-
// <Link to="/upload">upload</Link>
|
|
103
|
-
// </h1>
|
|
104
|
-
// <h1>
|
|
105
|
-
// <Link to="/drag-sort">drag-sort</Link>
|
|
106
|
-
// </h1>
|
|
107
|
-
// </div>
|
|
108
|
-
// </Route>
|
|
109
|
-
// </Switch>
|
|
110
|
-
// </BrowserRouter>
|
|
111
|
-
// </ConfigProvider>,
|
|
112
|
-
// // </React.StrictMode>,
|
|
113
|
-
// document.getElementById('root')
|
|
114
|
-
// );
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import App from './App';
|
|
4
|
+
import { ConfigProvider } from 'antd';
|
|
5
|
+
import zhCN from 'antd/lib/locale/zh_CN';
|
|
6
|
+
import * as dayjs from 'dayjs';
|
|
7
|
+
import zhCn from 'dayjs/locale/zh-cn';
|
|
8
|
+
import { BrowserRouter, Switch, Route, Link } from 'react-router-dom';
|
|
9
|
+
import Demo from './Demo';
|
|
10
|
+
import TreeSelectDemo from './TreeSelectDemo';
|
|
11
|
+
import TreeDemo from './TreeDemo';
|
|
12
|
+
import UploadDemo from './UploadDemo';
|
|
13
|
+
import CollapseDemo from './DemoCom/CollapseDemo';
|
|
14
|
+
import TimelineDemo from './DemoCom/TimelineDemo';
|
|
15
|
+
import WeChatDemo from './DemoCom/WechatDemo';
|
|
16
|
+
import TableDemo from './DemoCom/TableDemo';
|
|
17
|
+
import TableDemo1 from './DemoCom/TableDemo1';
|
|
18
|
+
import BasicDemo from './DemoCom/BasicDemo';
|
|
19
|
+
import FormDemo from './DemoCom/FormDemo';
|
|
20
|
+
import TableAnalyse from './DemoCom/TableAnalyse';
|
|
21
|
+
import DragSort from './DemoCom/DragSort';
|
|
22
|
+
import PrintDemo from './DemoCom/PrintDemo';
|
|
23
|
+
import PrintContainerDemo from './DemoCom/PrintContainerDemo';
|
|
24
|
+
import SinaturesDemo from './DemoCom/SinaturesDemo';
|
|
25
|
+
import TableDemoAll from './TableDemo';
|
|
26
|
+
import CodeQueryDemo from './DemoCom/CodeQueryDemo';
|
|
27
|
+
dayjs.locale(zhCn);
|
|
28
|
+
ReactDOM.render(
|
|
29
|
+
// <React.StrictMode>
|
|
30
|
+
React.createElement(ConfigProvider, { locale: zhCN },
|
|
31
|
+
React.createElement(BrowserRouter, null,
|
|
32
|
+
React.createElement(Switch, null,
|
|
33
|
+
React.createElement(Route, { exact: true, path: "/" },
|
|
34
|
+
React.createElement(App, null)),
|
|
35
|
+
React.createElement(Route, { exact: true, path: "/code-query" },
|
|
36
|
+
React.createElement(CodeQueryDemo, null)),
|
|
37
|
+
React.createElement(Route, { exact: true, path: "/select" },
|
|
38
|
+
React.createElement(Demo, null)),
|
|
39
|
+
React.createElement(Route, { exact: true, path: "/tree-select" },
|
|
40
|
+
React.createElement(TreeSelectDemo, null)),
|
|
41
|
+
React.createElement(Route, { exact: true, path: "/tree" },
|
|
42
|
+
React.createElement(TreeDemo, null)),
|
|
43
|
+
React.createElement(Route, { exact: true, path: "/upload" },
|
|
44
|
+
React.createElement(UploadDemo, null)),
|
|
45
|
+
React.createElement(Route, { exact: true, path: "/collapse" },
|
|
46
|
+
React.createElement(CollapseDemo, null)),
|
|
47
|
+
React.createElement(Route, { exact: true, path: "/timeline" },
|
|
48
|
+
React.createElement(TimelineDemo, null)),
|
|
49
|
+
React.createElement(Route, { exact: true, path: "/wechat" },
|
|
50
|
+
React.createElement(WeChatDemo, null)),
|
|
51
|
+
React.createElement(Route, { exact: true, path: "/table" },
|
|
52
|
+
React.createElement(TableDemo, null)),
|
|
53
|
+
React.createElement(Route, { exact: true, path: "/table1" },
|
|
54
|
+
React.createElement(TableDemo1, null)),
|
|
55
|
+
React.createElement(Route, { exact: true, path: "/basic" },
|
|
56
|
+
React.createElement(BasicDemo, null)),
|
|
57
|
+
React.createElement(Route, { exact: true, path: "/form" },
|
|
58
|
+
React.createElement(FormDemo, null)),
|
|
59
|
+
React.createElement(Route, { exact: true, path: "/print" },
|
|
60
|
+
React.createElement(PrintDemo, null)),
|
|
61
|
+
React.createElement(Route, { exact: true, path: "/print-container" },
|
|
62
|
+
React.createElement(PrintContainerDemo, null)),
|
|
63
|
+
React.createElement(Route, { exact: true, path: "/tableall" },
|
|
64
|
+
React.createElement(TableDemoAll, null)),
|
|
65
|
+
React.createElement(Route, { exact: true, path: "/table-analyse" },
|
|
66
|
+
React.createElement(TableAnalyse, null)),
|
|
67
|
+
React.createElement(Route, { exact: true, path: "/drag-sort" },
|
|
68
|
+
React.createElement(DragSort, null)),
|
|
69
|
+
React.createElement(Route, { exact: true, path: "/sinatures" },
|
|
70
|
+
React.createElement(SinaturesDemo, null)),
|
|
71
|
+
React.createElement(Route, { exact: true, path: "/test" },
|
|
72
|
+
React.createElement("div", null,
|
|
73
|
+
React.createElement("h1", null,
|
|
74
|
+
React.createElement(Link, { to: "/select" }, "select")),
|
|
75
|
+
React.createElement("h1", null,
|
|
76
|
+
React.createElement(Link, { to: "/tree-select" }, "tree select")),
|
|
77
|
+
React.createElement("h1", null,
|
|
78
|
+
React.createElement(Link, { to: "/tree" }, "tree")),
|
|
79
|
+
React.createElement("h1", null,
|
|
80
|
+
React.createElement(Link, { to: "/upload" }, "upload")),
|
|
81
|
+
React.createElement("h1", null,
|
|
82
|
+
React.createElement(Link, { to: "/drag-sort" }, "drag-sort"))))))),
|
|
83
|
+
// </React.StrictMode>,
|
|
84
|
+
document.getElementById('root'));
|
|
115
85
|
export { default as Button } from './components/Button';
|
|
116
86
|
export { default as Calendar } from './components/Calendar';
|
|
117
87
|
export { default as Checkbox } from './components/Checkbox';
|