ztxkui 3.8.15 → 3.8.16
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.
|
@@ -330,6 +330,7 @@ var EditableTable = function () {
|
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
332
|
var endIndex = startIndex + changeRecords.length - 1;
|
|
333
|
+
// 这里是当前最新的表格数据,注意自己的代码逻辑
|
|
333
334
|
var currentRecords = Array.isArray(recordsRef.current)
|
|
334
335
|
? recordsRef.current.slice()
|
|
335
336
|
: [];
|
|
@@ -337,7 +338,6 @@ var EditableTable = function () {
|
|
|
337
338
|
endIndex = currentRecords.length - 1;
|
|
338
339
|
}
|
|
339
340
|
var currentIndex = 0;
|
|
340
|
-
console.log(changeRecords, startIndex, endIndex);
|
|
341
341
|
var newRecords = currentRecords.map(function (record, index) {
|
|
342
342
|
if (index >= startIndex && index <= endIndex) {
|
|
343
343
|
var obj = __assign(__assign({}, record), changeRecords[currentIndex]);
|
|
@@ -346,6 +346,7 @@ var EditableTable = function () {
|
|
|
346
346
|
}
|
|
347
347
|
return record;
|
|
348
348
|
});
|
|
349
|
+
// 这里是表格数据的设置方法,注意代码逻辑
|
|
349
350
|
setRecords(newRecords);
|
|
350
351
|
}, []);
|
|
351
352
|
return (React.createElement("div", null,
|
|
@@ -109,6 +109,14 @@ var Sinatures = function (_a) {
|
|
|
109
109
|
var _s = useState(true), isInit = _s[0], setIsInit = _s[1];
|
|
110
110
|
// 表格loading
|
|
111
111
|
var _t = useState(false), tbloading = _t[0], setTbLoading = _t[1];
|
|
112
|
+
// 仅需要群杰印章
|
|
113
|
+
var _u = useState(false), isOnlyQj = _u[0], setIsOnlyQj = _u[1];
|
|
114
|
+
// 仅需要群杰印章时的fileList
|
|
115
|
+
var onlyQjRecords = [
|
|
116
|
+
{
|
|
117
|
+
attachId: '123456789',
|
|
118
|
+
},
|
|
119
|
+
];
|
|
112
120
|
useEffect(function () {
|
|
113
121
|
// 是否有勾选加盖电子印章
|
|
114
122
|
if (isInit) {
|
|
@@ -371,13 +379,18 @@ var Sinatures = function (_a) {
|
|
|
371
379
|
},
|
|
372
380
|
{
|
|
373
381
|
title: '附件',
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
382
|
+
key: 'attach',
|
|
383
|
+
dataIndex: 'attach',
|
|
384
|
+
children: __spreadArray(__spreadArray([], (isOnlyQj
|
|
385
|
+
? []
|
|
386
|
+
: [
|
|
387
|
+
{
|
|
388
|
+
title: '类型',
|
|
389
|
+
key: 'attachTypeName',
|
|
390
|
+
dataIndex: 'attachTypeName',
|
|
391
|
+
width: 100,
|
|
392
|
+
},
|
|
393
|
+
])), [
|
|
381
394
|
{
|
|
382
395
|
title: function () {
|
|
383
396
|
return (React.createElement("div", { className: "seal-file-upload" },
|
|
@@ -385,55 +398,63 @@ var Sinatures = function (_a) {
|
|
|
385
398
|
React.createElement("span", null, isUpload && (React.createElement(Upload, { apiBaseUrl: ZT_API_BASEURL, method: "post", showTable: false, showTip: false, headers: {
|
|
386
399
|
'Zmdms-Auth': authToken,
|
|
387
400
|
}, data: uploadData, authToken: authToken, callback: uploadCallbackFn, originFileList: originFileList, style: { margin: 0 } },
|
|
388
|
-
React.createElement(Button, { type: "link" }, "\u6DFB\u52A0\u9644\u4EF6"))))
|
|
401
|
+
React.createElement(Button, { type: "link" }, "\u6DFB\u52A0\u9644\u4EF6")))),
|
|
402
|
+
isUpload && (React.createElement(Button, { type: "link", onClick: function () {
|
|
403
|
+
setIsOnlyQj(true);
|
|
404
|
+
} }, "\u4EC5\u9700\u8981\u7FA4\u6770\u5370\u7AE0"))));
|
|
389
405
|
},
|
|
390
406
|
key: 'attachId',
|
|
391
407
|
dataIndex: 'attachId',
|
|
392
|
-
width: 240,
|
|
408
|
+
width: isOnlyQj ? 240 : 350,
|
|
393
409
|
render: function (text, record, index) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
var
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
410
|
+
if (!isOnlyQj) {
|
|
411
|
+
/** 删除附件 */
|
|
412
|
+
var deleteFile = function () {
|
|
413
|
+
var fileName = record === null || record === void 0 ? void 0 : record.attachName;
|
|
414
|
+
if (!fileName) {
|
|
415
|
+
console.error('没有找到需要删除的文件名!', "serverFileName \u4E3A " + fileName);
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
setTbLoading(true);
|
|
419
|
+
var xhr = new XMLHttpRequest();
|
|
420
|
+
xhr.open('post', ZT_API_BASEURL + "/api/zmdms-resource/oss/endpoint/remove-file", true);
|
|
421
|
+
xhr.addEventListener('readystatechange', function () {
|
|
422
|
+
if (xhr.readyState === 4) {
|
|
423
|
+
var response = JSON.parse(xhr.responseText);
|
|
424
|
+
if (xhr.status === 200) {
|
|
425
|
+
setTbLoading(false);
|
|
426
|
+
if ((response === null || response === void 0 ? void 0 : response.success) === true) {
|
|
427
|
+
setRecords(function (preRecords) {
|
|
428
|
+
var newRecords = preRecords.slice();
|
|
429
|
+
newRecords.splice(index, 1);
|
|
430
|
+
return newRecords;
|
|
431
|
+
});
|
|
432
|
+
message.success('文件删除成功!');
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
setTbLoading(false);
|
|
436
|
+
message.warning(response === null || response === void 0 ? void 0 : response.msg);
|
|
437
|
+
}
|
|
416
438
|
}
|
|
417
439
|
else {
|
|
418
440
|
setTbLoading(false);
|
|
419
441
|
message.warning(response === null || response === void 0 ? void 0 : response.msg);
|
|
420
442
|
}
|
|
421
443
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
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 })));
|
|
444
|
+
});
|
|
445
|
+
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
446
|
+
xhr.setRequestHeader('Zmdms-Auth', authToken);
|
|
447
|
+
xhr.send("fileName=" + fileName);
|
|
448
|
+
};
|
|
449
|
+
return (React.createElement(React.Fragment, null,
|
|
450
|
+
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 })));
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
return React.createElement(React.Fragment, null, "\u7FA4\u6770");
|
|
454
|
+
}
|
|
434
455
|
},
|
|
435
456
|
},
|
|
436
|
-
],
|
|
457
|
+
]),
|
|
437
458
|
},
|
|
438
459
|
{
|
|
439
460
|
title: '合同',
|
|
@@ -582,8 +603,13 @@ var Sinatures = function (_a) {
|
|
|
582
603
|
if (!needQys) {
|
|
583
604
|
columnsLast = columnsLast.filter(function (item) { return !['isWatermark', 'needQys'].includes(item.key); });
|
|
584
605
|
}
|
|
606
|
+
if (isOnlyQj) {
|
|
607
|
+
columnsLast = columnsLast.filter(function (item) {
|
|
608
|
+
return ['attach', 'qunJ'].includes(item.key);
|
|
609
|
+
});
|
|
610
|
+
}
|
|
585
611
|
// 上传组件的数据
|
|
586
|
-
var
|
|
612
|
+
var _v = useState(), originFileList = _v[0], setOriginFileList = _v[1];
|
|
587
613
|
/** 签章组件onChange事件 */
|
|
588
614
|
var sigValuesChange = function (type, value) {
|
|
589
615
|
var _a, _b;
|
|
@@ -643,6 +669,7 @@ var Sinatures = function (_a) {
|
|
|
643
669
|
*/
|
|
644
670
|
var uploadCallbackFn = useCallback(function (filelist) {
|
|
645
671
|
if (filelist.every(function (item) { return item.status === 'done' || item.status === 'error'; })) {
|
|
672
|
+
setIsOnlyQj(false);
|
|
646
673
|
setOriginFileList([]);
|
|
647
674
|
// 获取上传成功的,图片,进行数据转换,上传服务端
|
|
648
675
|
var successFileList_1 = filelist
|
|
@@ -693,7 +720,7 @@ var Sinatures = function (_a) {
|
|
|
693
720
|
setIsTotalSealNumTooMore(false);
|
|
694
721
|
}
|
|
695
722
|
return {
|
|
696
|
-
fileList: records,
|
|
723
|
+
fileList: isOnlyQj ? onlyQjRecords : records,
|
|
697
724
|
qunjSeal: innerQunjSeal,
|
|
698
725
|
electronicSealIdList: innerElectronicSeal,
|
|
699
726
|
checkAttachIdList: sealedIds,
|
|
@@ -719,7 +746,8 @@ var Sinatures = function (_a) {
|
|
|
719
746
|
needQys &&
|
|
720
747
|
(prevParam === null || prevParam === void 0 ? void 0 : prevParam.sealIdList) &&
|
|
721
748
|
(prevParam === null || prevParam === void 0 ? void 0 : prevParam.sealIdList.length) !== (innerElectronicSeal === null || innerElectronicSeal === void 0 ? void 0 : innerElectronicSeal.length) &&
|
|
722
|
-
!isSure
|
|
749
|
+
!isSure &&
|
|
750
|
+
!isOnlyQj) {
|
|
723
751
|
Modal.confirm({
|
|
724
752
|
title: '当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?',
|
|
725
753
|
okText: '是',
|
|
@@ -740,7 +768,8 @@ var Sinatures = function (_a) {
|
|
|
740
768
|
if (needQys &&
|
|
741
769
|
isEdit &&
|
|
742
770
|
(innerElectronicSeal === null || innerElectronicSeal === void 0 ? void 0 : innerElectronicSeal.length) === 0 &&
|
|
743
|
-
hasElectronicSeal
|
|
771
|
+
hasElectronicSeal &&
|
|
772
|
+
!isOnlyQj) {
|
|
744
773
|
message.warning('请勾选加盖电子印章所需要的印章列表!');
|
|
745
774
|
return false;
|
|
746
775
|
}
|
|
@@ -750,7 +779,7 @@ var Sinatures = function (_a) {
|
|
|
750
779
|
return false;
|
|
751
780
|
}
|
|
752
781
|
// 没有确认盖章
|
|
753
|
-
if (isEdit && needQys && hasElectronicSeal && !contractId) {
|
|
782
|
+
if (isEdit && needQys && hasElectronicSeal && !contractId && !isOnlyQj) {
|
|
754
783
|
message.warning('请点击确认盖章按钮,确认盖章位置后方可提交!');
|
|
755
784
|
return false;
|
|
756
785
|
}
|
|
@@ -797,6 +826,6 @@ var Sinatures = function (_a) {
|
|
|
797
826
|
request: request,
|
|
798
827
|
needSaveTemplate: NEED_SAVE_TEMPLATE.includes("" + flowId),
|
|
799
828
|
};
|
|
800
|
-
return (React.createElement(React.Fragment, null, isEdit ? (React.createElement(Table, { columns: columnsLast, rowKey: "attachId", loading: tbloading, dataSource: records, scroll: { x: 'max-content' } })) : (React.createElement(DetailTable, __assign({}, detail)))));
|
|
829
|
+
return (React.createElement(React.Fragment, null, isEdit ? (React.createElement(Table, { columns: columnsLast, rowKey: "attachId", loading: tbloading, dataSource: isOnlyQj ? onlyQjRecords : records, scroll: { x: 'max-content' } })) : (React.createElement(DetailTable, __assign({}, detail)))));
|
|
801
830
|
};
|
|
802
831
|
export default Sinatures;
|