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.
@@ -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
- var _a = useState([]), dataSource = _a[0], setDataSource = _a[1];
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
- var columns = [
50
- {
51
- title: '测试一',
52
- width: 100,
53
- dataIndex: 'test1',
54
- key: 'test1',
55
- },
56
- {
57
- title: '测试一',
58
- width: 100,
59
- dataIndex: 'test2',
60
- key: 'test2',
61
- },
62
- {
63
- title: '测试一',
64
- width: 100,
65
- dataIndex: 'test3',
66
- key: 'test3',
67
- },
68
- {
69
- title: '测试一',
70
- width: 100,
71
- dataIndex: 'test4',
72
- key: 'test4',
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" },
@@ -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.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoid2YxMCIsImVtcF9uYW1lIjoi5rWB56iL5Lit5b-DMTAiLCJlbXBfbnVtYmVyIjoiWUcyMjAzMDUwIiwiaW10X2lkIjpudWxsLCJyZWFsX25hbWUiOiLmtYHnqIvkuK3lv4MxMCIsImNsaWVudF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IiLCJhZG1pbmlzdHJhdG9yIl0sInJvbGVfbmFtZSI6ImFkbWluaXN0cmF0b3IsdXNlcixhZG1pbixhZG1pbiIsInJlc3VtZV90ZW1wbGF0ZSI6bnVsbCwibGljZW5zZSI6InBvd2VyZWQgYnkgem1kbXMiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjE0MTI5NTM4MDQzMzM1NTU3MTQiLCJvcmdfaWQiOm51bGwsIm5pY2tfbmFtZSI6IumZiOS6mumbhCIsImNvbXBhbnlfbmFtZSI6bnVsbCwiZGVwdF9pZCI6IiIsImhhbmRsZV9ocl9uYW1lIjpudWxsLCJhY2NvdW50IjoiY2hlbnl4IiwicmVzdW1lX2lkIjpudWxsfQ.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: fileList, maxCount: 1, callback: uploadCallbackFn, onDeleteCallback: function (index, file) {
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,12 @@
1
+ /**
2
+ * 创建打印任务
3
+ * @param {*} taskName 任务名称
4
+ * @param {*} width 纸张宽度
5
+ * @param {*} height 纸张高度
6
+ */
7
+ declare const createTask: ({ taskName, width, height }: {
8
+ taskName: any;
9
+ width: any;
10
+ height: any;
11
+ }) => any;
12
+ export { createTask };
@@ -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
- if (showPrintMessage) {
235
- var isOkSure_1 = false;
236
- Modal.confirm({
237
- title: '打印提示',
238
- content: '点击确认按钮后,将作为一次成功的打印,并记录到系统!你确认要打印吗?',
239
- okText: '确认',
240
- onOk: function () {
241
- isOkSure_1 = true;
242
- onPrintCallback && onPrintCallback();
243
- },
244
- afterClose: function () {
245
- if (isOkSure_1) {
246
- setTimeout(function () {
247
- printCurrentDom({
248
- hiddenClassNames: __spreadArray([
249
- '.print-container--header'
250
- ], (hiddenClassName || [])),
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
- else {
258
- onPrintCallback && onPrintCallback();
259
- printCurrentDom({
260
- hiddenClassNames: __spreadArray([
261
- '.print-container--header'
262
- ], (hiddenClassName || [])),
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: {
@@ -22,6 +22,7 @@ interface ISealProps {
22
22
  }[];
23
23
  handleRef?: any;
24
24
  isEdit: boolean;
25
+ showContranctNum: boolean;
25
26
  }
26
27
  declare const SealCheckboxGroup: React.FC<ISealProps>;
27
28
  export { SealCheckboxGroup };
@@ -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
- form.setFieldsValue({
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: 90,
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: 90,
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: '20%',
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: 135,
438
+ width: 180,
444
439
  render: function (value, row, index) {
445
440
  var Comp = function () {
446
- return records.length !== 0 ? (React.createElement("div", { style: { height: '100%', paddingTop: '23px' } },
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
- // 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
- // <ConfigProvider locale={zhCN}>
31
- // <BrowserRouter>
32
- // <Switch>
33
- // <Route exact path="/">
34
- // <App />
35
- // </Route>
36
- // <Route exact path="/code-query">
37
- // <CodeQueryDemo />
38
- // </Route>
39
- // <Route exact path="/select">
40
- // <Demo />
41
- // </Route>
42
- // <Route exact path="/tree-select">
43
- // <TreeSelectDemo />
44
- // </Route>
45
- // <Route exact path="/tree">
46
- // <TreeDemo />
47
- // </Route>
48
- // <Route exact path="/upload">
49
- // <UploadDemo />
50
- // </Route>
51
- // <Route exact path="/collapse">
52
- // <CollapseDemo />
53
- // </Route>
54
- // <Route exact path="/timeline">
55
- // <TimelineDemo />
56
- // </Route>
57
- // <Route exact path="/wechat">
58
- // <WeChatDemo />
59
- // </Route>
60
- // <Route exact path="/table">
61
- // <TableDemo />
62
- // </Route>
63
- // <Route exact path="/table1">
64
- // <TableDemo1 />
65
- // </Route>
66
- // <Route exact path="/basic">
67
- // <BasicDemo />
68
- // </Route>
69
- // <Route exact path="/form">
70
- // <FormDemo />
71
- // </Route>
72
- // <Route exact path="/print">
73
- // <PrintDemo />
74
- // </Route>
75
- // <Route exact path="/print-container">
76
- // <PrintContainerDemo />
77
- // </Route>
78
- // <Route exact path="/tableall">
79
- // <TableDemoAll />
80
- // </Route>
81
- // <Route exact path="/table-analyse">
82
- // <TableAnalyse />
83
- // </Route>
84
- // <Route exact path="/drag-sort">
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.5.4",
3
+ "version": "3.5.7",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",