ztxkui 2.2.0 → 2.2.1
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.
|
@@ -58,11 +58,11 @@ import { divide, round, times } from 'number-precision';
|
|
|
58
58
|
import { downloadFileCallBack, downloadPublicFile, previewFile, } from 'ztxkutils/dist/fileOperation';
|
|
59
59
|
import { transformFileSize } from 'ztxkutils/dist/tools';
|
|
60
60
|
var UploadTable = function (_a) {
|
|
61
|
-
var fileList = _a.fileList, action = _a.action, headers = _a.headers, authToken = _a.authToken, method = _a.method, apiBaseUrl = _a.apiBaseUrl, uploadUser = _a.uploadUser, _b = _a.fileBaseUrl, fileBaseUrl = _b === void 0 ? '' : _b, onDelete = _a.onDelete, onUpload = _a.onUpload, showDeleteBtn = _a.showDeleteBtn, isAutoDelete = _a.isAutoDelete, onDownLoadCallbackBefore = _a.onDownLoadCallbackBefore, showDownloadBtn = _a.showDownloadBtn, onDownLoadCallbackAfter = _a.onDownLoadCallbackAfter, onPreviewCallbackBefore = _a.onPreviewCallbackBefore, showPreviewBtn = _a.showPreviewBtn, isPublic = _a.isPublic, data = _a.data, _c = _a.
|
|
62
|
-
var
|
|
63
|
-
var
|
|
61
|
+
var fileList = _a.fileList, action = _a.action, headers = _a.headers, authToken = _a.authToken, method = _a.method, apiBaseUrl = _a.apiBaseUrl, uploadUser = _a.uploadUser, _b = _a.fileBaseUrl, fileBaseUrl = _b === void 0 ? '' : _b, onDelete = _a.onDelete, onUpload = _a.onUpload, showDeleteBtn = _a.showDeleteBtn, isAutoDelete = _a.isAutoDelete, onDownLoadCallbackBefore = _a.onDownLoadCallbackBefore, showDownloadBtn = _a.showDownloadBtn, onDownLoadCallbackAfter = _a.onDownLoadCallbackAfter, onPreviewCallbackBefore = _a.onPreviewCallbackBefore, showPreviewBtn = _a.showPreviewBtn, isPublic = _a.isPublic, data = _a.data, _c = _a.startColumns, startColumns = _c === void 0 ? [] : _c, _d = _a.otherColumns, otherColumns = _d === void 0 ? [] : _d, showUploadBtn = _a.showUploadBtn;
|
|
62
|
+
var _e = useState([]), dataSource = _e[0], setDataSource = _e[1];
|
|
63
|
+
var _f = useState(false), loading = _f[0], setLoading = _f[1];
|
|
64
64
|
var columns = showUploadBtn
|
|
65
|
-
? __spreadArray(__spreadArray([
|
|
65
|
+
? __spreadArray(__spreadArray(__spreadArray(__spreadArray([], startColumns), [
|
|
66
66
|
{
|
|
67
67
|
title: '文件名称',
|
|
68
68
|
width: 200,
|
|
@@ -91,7 +91,7 @@ var UploadTable = function (_a) {
|
|
|
91
91
|
dataIndex: 'uploadUser',
|
|
92
92
|
key: 'uploadUser',
|
|
93
93
|
}
|
|
94
|
-
], otherColumns), [
|
|
94
|
+
]), otherColumns), [
|
|
95
95
|
{
|
|
96
96
|
title: '上传进度',
|
|
97
97
|
width: 200,
|
|
@@ -153,7 +153,7 @@ var UploadTable = function (_a) {
|
|
|
153
153
|
}, type: "link" }, "\u5220\u9664")))));
|
|
154
154
|
},
|
|
155
155
|
},
|
|
156
|
-
]) : __spreadArray(__spreadArray([
|
|
156
|
+
]) : __spreadArray(__spreadArray(__spreadArray(__spreadArray([], startColumns), [
|
|
157
157
|
{
|
|
158
158
|
title: '文件名称',
|
|
159
159
|
width: 200,
|
|
@@ -182,7 +182,7 @@ var UploadTable = function (_a) {
|
|
|
182
182
|
dataIndex: 'uploadUser',
|
|
183
183
|
key: 'uploadUser',
|
|
184
184
|
}
|
|
185
|
-
], otherColumns), [
|
|
185
|
+
]), otherColumns), [
|
|
186
186
|
{
|
|
187
187
|
title: '操作',
|
|
188
188
|
width: 80,
|
|
@@ -44,7 +44,7 @@ var _accept = [
|
|
|
44
44
|
'.gif',
|
|
45
45
|
];
|
|
46
46
|
var Upload = function (props) {
|
|
47
|
-
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, 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, otherColumns = props.otherColumns, _h = props.isDirect, isDirect = _h === void 0 ? false : _h, restProps = __rest(props, ["children", "className", "showTip", "showUploadBtn", "showDeleteBtn", "onDownLoadCallbackBefore", "showDownloadBtn", "onDownLoadCallbackAfter", "showPreviewBtn", "onPreviewCallbackBefore", "showTable", "showUploadList", "onChange", "beforeUpload", "multiple", "ztAccept", "maxCount", "maxSize", "maxSizeStr", "action", "headers", "method", "uploadUser", "originFileList", "callback", "onDeleteCallback", "isAutoDelete", "apiBaseUrl", "fileBaseUrl", "fileBtnText", "data", "authToken", "listType", "isPublic", "otherColumns", "isDirect"]);
|
|
47
|
+
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, 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, restProps = __rest(props, ["children", "className", "showTip", "showUploadBtn", "showDeleteBtn", "onDownLoadCallbackBefore", "showDownloadBtn", "onDownLoadCallbackAfter", "showPreviewBtn", "onPreviewCallbackBefore", "showTable", "showUploadList", "onChange", "beforeUpload", "multiple", "ztAccept", "maxCount", "maxSize", "maxSizeStr", "action", "headers", "method", "uploadUser", "originFileList", "callback", "onDeleteCallback", "isAutoDelete", "apiBaseUrl", "fileBaseUrl", "fileBtnText", "data", "authToken", "listType", "isPublic", "startColumns", "otherColumns", "isDirect"]);
|
|
48
48
|
var _j = useState(originFileList || []), fileList = _j[0], setFileList = _j[1];
|
|
49
49
|
var _k = useState('20M'), maxSizeTransStr = _k[0], setMaxSizeTransStr = _k[1];
|
|
50
50
|
useEffect(function () {
|
|
@@ -184,6 +184,6 @@ var Upload = function (props) {
|
|
|
184
184
|
"(\u5355\u4E2A\u9644\u4EF6\u6700\u5927\u652F\u6301",
|
|
185
185
|
maxSizeTransStr,
|
|
186
186
|
"\uFF0C\u652F\u6301\u683C\u5F0F\uFF1APDF\u3001Word\u3001Excel\u3001Txt\u3001JPG\u3001PNG\u3001BMP\u3001GIF\u3001RAR\u3001ZIP)")))),
|
|
187
|
-
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, otherColumns: otherColumns, showUploadBtn: showUploadBtn }))));
|
|
187
|
+
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 }))));
|
|
188
188
|
};
|
|
189
189
|
export default Upload;
|