zmdms-webui 1.2.3 → 1.2.4

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.
@@ -1,5 +1,5 @@
1
1
  import { __assign } from '../_virtual/_tslib.js';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import React__default, { memo } from 'react';
4
4
  import classNames from '../node_modules/classnames/index.js';
5
5
  import ButtonCom from '../button/button.js';
@@ -9,27 +9,32 @@ var defaultPageSizeOptions = ["10", "20", "30", "100"];
9
9
  var Footer = function (props) {
10
10
  var children = props.children, className = props.className, _a = props.align, align = _a === void 0 ? "left" : _a, footerDom = props.footerDom;
11
11
  var classes = classNames("ztxk-footer", className);
12
- return (jsx("footer", __assign({ className: classes, style: {
13
- justifyContent: align === "left"
14
- ? "flex-start"
15
- : align === "center"
16
- ? "center"
17
- : "flex-end",
18
- } }, { children: footerDom ? (jsxs("div", __assign({ className: "ztxk-footer--group" }, { children: [footerDom.map(function (item, index) {
19
- var DOMType = item.DOMType, render = item.render;
20
- if (DOMType === "button") {
21
- var _a = item.type, type = _a === void 0 ? "primary" : _a, loading = item.loading, disabled = item.disabled, onClick = item.onClick;
22
- return (jsx(ButtonCom, __assign({ type: type, loading: loading, disabled: disabled, onClick: onClick }, { children: item.text }), index));
23
- }
24
- if (DOMType === "pagination") {
25
- var total = item.total, pageSize = item.pageSize, current = item.current, onChange = item.onChange, onShowSizeChange = item.onShowSizeChange, pageSizeOptions = item.pageSizeOptions;
26
- return (jsx(Pagination, { total: total, pageSize: pageSize, current: current, onChange: onChange, onShowSizeChange: onShowSizeChange, showTotal: function (total) { return (jsxs("span", __assign({ className: "footer-pagination" }, { children: ["\u5171", jsx("span", { children: total }), "\u6761"] }))); }, showSizeChanger: true, pageSizeOptions: pageSizeOptions ? pageSizeOptions : defaultPageSizeOptions }, index));
27
- }
28
- if (render) {
29
- return jsx(React__default.Fragment, { children: render() }, index);
30
- }
31
- return null;
32
- }), children] }))) : null })));
12
+ var leftFooterDom = footerDom === null || footerDom === void 0 ? void 0 : footerDom.filter(function (item) { return item.align === "left" || !item.align; });
13
+ var rightFooterDom = footerDom === null || footerDom === void 0 ? void 0 : footerDom.filter(function (item) { return item.align === "right"; });
14
+ var createDom = function (item, index) {
15
+ var DOMType = item.DOMType, render = item.render;
16
+ if (DOMType === "button") {
17
+ var _a = item.type, type = _a === void 0 ? "primary" : _a, loading = item.loading, disabled = item.disabled, onClick = item.onClick;
18
+ return (jsx(ButtonCom, __assign({ type: type, loading: loading, disabled: disabled, onClick: onClick }, { children: item.text }), index));
19
+ }
20
+ if (DOMType === "pagination") {
21
+ var total = item.total, pageSize = item.pageSize, current = item.current, onChange = item.onChange, onShowSizeChange = item.onShowSizeChange, pageSizeOptions = item.pageSizeOptions;
22
+ return (jsx(Pagination, { total: total, pageSize: pageSize, current: current, onChange: onChange, onShowSizeChange: onShowSizeChange, showTotal: function (total) { return (jsxs("span", __assign({ className: "footer-pagination" }, { children: ["\u5171", jsx("span", { children: total }), "\u6761"] }))); }, showSizeChanger: true, pageSizeOptions: pageSizeOptions ? pageSizeOptions : defaultPageSizeOptions }, index));
23
+ }
24
+ if (render) {
25
+ return jsx(React__default.Fragment, { children: render() }, index);
26
+ }
27
+ return null;
28
+ };
29
+ return (jsxs("footer", __assign({ className: classes, style: {
30
+ justifyContent: rightFooterDom
31
+ ? "space-between"
32
+ : align === "left"
33
+ ? "flex-start"
34
+ : align === "center"
35
+ ? "center"
36
+ : "flex-end",
37
+ } }, { children: [leftFooterDom ? (jsxs("div", __assign({ className: "ztxk-footer--group" }, { children: [leftFooterDom.map(createDom), children] }))) : null, rightFooterDom ? (jsx("div", __assign({ className: "ztxk-footer--group" }, { children: rightFooterDom.map(createDom) }))) : null] })));
33
38
  };
34
39
  var Footer$1 = memo(Footer);
35
40
 
@@ -22,6 +22,7 @@ interface IDropdown {
22
22
  interface IFooterDom extends Partial<IPagination & IBtn & IDropdown> {
23
23
  DOMType?: "button" | "pagination" | "dropdown";
24
24
  render?: () => React.ReactElement;
25
+ align?: "left" | "right";
25
26
  }
26
27
  interface IFooterProps {
27
28
  children?: React.ReactNode;
@@ -1,5 +1,6 @@
1
1
  import { UploadProps, UploadFile, Upload } from 'antd';
2
2
  import { ImgCropProps } from 'antd-img-crop';
3
+ import { IColumnsTypeProp } from '../table/interface.js';
3
4
 
4
5
  interface IUploadListProps extends Omit<UploadProps, "onChange"> {
5
6
  /** 默认按钮的文本内容 */
@@ -54,6 +55,8 @@ interface IUploadListProps extends Omit<UploadProps, "onChange"> {
54
55
  disAllowDuplicateFile?: boolean;
55
56
  /** 字段值 */
56
57
  fieldNames?: IUploadFieldNames;
58
+ /** 表格列自定义 */
59
+ tableColumns?: (IColumnsTypeProp<any> | string)[];
57
60
  }
58
61
  interface IUploadFieldNames {
59
62
  attachId?: string;
@@ -65,6 +68,13 @@ interface IUploadFieldNames {
65
68
  interface UploadListComponent extends React.ForwardRefExoticComponent<IUploadListProps & React.RefAttributes<unknown>> {
66
69
  Dragger: typeof Upload.Dragger;
67
70
  LIST_IGNORE: typeof Upload.LIST_IGNORE;
71
+ TABLE_FILENAME_COLUMN: string;
72
+ TABLE_FILESIZE_COLUMN: string;
73
+ TABLE_CREATETIME_COLUMN: string;
74
+ TABLE_CREATEUSER_COLUMN: string;
75
+ TABLE_PERCENT_COLUMN: string;
76
+ TABLE_OPTION_COLUMN: string;
77
+ TABLE_DEFAULT_COLUMNS: string[];
68
78
  }
69
79
 
70
80
  export { IUploadListProps, UploadListComponent };
@@ -0,0 +1,11 @@
1
+ var ETABLE_COLUMN_TYPE;
2
+ (function (ETABLE_COLUMN_TYPE) {
3
+ ETABLE_COLUMN_TYPE["TABLE_FILENAME_COLUMN"] = "TABLE_FILENAME_COLUMN";
4
+ ETABLE_COLUMN_TYPE["TABLE_FILESIZE_COLUMN"] = "TABLE_FILESIZE_COLUMN";
5
+ ETABLE_COLUMN_TYPE["TABLE_CREATETIME_COLUMN"] = "TABLE_CREATETIME_COLUMN";
6
+ ETABLE_COLUMN_TYPE["TABLE_CREATEUSER_COLUMN"] = "TABLE_CREATEUSER_COLUMN";
7
+ ETABLE_COLUMN_TYPE["TABLE_PERCENT_COLUMN"] = "TABLE_PERCENT_COLUMN";
8
+ ETABLE_COLUMN_TYPE["TABLE_OPTION_COLUMN"] = "TABLE_OPTION_COLUMN";
9
+ })(ETABLE_COLUMN_TYPE || (ETABLE_COLUMN_TYPE = {}));
10
+
11
+ export { ETABLE_COLUMN_TYPE };
@@ -3,6 +3,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { memo, forwardRef, useRef, useState, useEffect, useMemo, useImperativeHandle } from 'react';
4
4
  import { Upload, Popconfirm, Dropdown, message } from 'antd';
5
5
  import UploadTable from './uploadTable.js';
6
+ import { ETABLE_COLUMN_TYPE } from './interface.js';
6
7
  import classNames from '../node_modules/classnames/index.js';
7
8
  import { formatUnit, createDownloadLink, downloadFile, batchDownloadFiles } from 'zmdms-utils';
8
9
  import ImgCrop from '../node_modules/antd-img-crop/dist/antd-img-crop.esm.js';
@@ -28,7 +29,7 @@ var MAXSIZE = 104857600; // 100 * 1024 * 1024
28
29
  */
29
30
  var UploadList = function (props, ref) {
30
31
  var _a;
31
- var children = props.children, btnText = props.btnText, className = props.className, _b = props.showTip, showTip = _b === void 0 ? true : _b, _c = props.maxSize, maxSize = _c === void 0 ? MAXSIZE : _c, showTable = props.showTable, acceptList = props.acceptList, beforeUpload = props.beforeUpload, onChange = props.onChange, PROPS_API_BASEURL = props.API_BASEURL, PROPS_FILE_API_BASEURL = props.FILE_API_BASEURL, action = props.action, headers = props.headers, data = props.data, userName = props.userName, fileList = props.fileList, isPublic = props.isPublic, _d = props.maxPreviewSize, maxPreviewSize = _d === void 0 ? MAX_PREVIEW_SIZE : _d, isPreview = props.isPreview, isDownload = props.isDownload, isDelete = props.isDelete, _e = props.zipName, zipName = _e === void 0 ? "\u6279\u91CF\u4E0B\u8F7D-".concat(Date.now(), ".zip") : _e, isImage = props.isImage, imgCropProps = props.imgCropProps, _f = props.imgWidth, imgWidth = _f === void 0 ? 110 : _f, _g = props.imgHeight, imgHeight = _g === void 0 ? 110 : _g, customRenderBtn = props.customRenderBtn, disAllowDuplicateFile = props.disAllowDuplicateFile, fieldNames = props.fieldNames, resetProps = __rest(props, ["children", "btnText", "className", "showTip", "maxSize", "showTable", "acceptList", "beforeUpload", "onChange", "API_BASEURL", "FILE_API_BASEURL", "action", "headers", "data", "userName", "fileList", "isPublic", "maxPreviewSize", "isPreview", "isDownload", "isDelete", "zipName", "isImage", "imgCropProps", "imgWidth", "imgHeight", "customRenderBtn", "disAllowDuplicateFile", "fieldNames"]);
32
+ var children = props.children, btnText = props.btnText, className = props.className, _b = props.showTip, showTip = _b === void 0 ? true : _b, _c = props.maxSize, maxSize = _c === void 0 ? MAXSIZE : _c, showTable = props.showTable, acceptList = props.acceptList, beforeUpload = props.beforeUpload, onChange = props.onChange, PROPS_API_BASEURL = props.API_BASEURL, PROPS_FILE_API_BASEURL = props.FILE_API_BASEURL, action = props.action, headers = props.headers, data = props.data, userName = props.userName, fileList = props.fileList, isPublic = props.isPublic, _d = props.maxPreviewSize, maxPreviewSize = _d === void 0 ? MAX_PREVIEW_SIZE : _d, isPreview = props.isPreview, isDownload = props.isDownload, isDelete = props.isDelete, _e = props.zipName, zipName = _e === void 0 ? "\u6279\u91CF\u4E0B\u8F7D-".concat(Date.now(), ".zip") : _e, isImage = props.isImage, imgCropProps = props.imgCropProps, _f = props.imgWidth, imgWidth = _f === void 0 ? 110 : _f, _g = props.imgHeight, imgHeight = _g === void 0 ? 110 : _g, customRenderBtn = props.customRenderBtn, disAllowDuplicateFile = props.disAllowDuplicateFile, fieldNames = props.fieldNames, tableColumns = props.tableColumns, resetProps = __rest(props, ["children", "btnText", "className", "showTip", "maxSize", "showTable", "acceptList", "beforeUpload", "onChange", "API_BASEURL", "FILE_API_BASEURL", "action", "headers", "data", "userName", "fileList", "isPublic", "maxPreviewSize", "isPreview", "isDownload", "isDelete", "zipName", "isImage", "imgCropProps", "imgWidth", "imgHeight", "customRenderBtn", "disAllowDuplicateFile", "fieldNames", "tableColumns"]);
32
33
  var maxCount = resetProps.maxCount, listType = resetProps.listType, method = resetProps.method;
33
34
  var imgSizeClassName = "temporary-className-".concat(imgWidth, "-").concat(imgHeight);
34
35
  var classes = classNames("ztxk-upload", className, (_a = {},
@@ -275,7 +276,7 @@ var UploadList = function (props, ref) {
275
276
  onClick: function (e) {
276
277
  onBatchDownloadHandle(e.key);
277
278
  },
278
- }, placement: "bottomLeft" }, { children: jsx(ButtonCom, __assign({ type: "primary" }, { children: "\u6279\u91CF\u4E0B\u8F7D" })) }))) : null, customRenderBtn, showTable ? (jsx(UploadTable, { dataSource: uploadTableData, action: fileAction, headers: fileHeaders, data: fileData, method: method, setInnerFileList: setInnerFileList, isPublic: isPublic, API_BASEURL: API_BASEURL, FILE_API_BASEURL: FILE_API_BASEURL, maxPreviewSize: maxPreviewSize, isPreview: isPreview, isDelete: isDelete, isDownload: isDownload, ref: tableRef, listType: listType })) : null, isImage && (jsx(ModalComponent, __assign({ ref: modalRef, footer: null, width: "520px" }, { children: jsx("div", __assign({ style: {
279
+ }, placement: "bottomLeft" }, { children: jsx(ButtonCom, __assign({ type: "primary" }, { children: "\u6279\u91CF\u4E0B\u8F7D" })) }))) : null, customRenderBtn, showTable ? (jsx(UploadTable, { dataSource: uploadTableData, action: fileAction, headers: fileHeaders, data: fileData, method: method, setInnerFileList: setInnerFileList, isPublic: isPublic, API_BASEURL: API_BASEURL, FILE_API_BASEURL: FILE_API_BASEURL, maxPreviewSize: maxPreviewSize, isPreview: isPreview, isDelete: isDelete, isDownload: isDownload, ref: tableRef, listType: listType, tableColumns: tableColumns })) : null, isImage && (jsx(ModalComponent, __assign({ ref: modalRef, footer: null, width: "520px" }, { children: jsx("div", __assign({ style: {
279
280
  textAlign: "center",
280
281
  } }, { children: jsx("img", { src: imgSrc, alt: "\u9884\u89C8", style: {
281
282
  maxWidth: "400px",
@@ -285,6 +286,22 @@ var UploadList = function (props, ref) {
285
286
  var MemoUploadList = memo(forwardRef(UploadList));
286
287
  MemoUploadList.displayName = "ZTXK_WEBUI_UploadList";
287
288
  MemoUploadList.Dragger = Upload.Dragger;
288
- MemoUploadList.LIST_IGNORE = Upload.LIST_IGNORE;
289
+ MemoUploadList.LIST_IGNORE = Upload.LIST_IGNORE;
290
+ MemoUploadList.TABLE_FILENAME_COLUMN = ETABLE_COLUMN_TYPE.TABLE_FILENAME_COLUMN;
291
+ MemoUploadList.TABLE_FILESIZE_COLUMN = ETABLE_COLUMN_TYPE.TABLE_FILESIZE_COLUMN;
292
+ MemoUploadList.TABLE_CREATETIME_COLUMN =
293
+ ETABLE_COLUMN_TYPE.TABLE_CREATETIME_COLUMN;
294
+ MemoUploadList.TABLE_CREATEUSER_COLUMN =
295
+ ETABLE_COLUMN_TYPE.TABLE_CREATEUSER_COLUMN;
296
+ MemoUploadList.TABLE_PERCENT_COLUMN = ETABLE_COLUMN_TYPE.TABLE_PERCENT_COLUMN;
297
+ MemoUploadList.TABLE_OPTION_COLUMN = ETABLE_COLUMN_TYPE.TABLE_OPTION_COLUMN;
298
+ MemoUploadList.TABLE_DEFAULT_COLUMNS = [
299
+ ETABLE_COLUMN_TYPE.TABLE_FILENAME_COLUMN,
300
+ ETABLE_COLUMN_TYPE.TABLE_FILESIZE_COLUMN,
301
+ ETABLE_COLUMN_TYPE.TABLE_CREATETIME_COLUMN,
302
+ ETABLE_COLUMN_TYPE.TABLE_CREATEUSER_COLUMN,
303
+ ETABLE_COLUMN_TYPE.TABLE_PERCENT_COLUMN,
304
+ ETABLE_COLUMN_TYPE.TABLE_OPTION_COLUMN,
305
+ ];
289
306
 
290
307
  export { MemoUploadList as default };
@@ -1,7 +1,8 @@
1
- import { __assign, __awaiter, __generator } from '../_virtual/_tslib.js';
1
+ import { __spreadArray, __assign, __awaiter, __generator } from '../_virtual/_tslib.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef, useState, useMemo, useImperativeHandle } from 'react';
4
4
  import MemoTable from '../table/table.js';
5
+ import { ETABLE_COLUMN_TYPE } from './interface.js';
5
6
  import { formatUnit, downloadFile } from 'zmdms-utils';
6
7
  import { uploadFile } from './hooks.js';
7
8
  import dayjs from 'dayjs';
@@ -11,7 +12,7 @@ import OperationBtn from '../operationbtn/operationBtn.js';
11
12
  import { Progress, message } from 'antd';
12
13
 
13
14
  var UploadTable = function (_a, ref) {
14
- var dataSource = _a.dataSource, action = _a.action, headers = _a.headers, data = _a.data, method = _a.method, setInnerFileList = _a.setInnerFileList, isPublic = _a.isPublic, _b = _a.API_BASEURL, API_BASEURL = _b === void 0 ? "" : _b; _a.FILE_API_BASEURL; var maxPreviewSize = _a.maxPreviewSize, isPreview = _a.isPreview, isDelete = _a.isDelete, isDownload = _a.isDownload; _a.listType;
15
+ var dataSource = _a.dataSource, action = _a.action, headers = _a.headers, data = _a.data, method = _a.method, setInnerFileList = _a.setInnerFileList, isPublic = _a.isPublic, _b = _a.API_BASEURL, API_BASEURL = _b === void 0 ? "" : _b; _a.FILE_API_BASEURL; var maxPreviewSize = _a.maxPreviewSize, isPreview = _a.isPreview, isDelete = _a.isDelete, isDownload = _a.isDownload; _a.listType; var tableColumns = _a.tableColumns;
15
16
  var _d = useState(false), loading = _d[0], setLoading = _d[1];
16
17
  var _e = useState(), checked = _e[0], setChecked = _e[1];
17
18
  var isDownloadSingleBoolean = isDownload;
@@ -91,84 +92,111 @@ var UploadTable = function (_a, ref) {
91
92
  }
92
93
  });
93
94
  }); };
94
- // 列配置
95
- var columns = [
96
- {
97
- title: "序号",
98
- width: 60,
99
- key: "index",
100
- fixed: "left",
101
- align: "left",
102
- render: function (value, record, index) { return "".concat(index + 1); },
103
- },
104
- {
105
- title: "文件名称",
106
- width: 140,
107
- dataIndex: "attachName",
108
- key: "attachName",
109
- align: "left",
110
- render: function (text, record, index) {
111
- return (jsx(ButtonCom, __assign({ type: "link", onClick: function () { return operationCallback("preview", record, index); }, style: { textAlign: "left" } }, { children: text })));
112
- },
113
- },
114
- {
115
- title: "文件大小",
116
- width: 100,
117
- dataIndex: "attachSize",
118
- key: "attachSize",
119
- align: "left",
120
- render: function (text, record) {
121
- var size = text ? text : record.fileSize;
122
- return size ? formatUnit(size) : "— —";
123
- },
95
+ var indexColumn = {
96
+ title: "序号",
97
+ width: 60,
98
+ key: "index",
99
+ fixed: "left",
100
+ align: "left",
101
+ render: function (value, record, index) { return "".concat(index + 1); },
102
+ };
103
+ var fileNameColumn = {
104
+ title: "文件名称",
105
+ width: 140,
106
+ dataIndex: "attachName",
107
+ key: "attachName",
108
+ align: "left",
109
+ render: function (text, record, index) {
110
+ return (jsx(ButtonCom, __assign({ type: "link", onClick: function () { return operationCallback("preview", record, index); }, style: { textAlign: "left" } }, { children: text })));
124
111
  },
125
- {
126
- title: "上传时间",
127
- width: 100,
128
- dataIndex: "uploadTime",
129
- key: "uploadTime",
130
- align: "left",
131
- render: function (text) {
132
- return dayjs(text).format("YYYY-MM-DD HH:mm");
133
- },
112
+ };
113
+ var fileSizeColumn = {
114
+ title: "文件大小",
115
+ width: 100,
116
+ dataIndex: "attachSize",
117
+ key: "attachSize",
118
+ align: "left",
119
+ render: function (text, record) {
120
+ var size = text ? text : record.fileSize;
121
+ return size ? formatUnit(size) : "— —";
134
122
  },
135
- {
136
- title: "上传人",
137
- width: 100,
138
- align: "left",
139
- dataIndex: "uploadUser",
140
- key: "uploadUser",
123
+ };
124
+ var createTimeColumn = {
125
+ title: "上传时间",
126
+ width: 100,
127
+ dataIndex: "uploadTime",
128
+ key: "uploadTime",
129
+ align: "left",
130
+ render: function (text) {
131
+ return dayjs(text).format("YYYY-MM-DD HH:mm");
141
132
  },
142
- {
143
- title: "上传进度",
144
- width: 160,
145
- align: "left",
146
- isDisplay: !isPreview,
147
- render: function (text, record, index) {
148
- var _a, _b;
149
- var status = record.status === "error" ? "exception" : undefined;
150
- if (record.status === "error") {
151
- return (jsx(ButtonCom, __assign({ type: "link", style: { color: "#ff4d4f" }, onClick: function () { return onReloadUploadHandle(record, index); } }, { children: "\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF0C\u91CD\u65B0\u4E0A\u4F20" })));
152
- }
153
- var percent = (_b = (_a = record === null || record === void 0 ? void 0 : record.percent) === null || _a === void 0 ? void 0 : _a.toFixed) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
154
- // 要状态 和 进度都是完成时,才能把进度设置成100%
155
- if (percent + "" === "100" &&
156
- (record.status === "uploading" || record.status === "error")) {
157
- percent = 99;
158
- }
159
- return (jsx(Progress, { className: "ztxk-upload--progress", percent: percent, status: status }));
160
- },
133
+ };
134
+ var createUserColumn = {
135
+ title: "上传人",
136
+ width: 100,
137
+ align: "left",
138
+ dataIndex: "uploadUser",
139
+ key: "uploadUser",
140
+ };
141
+ var percentColumn = {
142
+ title: "上传进度",
143
+ width: 160,
144
+ align: "left",
145
+ isDisplay: !isPreview,
146
+ render: function (text, record, index) {
147
+ var _a, _b;
148
+ var status = record.status === "error" ? "exception" : undefined;
149
+ if (record.status === "error") {
150
+ return (jsx(ButtonCom, __assign({ type: "link", style: { color: "#ff4d4f" }, onClick: function () { return onReloadUploadHandle(record, index); } }, { children: "\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF0C\u91CD\u65B0\u4E0A\u4F20" })));
151
+ }
152
+ var percent = (_b = (_a = record === null || record === void 0 ? void 0 : record.percent) === null || _a === void 0 ? void 0 : _a.toFixed) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
153
+ // 要状态 和 进度都是完成时,才能把进度设置成100%
154
+ if (percent + "" === "100" &&
155
+ (record.status === "uploading" || record.status === "error")) {
156
+ percent = 99;
157
+ }
158
+ return (jsx(Progress, { className: "ztxk-upload--progress", percent: percent, status: status }));
161
159
  },
162
- {
163
- title: "操作",
164
- width: 140,
165
- ellipsis: false,
166
- fixed: "right",
167
- align: "left",
168
- render: function (text, record, index) {
169
- return createOpt(text, record, index);
170
- },
160
+ };
161
+ var optionsColumns = {
162
+ title: "操作",
163
+ width: 140,
164
+ ellipsis: false,
165
+ fixed: "right",
166
+ align: "left",
167
+ render: function (text, record, index) {
168
+ return createOpt(text, record, index);
171
169
  },
170
+ };
171
+ // 列配置
172
+ var columns = tableColumns
173
+ ? __spreadArray([
174
+ indexColumn
175
+ ], tableColumns.map(function (tableColumn) {
176
+ switch (tableColumn) {
177
+ case ETABLE_COLUMN_TYPE.TABLE_FILENAME_COLUMN:
178
+ return fileNameColumn;
179
+ case ETABLE_COLUMN_TYPE.TABLE_FILESIZE_COLUMN:
180
+ return fileSizeColumn;
181
+ case ETABLE_COLUMN_TYPE.TABLE_CREATETIME_COLUMN:
182
+ return createTimeColumn;
183
+ case ETABLE_COLUMN_TYPE.TABLE_CREATEUSER_COLUMN:
184
+ return createUserColumn;
185
+ case ETABLE_COLUMN_TYPE.TABLE_PERCENT_COLUMN:
186
+ return percentColumn;
187
+ case ETABLE_COLUMN_TYPE.TABLE_OPTION_COLUMN:
188
+ return optionsColumns;
189
+ default:
190
+ return tableColumn;
191
+ }
192
+ }), true) : [
193
+ indexColumn,
194
+ fileNameColumn,
195
+ fileSizeColumn,
196
+ createTimeColumn,
197
+ createUserColumn,
198
+ percentColumn,
199
+ optionsColumns,
172
200
  ];
173
201
  // 操作按钮组
174
202
  var createOpt = function (text, record, index) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmdms-webui",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "private": false,
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",