ztxkui 4.2.20 → 4.2.21
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 +1 -1
- package/dist/DemoCom/SinaturesDemo.js +2 -1
- package/dist/TableDemo/EditableTable.js +1 -0
- package/dist/components/Table/table.js +12 -0
- package/dist/components/business/Signatures/hooks.js +9 -4
- package/dist/components/business/Signatures/index.js +70 -47
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ import water from '../assets/img/water.png';
|
|
|
38
38
|
import { createDownloadUrl } from 'ztxkutils/dist/fileOperation';
|
|
39
39
|
import './print.scss';
|
|
40
40
|
import { token } from '../constants';
|
|
41
|
-
import imgSrc from '../assets/img/
|
|
41
|
+
import imgSrc from '../assets/img/logo012.jpg';
|
|
42
42
|
function request(options) {
|
|
43
43
|
var headers = options.headers, restOptions = __rest(options, ["headers"]);
|
|
44
44
|
return axios(__assign({ baseURL: options.baseURL ? options.baseURL : 'http://192.168.0.83:8000', url: options.url, headers: __assign({ 'Zmdms-Auth': "bearer " + token }, options.headers), method: options.method, data: options.data, params: options.params }, restOptions));
|
|
@@ -177,9 +177,10 @@ var SinaturesDemo = function () {
|
|
|
177
177
|
/** 是否可编辑 1可编辑 0不可编辑 */
|
|
178
178
|
var canEdit = 1;
|
|
179
179
|
/** 是否展示添加附件按钮 0不展示 1展示 */
|
|
180
|
-
var showAddBtn =
|
|
180
|
+
var showAddBtn = 1;
|
|
181
181
|
var params = {
|
|
182
182
|
// cancelDefaultCheckedQj: 1,
|
|
183
|
+
showDeleteBtn: true,
|
|
183
184
|
needQj: 1,
|
|
184
185
|
needDg: 1,
|
|
185
186
|
needQys: 1,
|
|
@@ -525,6 +525,7 @@ var EditableTable = function () {
|
|
|
525
525
|
} }, "\u9A8C\u8BC1"),
|
|
526
526
|
React.createElement(Button, { onClick: function () {
|
|
527
527
|
console.log(records);
|
|
528
|
+
console.log(tableHandleRef.current.getColumns());
|
|
528
529
|
} }, "\u83B7\u53D6\u6570\u636E"),
|
|
529
530
|
React.createElement(Table, { dataSource: records, columns: columns, rowKey: "id",
|
|
530
531
|
// 表格项可输入
|
|
@@ -428,6 +428,18 @@ function Table(props) {
|
|
|
428
428
|
}
|
|
429
429
|
return index;
|
|
430
430
|
},
|
|
431
|
+
/** 获取自定义列配置当前配置 */
|
|
432
|
+
getColumns: function () {
|
|
433
|
+
var columns = [];
|
|
434
|
+
mergeColumns.forEach(function (column) {
|
|
435
|
+
if (column.dataIndex) {
|
|
436
|
+
columns.push({
|
|
437
|
+
dataIndex: column.dataIndex || column.key,
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
return columns;
|
|
442
|
+
},
|
|
431
443
|
}); });
|
|
432
444
|
var tableResizableTitle = useMemo(function () {
|
|
433
445
|
return {
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
1
|
+
import { useState, useEffect, useRef } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* 外部数据发生改变,设置内部数据
|
|
4
4
|
*/
|
|
5
5
|
export function useRecords(fileList) {
|
|
6
6
|
var _a = useState([]), records = _a[0], setRecords = _a[1];
|
|
7
|
+
var fileRef = useRef();
|
|
7
8
|
useEffect(function () {
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
fileRef.current = fileList;
|
|
10
|
+
}, [fileList]);
|
|
11
|
+
var list = fileRef.current;
|
|
12
|
+
useEffect(function () {
|
|
13
|
+
if (Array.isArray(list)) {
|
|
14
|
+
setRecords(list);
|
|
10
15
|
}
|
|
11
16
|
else {
|
|
12
17
|
setRecords([]);
|
|
13
18
|
}
|
|
14
|
-
}, [
|
|
19
|
+
}, [list]);
|
|
15
20
|
return {
|
|
16
21
|
records: records,
|
|
17
22
|
setRecords: setRecords,
|
|
@@ -550,7 +550,7 @@ var Sinatures = function (_a) {
|
|
|
550
550
|
},
|
|
551
551
|
key: 'attachId',
|
|
552
552
|
dataIndex: 'attachId',
|
|
553
|
-
width: isOnlyQj ?
|
|
553
|
+
width: isOnlyQj ? 300 : 410,
|
|
554
554
|
render: function (text, record, index) {
|
|
555
555
|
if (!isOnlyQj) {
|
|
556
556
|
/** 删除附件 */
|
|
@@ -560,45 +560,68 @@ var Sinatures = function (_a) {
|
|
|
560
560
|
console.error('没有找到需要删除的文件名!', "serverFileName \u4E3A " + fileName);
|
|
561
561
|
return;
|
|
562
562
|
}
|
|
563
|
-
|
|
564
|
-
var
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
var result_1 = [];
|
|
573
|
-
var getNewRecord_1 = function (data) {
|
|
574
|
-
var newRecords = data.slice();
|
|
575
|
-
newRecords.splice(index, 1);
|
|
576
|
-
result_1 = newRecords;
|
|
577
|
-
return newRecords;
|
|
578
|
-
};
|
|
579
|
-
setRecords(function (preRecords) {
|
|
580
|
-
return getNewRecord_1(preRecords);
|
|
581
|
-
});
|
|
582
|
-
setContractId(null);
|
|
583
|
-
if (records.length > 0 && onSigValuesChange) {
|
|
584
|
-
onSigValuesChange(sigValuesChange('fileList', result_1));
|
|
585
|
-
}
|
|
586
|
-
message.success('文件删除成功!');
|
|
587
|
-
}
|
|
588
|
-
else {
|
|
589
|
-
setTbLoading(false);
|
|
590
|
-
message.warning(response === null || response === void 0 ? void 0 : response.msg);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
else {
|
|
594
|
-
setTbLoading(false);
|
|
595
|
-
message.warning(response === null || response === void 0 ? void 0 : response.msg);
|
|
596
|
-
}
|
|
597
|
-
}
|
|
563
|
+
var result = [];
|
|
564
|
+
var getNewRecord = function (data) {
|
|
565
|
+
var newRecords = data.slice();
|
|
566
|
+
newRecords.splice(index, 1);
|
|
567
|
+
result = newRecords;
|
|
568
|
+
return newRecords;
|
|
569
|
+
};
|
|
570
|
+
setRecords(function (preRecords) {
|
|
571
|
+
return getNewRecord(preRecords);
|
|
598
572
|
});
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
573
|
+
setContractId(null);
|
|
574
|
+
if (records.length > 0 && onSigValuesChange) {
|
|
575
|
+
onSigValuesChange(sigValuesChange('fileList', result));
|
|
576
|
+
}
|
|
577
|
+
message.success('文件删除成功!');
|
|
578
|
+
// 此删除附件接口需要管理员权限 后端建议此处仅前端删除 20230111
|
|
579
|
+
// setTbLoading(true);
|
|
580
|
+
// const xhr = new XMLHttpRequest();
|
|
581
|
+
// xhr.open(
|
|
582
|
+
// 'post',
|
|
583
|
+
// `${ZT_API_BASEURL}/api/zmdms-resource/oss/endpoint/remove-file`,
|
|
584
|
+
// true
|
|
585
|
+
// );
|
|
586
|
+
// xhr.addEventListener('readystatechange', function () {
|
|
587
|
+
// if (xhr.readyState === 4) {
|
|
588
|
+
// const response = JSON.parse(xhr.responseText);
|
|
589
|
+
// if (xhr.status === 200) {
|
|
590
|
+
// setTbLoading(false);
|
|
591
|
+
// if (response?.success === true) {
|
|
592
|
+
// let result: any = [];
|
|
593
|
+
// const getNewRecord = (data) => {
|
|
594
|
+
// const newRecords = data.slice();
|
|
595
|
+
// newRecords.splice(index, 1);
|
|
596
|
+
// result = newRecords;
|
|
597
|
+
// return newRecords;
|
|
598
|
+
// };
|
|
599
|
+
// setRecords((preRecords) => {
|
|
600
|
+
// return getNewRecord(preRecords);
|
|
601
|
+
// });
|
|
602
|
+
// setContractId(null);
|
|
603
|
+
// if (records.length > 0 && onSigValuesChange) {
|
|
604
|
+
// onSigValuesChange(
|
|
605
|
+
// sigValuesChange('fileList', result)
|
|
606
|
+
// );
|
|
607
|
+
// }
|
|
608
|
+
// message.success('文件删除成功!');
|
|
609
|
+
// } else {
|
|
610
|
+
// setTbLoading(false);
|
|
611
|
+
// message.warning(response?.msg);
|
|
612
|
+
// }
|
|
613
|
+
// } else {
|
|
614
|
+
// setTbLoading(false);
|
|
615
|
+
// message.warning(response?.msg);
|
|
616
|
+
// }
|
|
617
|
+
// }
|
|
618
|
+
// });
|
|
619
|
+
// xhr.setRequestHeader(
|
|
620
|
+
// 'Content-type',
|
|
621
|
+
// 'application/x-www-form-urlencoded'
|
|
622
|
+
// );
|
|
623
|
+
// xhr.setRequestHeader('Zmdms-Auth', authToken);
|
|
624
|
+
// xhr.send(`fileName=${fileName}`);
|
|
602
625
|
};
|
|
603
626
|
return (React.createElement(React.Fragment, null,
|
|
604
627
|
React.createElement(AttachOperation, { ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: authToken, attachId: record === null || record === void 0 ? void 0 : record.attachId, attachName: record === null || record === void 0 ? void 0 : record.attachName, attachSize: record === null || record === void 0 ? void 0 : record.attachSize, showDeleteBtn: showDeleteBtn, onDeleteFile: deleteFile })));
|
|
@@ -619,7 +642,7 @@ var Sinatures = function (_a) {
|
|
|
619
642
|
title: '合同比对模板',
|
|
620
643
|
key: 'templateAttachId',
|
|
621
644
|
dataIndex: 'templateAttachId',
|
|
622
|
-
width:
|
|
645
|
+
width: 200,
|
|
623
646
|
render: function (text, record, index) {
|
|
624
647
|
return record.attachTypeName === '合同本身' ? (React.createElement(TemplateAttach, { record: record, index: index, openCustomerModalHandle: openCustomerModalHandle, isEdit: isEdit })) : ('');
|
|
625
648
|
},
|
|
@@ -650,7 +673,7 @@ var Sinatures = function (_a) {
|
|
|
650
673
|
title: isEdit ? '添加水印' : '水印',
|
|
651
674
|
key: 'isWatermark',
|
|
652
675
|
dataIndex: 'isWatermark',
|
|
653
|
-
width:
|
|
676
|
+
width: 100,
|
|
654
677
|
render: function (text, record, index) {
|
|
655
678
|
return (React.createElement(Switch, { checked: text, disabled: !isEdit, onChange: function (value) {
|
|
656
679
|
return onSwitchChangeHandle(value, 'isWatermark', index);
|
|
@@ -661,7 +684,7 @@ var Sinatures = function (_a) {
|
|
|
661
684
|
title: '电子印章',
|
|
662
685
|
key: 'needQys',
|
|
663
686
|
dataIndex: 'needQys',
|
|
664
|
-
width:
|
|
687
|
+
width: 700,
|
|
665
688
|
children: [
|
|
666
689
|
{
|
|
667
690
|
title: '盖电子印章',
|
|
@@ -678,7 +701,7 @@ var Sinatures = function (_a) {
|
|
|
678
701
|
title: '选择电子印章',
|
|
679
702
|
key: 'electronicSeal',
|
|
680
703
|
dataIndex: 'electronicSeal',
|
|
681
|
-
width:
|
|
704
|
+
width: 450,
|
|
682
705
|
render: function (value, row, index) {
|
|
683
706
|
// 是否有勾选加盖电子印章
|
|
684
707
|
var hasElectronicSeal = records === null || records === void 0 ? void 0 : records.some(function (item) { return !!item.isElectronicSeal; });
|
|
@@ -688,7 +711,7 @@ var Sinatures = function (_a) {
|
|
|
688
711
|
React.createElement("div", { style: __assign({ height: '36px', borderBottom: '1px solid #EBEBEB', marginBottom: '5px', paddingLeft: '8px', lineHeight: '36px' }, (yjzrr ? {} : { display: 'none' })), title: _label },
|
|
689
712
|
React.createElement(Checkbox, { checked: isEconomic, disabled: !(hasElectronicSeal && isEdit), onChange: function (e) { return needEconomic(e); } },
|
|
690
713
|
React.createElement("div", { style: {
|
|
691
|
-
width: '
|
|
714
|
+
width: '370px',
|
|
692
715
|
whiteSpace: 'nowrap',
|
|
693
716
|
textOverflow: 'ellipsis',
|
|
694
717
|
overflow: 'hidden',
|
|
@@ -852,16 +875,16 @@ var Sinatures = function (_a) {
|
|
|
852
875
|
});
|
|
853
876
|
});
|
|
854
877
|
console.log(successFileList_1);
|
|
855
|
-
var
|
|
878
|
+
var getNewRecord_1 = function (data) {
|
|
856
879
|
if (data === void 0) { data = []; }
|
|
857
880
|
var newRecords = __spreadArray(__spreadArray([], data), successFileList_1).filter(function (item) { return item.attachId !== '123456789'; });
|
|
858
881
|
return newRecords;
|
|
859
882
|
};
|
|
860
883
|
setRecords(function (preRecords) {
|
|
861
|
-
return
|
|
884
|
+
return getNewRecord_1(preRecords);
|
|
862
885
|
});
|
|
863
886
|
if (typeof fnRef.current === 'function') {
|
|
864
|
-
fnRef.current(sigValuesChange('fileList',
|
|
887
|
+
fnRef.current(sigValuesChange('fileList', getNewRecord_1(records)));
|
|
865
888
|
}
|
|
866
889
|
}
|
|
867
890
|
if (filelist.every(function (item) { return item.status === 'error'; })) {
|