ztxkui 2.2.1 → 2.2.5
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/Demo.js +12 -1
- package/dist/DemoCom/TableDemo.d.ts +4 -0
- package/dist/DemoCom/TableDemo.js +451 -0
- package/dist/UploadDemo.js +68 -20
- package/dist/components/Upload/upload-table.js +16 -12
- package/dist/components/Upload/upload.js +35 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/Demo.js
CHANGED
|
@@ -6,7 +6,7 @@ var selectStyle = { width: '200px' };
|
|
|
6
6
|
function request(options) {
|
|
7
7
|
return fetch(options.url + "?" + stringify(options.params), {
|
|
8
8
|
headers: {
|
|
9
|
-
'Zmdms-Auth': 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
9
|
+
'Zmdms-Auth': 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25hbWUiOiLpmYjkuprpm4QiLCJlbXBfbnVtYmVyIjoiWUcyMTA3MDA4IiwiaW10X2lkIjpudWxsLCJyZWFsX25hbWUiOiLpmYjkuprpm4QiLCJjbGllbnRfdHlwZSI6IndlYiIsImRhdGFfcm9sZV9pZCI6IjEzNDU5Nzg1MDUzMDIwNTY5NjIsMTQxMjYxNDExMDY0NzM4NjExNCwxNDEyNjE1Njc3MTE5MjY2ODE3LDE0NDgxMjEwODY1MDQzMDA1NDYsMTQ1MjgyMDI5MzgwMjcxMzA5MCwxNDUzOTI1MDAxNTMxNDc4MDE3LDE0NTg3MTIwODIwODIzNTcyNTAsMTQ1ODgyNjIzODE4NTg4OTc5NCwxNDU4ODI3NzAxMDEyMzI0MzUzLDE0NTg4MjgzNjA4MDE1MDkzNzcsMTQ2MDA4OTI2MjAxMjAzMDk3NywxNDYxMTM3Nzg4NjQ1MTI2MTQ2IiwiY2xpZW50X2lkIjoic3dvcmQiLCJ1c2VyX3R5cGUiOiJ3ZWIiLCJyb2xlX2lkIjoiMTQxMjYwODc0Mjk1MzI4NzY4MiwxNDM4MzIyNTQzMjk1OTI2Mjc0LDE0NDM0NzU0NzU5NzI3MzQ5NzcsMTQ0NjgxOTQ2MzY5Mzg0NDQ4MiwxNDYwMDg1NDI2ODE1OTUwODQ5LDE0NjI2MjI5OTIzNzUyMDk5ODYiLCJwb3N0X25hbWUiOm51bGwsInNjb3BlIjpbImFsbCJdLCJpbnRlcnZpZXdfaWQiOm51bGwsImV4cCI6MTY0MDc2OTQyMiwib3JnX25hbWUiOiLmuZbljZfkuK3mi5Pkv6Hmga_np5HmioDmnInpmZDlhazlj7giLCJqdGkiOiI1M2ZlMTAxMS1hNzFkLTRmZjAtYmQ2My1jYjkzMzcyM2NjZDAiLCJtZW1iZXJfaWQiOjE0MTI5NTMyMDUyNjk1MTYyOTAsImNvbXBhbnlfaWQiOjEzOTcwNzQ2MDU0MTI2OTYwNjYsInN5c3RlbV9pZCI6bnVsbCwiZGVwdF9uYW1lIjoi5Lia5Yqh5LiA6YOoIiwiYXZhdGFyIjoiIiwiZGF0YV9yb2xlX25hbWUiOiJhZG1pbix1c2VyLHVzZXIsYWRtaW4sYWRtaW4sYWRtaW4sdXNlcix1c2VyLHVzZXIsdXNlcix1c2VyLHVzZXIiLCJhdXRob3JpdGllcyI6WyJhZG1pbiIsInVzZXIiLCJhZG1pbmlzdHJhdG9yIl0sInJvbGVfbmFtZSI6InVzZXIsYWRtaW5pc3RyYXRvcixhZG1pbixhZG1pbmlzdHJhdG9yLHVzZXIsdXNlciIsInJlc3VtZV90ZW1wbGF0ZSI6bnVsbCwibGljZW5zZSI6InBvd2VyZWQgYnkgem1kbXMiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjE0MTI5NTM4MDQzMzM1NTU3MTQiLCJvcmdfaWQiOjE0NTc1Mjc3NjU5MTg1MTU1MzUsIm5pY2tfbmFtZSI6IumZiOS6mumbhCIsImNvbXBhbnlfbmFtZSI6Iua1meWVhuS4reaLk-mbhuWboueJqea1geenkeaKgOaciemZkOWFrOWPuCIsImRlcHRfaWQiOiIxMzk3MDgxOTMwMzI4NDI0NDQ5IiwiaGFuZGxlX2hyX25hbWUiOm51bGwsImFjY291bnQiOiJjaGVueXgiLCJyZXN1bWVfaWQiOm51bGx9.59w7FkzK6z0FitLUaYcaE9rZLxvfZ8Xf6C_wR9lRzWs',
|
|
10
10
|
},
|
|
11
11
|
method: options.method,
|
|
12
12
|
}).then(function (response) { return response.json(); });
|
|
@@ -68,8 +68,19 @@ function Demo() {
|
|
|
68
68
|
React.createElement(Link, { to: "/test" }, "test"),
|
|
69
69
|
React.createElement("h1", null, "\u4F5C\u4E3A\u6F14\u793A\u4F7F\u7528"),
|
|
70
70
|
React.createElement("h2", null, "\u5982\u679C\u6570\u636E\u662F\u901A\u8FC7\u5916\u90E8\u83B7\u53D6\u7684\uFF0C\u53EF\u4EE5\u901A\u8FC7\u4F20\u9012list\u5C5E\u6027"),
|
|
71
|
+
React.createElement(EnhanceSelect, { style: selectStyle, list: list, showAll: true, joinKey: "test1", onChange: function (value, option, fullData) {
|
|
72
|
+
console.log(value, option, fullData);
|
|
73
|
+
} }),
|
|
71
74
|
React.createElement("h2", null, "\u5F02\u6B65\u83B7\u53D6\u6570\u636E"),
|
|
75
|
+
React.createElement(EnhanceSelect, { style: selectStyle, url: "http://192.168.0.83:8000/api/zmdms-user/page", params: JSON.stringify({
|
|
76
|
+
status: 50,
|
|
77
|
+
companyId: '1397074605412696066',
|
|
78
|
+
}), request: request, joinKey: "depName" }),
|
|
72
79
|
React.createElement("h2", null, "\u5F02\u6B65\u83B7\u53D6\u6570\u636E\uFF0C\u5E76\u7F13\u5B58\u6570\u636E"),
|
|
80
|
+
React.createElement(EnhanceSelect, { style: selectStyle, url: "http://192.168.0.83:8000/api/zmdms-user/page", params: JSON.stringify({
|
|
81
|
+
status: 50,
|
|
82
|
+
companyId: '1397074605412696066',
|
|
83
|
+
}), request: request, isCatch: true }),
|
|
73
84
|
React.createElement("h2", null, "\u8FDC\u7A0B\u6A21\u7CCA\u641C\u7D22"),
|
|
74
85
|
React.createElement("button", { onClick: function () { return setValue('1462433051208762629'); } }, "\u4FEE\u6539"),
|
|
75
86
|
React.createElement(EnhanceSelect, { style: selectStyle, placeholder: "\u53EF\u8FDC\u7A0B\u6A21\u7CCA\u641C\u7D22", url: "http://192.168.0.83:8000/api/zmdms-system/employee/page", request: request, remoteSearch: true, dataKey: "id", titleKey: "empName", value: value, showAll: true, onChange: function (value, option, fullData) {
|
|
@@ -0,0 +1,451 @@
|
|
|
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
|
+
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
13
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
14
|
+
to[j] = from[i];
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
import React, { useEffect, useState, useCallback, useRef } from 'react';
|
|
18
|
+
import Table from 'components/Table';
|
|
19
|
+
import EnhanceSelect from 'components/EnhanceSelect';
|
|
20
|
+
import { DatePicker } from 'index';
|
|
21
|
+
import dayjs from 'dayjs';
|
|
22
|
+
import update from 'immutability-helper';
|
|
23
|
+
// 获取表格数据
|
|
24
|
+
function useGetTableRecords() {
|
|
25
|
+
// 表格数据
|
|
26
|
+
var _a = useState([]), records = _a[0], setRecords = _a[1];
|
|
27
|
+
useEffect(function () {
|
|
28
|
+
console.log('开始远程获取表格数据!');
|
|
29
|
+
setTimeout(function () {
|
|
30
|
+
// setRecords([
|
|
31
|
+
// { id: '1', test1: '1-test1', test2: '1-test2', studentId: '2' },
|
|
32
|
+
// { id: '2', test1: '2-test1', test2: '2-test2' },
|
|
33
|
+
// { id: '3', test1: '3-test1', test2: '3-test2' },
|
|
34
|
+
// ]);
|
|
35
|
+
setRecords(Array.from({ length: 4 }).map(function (item, index) {
|
|
36
|
+
return {
|
|
37
|
+
id: "" + (index + 1),
|
|
38
|
+
test1: index + 1 + "-test1",
|
|
39
|
+
test2: index + 1 + "-test2",
|
|
40
|
+
test3: index + 1 + "-test3",
|
|
41
|
+
};
|
|
42
|
+
}));
|
|
43
|
+
}, 2000);
|
|
44
|
+
}, []);
|
|
45
|
+
return {
|
|
46
|
+
records: records,
|
|
47
|
+
setRecords: setRecords,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// 获取列表数据
|
|
51
|
+
function useGetSelectList() {
|
|
52
|
+
var _a = useState([]), list = _a[0], setList = _a[1];
|
|
53
|
+
var _b = useState(false), loading = _b[0], setLoading = _b[1];
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
console.log('开始远程拉取下拉框数据!');
|
|
56
|
+
setTimeout(function () {
|
|
57
|
+
setLoading(true);
|
|
58
|
+
setList([
|
|
59
|
+
{
|
|
60
|
+
id: '1',
|
|
61
|
+
name: '张三',
|
|
62
|
+
jobNumber: '001',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: '2',
|
|
66
|
+
name: '张三',
|
|
67
|
+
jobNumber: '002',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: '3',
|
|
71
|
+
name: '李四',
|
|
72
|
+
jobNumber: '003',
|
|
73
|
+
},
|
|
74
|
+
]);
|
|
75
|
+
}, 2000);
|
|
76
|
+
}, []);
|
|
77
|
+
return { list: list, loading: loading, setLoading: setLoading };
|
|
78
|
+
}
|
|
79
|
+
// 获取表格columns完整数据
|
|
80
|
+
export var getTableLayoutFullData = function (columns, tableLayout) {
|
|
81
|
+
if (Array.isArray(tableLayout) && tableLayout.length > 0) {
|
|
82
|
+
var newColumns = tableLayout.map(function (item) {
|
|
83
|
+
if ((item === null || item === void 0 ? void 0 : item.key) || (item === null || item === void 0 ? void 0 : item.dataIndex)) {
|
|
84
|
+
var result = columns.find(function (column) {
|
|
85
|
+
if (column.key) {
|
|
86
|
+
return column.key === (item === null || item === void 0 ? void 0 : item.key);
|
|
87
|
+
}
|
|
88
|
+
if (column.dataIndex) {
|
|
89
|
+
return column.dataIndex === (item === null || item === void 0 ? void 0 : item.dataIndex);
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
92
|
+
});
|
|
93
|
+
return __assign(__assign({}, result), item);
|
|
94
|
+
}
|
|
95
|
+
return __assign({}, item);
|
|
96
|
+
});
|
|
97
|
+
var newAddColumns = columns.filter(function (column) { return !tableLayout.find(function (item) { return item.key === column.key; }); });
|
|
98
|
+
return __spreadArray(__spreadArray([], newColumns), newAddColumns);
|
|
99
|
+
}
|
|
100
|
+
return columns;
|
|
101
|
+
};
|
|
102
|
+
var TableDemo = function () {
|
|
103
|
+
var _a = useGetTableRecords(), records = _a.records, setRecords = _a.setRecords;
|
|
104
|
+
var _b = useGetSelectList(), list = _b.list, loading = _b.loading, setLoading = _b.setLoading;
|
|
105
|
+
// 表格数据引用
|
|
106
|
+
var recordsRef = useRef([]);
|
|
107
|
+
// 新增删除行改变
|
|
108
|
+
var _c = useState(false), lengthChange = _c[0], setLengthChange = _c[1];
|
|
109
|
+
// 表格行拖拽改变
|
|
110
|
+
var _d = useState(false), moveChange = _d[0], setMoveChange = _d[1];
|
|
111
|
+
// 将表格最新数据赋值给ref引用
|
|
112
|
+
useEffect(function () {
|
|
113
|
+
recordsRef.current = records;
|
|
114
|
+
}, [records]);
|
|
115
|
+
// 表格列配置
|
|
116
|
+
var columns = [
|
|
117
|
+
{
|
|
118
|
+
title: '序号',
|
|
119
|
+
width: 62,
|
|
120
|
+
fixed: 'left',
|
|
121
|
+
align: 'center',
|
|
122
|
+
key: 'index',
|
|
123
|
+
render: function (_text, _record, index) { return "" + (index + 1); },
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
title: '测试字段1',
|
|
127
|
+
width: 120,
|
|
128
|
+
dataIndex: 'test1',
|
|
129
|
+
key: 'test1',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
title: '测试字段2',
|
|
133
|
+
width: 120,
|
|
134
|
+
dataIndex: 'test2',
|
|
135
|
+
key: 'test2',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
title: '编辑字段1',
|
|
139
|
+
width: 220,
|
|
140
|
+
dataIndex: 'test3',
|
|
141
|
+
key: 'test3',
|
|
142
|
+
// 普通的输入框
|
|
143
|
+
editable: true,
|
|
144
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
145
|
+
if (lengthChange) {
|
|
146
|
+
setLengthChange(false);
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
if (moveChange) {
|
|
150
|
+
setMoveChange(false);
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
return record.test3 !== preRecord.test3;
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
title: '编辑字段2',
|
|
158
|
+
width: 220,
|
|
159
|
+
dataIndex: 'test4',
|
|
160
|
+
key: 'test4',
|
|
161
|
+
// 简单配置的输入框
|
|
162
|
+
editable: true,
|
|
163
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
164
|
+
if (lengthChange) {
|
|
165
|
+
setLengthChange(false);
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
if (moveChange) {
|
|
169
|
+
setMoveChange(false);
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
return record.test4 !== preRecord.test4;
|
|
173
|
+
},
|
|
174
|
+
editableConfig: {
|
|
175
|
+
type: 'inputNumber',
|
|
176
|
+
min: 0,
|
|
177
|
+
precision: 3,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
title: '编辑字段2+1',
|
|
182
|
+
width: 220,
|
|
183
|
+
dataIndex: 'time',
|
|
184
|
+
key: 'time',
|
|
185
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
186
|
+
if (lengthChange) {
|
|
187
|
+
setLengthChange(false);
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
if (moveChange) {
|
|
191
|
+
setMoveChange(false);
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
return record.time !== preRecord.time;
|
|
195
|
+
},
|
|
196
|
+
render: function (text, record, index) {
|
|
197
|
+
return (React.createElement(DatePicker, { value: text ? dayjs(text) : null, onChange: function (value) {
|
|
198
|
+
if (dayjs.isDayjs(value)) {
|
|
199
|
+
var newRecord = {
|
|
200
|
+
time: dayjs(value).format('YYYY-MM-DD'),
|
|
201
|
+
};
|
|
202
|
+
onEditableSaveHandle(newRecord, index);
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
var newRecord = {
|
|
206
|
+
time: '',
|
|
207
|
+
};
|
|
208
|
+
onEditableSaveHandle(newRecord, index);
|
|
209
|
+
}
|
|
210
|
+
} }));
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
title: '编辑字段3',
|
|
215
|
+
width: 220,
|
|
216
|
+
dataIndex: 'studentId',
|
|
217
|
+
key: 'studentId',
|
|
218
|
+
// 远程搜索来的数据
|
|
219
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
220
|
+
if (loading) {
|
|
221
|
+
setLoading(false);
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
if (lengthChange) {
|
|
225
|
+
setLengthChange(false);
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
if (moveChange) {
|
|
229
|
+
setMoveChange(false);
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
return record.studentId !== preRecord.studentId;
|
|
233
|
+
},
|
|
234
|
+
render: function (text, record, index) {
|
|
235
|
+
return (React.createElement(EnhanceSelect, { value: text, list: list, dataKey: "id", titleKey: "name", joinKey: "jobNumber", onChange: function (value, option, fullData) {
|
|
236
|
+
var newRecord = {
|
|
237
|
+
studentId: value,
|
|
238
|
+
studentName: fullData === null || fullData === void 0 ? void 0 : fullData.name,
|
|
239
|
+
depId: '',
|
|
240
|
+
depName: '',
|
|
241
|
+
};
|
|
242
|
+
onEditableSaveHandle(newRecord, index);
|
|
243
|
+
} }));
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
title: '编辑字段4',
|
|
248
|
+
width: 220,
|
|
249
|
+
dataIndex: 'depId',
|
|
250
|
+
key: 'depId',
|
|
251
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
252
|
+
if (lengthChange) {
|
|
253
|
+
setLengthChange(false);
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
if (moveChange) {
|
|
257
|
+
setMoveChange(false);
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
return (record.depId !== preRecord.depId ||
|
|
261
|
+
record.studentId !== preRecord.studentId);
|
|
262
|
+
},
|
|
263
|
+
// 依赖字段下拉值改变
|
|
264
|
+
render: function (text, record, index) {
|
|
265
|
+
return (React.createElement(EnhanceSelect, { value: text, url: "/api/test", request: myRequest, params: JSON.stringify({ studentId: record === null || record === void 0 ? void 0 : record.studentId }), onChange: function (value, option, fullData) {
|
|
266
|
+
var newRecord = {
|
|
267
|
+
depId: value,
|
|
268
|
+
depName: fullData === null || fullData === void 0 ? void 0 : fullData.name,
|
|
269
|
+
};
|
|
270
|
+
onEditableSaveHandle(newRecord, index);
|
|
271
|
+
} }));
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
];
|
|
275
|
+
// 本地偏好设置相关
|
|
276
|
+
var _e = useState(getStorage('test-table') || []), tableLayout = _e[0], setTableLayout = _e[1];
|
|
277
|
+
var onDynamicChange = useCallback(function (tableLayout) {
|
|
278
|
+
// 剔除调一些可能不可序列化的字段,只保留关键数据
|
|
279
|
+
var newTableLayout = tableLayout.map(function (item) { return ({
|
|
280
|
+
key: item === null || item === void 0 ? void 0 : item.key,
|
|
281
|
+
dataIndex: item === null || item === void 0 ? void 0 : item.dataIndex,
|
|
282
|
+
hideColumn: item === null || item === void 0 ? void 0 : item.hideColumn,
|
|
283
|
+
}); });
|
|
284
|
+
setTableLayout(newTableLayout);
|
|
285
|
+
setStorege('test-table', newTableLayout);
|
|
286
|
+
}, []);
|
|
287
|
+
// 本地偏好设置end
|
|
288
|
+
// 表格数据改变相关
|
|
289
|
+
var onEditableSaveHandle = useCallback(function (record, index, _dataIndex) {
|
|
290
|
+
var _a;
|
|
291
|
+
if (_dataIndex === void 0) { _dataIndex = ''; }
|
|
292
|
+
if (typeof index === 'number') {
|
|
293
|
+
var newRecords = recordsRef.current.slice();
|
|
294
|
+
var item = newRecords[index];
|
|
295
|
+
newRecords.splice(index, 1, _dataIndex
|
|
296
|
+
? __assign(__assign(__assign({}, record), item), (_a = {}, _a[_dataIndex] = record[_dataIndex], _a)) : __assign(__assign({}, item), record));
|
|
297
|
+
setRecords(newRecords);
|
|
298
|
+
}
|
|
299
|
+
}, [setRecords]);
|
|
300
|
+
// 新增删除行
|
|
301
|
+
var onAddAndDelHandle = useCallback(function (type, index) {
|
|
302
|
+
var newRecords = recordsRef.current.slice();
|
|
303
|
+
if (type === 'add') {
|
|
304
|
+
var newItem = {
|
|
305
|
+
_isNewData: true,
|
|
306
|
+
id: Date.now() + "-" + index,
|
|
307
|
+
};
|
|
308
|
+
newRecords.splice(index + 1, 0, newItem);
|
|
309
|
+
setRecords(newRecords);
|
|
310
|
+
setLengthChange(true);
|
|
311
|
+
}
|
|
312
|
+
else if (type === 'del') {
|
|
313
|
+
if (newRecords.length === 1) {
|
|
314
|
+
newRecords.splice(index, 1, {
|
|
315
|
+
_isNewData: true,
|
|
316
|
+
id: Date.now() + "-" + index,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
newRecords.splice(index, 1);
|
|
321
|
+
}
|
|
322
|
+
setRecords(newRecords);
|
|
323
|
+
setLengthChange(true);
|
|
324
|
+
}
|
|
325
|
+
}, [setRecords]);
|
|
326
|
+
// 表格拖拽排序功能函数
|
|
327
|
+
var onMoveRowHandle = useCallback(function (dragIndex, hoverIndex) {
|
|
328
|
+
var newRecords = recordsRef.current.slice();
|
|
329
|
+
var dragRow = newRecords[dragIndex];
|
|
330
|
+
var newDataSource = update(newRecords, {
|
|
331
|
+
$splice: [
|
|
332
|
+
[dragIndex, 1],
|
|
333
|
+
[hoverIndex, 0, dragRow],
|
|
334
|
+
],
|
|
335
|
+
});
|
|
336
|
+
setRecords(newDataSource);
|
|
337
|
+
setMoveChange(true);
|
|
338
|
+
}, [setRecords]);
|
|
339
|
+
return (React.createElement(React.Fragment, null,
|
|
340
|
+
React.createElement(Table
|
|
341
|
+
// 如果需要保留本地偏好,那么这里需要预处理一下columns数据
|
|
342
|
+
, {
|
|
343
|
+
// 如果需要保留本地偏好,那么这里需要预处理一下columns数据
|
|
344
|
+
columns: getTableLayoutFullData(columns, tableLayout), initColumns: columns, dataSource: records, rowKey: "id",
|
|
345
|
+
// 添加动态列配置
|
|
346
|
+
showColumnDynamic: true, onDynamicChange: onDynamicChange,
|
|
347
|
+
// 表格项可输入
|
|
348
|
+
onEditableSave: onEditableSaveHandle,
|
|
349
|
+
// 新增删除行
|
|
350
|
+
onAddAndDelHandle: onAddAndDelHandle,
|
|
351
|
+
// 表格行拖拽
|
|
352
|
+
onMoveRow: onMoveRowHandle }),
|
|
353
|
+
React.createElement("div", null,
|
|
354
|
+
React.createElement("button", { onClick: function () { return console.log(records); } }, "\u83B7\u53D6\u6570\u636E"))));
|
|
355
|
+
};
|
|
356
|
+
function getStorage(key) {
|
|
357
|
+
try {
|
|
358
|
+
var result = localStorage.getItem(key) || '';
|
|
359
|
+
return JSON.parse(result);
|
|
360
|
+
}
|
|
361
|
+
catch (err) {
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function setStorege(key, value) {
|
|
366
|
+
try {
|
|
367
|
+
var _value = typeof value === 'object' ? JSON.stringify(value) : value;
|
|
368
|
+
localStorage.setItem(key, _value);
|
|
369
|
+
}
|
|
370
|
+
catch (err) { }
|
|
371
|
+
}
|
|
372
|
+
function myRequest(options) {
|
|
373
|
+
return new Promise(function (resolve, reject) {
|
|
374
|
+
console.log(options);
|
|
375
|
+
if (options.params.studentId === '1') {
|
|
376
|
+
resolve({
|
|
377
|
+
code: 200,
|
|
378
|
+
data: [
|
|
379
|
+
{
|
|
380
|
+
id: '1',
|
|
381
|
+
name: '数据项1',
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
id: '2',
|
|
385
|
+
name: '数据项2',
|
|
386
|
+
},
|
|
387
|
+
],
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
if (options.params.studentId === '2') {
|
|
391
|
+
resolve({
|
|
392
|
+
code: 200,
|
|
393
|
+
data: [
|
|
394
|
+
{
|
|
395
|
+
id: '3',
|
|
396
|
+
name: '数据项3',
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
id: '4',
|
|
400
|
+
name: '数据项4',
|
|
401
|
+
},
|
|
402
|
+
],
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
if (options.params.studentId === '3') {
|
|
406
|
+
resolve({
|
|
407
|
+
code: 200,
|
|
408
|
+
data: [
|
|
409
|
+
{
|
|
410
|
+
id: '5',
|
|
411
|
+
name: '数据项5',
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
id: '6',
|
|
415
|
+
name: '数据项6',
|
|
416
|
+
},
|
|
417
|
+
],
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
resolve({
|
|
421
|
+
code: 200,
|
|
422
|
+
data: [
|
|
423
|
+
{
|
|
424
|
+
id: '1',
|
|
425
|
+
name: '数据项1',
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
id: '2',
|
|
429
|
+
name: '数据项2',
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
id: '3',
|
|
433
|
+
name: '数据项3',
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
id: '4',
|
|
437
|
+
name: '数据项4',
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
id: '5',
|
|
441
|
+
name: '数据项5',
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
id: '6',
|
|
445
|
+
name: '数据项6',
|
|
446
|
+
},
|
|
447
|
+
],
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
export default TableDemo;
|
package/dist/UploadDemo.js
CHANGED
|
@@ -2,32 +2,80 @@ import { Link } from 'react-router-dom';
|
|
|
2
2
|
import Upload from 'components/Upload';
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
var originFileList = [];
|
|
5
|
+
var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25hbWUiOiLpmYjkuprpm4QiLCJlbXBfbnVtYmVyIjoiWUcyMTA3MDA4IiwiaW10X2lkIjpudWxsLCJyZWFsX25hbWUiOiLpmYjkuprpm4QiLCJjbGllbnRfdHlwZSI6IndlYiIsImRhdGFfcm9sZV9pZCI6IjEzNDU5Nzg1MDUzMDIwNTY5NjIsMTQxMjYxNDExMDY0NzM4NjExNCwxNDEyNjE1Njc3MTE5MjY2ODE3LDE0NDgxMjEwODY1MDQzMDA1NDYsMTQ1MjgyMDI5MzgwMjcxMzA5MCwxNDUzOTI1MDAxNTMxNDc4MDE3LDE0NTg3MTIwODIwODIzNTcyNTAsMTQ1ODgyNjIzODE4NTg4OTc5NCwxNDU4ODI3NzAxMDEyMzI0MzUzLDE0NTg4MjgzNjA4MDE1MDkzNzcsMTQ2MDA4OTI2MjAxMjAzMDk3NywxNDYxMTM3Nzg4NjQ1MTI2MTQ2IiwiY2xpZW50X2lkIjoic3dvcmQiLCJ1c2VyX3R5cGUiOiJ3ZWIiLCJyb2xlX2lkIjoiMTQxMjYwODc0Mjk1MzI4NzY4MiwxNDM4MzIyNTQzMjk1OTI2Mjc0LDE0NDM0NzU0NzU5NzI3MzQ5NzcsMTQ0NjgxOTQ2MzY5Mzg0NDQ4MiwxNDYwMDg1NDI2ODE1OTUwODQ5LDE0NjI2MjI5OTIzNzUyMDk5ODYiLCJwb3N0X25hbWUiOm51bGwsInNjb3BlIjpbImFsbCJdLCJpbnRlcnZpZXdfaWQiOm51bGwsImV4cCI6MTY0MDc2OTQyMiwib3JnX25hbWUiOiLmuZbljZfkuK3mi5Pkv6Hmga_np5HmioDmnInpmZDlhazlj7giLCJqdGkiOiI1M2ZlMTAxMS1hNzFkLTRmZjAtYmQ2My1jYjkzMzcyM2NjZDAiLCJtZW1iZXJfaWQiOjE0MTI5NTMyMDUyNjk1MTYyOTAsImNvbXBhbnlfaWQiOjEzOTcwNzQ2MDU0MTI2OTYwNjYsInN5c3RlbV9pZCI6bnVsbCwiZGVwdF9uYW1lIjoi5Lia5Yqh5LiA6YOoIiwiYXZhdGFyIjoiIiwiZGF0YV9yb2xlX25hbWUiOiJhZG1pbix1c2VyLHVzZXIsYWRtaW4sYWRtaW4sYWRtaW4sdXNlcix1c2VyLHVzZXIsdXNlcix1c2VyLHVzZXIiLCJhdXRob3JpdGllcyI6WyJhZG1pbiIsInVzZXIiLCJhZG1pbmlzdHJhdG9yIl0sInJvbGVfbmFtZSI6InVzZXIsYWRtaW5pc3RyYXRvcixhZG1pbixhZG1pbmlzdHJhdG9yLHVzZXIsdXNlciIsInJlc3VtZV90ZW1wbGF0ZSI6bnVsbCwibGljZW5zZSI6InBvd2VyZWQgYnkgem1kbXMiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjE0MTI5NTM4MDQzMzM1NTU3MTQiLCJvcmdfaWQiOjE0NTc1Mjc3NjU5MTg1MTU1MzUsIm5pY2tfbmFtZSI6IumZiOS6mumbhCIsImNvbXBhbnlfbmFtZSI6Iua1meWVhuS4reaLk-mbhuWboueJqea1geenkeaKgOaciemZkOWFrOWPuCIsImRlcHRfaWQiOiIxMzk3MDgxOTMwMzI4NDI0NDQ5IiwiaGFuZGxlX2hyX25hbWUiOm51bGwsImFjY291bnQiOiJjaGVueXgiLCJyZXN1bWVfaWQiOm51bGx9.59w7FkzK6z0FitLUaYcaE9rZLxvfZ8Xf6C_wR9lRzWs";
|
|
5
6
|
function UploadDemo() {
|
|
6
7
|
var _a = useState(originFileList), fileList = _a[0], setFileList = _a[1];
|
|
7
8
|
useEffect(function () {
|
|
8
9
|
setTimeout(function () {
|
|
9
10
|
setFileList([
|
|
10
11
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
data: {
|
|
17
|
-
attachId: '1418469936545132546',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
percent: 100,
|
|
21
|
-
status: 'done',
|
|
12
|
+
attachId: '1418469936545132546',
|
|
13
|
+
attachName: '奔奔.jpg',
|
|
14
|
+
fileSize: 36742,
|
|
15
|
+
// percent: 100,
|
|
16
|
+
// status: 'done',
|
|
22
17
|
},
|
|
18
|
+
// {
|
|
19
|
+
// // uid可不传,这个应该时组件需要一个内部id,可以同attachId
|
|
20
|
+
// uid: '1418469936545132546',
|
|
21
|
+
// name: '奔奔.jpg',
|
|
22
|
+
// size: 36742,
|
|
23
|
+
// // 服务端返回参数(这个可不传,由于一些历史原因,可传入下面的格式,组件会优先取这里面的值)
|
|
24
|
+
// response: {
|
|
25
|
+
// code: 200,
|
|
26
|
+
// data: {
|
|
27
|
+
// attachId: '1418469936545132546',
|
|
28
|
+
// },
|
|
29
|
+
// },
|
|
30
|
+
// // 上传进度,必传
|
|
31
|
+
// percent: 100,
|
|
32
|
+
// // 当前状态,必传
|
|
33
|
+
// status: 'done',
|
|
34
|
+
// },
|
|
35
|
+
// {
|
|
36
|
+
// // 附件id必传
|
|
37
|
+
// attachId: '1418469936545132546',
|
|
38
|
+
// // uid可不传,这个应该时组件需要一个内部id,可以同attachId
|
|
39
|
+
// uid: '1418469936545132546',
|
|
40
|
+
// // 附件名(因为一些历史原因,兼容传入attachName、name、fileName)
|
|
41
|
+
// attachName: '奔奔.jpg',
|
|
42
|
+
// name: '奔奔.jpg',
|
|
43
|
+
// fileName: '奔奔.jpg',
|
|
44
|
+
// // 文件大小(因为一些历史原因,兼容传入size、fileSize)
|
|
45
|
+
// size: 36742,
|
|
46
|
+
// fileSize: 36742,
|
|
47
|
+
// // 服务端返回参数(这个可不传,由于一些历史原因,可传入下面的格式,组件会优先取这里面的值)
|
|
48
|
+
// response: {
|
|
49
|
+
// code: 200,
|
|
50
|
+
// data: {
|
|
51
|
+
// attachId: '1418469936545132546',
|
|
52
|
+
// },
|
|
53
|
+
// },
|
|
54
|
+
// // 上传进度,必传
|
|
55
|
+
// percent: 100,
|
|
56
|
+
// // 当前状态,必传
|
|
57
|
+
// status: 'done',
|
|
58
|
+
// },
|
|
23
59
|
]);
|
|
24
60
|
}, 3000);
|
|
25
61
|
}, []);
|
|
26
62
|
var uploadCallbackFn = useCallback(function (filelist) {
|
|
27
|
-
console.log(filelist);
|
|
28
63
|
if (filelist.every(function (item) { return item.status === 'done' || item.status === 'error'; })) {
|
|
29
|
-
//
|
|
30
|
-
var successFileList = filelist
|
|
64
|
+
// 获取上传成功的,图片,进行数据转换,上传服务端
|
|
65
|
+
var successFileList = filelist
|
|
66
|
+
.filter(function (item) { return item.status === 'done'; })
|
|
67
|
+
.map(function (item) {
|
|
68
|
+
var _a, _b, _c, _d;
|
|
69
|
+
return ({
|
|
70
|
+
attachId: item.attachId
|
|
71
|
+
? item.attachId
|
|
72
|
+
: (_b = (_a = item === null || item === void 0 ? void 0 : item.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.attachId,
|
|
73
|
+
attachName: item.attachName
|
|
74
|
+
? item.attachName
|
|
75
|
+
: (_d = (_c = item === null || item === void 0 ? void 0 : item.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.originalName,
|
|
76
|
+
fileSize: item.fileSize ? item.fileSize : item.size,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
31
79
|
console.log(successFileList);
|
|
32
80
|
setFileList(filelist);
|
|
33
81
|
}
|
|
@@ -35,28 +83,28 @@ function UploadDemo() {
|
|
|
35
83
|
return (React.createElement("div", null,
|
|
36
84
|
React.createElement(Link, { to: "/test" }, "test"),
|
|
37
85
|
React.createElement(Upload, { method: "post", headers: {
|
|
38
|
-
'Zmdms-Auth':
|
|
86
|
+
'Zmdms-Auth': token,
|
|
39
87
|
}, showUploadList: {
|
|
40
88
|
showDownloadIcon: true,
|
|
41
89
|
showRemoveIcon: true,
|
|
42
90
|
}, apiBaseUrl: "http://192.168.0.83:8888", fileBaseUrl: "http://192.168.0.83:88", showTable: false, showTip: false, originFileList: fileList, maxCount: 2, callback: uploadCallbackFn, onDeleteCallback: function (index, file) {
|
|
43
91
|
console.log(index, file);
|
|
44
|
-
}, authToken:
|
|
92
|
+
}, authToken: token }),
|
|
45
93
|
React.createElement(Upload, { method: "post", headers: {
|
|
46
|
-
'Zmdms-Auth':
|
|
47
|
-
}, authToken:
|
|
94
|
+
'Zmdms-Auth': token,
|
|
95
|
+
}, authToken: token, data: {
|
|
48
96
|
system: '2',
|
|
49
97
|
}, apiBaseUrl: "http://192.168.0.83:8888", fileBaseUrl: "http://192.168.0.83:88", originFileList: fileList, callback: uploadCallbackFn, onDeleteCallback: function (index, file) {
|
|
50
98
|
console.log(index, file);
|
|
51
99
|
} }),
|
|
52
100
|
React.createElement(Upload, { maxSize: 200 * 1024, ztAccept: ['.jpg', '.jpeg', '.png', '.bmp', '.gif'], listType: "picture-card", method: "post", headers: {
|
|
53
|
-
'Zmdms-Auth':
|
|
101
|
+
'Zmdms-Auth': token,
|
|
54
102
|
}, showUploadList: {
|
|
55
103
|
showPreviewIcon: true,
|
|
56
104
|
showDownloadIcon: true,
|
|
57
105
|
showRemoveIcon: true,
|
|
58
106
|
}, apiBaseUrl: "http://192.168.0.83:8888", fileBaseUrl: "http://192.168.0.83:88", showTable: false, showTip: false, originFileList: fileList, maxCount: 1, callback: uploadCallbackFn, onDeleteCallback: function (index, file) {
|
|
59
107
|
console.log(index, file);
|
|
60
|
-
}, authToken:
|
|
108
|
+
}, authToken: token })));
|
|
61
109
|
}
|
|
62
110
|
export default UploadDemo;
|
|
@@ -360,8 +360,8 @@ var UploadTable = function (_a) {
|
|
|
360
360
|
useEffect(function () {
|
|
361
361
|
if (Array.isArray(fileList)) {
|
|
362
362
|
var newDataSource = fileList.map(function (file, index) {
|
|
363
|
-
var _a, _b, _c, _d, _e, _f;
|
|
364
|
-
var name = file.name, percent = file.percent, size = file.size, status = file.status, response = file.response, originFileObj = file.originFileObj;
|
|
363
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
364
|
+
var name = file.name, fileName = file.fileName, percent = file.percent, size = file.size, fileSize = file.fileSize, status = file.status, response = file.response, originFileObj = file.originFileObj, updateTime = file.updateTime, createUserName = file.createUserName;
|
|
365
365
|
// if (response && response.data && !response.data?.createTime) {
|
|
366
366
|
// response.data.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
367
367
|
// }
|
|
@@ -379,20 +379,24 @@ var UploadTable = function (_a) {
|
|
|
379
379
|
id: index,
|
|
380
380
|
status: status,
|
|
381
381
|
percent: newPercent,
|
|
382
|
-
fileName: name,
|
|
383
|
-
fileSize: size || 0,
|
|
382
|
+
fileName: name || fileName,
|
|
383
|
+
fileSize: size || fileSize || 0,
|
|
384
384
|
response: response,
|
|
385
|
-
uploadTime: response
|
|
386
|
-
? dayjs((
|
|
387
|
-
:
|
|
388
|
-
|
|
385
|
+
uploadTime: response && ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.createTime)
|
|
386
|
+
? dayjs((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.createTime).format('YYYY-MM-DD HH:mm:ss')
|
|
387
|
+
: updateTime
|
|
388
|
+
? dayjs(updateTime).format('YYYY-MM-DD HH:mm:ss')
|
|
389
|
+
: dayjs((_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.createTime).format('YYYY-MM-DD HH:mm:ss'),
|
|
390
|
+
uploadUser: response && ((_d = response.data) === null || _d === void 0 ? void 0 : _d.createUserName)
|
|
389
391
|
? response.data.createUserName
|
|
390
|
-
:
|
|
391
|
-
|
|
392
|
-
|
|
392
|
+
: createUserName
|
|
393
|
+
? createUserName
|
|
394
|
+
: uploadUser,
|
|
395
|
+
fileId: response ? (_e = response === null || response === void 0 ? void 0 : response.data) === null || _e === void 0 ? void 0 : _e.attachId : null,
|
|
396
|
+
fileUrl: response ? (_f = response === null || response === void 0 ? void 0 : response.data) === null || _f === void 0 ? void 0 : _f.link : null,
|
|
393
397
|
originFileObj: originFileObj,
|
|
394
398
|
serverFileName: response
|
|
395
|
-
? ((
|
|
399
|
+
? ((_g = response.data) === null || _g === void 0 ? void 0 : _g.name) || ((_h = response.data) === null || _h === void 0 ? void 0 : _h.originalName)
|
|
396
400
|
: null,
|
|
397
401
|
};
|
|
398
402
|
});
|
|
@@ -53,16 +53,47 @@ var Upload = function (props) {
|
|
|
53
53
|
setMaxSizeTransStr(MAXSIZESTR);
|
|
54
54
|
}, [maxSize, maxSizeStr]);
|
|
55
55
|
useEffect(function () {
|
|
56
|
+
// 拉平数据
|
|
56
57
|
if (Array.isArray(originFileList) && originFileList.length > 0) {
|
|
57
58
|
if (listType === 'text') {
|
|
58
|
-
setFileList(originFileList)
|
|
59
|
+
setFileList(originFileList.map(function (item) {
|
|
60
|
+
var _a, _b, _c, _d;
|
|
61
|
+
var attachId = item.attachId, name = item.name, attachName = item.attachName, fileSize = item.fileSize, size = item.size, response = item.response;
|
|
62
|
+
return __assign(__assign({}, item), { uid: attachId ? attachId : (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.attachId, size: fileSize ? fileSize : size, name: name
|
|
63
|
+
? name
|
|
64
|
+
: attachName
|
|
65
|
+
? attachName
|
|
66
|
+
: ((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.attachName)
|
|
67
|
+
? (_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.attachName
|
|
68
|
+
: (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.originalName, percent: 100, status: 'done', response: response
|
|
69
|
+
? response
|
|
70
|
+
: {
|
|
71
|
+
code: 200,
|
|
72
|
+
data: {
|
|
73
|
+
attachId: attachId,
|
|
74
|
+
},
|
|
75
|
+
} });
|
|
76
|
+
}));
|
|
59
77
|
}
|
|
60
78
|
else {
|
|
61
79
|
setFileList(originFileList.map(function (item) {
|
|
62
|
-
var _a;
|
|
63
|
-
var response = item.response;
|
|
80
|
+
var _a, _b, _c, _d, _e;
|
|
81
|
+
var attachId = item.attachId, name = item.name, attachName = item.attachName, fileSize = item.fileSize, size = item.size, response = item.response;
|
|
64
82
|
var fileId = response ? (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.attachId : null;
|
|
65
|
-
return __assign(__assign({}, item), {
|
|
83
|
+
return __assign(__assign({}, item), { uid: attachId ? attachId : (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.attachId, size: fileSize ? fileSize : size, name: name
|
|
84
|
+
? name
|
|
85
|
+
: attachName
|
|
86
|
+
? attachName
|
|
87
|
+
: ((_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.attachName)
|
|
88
|
+
? (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.attachName
|
|
89
|
+
: (_e = response === null || response === void 0 ? void 0 : response.data) === null || _e === void 0 ? void 0 : _e.originalName, percent: 100, status: 'done', response: response
|
|
90
|
+
? response
|
|
91
|
+
: {
|
|
92
|
+
code: 200,
|
|
93
|
+
data: {
|
|
94
|
+
attachId: attachId,
|
|
95
|
+
},
|
|
96
|
+
}, thumbUrl: createThumbnailUrl(apiBaseUrl, fileId, 1) });
|
|
66
97
|
}));
|
|
67
98
|
}
|
|
68
99
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,6 @@ export { default as Collapse } from './components/Collapse';
|
|
|
35
35
|
export { default as GridList } from './components/business/GridList';
|
|
36
36
|
export { default as Timeline } from './components/Timeline';
|
|
37
37
|
export { UserInfo, UserPassword } from './components/business/Common';
|
|
38
|
-
export { ConfigProvider, Drawer, message, Space, Grid, Divider, Dropdown, Badge, List, Result, Spin, Popconfirm, TreeSelect, Tree, Progress, Cascader, Tag, Empty, Tooltip, Descriptions, Image, Popover, Breadcrumb, } from 'antd';
|
|
38
|
+
export { ConfigProvider, Drawer, message, Space, Grid, Divider, Dropdown, Badge, List, Result, Spin, Popconfirm, TreeSelect, Tree, Progress, Cascader, Tag, Empty, Tooltip, Descriptions, Image, Popover, Breadcrumb, Transfer, } from 'antd';
|
|
39
39
|
export { default as zhCN } from 'antd/lib/locale/zh_CN';
|
|
40
40
|
export { default as Icon, createFromIconfontCN } from '@ant-design/icons';
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
// import CollapseDemo from './DemoCom/CollapseDemo';
|
|
14
14
|
// import TimelineDemo from './DemoCom/TimelineDemo';
|
|
15
15
|
// import WeChatDemo from './DemoCom/WechatDemo';
|
|
16
|
+
// import TableDemo from './DemoCom/TableDemo';
|
|
16
17
|
// dayjs.locale(zhCn);
|
|
17
18
|
// ReactDOM.render(
|
|
18
19
|
// // <React.StrictMode>
|
|
@@ -43,6 +44,9 @@
|
|
|
43
44
|
// <Route exact path="/wechat">
|
|
44
45
|
// <WeChatDemo />
|
|
45
46
|
// </Route>
|
|
47
|
+
// <Route exact path="/table">
|
|
48
|
+
// <TableDemo />
|
|
49
|
+
// </Route>
|
|
46
50
|
// <Route exact path="/test">
|
|
47
51
|
// <div>
|
|
48
52
|
// <h1>
|
|
@@ -102,6 +106,6 @@ export { default as Collapse } from './components/Collapse';
|
|
|
102
106
|
export { default as GridList } from './components/business/GridList';
|
|
103
107
|
export { default as Timeline } from './components/Timeline';
|
|
104
108
|
export { UserInfo, UserPassword } from './components/business/Common';
|
|
105
|
-
export { ConfigProvider, Drawer, message, Space, Grid, Divider, Dropdown, Badge, List, Result, Spin, Popconfirm, TreeSelect, Tree, Progress, Cascader, Tag, Empty, Tooltip, Descriptions, Image, Popover, Breadcrumb, } from 'antd';
|
|
109
|
+
export { ConfigProvider, Drawer, message, Space, Grid, Divider, Dropdown, Badge, List, Result, Spin, Popconfirm, TreeSelect, Tree, Progress, Cascader, Tag, Empty, Tooltip, Descriptions, Image, Popover, Breadcrumb, Transfer, } from 'antd';
|
|
106
110
|
export { default as zhCN } from 'antd/lib/locale/zh_CN';
|
|
107
111
|
export { default as Icon, createFromIconfontCN } from '@ant-design/icons';
|