ztxkui 4.3.51 → 4.3.52
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.
|
@@ -301,6 +301,7 @@ var UploadTable = function (_a) {
|
|
|
301
301
|
// );
|
|
302
302
|
downloadFileCallBack(apiBaseUrl, record === null || record === void 0 ? void 0 : record.fileId, record === null || record === void 0 ? void 0 : record.fileName, {
|
|
303
303
|
authToken: authToken,
|
|
304
|
+
addWaterMark: addWaterMark ? 'true' : 'false',
|
|
304
305
|
callbackAfter: function () {
|
|
305
306
|
var _a, _b, _c;
|
|
306
307
|
var newDataSource = ((_b = (_a = (dataSourceRef.current || [])) === null || _a === void 0 ? void 0 : _a.slice) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
|
|
@@ -79,6 +79,8 @@ export interface IProps extends UploadProps {
|
|
|
79
79
|
uploadTableRef?: any;
|
|
80
80
|
/**表格方法 */
|
|
81
81
|
tableRestProps?: any;
|
|
82
|
+
/** 附件下载水印 */
|
|
83
|
+
addWaterMark?: boolean;
|
|
82
84
|
}
|
|
83
85
|
export declare function getFileId(item: any): any;
|
|
84
86
|
export declare function getFileSize(item: any): any;
|
|
@@ -119,9 +119,9 @@ export function getFileSize(item) {
|
|
|
119
119
|
return null;
|
|
120
120
|
}
|
|
121
121
|
var Upload = function (props) {
|
|
122
|
-
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, batchDownloadZipName = props.batchDownloadZipName, 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", "batchDownloadZipName"]);
|
|
123
|
-
var
|
|
124
|
-
var
|
|
122
|
+
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, batchDownloadZipName = props.batchDownloadZipName, _j = props.addWaterMark, addWaterMark = _j === void 0 ? true : _j, 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", "batchDownloadZipName", "addWaterMark"]);
|
|
123
|
+
var _k = useState(originFileList || []), fileList = _k[0], setFileList = _k[1];
|
|
124
|
+
var _l = useState('20M'), maxSizeTransStr = _l[0], setMaxSizeTransStr = _l[1];
|
|
125
125
|
useEffect(function () {
|
|
126
126
|
if (upload) {
|
|
127
127
|
upload.current = upload.current ? upload.current : {};
|
|
@@ -299,6 +299,7 @@ var Upload = function (props) {
|
|
|
299
299
|
callbackAfter: function () {
|
|
300
300
|
onDownLoadCallbackAfter && onDownLoadCallbackAfter(file);
|
|
301
301
|
},
|
|
302
|
+
addWaterMark: addWaterMark ? 'true' : 'false',
|
|
302
303
|
});
|
|
303
304
|
}
|
|
304
305
|
else {
|
|
@@ -308,6 +309,7 @@ var Upload = function (props) {
|
|
|
308
309
|
callbackAfter: function () {
|
|
309
310
|
onDownLoadCallbackAfter && onDownLoadCallbackAfter(file);
|
|
310
311
|
},
|
|
312
|
+
addWaterMark: addWaterMark ? 'true' : 'false',
|
|
311
313
|
});
|
|
312
314
|
}
|
|
313
315
|
}
|
|
@@ -459,6 +461,6 @@ var Upload = function (props) {
|
|
|
459
461
|
? ztShowTipText
|
|
460
462
|
: 'PDF、Word、Excel、Txt、JPG、PNG、BMP、GIF、RAR、ZIP',
|
|
461
463
|
")")))),
|
|
462
|
-
showTable && (React.createElement(UploadTable, { fileList: fileList, action: fileAction, apiBaseUrl: apiBaseUrl, fileBaseUrl: fileBaseUrl, headers: headers, method: method, uploadUser: uploadUser, onDelete: onDeleteHandle, onUpload: onUploadHandle, showDeleteBtn: showDeleteBtn, onDownLoadCallbackBefore: onDownLoadCallbackBefore, showDownloadBtn: showDownloadBtn, onDownLoadCallbackAfter: onDownLoadCallbackAfter, showPreviewBtn: showPreviewBtn, onPreviewCallbackBefore: onPreviewCallbackBefore, isAutoDelete: isAutoDelete, authToken: authToken, isPublic: isPublic, data: data, startColumns: startColumns, otherColumns: otherColumns, showUploadBtn: showUploadBtn, rowSelection: rowSelection, uploadTableRef: uploadTableRef, tableRestProps: tableRestProps, privateTableRef: privateTableRef }))));
|
|
464
|
+
showTable && (React.createElement(UploadTable, { fileList: fileList, action: fileAction, apiBaseUrl: apiBaseUrl, fileBaseUrl: fileBaseUrl, headers: headers, method: method, uploadUser: uploadUser, onDelete: onDeleteHandle, onUpload: onUploadHandle, showDeleteBtn: showDeleteBtn, onDownLoadCallbackBefore: onDownLoadCallbackBefore, showDownloadBtn: showDownloadBtn, onDownLoadCallbackAfter: onDownLoadCallbackAfter, showPreviewBtn: showPreviewBtn, onPreviewCallbackBefore: onPreviewCallbackBefore, isAutoDelete: isAutoDelete, authToken: authToken, isPublic: isPublic, data: data, startColumns: startColumns, otherColumns: otherColumns, showUploadBtn: showUploadBtn, rowSelection: rowSelection, uploadTableRef: uploadTableRef, tableRestProps: tableRestProps, privateTableRef: privateTableRef, addWaterMark: addWaterMark }))));
|
|
463
465
|
};
|
|
464
466
|
export default Upload;
|