ztxkui 3.9.15 → 3.9.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.
- package/dist/UploadDemo.js +87 -2
- package/dist/components/Upload/upload.js +47 -2
- package/dist/components/Upload/utils.d.ts +12 -7
- package/dist/components/Upload/utils.js +51 -3
- package/dist/components/business/Signatures/components/DetailTable.js +68 -3
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/package.json +1 -1
package/dist/UploadDemo.js
CHANGED
|
@@ -37,9 +37,93 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
import { Link } from 'react-router-dom';
|
|
38
38
|
import Upload from 'components/Upload';
|
|
39
39
|
import { useState, useEffect, useCallback, useRef } from 'react';
|
|
40
|
-
import { UploadSingle } from './index';
|
|
40
|
+
import { UploadSingle, Sinatures } from './index';
|
|
41
41
|
import { token } from './constants';
|
|
42
42
|
var originFileList = [];
|
|
43
|
+
var test = {
|
|
44
|
+
canEdit: 0,
|
|
45
|
+
needDg: 0,
|
|
46
|
+
needQys: 0,
|
|
47
|
+
needQj: 1,
|
|
48
|
+
deptId: '1295909543961944065',
|
|
49
|
+
memberId: '1514441904460652546',
|
|
50
|
+
flowId: 'scm_order_order_cgdd',
|
|
51
|
+
contractId: null,
|
|
52
|
+
caseId: null,
|
|
53
|
+
docAttachMap: null,
|
|
54
|
+
checkAttachIdList: [],
|
|
55
|
+
documentIdList: [],
|
|
56
|
+
fileList: [
|
|
57
|
+
{
|
|
58
|
+
attachId: '1589432309903725011',
|
|
59
|
+
attachName: '恒大集团有限公司-股权穿透图谱 (6) (2) (2).png',
|
|
60
|
+
attachTypeName: null,
|
|
61
|
+
isCustomerReference: null,
|
|
62
|
+
templateAttachId: null,
|
|
63
|
+
templateAttachName: null,
|
|
64
|
+
templateCrNo: null,
|
|
65
|
+
taskId: null,
|
|
66
|
+
isWatermark: 0,
|
|
67
|
+
isElectronicSeal: 0,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
attachId: '1589432285429957367',
|
|
71
|
+
attachName: '恒大集团有限公司-股权穿透图谱 (6) (1) (1) (1).png',
|
|
72
|
+
attachTypeName: null,
|
|
73
|
+
isCustomerReference: null,
|
|
74
|
+
templateAttachId: null,
|
|
75
|
+
templateAttachName: null,
|
|
76
|
+
templateCrNo: null,
|
|
77
|
+
taskId: null,
|
|
78
|
+
isWatermark: 0,
|
|
79
|
+
isElectronicSeal: 0,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
attachId: '1589432338441758419',
|
|
83
|
+
attachName: '恒大集团有限公司-股权穿透图谱 (6) (1) (1).png',
|
|
84
|
+
attachTypeName: null,
|
|
85
|
+
isCustomerReference: null,
|
|
86
|
+
templateAttachId: null,
|
|
87
|
+
templateAttachName: null,
|
|
88
|
+
templateCrNo: null,
|
|
89
|
+
taskId: null,
|
|
90
|
+
isWatermark: 0,
|
|
91
|
+
isElectronicSeal: 0,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
attachId: '1589432351620261525',
|
|
95
|
+
attachName: '中拓信科-谌姚琦的离职审批 (1) (3).pdf',
|
|
96
|
+
attachTypeName: null,
|
|
97
|
+
isCustomerReference: null,
|
|
98
|
+
templateAttachId: null,
|
|
99
|
+
templateAttachName: null,
|
|
100
|
+
templateCrNo: null,
|
|
101
|
+
taskId: null,
|
|
102
|
+
isWatermark: 0,
|
|
103
|
+
isElectronicSeal: 0,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
attachId: '1589432300667861633',
|
|
107
|
+
attachName: '恒大集团有限公司-股权穿透图谱 (4).png',
|
|
108
|
+
attachTypeName: null,
|
|
109
|
+
isCustomerReference: null,
|
|
110
|
+
templateAttachId: null,
|
|
111
|
+
templateAttachName: null,
|
|
112
|
+
templateCrNo: null,
|
|
113
|
+
taskId: null,
|
|
114
|
+
isWatermark: 0,
|
|
115
|
+
isElectronicSeal: 0,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
qunjSeal: {
|
|
119
|
+
vertifyCode: null,
|
|
120
|
+
contranctNum: null,
|
|
121
|
+
isTakeOut: 0,
|
|
122
|
+
details: [],
|
|
123
|
+
},
|
|
124
|
+
electronicSealIdList: [],
|
|
125
|
+
flowStatus: 15,
|
|
126
|
+
};
|
|
43
127
|
function UploadDemo() {
|
|
44
128
|
var _this = this;
|
|
45
129
|
var _a = useState(originFileList), fileList = _a[0], setFileList = _a[1];
|
|
@@ -207,7 +291,7 @@ function UploadDemo() {
|
|
|
207
291
|
// ztAccept={['.ttf']}
|
|
208
292
|
apiBaseUrl: "http://192.168.0.83:8000", fileBaseUrl: "http://192.168.0.83:88", originFileList: fileList, callback: uploadCallbackFn, onDeleteCallback: function (index, file) {
|
|
209
293
|
console.log(index, file);
|
|
210
|
-
}, upload: upload, rowSelection: "checkbox", showAllDeleteBtn: true, uploadTableRef: uploadTableRef, tableRestProps: {
|
|
294
|
+
}, upload: upload, rowSelection: "checkbox", showAllDeleteBtn: true, showAllDownloadBtn: true, uploadTableRef: uploadTableRef, tableRestProps: {
|
|
211
295
|
tableHandleRef: tableHandleRef,
|
|
212
296
|
} }),
|
|
213
297
|
React.createElement(Upload, { maxSize: 200 * 1024, ztAccept: ['.jpg', '.jpeg', '.png', '.bmp', '.gif'], listType: "picture-card", method: "post", headers: {
|
|
@@ -219,6 +303,7 @@ function UploadDemo() {
|
|
|
219
303
|
}, 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) {
|
|
220
304
|
console.log(index, file);
|
|
221
305
|
}, authToken: token }),
|
|
306
|
+
React.createElement(Sinatures, { canEdit: 0, ZT_API_BASEURL: "http://192.168.0.83:8888", ZT_FILE_BASEURL: "http://192.168.0.83:88", needQj: 0, needDg: 0, needQys: 0, flowId: 1, deptId: "1", caseId: "1", contractId: "1", docAttachMap: "1", checkAttachIdList: [], documentIdList: [], flowStatus: 1, fileList: test.fileList, token: token }),
|
|
222
307
|
React.createElement("button", { onClick: checkHandle }, "\u68C0\u67E5"),
|
|
223
308
|
React.createElement("button", { onClick: getHandle }, "\u83B7\u53D6\u9009\u4E2D\u9879")));
|
|
224
309
|
}
|
|
@@ -65,6 +65,7 @@ import classNames from 'classnames';
|
|
|
65
65
|
import { downloadFileCallBack, downloadPublicFile, previewFile, createThumbnailUrl, } from 'ztxkutils/dist/fileOperation';
|
|
66
66
|
import { transformFileSize } from 'ztxkutils/dist/tools';
|
|
67
67
|
import { MAX_PREVIEW_FILE_SIZE } from '../utils/constants';
|
|
68
|
+
import { fileBatchDownload } from './utils';
|
|
68
69
|
var _accept = [
|
|
69
70
|
'.pdf',
|
|
70
71
|
'.txt',
|
|
@@ -89,6 +90,7 @@ var Upload = function (props) {
|
|
|
89
90
|
var children = props.children, className = props.className, _a = props.showTip, showTip = _a === void 0 ? true : _a, _b = props.showUploadBtn, showUploadBtn = _b === void 0 ? true : _b, _c = props.showDeleteBtn, showDeleteBtn = _c === void 0 ? true : _c, onDownLoadCallbackBefore = props.onDownLoadCallbackBefore, _d = props.showDownloadBtn, showDownloadBtn = _d === void 0 ? true : _d, onDownLoadCallbackAfter = props.onDownLoadCallbackAfter, _e = props.showPreviewBtn, showPreviewBtn = _e === void 0 ? true : _e, onPreviewCallbackBefore = props.onPreviewCallbackBefore, _f = props.showTable, showTable = _f === void 0 ? true : _f, showUploadList = props.showUploadList, onChange = props.onChange, beforeUpload = props.beforeUpload, multiple = props.multiple, ztAccept = props.ztAccept, ztShowTipText = props.ztShowTipText, maxCount = props.maxCount, maxSize = props.maxSize, maxSizeStr = props.maxSizeStr, action = props.action, headers = props.headers, method = props.method, uploadUser = props.uploadUser, originFileList = props.originFileList, callback = props.callback, onDeleteCallback = props.onDeleteCallback, isAutoDelete = props.isAutoDelete, apiBaseUrl = props.apiBaseUrl, _g = props.fileBaseUrl, fileBaseUrl = _g === void 0 ? '' : _g, fileBtnText = props.fileBtnText, data = props.data, authToken = props.authToken, listType = props.listType, isPublic = props.isPublic, startColumns = props.startColumns, otherColumns = props.otherColumns, _h = props.isDirect, isDirect = _h === void 0 ? false : _h, upload = props.upload, rowSelection = props.rowSelection, uploadTableRef = props.uploadTableRef, tableRestProps = props.tableRestProps, showAllDeleteBtn = props.showAllDeleteBtn, showAllDownloadBtn = props.showAllDownloadBtn, allDeleteCallback = props.allDeleteCallback, allDownloadCallback = props.allDownloadCallback, restProps = __rest(props, ["children", "className", "showTip", "showUploadBtn", "showDeleteBtn", "onDownLoadCallbackBefore", "showDownloadBtn", "onDownLoadCallbackAfter", "showPreviewBtn", "onPreviewCallbackBefore", "showTable", "showUploadList", "onChange", "beforeUpload", "multiple", "ztAccept", "ztShowTipText", "maxCount", "maxSize", "maxSizeStr", "action", "headers", "method", "uploadUser", "originFileList", "callback", "onDeleteCallback", "isAutoDelete", "apiBaseUrl", "fileBaseUrl", "fileBtnText", "data", "authToken", "listType", "isPublic", "startColumns", "otherColumns", "isDirect", "upload", "rowSelection", "uploadTableRef", "tableRestProps", "showAllDeleteBtn", "showAllDownloadBtn", "allDeleteCallback", "allDownloadCallback"]);
|
|
90
91
|
var _j = useState(originFileList || []), fileList = _j[0], setFileList = _j[1];
|
|
91
92
|
var _k = useState('20M'), maxSizeTransStr = _k[0], setMaxSizeTransStr = _k[1];
|
|
93
|
+
var batchDownloadRef = useRef(null);
|
|
92
94
|
useEffect(function () {
|
|
93
95
|
if (upload) {
|
|
94
96
|
upload.current = upload.current ? upload.current : {};
|
|
@@ -318,14 +320,57 @@ var Upload = function (props) {
|
|
|
318
320
|
var onAllDownloadHandle = useCallback(function () {
|
|
319
321
|
var list = privateTableRef.current.getSelectedRows();
|
|
320
322
|
if (Array.isArray(list) && list.length > 0) {
|
|
321
|
-
|
|
323
|
+
if (batchDownloadRef.current) {
|
|
324
|
+
var canDownloadFileList_1 = batchDownloadRef.current.canDownloadFileList;
|
|
325
|
+
if (!Array.isArray(canDownloadFileList_1) ||
|
|
326
|
+
canDownloadFileList_1.length === 0) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
// 如果能找到未下载的 或者下载失败的 给出提示
|
|
330
|
+
if (canDownloadFileList_1.find(function (item) { return !item._downloadStatus; })) {
|
|
331
|
+
message.info("\u6709\u6587\u4EF6\u8FD8\u672A\u4E0B\u8F7D\u5B8C\u6210\u7A0D\u540E\u518D\u8FDB\u884C\u6279\u91CF\u4E0B\u8F7D!");
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
if (canDownloadFileList_1.find(function (item) { return item._downloadStatus === 'rejected'; })) {
|
|
335
|
+
var result = (canDownloadFileList_1 === null || canDownloadFileList_1 === void 0 ? void 0 : canDownloadFileList_1.filter(function (item) { return item._downloadStatus === 'rejected'; })) || [];
|
|
336
|
+
message.info("\u6709\u6587\u4EF6\n" + result
|
|
337
|
+
.map(function (item) { return item === null || item === void 0 ? void 0 : item.fileName; })
|
|
338
|
+
.join('\n') + "\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u4E0B\u8F7D\u5931\u8D25\u6587\u4EF6\u91CD\u65B0\u4E0B\u8F7D!");
|
|
339
|
+
batchDownloadRef.current = null;
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
322
343
|
// 根据相关信息生成下载的链接
|
|
344
|
+
batchDownloadRef.current = fileBatchDownload(list, {
|
|
345
|
+
showDownloadBtn: showDownloadBtn,
|
|
346
|
+
showPreviewBtn: showPreviewBtn,
|
|
347
|
+
authToken: authToken,
|
|
348
|
+
apiBaseUrl: apiBaseUrl,
|
|
349
|
+
});
|
|
350
|
+
var _a = batchDownloadRef.current, noCanDownloadFileList = _a.noCanDownloadFileList, canDownloadFileList = _a.canDownloadFileList;
|
|
351
|
+
if (Array.isArray(noCanDownloadFileList) &&
|
|
352
|
+
noCanDownloadFileList.length > 0) {
|
|
353
|
+
message.info("\u4EE5\u4E0B\u6587\u4EF6\u672A\u6388\u6743\u4E0B\u8F7D\uFF1A\n " + noCanDownloadFileList
|
|
354
|
+
.map(function (item) { return item.fileName; })
|
|
355
|
+
.join('\n') + "!");
|
|
356
|
+
}
|
|
357
|
+
if (Array.isArray(canDownloadFileList) &&
|
|
358
|
+
canDownloadFileList.length === 0) {
|
|
359
|
+
message.info('请选择有权限下载的附件!');
|
|
360
|
+
batchDownloadRef.current = null;
|
|
361
|
+
}
|
|
323
362
|
allDownloadCallback && allDownloadCallback(list);
|
|
324
363
|
}
|
|
325
364
|
else {
|
|
326
365
|
message.info('请选择需要下载的附件!');
|
|
327
366
|
}
|
|
328
|
-
}, [
|
|
367
|
+
}, [
|
|
368
|
+
allDownloadCallback,
|
|
369
|
+
showDownloadBtn,
|
|
370
|
+
showPreviewBtn,
|
|
371
|
+
authToken,
|
|
372
|
+
apiBaseUrl,
|
|
373
|
+
]);
|
|
329
374
|
var fileAction = (apiBaseUrl.endsWith('/')
|
|
330
375
|
? apiBaseUrl.slice(0, apiBaseUrl.length - 1)
|
|
331
376
|
: apiBaseUrl) + "/api/zmdms-resource/oss/endpoint/put-file-attach";
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* @author 陈亚雄
|
|
3
|
-
* @description 文件批量下载功能
|
|
4
|
-
*/
|
|
5
|
-
interface IFileItem {
|
|
1
|
+
export interface IFileItem {
|
|
6
2
|
operationAuth?: string;
|
|
7
|
-
fileId
|
|
3
|
+
fileId: string;
|
|
8
4
|
fileName?: string;
|
|
9
5
|
fileSize?: number;
|
|
10
6
|
[prop: string]: any;
|
|
11
7
|
}
|
|
12
|
-
|
|
8
|
+
interface IConfig {
|
|
9
|
+
showDownloadBtn?: boolean;
|
|
10
|
+
showPreviewBtn?: boolean;
|
|
11
|
+
authToken?: string;
|
|
12
|
+
apiBaseUrl: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function fileBatchDownload(fileList: IFileItem[], otherConfig: IConfig): {
|
|
15
|
+
canDownloadFileList: IFileItem[];
|
|
16
|
+
noCanDownloadFileList: IFileItem[];
|
|
17
|
+
};
|
|
13
18
|
export {};
|
|
@@ -1,16 +1,64 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
/**
|
|
2
13
|
* @author 陈亚雄
|
|
3
14
|
* @description 文件批量下载功能
|
|
4
15
|
*/
|
|
5
|
-
|
|
16
|
+
import { MAX_PREVIEW_FILE_SIZE } from '../utils/constants';
|
|
17
|
+
import { downloadFileCallBack } from 'ztxkutils/dist/fileOperation';
|
|
18
|
+
export function fileBatchDownload(fileList, otherConfig) {
|
|
6
19
|
var canDownloadFileList = []; // 可以下载的附件列表
|
|
7
20
|
var noCanDownloadFileList = []; // 不可以下载的附件列表
|
|
8
21
|
if (Array.isArray(fileList) && fileList.length > 0) {
|
|
9
|
-
|
|
10
|
-
|
|
22
|
+
var showDownloadBtn_1 = otherConfig.showDownloadBtn, showPreviewBtn_1 = otherConfig.showPreviewBtn, authToken_1 = otherConfig.authToken, apiBaseUrl_1 = otherConfig.apiBaseUrl;
|
|
23
|
+
// 找出可以下载的文件,以及不可以下载的文件
|
|
24
|
+
fileList.forEach(function (fileItem, index) {
|
|
25
|
+
var fileSize = fileItem.fileSize, operationAuth = fileItem.operationAuth;
|
|
11
26
|
var authDownloadBtn = typeof operationAuth === 'string' && operationAuth.indexOf('2') !== -1
|
|
12
27
|
? true
|
|
13
28
|
: false;
|
|
29
|
+
var authPreviewBtn = typeof operationAuth === 'string' && operationAuth.indexOf('1') !== -1
|
|
30
|
+
? true
|
|
31
|
+
: false;
|
|
32
|
+
// 如果可以下载
|
|
33
|
+
if ((typeof operationAuth === 'string'
|
|
34
|
+
? authDownloadBtn
|
|
35
|
+
: showDownloadBtn_1) ||
|
|
36
|
+
((typeof operationAuth === 'string'
|
|
37
|
+
? authPreviewBtn
|
|
38
|
+
: showPreviewBtn_1) &&
|
|
39
|
+
(fileSize || 0) >= MAX_PREVIEW_FILE_SIZE)) {
|
|
40
|
+
canDownloadFileList.push(__assign({}, fileItem));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
noCanDownloadFileList.push(__assign({}, fileItem));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
// 开始下载可以下载的文件
|
|
47
|
+
canDownloadFileList.forEach(function (fileItem, index) {
|
|
48
|
+
var fileId = fileItem.fileId, fileName = fileItem.fileName;
|
|
49
|
+
downloadFileCallBack(apiBaseUrl_1, fileId, fileName || "\u9644\u4EF6" + (index + 1), {
|
|
50
|
+
authToken: authToken_1,
|
|
51
|
+
callbackAfter: function () {
|
|
52
|
+
fileItem._downloadStatus = 'fulfilled';
|
|
53
|
+
},
|
|
54
|
+
callbackError: function () {
|
|
55
|
+
fileItem._downloadStatus = 'rejected';
|
|
56
|
+
},
|
|
57
|
+
});
|
|
14
58
|
});
|
|
15
59
|
}
|
|
60
|
+
return {
|
|
61
|
+
canDownloadFileList: canDownloadFileList,
|
|
62
|
+
noCanDownloadFileList: noCanDownloadFileList,
|
|
63
|
+
};
|
|
16
64
|
}
|
|
@@ -13,17 +13,19 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
};
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
|
-
import React, { memo } from 'react';
|
|
17
|
-
import { Table, Button } from '../../../../index';
|
|
16
|
+
import React, { memo, useMemo, useRef } from 'react';
|
|
17
|
+
import { Table, Button, message } from '../../../../index';
|
|
18
18
|
import { Switch } from 'antd';
|
|
19
19
|
// 自定义组件
|
|
20
20
|
import AttachOperation from './AttachOperation';
|
|
21
21
|
import CompareResult from './CompareResult';
|
|
22
|
+
import { fileBatchDownload } from '../../../Upload/utils';
|
|
22
23
|
var DetailTable = function (_a) {
|
|
23
24
|
var _b;
|
|
24
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;
|
|
25
26
|
var authToken = token || '';
|
|
26
27
|
var isOnlyQj = "" + ((_b = records === null || records === void 0 ? void 0 : records[0]) === null || _b === void 0 ? void 0 : _b.attachId) === '123456789';
|
|
28
|
+
var selectRows = useRef(null);
|
|
27
29
|
/** 下载水印附件 */
|
|
28
30
|
var downFileFn = function (_record) {
|
|
29
31
|
try {
|
|
@@ -229,7 +231,70 @@ var DetailTable = function (_a) {
|
|
|
229
231
|
return ['qunjSeal'].includes(item.key);
|
|
230
232
|
});
|
|
231
233
|
}
|
|
234
|
+
var myRowSelection = useMemo(function () { return ({
|
|
235
|
+
type: 'checkbox',
|
|
236
|
+
onChange: function (selectedRowKeys, selectedRows) {
|
|
237
|
+
selectRows.current = selectedRows.map(function (item) {
|
|
238
|
+
var newItem = __assign(__assign({}, item), { fileId: item.attachId, fileName: item === null || item === void 0 ? void 0 : item.attachName, fileSize: item === null || item === void 0 ? void 0 : item.attachSize });
|
|
239
|
+
return newItem;
|
|
240
|
+
});
|
|
241
|
+
},
|
|
242
|
+
}); }, []);
|
|
243
|
+
/**
|
|
244
|
+
* @author 陈亚雄
|
|
245
|
+
* @description 批量下载
|
|
246
|
+
*/
|
|
247
|
+
var batchDownloadRef = useRef(null);
|
|
248
|
+
var onAllDownloadHandle = function () {
|
|
249
|
+
var list = selectRows.current;
|
|
250
|
+
if (Array.isArray(list) && list.length > 0) {
|
|
251
|
+
if (batchDownloadRef.current) {
|
|
252
|
+
var canDownloadFileList_1 = batchDownloadRef.current.canDownloadFileList;
|
|
253
|
+
if (!Array.isArray(canDownloadFileList_1) ||
|
|
254
|
+
canDownloadFileList_1.length === 0) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
// 如果能找到未下载的 或者下载失败的 给出提示
|
|
258
|
+
if (canDownloadFileList_1.find(function (item) { return !item._downloadStatus; })) {
|
|
259
|
+
message.info("\u6709\u6587\u4EF6\u8FD8\u672A\u4E0B\u8F7D\u5B8C\u6210\u7A0D\u540E\u518D\u8FDB\u884C\u6279\u91CF\u4E0B\u8F7D!");
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (canDownloadFileList_1.find(function (item) { return item._downloadStatus === 'rejected'; })) {
|
|
263
|
+
var result = (canDownloadFileList_1 === null || canDownloadFileList_1 === void 0 ? void 0 : canDownloadFileList_1.filter(function (item) { return item._downloadStatus === 'rejected'; })) || [];
|
|
264
|
+
message.info("\u6709\u6587\u4EF6\n" + result
|
|
265
|
+
.map(function (item) { return item === null || item === void 0 ? void 0 : item.fileName; })
|
|
266
|
+
.join('\n') + "\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u4E0B\u8F7D\u5931\u8D25\u6587\u4EF6\u91CD\u65B0\u4E0B\u8F7D!");
|
|
267
|
+
batchDownloadRef.current = null;
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// 根据相关信息生成下载的链接
|
|
272
|
+
batchDownloadRef.current = fileBatchDownload(list, {
|
|
273
|
+
showDownloadBtn: true,
|
|
274
|
+
showPreviewBtn: true,
|
|
275
|
+
authToken: authToken,
|
|
276
|
+
apiBaseUrl: ZT_API_BASEURL,
|
|
277
|
+
});
|
|
278
|
+
var _a = batchDownloadRef.current, noCanDownloadFileList = _a.noCanDownloadFileList, canDownloadFileList = _a.canDownloadFileList;
|
|
279
|
+
if (Array.isArray(noCanDownloadFileList) &&
|
|
280
|
+
noCanDownloadFileList.length > 0) {
|
|
281
|
+
message.info("\u4EE5\u4E0B\u6587\u4EF6\u672A\u6388\u6743\u4E0B\u8F7D\uFF1A\n " + noCanDownloadFileList
|
|
282
|
+
.map(function (item) { return item.fileName; })
|
|
283
|
+
.join('\n') + "!");
|
|
284
|
+
}
|
|
285
|
+
if (Array.isArray(canDownloadFileList) &&
|
|
286
|
+
canDownloadFileList.length === 0) {
|
|
287
|
+
message.info('请选择有权限下载的附件!');
|
|
288
|
+
batchDownloadRef.current = null;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
message.info('请选择需要下载的附件!');
|
|
293
|
+
}
|
|
294
|
+
};
|
|
232
295
|
return (React.createElement(React.Fragment, null,
|
|
233
|
-
React.createElement(
|
|
296
|
+
React.createElement("div", { style: { marginBottom: '10px' } },
|
|
297
|
+
React.createElement(Button, { type: "primary", style: { marginRight: '10px' }, onClick: onAllDownloadHandle }, "\u6279\u91CF\u4E0B\u8F7D")),
|
|
298
|
+
React.createElement(Table, { columns: columnsLast, rowKey: "attachId", dataSource: records, scroll: { x: 'max-content' }, rowSelection: myRowSelection })));
|
|
234
299
|
};
|
|
235
300
|
export default memo(DetailTable);
|
package/dist/constants.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
1
|
+
export declare const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25h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