zmdms-webui 0.0.49 → 0.0.51
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/es/_virtual/_tslib.js +7 -2
- package/dist/es/calendar/index.d.ts +2 -1
- package/dist/es/container/container.d.ts +9 -0
- package/dist/es/container/container.js +11 -3
- package/dist/es/inputnumber/utils.js +1 -1
- package/dist/es/node_modules/@ant-design/icons/es/icons/DownloadOutlined.js +15 -0
- package/dist/es/node_modules/@ant-design/icons/es/icons/LoadingOutlined.js +15 -0
- package/dist/es/node_modules/@ant-design/icons-svg/es/asn/DownloadOutlined.js +5 -0
- package/dist/es/node_modules/@ant-design/icons-svg/es/asn/LoadingOutlined.js +5 -0
- package/dist/es/node_modules/rc-util/es/Dom/dynamicCSS.js +19 -4
- package/dist/es/table/components/EnhanceCell.js +37 -4
- package/dist/es/table/components/SortTitle.js +5 -2
- package/dist/es/table/components/TitleDirectionColumn.d.ts +11 -0
- package/dist/es/table/components/TitleDirectionColumn.js +11 -0
- package/dist/es/table/interface.d.ts +19 -0
- package/dist/es/table/table.js +3 -1
- package/dist/es/table/useColumns.js +11 -9
- package/dist/es/table/useDynamicListByColumns.js +8 -2
- package/dist/es/uploadlist/interface.d.ts +2 -0
- package/dist/es/uploadlist/uploadList.js +89 -14
- package/dist/es/uploadlist/uploadTable.js +20 -19
- package/dist/es/uploadlist/utils.js +22 -0
- package/dist/index.dark.css +2 -2
- package/dist/index.default.css +2 -2
- package/package.json +2 -2
|
@@ -2,18 +2,18 @@ import { __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 { formatUnit,
|
|
5
|
+
import { formatUnit, downloadFile } from 'zmdms-utils';
|
|
6
6
|
import { uploadFile } from './hooks.js';
|
|
7
7
|
import dayjs from 'dayjs';
|
|
8
|
-
import {
|
|
8
|
+
import { toPreviewFile } from './utils.js';
|
|
9
9
|
import ButtonCom from '../button/button.js';
|
|
10
10
|
import OperationBtn from '../operationbtn/operationBtn.js';
|
|
11
|
-
import { Progress
|
|
11
|
+
import { Progress } from 'antd';
|
|
12
12
|
|
|
13
13
|
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, _c = _a.FILE_API_BASEURL, FILE_API_BASEURL = _c === void 0 ? "" : _c,
|
|
15
|
-
var
|
|
16
|
-
var
|
|
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, _c = _a.FILE_API_BASEURL, FILE_API_BASEURL = _c === void 0 ? "" : _c, maxPreviewSize = _a.maxPreviewSize, isPreview = _a.isPreview, isDelete = _a.isDelete, isDownload = _a.isDownload;
|
|
15
|
+
var _d = useState(false), loading = _d[0], setLoading = _d[1];
|
|
16
|
+
var _e = useState(), checked = _e[0], setChecked = _e[1];
|
|
17
17
|
var isDownloadBoolean = isDownload;
|
|
18
18
|
var isDeleteBoolean = isDelete && !isPreview;
|
|
19
19
|
var operationCallback = function (type, record, index) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -62,15 +62,11 @@ var UploadTable = function (_a, ref) {
|
|
|
62
62
|
// finally 可能再某些浏览器下不兼容
|
|
63
63
|
return [3 /*break*/, 8];
|
|
64
64
|
case 6:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
API_BASEURL: FILE_API_BASEURL,
|
|
71
|
-
fileList: dataSource,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
65
|
+
toPreviewFile(record, {
|
|
66
|
+
maxPreviewSize: maxPreviewSize,
|
|
67
|
+
FILE_API_BASEURL: FILE_API_BASEURL,
|
|
68
|
+
uploadTableData: dataSource,
|
|
69
|
+
});
|
|
74
70
|
return [3 /*break*/, 8];
|
|
75
71
|
case 7:
|
|
76
72
|
setChecked(function (c) {
|
|
@@ -98,6 +94,7 @@ var UploadTable = function (_a, ref) {
|
|
|
98
94
|
width: 60,
|
|
99
95
|
key: "index",
|
|
100
96
|
fixed: "left",
|
|
97
|
+
align: "center",
|
|
101
98
|
render: function (value, record, index) { return "".concat(index + 1); },
|
|
102
99
|
},
|
|
103
100
|
{
|
|
@@ -111,7 +108,7 @@ var UploadTable = function (_a, ref) {
|
|
|
111
108
|
},
|
|
112
109
|
{
|
|
113
110
|
title: "文件大小",
|
|
114
|
-
width:
|
|
111
|
+
width: 100,
|
|
115
112
|
dataIndex: "attachSize",
|
|
116
113
|
key: "attachSize",
|
|
117
114
|
render: function (text) {
|
|
@@ -120,9 +117,10 @@ var UploadTable = function (_a, ref) {
|
|
|
120
117
|
},
|
|
121
118
|
{
|
|
122
119
|
title: "上传时间",
|
|
123
|
-
width:
|
|
120
|
+
width: 100,
|
|
124
121
|
dataIndex: "uploadTime",
|
|
125
122
|
key: "uploadTime",
|
|
123
|
+
align: "center",
|
|
126
124
|
render: function (text) {
|
|
127
125
|
return dayjs(text).format("YYYY-MM-DD HH:mm:ss");
|
|
128
126
|
},
|
|
@@ -136,17 +134,19 @@ var UploadTable = function (_a, ref) {
|
|
|
136
134
|
{
|
|
137
135
|
title: "上传进度",
|
|
138
136
|
width: 160,
|
|
137
|
+
align: "center",
|
|
139
138
|
render: function (text, record, index) {
|
|
139
|
+
var _a, _b;
|
|
140
140
|
var status = record.status === "error" ? "exception" : undefined;
|
|
141
141
|
if (record.status === "error") {
|
|
142
142
|
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" })));
|
|
143
143
|
}
|
|
144
|
-
return jsx(Progress, { percent: record === null || record === void 0 ? void 0 : record.percent, status: status });
|
|
144
|
+
return (jsx(Progress, { 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, 2), status: status }));
|
|
145
145
|
},
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
title: "操作",
|
|
149
|
-
width:
|
|
149
|
+
width: 140,
|
|
150
150
|
ellipsis: false,
|
|
151
151
|
fixed: "right",
|
|
152
152
|
render: function (text, record, index) {
|
|
@@ -264,6 +264,7 @@ var UploadTable = function (_a, ref) {
|
|
|
264
264
|
setLoading(loading);
|
|
265
265
|
},
|
|
266
266
|
setChecked: setChecked,
|
|
267
|
+
operationCallback: operationCallback,
|
|
267
268
|
};
|
|
268
269
|
});
|
|
269
270
|
return (jsx(MemoTable, { columns: columns, rowKey: "uid", dataSource: dataSource, loading: loading, rowSelection: isDownloadBoolean || isDeleteBoolean ? rowSelection : null }));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { formatUnit, previewFile } from 'zmdms-utils';
|
|
2
|
+
import { message } from 'antd';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 附件预览方法
|
|
6
|
+
* @param fileInfo
|
|
7
|
+
* @param info
|
|
8
|
+
*/
|
|
9
|
+
function toPreviewFile(fileInfo, info) {
|
|
10
|
+
var maxPreviewSize = info.maxPreviewSize, FILE_API_BASEURL = info.FILE_API_BASEURL, uploadTableData = info.uploadTableData;
|
|
11
|
+
if (fileInfo.attachSize > maxPreviewSize) {
|
|
12
|
+
message.info("\u6587\u4EF6\u5927\u4E8E".concat(formatUnit(maxPreviewSize), ",\u6682\u4E0D\u652F\u6301\u5728\u7EBF\u9884\u89C8\uFF0C\u8BF7\u5148\u4E0B\u8F7D\u540E\u67E5\u770B"));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
previewFile(fileInfo.attachId, fileInfo.attachName, {
|
|
16
|
+
API_BASEURL: FILE_API_BASEURL,
|
|
17
|
+
fileList: uploadTableData,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { toPreviewFile };
|