ztxkui 4.0.1 → 4.0.2
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.
|
@@ -22,7 +22,7 @@ import CompareResult from './CompareResult';
|
|
|
22
22
|
import { fileBatchDownload, preCanDownload, nextDownload, } from '../../../Upload/utils';
|
|
23
23
|
var DetailTable = function (_a) {
|
|
24
24
|
var _b;
|
|
25
|
-
var needQj = _a.needQj, needQys = _a.needQys, records = _a.records, qunjSeal = _a.qunjSeal, electronicSeal = _a.electronicSealIdList, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, viewSealPageFn = _a.viewSealPageFn, contractId = _a.contractId, electronicList = _a.electronicList, sealList = _a.sealList, querySealStatus = _a.querySealStatus, showContranctNum = _a.showContranctNum, request = _a.request, needSaveTemplate = _a.needSaveTemplate, batchDownloadZipName = _a.batchDownloadZipName;
|
|
25
|
+
var needQj = _a.needQj, needQys = _a.needQys, records = _a.records, qunjSeal = _a.qunjSeal, electronicSeal = _a.electronicSealIdList, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, viewSealPageFn = _a.viewSealPageFn, contractId = _a.contractId, electronicList = _a.electronicList, sealList = _a.sealList, querySealStatus = _a.querySealStatus, showContranctNum = _a.showContranctNum, request = _a.request, needSaveTemplate = _a.needSaveTemplate, batchDownloadZipName = _a.batchDownloadZipName, docAttachMap = _a.docAttachMap;
|
|
26
26
|
var authToken = token || '';
|
|
27
27
|
var isOnlyQj = "" + ((_b = records === null || records === void 0 ? void 0 : records[0]) === null || _b === void 0 ? void 0 : _b.attachId) === '123456789';
|
|
28
28
|
var selectRows = useRef(null);
|
|
@@ -267,9 +267,59 @@ var DetailTable = function (_a) {
|
|
|
267
267
|
message.info('请选择需要下载的附件!');
|
|
268
268
|
}
|
|
269
269
|
};
|
|
270
|
+
/** 批量下载盖章件 */
|
|
271
|
+
var batchDownload = function () {
|
|
272
|
+
var list = selectRows.current;
|
|
273
|
+
if (Array.isArray(list) && list.length > 0) {
|
|
274
|
+
var qysAttachVOList = list.map(function (item) {
|
|
275
|
+
var _a, _b;
|
|
276
|
+
return ({
|
|
277
|
+
fileName: ((_b = (_a = item === null || item === void 0 ? void 0 : item.fileName) === null || _a === void 0 ? void 0 : _a.split('.')) === null || _b === void 0 ? void 0 : _b[0]) + ".zip",
|
|
278
|
+
attachId: item.attachId,
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
var params = {
|
|
282
|
+
docAttachMap: docAttachMap,
|
|
283
|
+
qysAttachVOList: qysAttachVOList,
|
|
284
|
+
};
|
|
285
|
+
request({
|
|
286
|
+
method: 'POST',
|
|
287
|
+
url: '/api/zmdms-resource/seal/batch-download-seal-files',
|
|
288
|
+
responseType: 'blob',
|
|
289
|
+
data: params,
|
|
290
|
+
}).then(function (res) {
|
|
291
|
+
var _a, _b;
|
|
292
|
+
if (!((_a = res.headers) === null || _a === void 0 ? void 0 : _a['content-disposition'])) {
|
|
293
|
+
message.warning('没有可下载的内容');
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
var fileName = res.headers['content-disposition'].split(';');
|
|
297
|
+
var fileNameArray = (_b = fileName[1]) === null || _b === void 0 ? void 0 : _b.split('=');
|
|
298
|
+
var fileNameStr = decodeURIComponent(fileNameArray[1]);
|
|
299
|
+
var blob = new Blob([res.data], {
|
|
300
|
+
type: 'application/vnd.ms-excel',
|
|
301
|
+
});
|
|
302
|
+
if (blob.size < 1) {
|
|
303
|
+
alert('下载失败,下载的内容为空!');
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
var aLink = document.createElement('a');
|
|
307
|
+
aLink.style.display = 'none';
|
|
308
|
+
aLink.href = window.URL.createObjectURL(blob);
|
|
309
|
+
aLink.download = fileNameStr === null || fileNameStr === void 0 ? void 0 : fileNameStr.replaceAll('"', '');
|
|
310
|
+
document.body.appendChild(aLink);
|
|
311
|
+
aLink.click();
|
|
312
|
+
document.body.removeChild(aLink);
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
message.info('请选择需要下载的盖章件!');
|
|
317
|
+
}
|
|
318
|
+
};
|
|
270
319
|
return (React.createElement(React.Fragment, null,
|
|
271
320
|
React.createElement("div", { style: { marginBottom: '10px' } },
|
|
272
|
-
React.createElement(Button, { type: "primary", style: { marginRight: '10px' }, onClick: onAllDownloadHandle }, "\u6279\u91CF\u4E0B\u8F7D")
|
|
321
|
+
React.createElement(Button, { type: "primary", style: { marginRight: '10px' }, onClick: onAllDownloadHandle }, "\u6279\u91CF\u4E0B\u8F7D\u539F\u4EF6"),
|
|
322
|
+
React.createElement(Button, { type: "primary", style: { marginRight: '10px' }, onClick: batchDownload }, "\u6279\u91CF\u4E0B\u8F7D\u76D6\u7AE0\u4EF6")),
|
|
273
323
|
React.createElement(Table, { columns: columnsLast, rowKey: "attachId", dataSource: records, scroll: { x: 'max-content' }, rowSelection: myRowSelection })));
|
|
274
324
|
};
|
|
275
325
|
export default memo(DetailTable);
|
|
@@ -1063,6 +1063,7 @@ var Sinatures = function (_a) {
|
|
|
1063
1063
|
showContranctNum: showContranctNum,
|
|
1064
1064
|
request: request,
|
|
1065
1065
|
needSaveTemplate: NEED_SAVE_TEMPLATE.includes("" + flowId),
|
|
1066
|
+
docAttachMap: attachMap,
|
|
1066
1067
|
};
|
|
1067
1068
|
return (React.createElement(React.Fragment, null,
|
|
1068
1069
|
isEdit ? (React.createElement(Table, { columns: columnsLast, rowKey: "attachId", loading: tbloading, dataSource: records, scroll: { x: 'max-content' } })) : (React.createElement(DetailTable, __assign({}, detail, { batchDownloadZipName: batchDownloadZipName }))),
|