ztxkui 3.5.7 → 3.5.10
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/TableDemo/EditableTable.js +2 -2
- package/dist/TableDemo/ModalTable.d.ts +7 -0
- package/dist/TableDemo/ModalTable.js +351 -0
- package/dist/TableDemo/index.js +3 -1
- package/dist/UploadDemo.js +6 -1
- package/dist/components/Table/table-dynamic.js +1 -0
- package/dist/components/Table/table.js +1 -0
- package/dist/components/Table/utils/validate.js +3 -3
- package/dist/components/Upload/upload-table.js +2 -0
- package/dist/components/business/Signatures/components/DetailTable.d.ts +1 -0
- package/dist/components/business/Signatures/components/DetailTable.js +3 -3
- package/dist/components/business/Signatures/index.js +1 -0
- package/dist/index.js +114 -84
- package/package.json +1 -1
|
@@ -129,7 +129,7 @@ var EditableTable = function () {
|
|
|
129
129
|
return Promise.reject({
|
|
130
130
|
errorFields: [
|
|
131
131
|
{
|
|
132
|
-
errors: "\
|
|
132
|
+
errors: "\u6D4B\u8BD5-\u660E\u7EC6\u8868 \u7B2C" + index + "\u884C \u6D4B\u8BD52 \u4E0D\u80FD\u5C0F\u4E8E102\uFF01",
|
|
133
133
|
},
|
|
134
134
|
],
|
|
135
135
|
});
|
|
@@ -331,6 +331,6 @@ var EditableTable = function () {
|
|
|
331
331
|
// tableValidate
|
|
332
332
|
tableHandleRef: tableHandleRef, tableName: "\u6211\u662F\u4E00\u4E2A\u8868\u683C",
|
|
333
333
|
// 显隐配置
|
|
334
|
-
configInfo: tableConfig })));
|
|
334
|
+
configInfo: tableConfig, showColumnDynamic: true, showColumnDynamicKey: "test-o-0011" })));
|
|
335
335
|
};
|
|
336
336
|
export default EditableTable;
|
|
@@ -0,0 +1,351 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* @author 陈亚雄
|
|
50
|
+
* @description 可编辑表格
|
|
51
|
+
*/
|
|
52
|
+
import React, { useState, useCallback, useRef, useEffect } from 'react';
|
|
53
|
+
// redux
|
|
54
|
+
// ztxkui公共组件
|
|
55
|
+
import { Table, EnhanceSelect, Button, message, Modal } from '../index';
|
|
56
|
+
// 路由配置
|
|
57
|
+
// store
|
|
58
|
+
// 自定义组件
|
|
59
|
+
// 其他文件
|
|
60
|
+
import update from 'immutability-helper';
|
|
61
|
+
import { dataSource, list1 } from './data';
|
|
62
|
+
var ModalTable = function () {
|
|
63
|
+
var _a = useState(dataSource), records = _a[0], setRecords = _a[1];
|
|
64
|
+
var recordsRef = useRef([]);
|
|
65
|
+
// 初始化渲染,针对配置了editable、editableConfig的列配置
|
|
66
|
+
var _b = useState(false), firstRender = _b[0], setFirstRender = _b[1];
|
|
67
|
+
// 新增删除行改变
|
|
68
|
+
var _c = useState(false), lengthChange = _c[0], setLengthChange = _c[1];
|
|
69
|
+
// 表格行拖拽改变
|
|
70
|
+
var _d = useState(false), moveChange = _d[0], setMoveChange = _d[1];
|
|
71
|
+
// 表格
|
|
72
|
+
var tableHandleRef = useRef({});
|
|
73
|
+
// 表格配置
|
|
74
|
+
var _e = useState({
|
|
75
|
+
test1: { isChangeable: 1, isDisplay: 1, isRequired: 1 },
|
|
76
|
+
test2: { isChangeable: 1, isDisplay: 1, isRequired: 1 },
|
|
77
|
+
}), tableConfig = _e[0], setTableConfig = _e[1];
|
|
78
|
+
var _f = useState(true), loading = _f[0], setLoading = _f[1];
|
|
79
|
+
var _g = useState(false), visible = _g[0], setVisible = _g[1];
|
|
80
|
+
useEffect(function () {
|
|
81
|
+
setTimeout(function () {
|
|
82
|
+
setLoading(false);
|
|
83
|
+
}, 5000);
|
|
84
|
+
}, []);
|
|
85
|
+
useEffect(function () {
|
|
86
|
+
setTimeout(function () {
|
|
87
|
+
setTableConfig({
|
|
88
|
+
test1: { isChangeable: 1, isDisplay: 1, isRequired: 1 },
|
|
89
|
+
test2: { isChangeable: 1, isDisplay: 1, isRequired: 1 },
|
|
90
|
+
});
|
|
91
|
+
}, 5000);
|
|
92
|
+
}, []);
|
|
93
|
+
var columns = [
|
|
94
|
+
{
|
|
95
|
+
title: '序号',
|
|
96
|
+
width: 62,
|
|
97
|
+
fixed: 'left',
|
|
98
|
+
key: 'index',
|
|
99
|
+
render: function (_text, _record, index) { return "" + (index + 1); },
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
title: '测试1',
|
|
103
|
+
width: 100,
|
|
104
|
+
dataIndex: 'test1',
|
|
105
|
+
key: 'test1',
|
|
106
|
+
editable: true,
|
|
107
|
+
validate: {},
|
|
108
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
109
|
+
if (firstRender) {
|
|
110
|
+
setFirstRender(false);
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
if (lengthChange) {
|
|
114
|
+
setLengthChange(false);
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
if (moveChange) {
|
|
118
|
+
setMoveChange(false);
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
return record.test1 !== preRecord.test1;
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
title: '测试2',
|
|
126
|
+
width: 100,
|
|
127
|
+
dataIndex: 'test2',
|
|
128
|
+
key: 'test2',
|
|
129
|
+
editable: true,
|
|
130
|
+
editableConfig: {
|
|
131
|
+
type: 'inputNumber',
|
|
132
|
+
},
|
|
133
|
+
validate: {
|
|
134
|
+
validate: function (value, record, index, title) {
|
|
135
|
+
if (value === 102) {
|
|
136
|
+
return Promise.reject({
|
|
137
|
+
errorFields: [
|
|
138
|
+
{
|
|
139
|
+
errors: "\u6D4B\u8BD5-\u660E\u7EC6\u8868 \u7B2C" + index + "\u884C \u6D4B\u8BD52 \u4E0D\u80FD\u5C0F\u4E8E102\uFF01",
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return Promise.resolve();
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
148
|
+
if (firstRender) {
|
|
149
|
+
setFirstRender(false);
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
if (lengthChange) {
|
|
153
|
+
setLengthChange(false);
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
if (moveChange) {
|
|
157
|
+
setMoveChange(false);
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
return record.test2 !== preRecord.test2;
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
title: '测试3',
|
|
165
|
+
width: 100,
|
|
166
|
+
dataIndex: 'test3',
|
|
167
|
+
key: 'test3',
|
|
168
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
169
|
+
if (lengthChange) {
|
|
170
|
+
setLengthChange(false);
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
if (moveChange) {
|
|
174
|
+
setMoveChange(false);
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
return record.test3 !== preRecord.test3;
|
|
178
|
+
},
|
|
179
|
+
validate: {},
|
|
180
|
+
render: function (text, record, index) {
|
|
181
|
+
return (React.createElement(EnhanceSelect, { value: text, list: list1, dataKey: "id", titleKey: "name", dropdownMatchSelectWidth: 130, onChange: function (value, option, fullData) {
|
|
182
|
+
tableHandleRef.current.clearErrorClass(index);
|
|
183
|
+
var newRecord = {
|
|
184
|
+
test3: value,
|
|
185
|
+
test3Name: fullData === null || fullData === void 0 ? void 0 : fullData.name,
|
|
186
|
+
};
|
|
187
|
+
onEditableSaveHandle(newRecord, index);
|
|
188
|
+
} }));
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
title: '测试4',
|
|
193
|
+
width: 100,
|
|
194
|
+
dataIndex: 'test4',
|
|
195
|
+
key: 'test4',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
title: '测试5',
|
|
199
|
+
width: 100,
|
|
200
|
+
dataIndex: 'test5',
|
|
201
|
+
key: 'test5',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
title: '测试6',
|
|
205
|
+
width: 100,
|
|
206
|
+
dataIndex: 'test6',
|
|
207
|
+
key: 'test6',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
title: '测试7',
|
|
211
|
+
width: 100,
|
|
212
|
+
dataIndex: 'test7',
|
|
213
|
+
key: 'test7',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
title: '测试8',
|
|
217
|
+
width: 100,
|
|
218
|
+
dataIndex: 'test8',
|
|
219
|
+
key: 'test8',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
title: '测试9',
|
|
223
|
+
width: 100,
|
|
224
|
+
dataIndex: 'test9',
|
|
225
|
+
key: 'test9',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
title: '测试10',
|
|
229
|
+
width: 100,
|
|
230
|
+
dataIndex: 'test10',
|
|
231
|
+
key: 'test10',
|
|
232
|
+
},
|
|
233
|
+
];
|
|
234
|
+
// 初始化渲染,针对配置了editable、editableConfig的列配置
|
|
235
|
+
useEffect(function () {
|
|
236
|
+
setFirstRender(true);
|
|
237
|
+
}, []);
|
|
238
|
+
// 将表格最新数据赋值给ref引用
|
|
239
|
+
useEffect(function () {
|
|
240
|
+
recordsRef.current = records;
|
|
241
|
+
}, [records]);
|
|
242
|
+
// 表格数据改变相关
|
|
243
|
+
var onEditableSaveHandle = useCallback(function (record, index, _dataIndex) {
|
|
244
|
+
var _a;
|
|
245
|
+
if (_dataIndex === void 0) { _dataIndex = ''; }
|
|
246
|
+
if (typeof index === 'number') {
|
|
247
|
+
var newRecords = recordsRef.current.slice();
|
|
248
|
+
var item = newRecords[index];
|
|
249
|
+
newRecords.splice(index, 1, _dataIndex
|
|
250
|
+
? __assign(__assign(__assign({}, record), item), (_a = {}, _a[_dataIndex] = record[_dataIndex], _a)) : __assign(__assign({}, item), record));
|
|
251
|
+
setRecords(newRecords);
|
|
252
|
+
}
|
|
253
|
+
}, [setRecords]);
|
|
254
|
+
// 新增删除行
|
|
255
|
+
var onAddAndDelHandle = useCallback(function (type, index) {
|
|
256
|
+
var newRecords = recordsRef.current.slice();
|
|
257
|
+
if (type === 'add') {
|
|
258
|
+
var newItem = __assign(__assign({}, newRecords[index]), { _isNewData: true, id: Date.now() + "-" + index });
|
|
259
|
+
newRecords.splice(index + 1, 0, newItem);
|
|
260
|
+
setRecords(newRecords);
|
|
261
|
+
setLengthChange(true);
|
|
262
|
+
}
|
|
263
|
+
else if (type === 'del') {
|
|
264
|
+
if (newRecords.length === 1) {
|
|
265
|
+
newRecords.splice(index, 1, {
|
|
266
|
+
_isNewData: true,
|
|
267
|
+
id: Date.now() + "-" + index,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
newRecords.splice(index, 1);
|
|
272
|
+
}
|
|
273
|
+
setRecords(newRecords);
|
|
274
|
+
setLengthChange(true);
|
|
275
|
+
}
|
|
276
|
+
}, [setRecords]);
|
|
277
|
+
// 表格拖拽排序功能函数
|
|
278
|
+
var onMoveRowHandle = useCallback(function (dragIndex, hoverIndex) {
|
|
279
|
+
var newRecords = recordsRef.current.slice();
|
|
280
|
+
var dragRow = newRecords[dragIndex];
|
|
281
|
+
var newDataSource = update(newRecords, {
|
|
282
|
+
$splice: [
|
|
283
|
+
[dragIndex, 1],
|
|
284
|
+
[hoverIndex, 0, dragRow],
|
|
285
|
+
],
|
|
286
|
+
});
|
|
287
|
+
setRecords(newDataSource);
|
|
288
|
+
setMoveChange(true);
|
|
289
|
+
}, [setRecords]);
|
|
290
|
+
return (React.createElement("div", null,
|
|
291
|
+
React.createElement("div", null,
|
|
292
|
+
"\u53EF\u7F16\u8F91\u8868\u683C\uFF1B\u5982\u679C\u662F\u8F93\u5165\u6846\uFF0C\u53EF\u4F7F\u7528\u8868\u683C\u9ED8\u8BA4\u63D0\u4F9B\u7684\u7F16\u8F91\u6846\uFF1B \u914D\u7F6Eeditable\u4E3Atrue\u5373\u53EF\uFF0C\u8FD8\u53EF\u914D\u7F6EeditableConfig\u914D\u7F6E\u6267\u884C\u7C7B\u578B\u7B49\uFF1B\u5177\u4F53editableConfig\u53EF\u67E5\u770B\u8BE6\u7EC6\u7B7E\u540D",
|
|
293
|
+
React.createElement("br", null),
|
|
294
|
+
React.createElement("b", null, "\u5BF9\u4E8E\u914D\u7F6E\u4E86\u7F16\u8F91\u7684\u8868\u683C\uFF0C\u4E00\u5B9A\u8981\u4F7F\u7528SCU\u6765\u4F18\u5316\u8868\u683C\u6E32\u67D3\uFF0C\u6B64\u4E3E\u53EF\u4EE5\u4F18\u5316\u8868\u683C\u6E32\u67D3"),
|
|
295
|
+
React.createElement("br", null),
|
|
296
|
+
React.createElement("b", null, "\u5982\u679C\u914D\u7F6E\u4E86editable\uFF0C\u5E76\u4E14\u914D\u7F6E\u4E86SCU\u6765\u4F18\u5316\u6E32\u67D3\uFF0C\u90A3\u4E48\u521D\u59CB\u5316\u7684\u65F6\u5019\u9700\u8981\u7528\u4E00\u4E2A\u53D8\u91CF\u6807\u8BC6\u9996\u6B21\u9700\u8981\u6E32\u67D3"),
|
|
297
|
+
React.createElement("br", null),
|
|
298
|
+
React.createElement("b", null, "\u65B0\u589E\u5220\u9664\u884C\uFF0C\u8868\u683C\u62D6\u62FD\u6392\u5E8F\uFF1B"),
|
|
299
|
+
"\u5BF9\u4E8E\u914D\u7F6E\u4E86SCU\u7684\u5217\uFF0C\u9700\u8981\u5728\u65B0\u589E\u5220\u9664\u7684\u65F6\u5019\u91CD\u65B0\u6E32\u67D3\uFF0C\u901A\u8FC7\u8BBE\u7F6Estate\u6807\u8BC6",
|
|
300
|
+
React.createElement("br", null),
|
|
301
|
+
React.createElement("b", null, "\u8868\u683C\u81EA\u5B9A\u4E49\u9A8C\u8BC1\uFF0C\u4F20\u5165tableHandleRef\u4E00\u4E2ARef\u5BF9\u8C61\uFF0C\u53EF\u83B7\u53D6\u8868\u683C\u63D0\u4F9B\u76F8\u5173\u65B9\u6CD5"),
|
|
302
|
+
React.createElement("p", null, "1.\u7F16\u5199\u9A8C\u8BC1\u89C4\u5219\uFF0C\u5728\u5217\u91CC\u9762\u7F16\u5199\uFF0C\u901A\u8FC7\u4F20\u5165validate\u5C5E\u6027\u914D\u7F6E,\u5177\u4F53\u53EF\u67E5\u770B\u7B7E\u540D \u5982\u679C\u53EA\u662F\u7B80\u5355\u7684\u975E\u7A7A\u9A8C\u8BC1\uFF0C\u90A3\u4E48\u53EF\u4F20\u5165\u4E00\u4E2A\u7A7A\u5BF9\u8C61\u5373\u53EF \u5982\u679C\u662F\u590D\u6742\u9A8C\u8BC1\u53EF\u901A\u8FC7validate\u4F20\u5165\u66F4\u591A\u914D\u7F6E"),
|
|
303
|
+
React.createElement("p", null, "2.\u5982\u679C\u4F20\u5165\u4E86\u81EA\u5B9A\u4E49render\u51FD\u6570\uFF0C\u7EC4\u4EF6\u65E0\u6CD5\u638C\u63E1\u5728\u4F55\u65F6\u6E05\u7A7A\u9519\u8BEF\u4FE1\u606F\uFF0C\u6240\u4EE5\u9700\u8981\u8C03\u7528\u65B9\u4E3B\u52A8\u6E05\u7A7A\u9519\u8BEF\u4FE1\u606F")),
|
|
304
|
+
React.createElement(Button, { onClick: function () {
|
|
305
|
+
(function () {
|
|
306
|
+
var _a;
|
|
307
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
308
|
+
var err_1, errorFields;
|
|
309
|
+
return __generator(this, function (_b) {
|
|
310
|
+
switch (_b.label) {
|
|
311
|
+
case 0:
|
|
312
|
+
_b.trys.push([0, 2, , 3]);
|
|
313
|
+
return [4 /*yield*/, ((_a = tableHandleRef.current) === null || _a === void 0 ? void 0 : _a.validate())];
|
|
314
|
+
case 1:
|
|
315
|
+
_b.sent();
|
|
316
|
+
return [3 /*break*/, 3];
|
|
317
|
+
case 2:
|
|
318
|
+
err_1 = _b.sent();
|
|
319
|
+
console.log(err_1);
|
|
320
|
+
errorFields = err_1.errorFields;
|
|
321
|
+
if (errorFields) {
|
|
322
|
+
message.warning(errorFields[0].errors + '');
|
|
323
|
+
}
|
|
324
|
+
return [3 /*break*/, 3];
|
|
325
|
+
case 3: return [2 /*return*/];
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
})();
|
|
330
|
+
} }, "\u9A8C\u8BC1"),
|
|
331
|
+
React.createElement(Button, { onClick: function () {
|
|
332
|
+
setVisible(function (visible) { return !visible; });
|
|
333
|
+
setLoading(true);
|
|
334
|
+
setTimeout(function () {
|
|
335
|
+
setLoading(false);
|
|
336
|
+
}, 5000);
|
|
337
|
+
} }, "\u6253\u5F00\u6A21\u6001\u6846"),
|
|
338
|
+
React.createElement(Modal, { title: "\u6D4B\u8BD5", loading: loading, visible: visible, onCancel: function () { return setVisible(false); } },
|
|
339
|
+
React.createElement(Table, { dataSource: records, columns: columns, rowKey: "id",
|
|
340
|
+
// 表格项可输入
|
|
341
|
+
onEditableSave: onEditableSaveHandle,
|
|
342
|
+
// 新增删除行
|
|
343
|
+
onAddAndDelHandle: onAddAndDelHandle,
|
|
344
|
+
// 表格行拖拽
|
|
345
|
+
onMoveRow: onMoveRowHandle,
|
|
346
|
+
// tableValidate
|
|
347
|
+
tableHandleRef: tableHandleRef, tableName: "\u6211\u662F\u4E00\u4E2A\u8868\u683C",
|
|
348
|
+
// 显隐配置
|
|
349
|
+
configInfo: tableConfig, showColumnDynamic: true, showColumnDynamicKey: "test-o-0011" }))));
|
|
350
|
+
};
|
|
351
|
+
export default ModalTable;
|
package/dist/TableDemo/index.js
CHANGED
|
@@ -10,10 +10,12 @@ import React from 'react';
|
|
|
10
10
|
// 自定义组件
|
|
11
11
|
import BasicTable from './BasicTable';
|
|
12
12
|
import EditableTable from './EditableTable';
|
|
13
|
+
import ModalTable from './ModalTable';
|
|
13
14
|
// 其他文件
|
|
14
15
|
var TableDemo = function () {
|
|
15
16
|
return (React.createElement("div", null,
|
|
16
17
|
React.createElement(BasicTable, null),
|
|
17
|
-
React.createElement(EditableTable, null)
|
|
18
|
+
React.createElement(EditableTable, null),
|
|
19
|
+
React.createElement(ModalTable, null)));
|
|
18
20
|
};
|
|
19
21
|
export default TableDemo;
|
package/dist/UploadDemo.js
CHANGED
|
@@ -39,7 +39,7 @@ import Upload from 'components/Upload';
|
|
|
39
39
|
import { useState, useEffect, useCallback, useRef } from 'react';
|
|
40
40
|
import { UploadSingle } from './index';
|
|
41
41
|
var originFileList = [];
|
|
42
|
-
var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
42
|
+
var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25hbWUiOm51bGwsImVtcF9udW1iZXIiOm51bGwsImltdF9pZCI6bnVsbCwicmVhbF9uYW1lIjoi6ZmI5Lqa6ZuEIiwiY2xpZW50X3R5cGUiOiJ3ZWIiLCJkYXRhX3JvbGVfaWQiOiIxMzQ1OTc4NTA1MzAyMDU2OTYyLDE0NjgwMzUzNTE2MjUyODU2MzQsMTU0MjA3NjMwODU3ODAyNTQ3NCIsImNsaWVudF9pZCI6InN3b3JkIiwidXNlcl90eXBlIjoid2ViIiwicm9sZV9pZCI6IjExMjM1OTg4MTY3Mzg2NzUyMDEsMTQ2NzAxNTk3NTQ4NDc2MDA2NiwxNDY4MDM0NDM3MTU3OTYxNzI5LDE0ODA4MjkzMzc5MzkxMzI0MTciLCJwb3N0X25hbWUiOm51bGwsInNjb3BlIjpbImFsbCJdLCJpbnRlcnZpZXdfaWQiOm51bGwsImV4cCI6MTY2MTI0MDUxNiwib3JnX25hbWUiOm51bGwsImp0aSI6IjEwOGY2YjhmLTU0ZjUtNDcwYy04YzU0LTU4MWViZDMyMmZjYSIsIm1lbWJlcl9pZCI6MSwiY29tcGFueV9pZCI6bnVsbCwic3lzdGVtX2lkIjpudWxsLCJkZXB0X25hbWUiOm51bGwsImF2YXRhciI6IiIsImRhdGFfcm9sZV9uYW1lIjoiYWRtaW4sYWRtaW4sYWRtaW4iLCJhdXRob3JpdGllcyI6WyJhZG1pbiIsInVzZXIiLCJhZG1pbmlzdHJhdG9yIl0sInJvbGVfbmFtZSI6ImFkbWluaXN0cmF0b3IsdXNlcixhZG1pbixhZG1pbiIsInJlc3VtZV90ZW1wbGF0ZSI6bnVsbCwibGljZW5zZSI6InBvd2VyZWQgYnkgem1kbXMiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjE0MTI5NTM4MDQzMzM1NTU3MTQiLCJvcmdfaWQiOm51bGwsIm5pY2tfbmFtZSI6IumZiOS6mumbhCIsImNvbXBhbnlfbmFtZSI6bnVsbCwiZGVwdF9pZCI6IiIsImhhbmRsZV9ocl9uYW1lIjpudWxsLCJhY2NvdW50IjoiY2hlbnl4IiwicmVzdW1lX2lkIjpudWxsfQ.UXl68JBAGWQgL9uweedOonIj7Sflz2B_PQ6JS-Mi6_E";
|
|
43
43
|
function UploadDemo() {
|
|
44
44
|
var _this = this;
|
|
45
45
|
var _a = useState(originFileList), fileList = _a[0], setFileList = _a[1];
|
|
@@ -77,6 +77,11 @@ function UploadDemo() {
|
|
|
77
77
|
// percent: 100,
|
|
78
78
|
// status: 'error',
|
|
79
79
|
},
|
|
80
|
+
{
|
|
81
|
+
attachId: '1559718559965757442',
|
|
82
|
+
attachName: '浙商中拓报总第101期.pdf',
|
|
83
|
+
fileSize: 301024,
|
|
84
|
+
},
|
|
80
85
|
// {
|
|
81
86
|
// // uid可不传,这个应该时组件需要一个内部id,可以同attachId
|
|
82
87
|
// uid: '1418469936545132546',
|
|
@@ -75,6 +75,7 @@ function TableDynamic(props) {
|
|
|
75
75
|
var onDynamicChangeHandle = function (checkedValue) {
|
|
76
76
|
setCheckedValues(checkedValue);
|
|
77
77
|
};
|
|
78
|
+
console.log(visible);
|
|
78
79
|
return (React.createElement(Drawer, { placement: "right", getContainer: false, closable: false, maskClosable: false,
|
|
79
80
|
// style={{ position: 'absolute' }}
|
|
80
81
|
visible: visible, className: "zt-table__dynamic", title: React.createElement("div", null,
|
|
@@ -42,11 +42,11 @@ import { ERROR_TD_CLASSNAME } from '../index';
|
|
|
42
42
|
export function tableValidate(dataSource, mergeColumns, restParams) {
|
|
43
43
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
44
44
|
return __awaiter(this, void 0, void 0, function () {
|
|
45
|
-
var getCurrentTable, rowSelection, tableName, requiredFileds, resultTr, i, item, j, _o, dataIndex, title, validate, index, value, err_1, errorTr, errorTds, errorTd, errorTr, errorTds, errorTd, errorTr, errorTds, errorTd;
|
|
45
|
+
var getCurrentTable, rowSelection, tableName, expandable, requiredFileds, resultTr, i, item, j, _o, dataIndex, title, validate, index, value, err_1, errorTr, errorTds, errorTd, errorTr, errorTds, errorTd, errorTr, errorTds, errorTd;
|
|
46
46
|
return __generator(this, function (_p) {
|
|
47
47
|
switch (_p.label) {
|
|
48
48
|
case 0:
|
|
49
|
-
getCurrentTable = restParams.getCurrentTable, rowSelection = restParams.rowSelection, tableName = restParams.tableName;
|
|
49
|
+
getCurrentTable = restParams.getCurrentTable, rowSelection = restParams.rowSelection, tableName = restParams.tableName, expandable = restParams.expandable;
|
|
50
50
|
if (!Array.isArray(dataSource) || dataSource.length === 0) {
|
|
51
51
|
console.info('没有数据,无需验证!');
|
|
52
52
|
return [2 /*return*/];
|
|
@@ -63,7 +63,7 @@ export function tableValidate(dataSource, mergeColumns, restParams) {
|
|
|
63
63
|
dataIndex: column.validate.dataIndex || column.dataIndex,
|
|
64
64
|
title: column.validate.title || column.title,
|
|
65
65
|
validate: column.validate.validate,
|
|
66
|
-
index: index + (rowSelection ? 1 : 0),
|
|
66
|
+
index: index + (rowSelection ? 1 : 0) + (expandable ? 1 : 0),
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
});
|
|
@@ -218,6 +218,7 @@ var UploadTable = function (_a) {
|
|
|
218
218
|
var newDataSource = ((_b = (_a = (dataSourceRef.current || [])) === null || _a === void 0 ? void 0 : _a.slice) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
|
|
219
219
|
if ((_c = newDataSource[index]) === null || _c === void 0 ? void 0 : _c.loading) {
|
|
220
220
|
newDataSource.splice(index, 1, __assign(__assign({}, record), { loading: false }));
|
|
221
|
+
message.warning((record === null || record === void 0 ? void 0 : record.fileName) + " \u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25!");
|
|
221
222
|
setDataSource(newDataSource);
|
|
222
223
|
}
|
|
223
224
|
},
|
|
@@ -247,6 +248,7 @@ var UploadTable = function (_a) {
|
|
|
247
248
|
var newDataSource = ((_b = (_a = (dataSourceRef.current || [])) === null || _a === void 0 ? void 0 : _a.slice) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
|
|
248
249
|
if ((_c = newDataSource[index]) === null || _c === void 0 ? void 0 : _c.loading) {
|
|
249
250
|
newDataSource.splice(index, 1, __assign(__assign({}, record), { loading: false }));
|
|
251
|
+
message.warning((record === null || record === void 0 ? void 0 : record.fileName) + " \u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25!");
|
|
250
252
|
setDataSource(newDataSource);
|
|
251
253
|
}
|
|
252
254
|
},
|
|
@@ -18,7 +18,7 @@ import { Table, Button } from '../../../../index';
|
|
|
18
18
|
// 自定义组件
|
|
19
19
|
import AttachOperation from './AttachOperation';
|
|
20
20
|
var DetailTable = function (_a) {
|
|
21
|
-
var needQj = _a.needQj, needQys = _a.needQys, records = _a.records, qunjSeal = _a.qunjSeal, electronicSeal = _a.electronicSealIdList, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, viewSealPageFn = _a.viewSealPageFn, contractId = _a.contractId, electronicList = _a.electronicList, sealList = _a.sealList, querySealStatus = _a.querySealStatus;
|
|
21
|
+
var needQj = _a.needQj, needQys = _a.needQys, records = _a.records, qunjSeal = _a.qunjSeal, electronicSeal = _a.electronicSealIdList, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, viewSealPageFn = _a.viewSealPageFn, contractId = _a.contractId, electronicList = _a.electronicList, sealList = _a.sealList, querySealStatus = _a.querySealStatus, showContranctNum = _a.showContranctNum;
|
|
22
22
|
var authToken = token || '';
|
|
23
23
|
/** 下载水印附件 */
|
|
24
24
|
var downFileFn = function (_record) {
|
|
@@ -130,12 +130,12 @@ var DetailTable = function (_a) {
|
|
|
130
130
|
} },
|
|
131
131
|
React.createElement("div", { style: __assign({}, (!!(qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.vertifyCode) ? {} : { display: 'none' })) },
|
|
132
132
|
React.createElement(Button, { type: "link", size: "small", onClick: querySealStatus }, "\u67E5\u8BE2\u7528\u5370\u72B6\u6001")),
|
|
133
|
-
React.createElement("div", null,
|
|
133
|
+
showContranctNum && (React.createElement("div", null,
|
|
134
134
|
React.createElement("span", { style: {
|
|
135
135
|
color: '#888888',
|
|
136
136
|
} }, "\u5408\u540C\u4EFD\u6570\uFF1A"),
|
|
137
137
|
(qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.contranctNum) || '',
|
|
138
|
-
" \u4EFD"),
|
|
138
|
+
" \u4EFD")),
|
|
139
139
|
React.createElement("div", null,
|
|
140
140
|
React.createElement("span", { style: {
|
|
141
141
|
color: '#888888',
|
|
@@ -690,6 +690,7 @@ var Sinatures = function (_a) {
|
|
|
690
690
|
querySealStatus: querySealStatus,
|
|
691
691
|
needQj: needQj,
|
|
692
692
|
needQys: needQys,
|
|
693
|
+
showContranctNum: showContranctNum,
|
|
693
694
|
};
|
|
694
695
|
return (React.createElement(React.Fragment, null, isEdit ? (React.createElement(Table, { columns: columnsLast, rowKey: "attachId", dataSource: records, scroll: { x: 'max-content' } })) : (React.createElement(DetailTable, __assign({}, detail)))));
|
|
695
696
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,87 +1,117 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
import App from './App';
|
|
4
|
-
import { ConfigProvider } from 'antd';
|
|
5
|
-
import zhCN from 'antd/lib/locale/zh_CN';
|
|
6
|
-
import * as dayjs from 'dayjs';
|
|
7
|
-
import zhCn from 'dayjs/locale/zh-cn';
|
|
8
|
-
import { BrowserRouter, Switch, Route, Link } from 'react-router-dom';
|
|
9
|
-
import Demo from './Demo';
|
|
10
|
-
import TreeSelectDemo from './TreeSelectDemo';
|
|
11
|
-
import TreeDemo from './TreeDemo';
|
|
12
|
-
import UploadDemo from './UploadDemo';
|
|
13
|
-
import CollapseDemo from './DemoCom/CollapseDemo';
|
|
14
|
-
import TimelineDemo from './DemoCom/TimelineDemo';
|
|
15
|
-
import WeChatDemo from './DemoCom/WechatDemo';
|
|
16
|
-
import TableDemo from './DemoCom/TableDemo';
|
|
17
|
-
import TableDemo1 from './DemoCom/TableDemo1';
|
|
18
|
-
import BasicDemo from './DemoCom/BasicDemo';
|
|
19
|
-
import FormDemo from './DemoCom/FormDemo';
|
|
20
|
-
import TableAnalyse from './DemoCom/TableAnalyse';
|
|
21
|
-
import DragSort from './DemoCom/DragSort';
|
|
22
|
-
import PrintDemo from './DemoCom/PrintDemo';
|
|
23
|
-
import PrintContainerDemo from './DemoCom/PrintContainerDemo';
|
|
24
|
-
import SinaturesDemo from './DemoCom/SinaturesDemo';
|
|
25
|
-
import TableDemoAll from './TableDemo';
|
|
26
|
-
import CodeQueryDemo from './DemoCom/CodeQueryDemo';
|
|
27
|
-
dayjs.locale(zhCn);
|
|
28
|
-
ReactDOM.render(
|
|
29
|
-
// <React.StrictMode>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import ReactDOM from 'react-dom';
|
|
3
|
+
// import App from './App';
|
|
4
|
+
// import { ConfigProvider } from 'antd';
|
|
5
|
+
// import zhCN from 'antd/lib/locale/zh_CN';
|
|
6
|
+
// import * as dayjs from 'dayjs';
|
|
7
|
+
// import zhCn from 'dayjs/locale/zh-cn';
|
|
8
|
+
// import { BrowserRouter, Switch, Route, Link } from 'react-router-dom';
|
|
9
|
+
// import Demo from './Demo';
|
|
10
|
+
// import TreeSelectDemo from './TreeSelectDemo';
|
|
11
|
+
// import TreeDemo from './TreeDemo';
|
|
12
|
+
// import UploadDemo from './UploadDemo';
|
|
13
|
+
// import CollapseDemo from './DemoCom/CollapseDemo';
|
|
14
|
+
// import TimelineDemo from './DemoCom/TimelineDemo';
|
|
15
|
+
// import WeChatDemo from './DemoCom/WechatDemo';
|
|
16
|
+
// import TableDemo from './DemoCom/TableDemo';
|
|
17
|
+
// import TableDemo1 from './DemoCom/TableDemo1';
|
|
18
|
+
// import BasicDemo from './DemoCom/BasicDemo';
|
|
19
|
+
// import FormDemo from './DemoCom/FormDemo';
|
|
20
|
+
// import TableAnalyse from './DemoCom/TableAnalyse';
|
|
21
|
+
// import DragSort from './DemoCom/DragSort';
|
|
22
|
+
// import PrintDemo from './DemoCom/PrintDemo';
|
|
23
|
+
// import PrintContainerDemo from './DemoCom/PrintContainerDemo';
|
|
24
|
+
// import SinaturesDemo from './DemoCom/SinaturesDemo';
|
|
25
|
+
// import TableDemoAll from './TableDemo';
|
|
26
|
+
// import CodeQueryDemo from './DemoCom/CodeQueryDemo';
|
|
27
|
+
// dayjs.locale(zhCn);
|
|
28
|
+
// ReactDOM.render(
|
|
29
|
+
// // <React.StrictMode>
|
|
30
|
+
// <ConfigProvider locale={zhCN}>
|
|
31
|
+
// <BrowserRouter>
|
|
32
|
+
// <Switch>
|
|
33
|
+
// <Route exact path="/">
|
|
34
|
+
// <App />
|
|
35
|
+
// </Route>
|
|
36
|
+
// <Route exact path="/code-query">
|
|
37
|
+
// <CodeQueryDemo />
|
|
38
|
+
// </Route>
|
|
39
|
+
// <Route exact path="/select">
|
|
40
|
+
// <Demo />
|
|
41
|
+
// </Route>
|
|
42
|
+
// <Route exact path="/tree-select">
|
|
43
|
+
// <TreeSelectDemo />
|
|
44
|
+
// </Route>
|
|
45
|
+
// <Route exact path="/tree">
|
|
46
|
+
// <TreeDemo />
|
|
47
|
+
// </Route>
|
|
48
|
+
// <Route exact path="/upload">
|
|
49
|
+
// <UploadDemo />
|
|
50
|
+
// </Route>
|
|
51
|
+
// <Route exact path="/collapse">
|
|
52
|
+
// <CollapseDemo />
|
|
53
|
+
// </Route>
|
|
54
|
+
// <Route exact path="/timeline">
|
|
55
|
+
// <TimelineDemo />
|
|
56
|
+
// </Route>
|
|
57
|
+
// <Route exact path="/wechat">
|
|
58
|
+
// <WeChatDemo />
|
|
59
|
+
// </Route>
|
|
60
|
+
// <Route exact path="/table">
|
|
61
|
+
// <TableDemo />
|
|
62
|
+
// </Route>
|
|
63
|
+
// <Route exact path="/table1">
|
|
64
|
+
// <TableDemo1 />
|
|
65
|
+
// </Route>
|
|
66
|
+
// <Route exact path="/basic">
|
|
67
|
+
// <BasicDemo />
|
|
68
|
+
// </Route>
|
|
69
|
+
// <Route exact path="/form">
|
|
70
|
+
// <FormDemo />
|
|
71
|
+
// </Route>
|
|
72
|
+
// <Route exact path="/print">
|
|
73
|
+
// <PrintDemo />
|
|
74
|
+
// </Route>
|
|
75
|
+
// <Route exact path="/print-container">
|
|
76
|
+
// <PrintContainerDemo />
|
|
77
|
+
// </Route>
|
|
78
|
+
// <Route exact path="/tableall">
|
|
79
|
+
// <TableDemoAll />
|
|
80
|
+
// </Route>
|
|
81
|
+
// <Route exact path="/table-analyse">
|
|
82
|
+
// <TableAnalyse />
|
|
83
|
+
// </Route>
|
|
84
|
+
// <Route exact path="/drag-sort">
|
|
85
|
+
// <DragSort />
|
|
86
|
+
// </Route>
|
|
87
|
+
// <Route exact path="/sinatures">
|
|
88
|
+
// <SinaturesDemo />
|
|
89
|
+
// </Route>
|
|
90
|
+
// <Route exact path="/test">
|
|
91
|
+
// <div>
|
|
92
|
+
// <h1>
|
|
93
|
+
// <Link to="/select">select</Link>
|
|
94
|
+
// </h1>
|
|
95
|
+
// <h1>
|
|
96
|
+
// <Link to="/tree-select">tree select</Link>
|
|
97
|
+
// </h1>
|
|
98
|
+
// <h1>
|
|
99
|
+
// <Link to="/tree">tree</Link>
|
|
100
|
+
// </h1>
|
|
101
|
+
// <h1>
|
|
102
|
+
// <Link to="/upload">upload</Link>
|
|
103
|
+
// </h1>
|
|
104
|
+
// <h1>
|
|
105
|
+
// <Link to="/drag-sort">drag-sort</Link>
|
|
106
|
+
// </h1>
|
|
107
|
+
// </div>
|
|
108
|
+
// </Route>
|
|
109
|
+
// </Switch>
|
|
110
|
+
// </BrowserRouter>
|
|
111
|
+
// </ConfigProvider>,
|
|
112
|
+
// // </React.StrictMode>,
|
|
113
|
+
// document.getElementById('root')
|
|
114
|
+
// );
|
|
85
115
|
export { default as Button } from './components/Button';
|
|
86
116
|
export { default as Calendar } from './components/Calendar';
|
|
87
117
|
export { default as Checkbox } from './components/Checkbox';
|