ztxkui 2.4.7 → 2.5.0
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/DemoCom/CollapseDemo.js +10 -9
- package/dist/DemoCom/TableDemo.d.ts +10 -0
- package/dist/DemoCom/TableDemo.js +331 -186
- package/dist/DemoCom/TestCom.d.ts +49 -11
- package/dist/DemoCom/TestCom.js +359 -73
- package/dist/components/EnhanceSelect/index.js +4 -4
- package/dist/components/business/Container/container.d.ts +2 -0
- package/dist/components/business/Container/container.js +2 -2
- package/dist/components/business/NewList/item.js +1 -1
- package/dist/components/business/NewList/list.js +1 -1
- package/dist/index.css +5 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import GridList from 'components/business/NewList';
|
|
|
3
3
|
function CollapseDemo() {
|
|
4
4
|
return (React.createElement("div", { style: { padding: 20 } },
|
|
5
5
|
React.createElement(Collapse, { showBackground: true },
|
|
6
|
-
React.createElement(Collapse.Panel, { key: "1", header: "\u4E2A\u4EBA\u4FE1\u606F"
|
|
6
|
+
React.createElement(Collapse.Panel, { key: "1", header: "\u4E2A\u4EBA\u4FE1\u606F" },
|
|
7
7
|
React.createElement(GridList, null,
|
|
8
8
|
React.createElement(GridList.Item, { span: 8, title: "\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5", showDiff: true }, "\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1\u518D\u89C1"),
|
|
9
9
|
React.createElement(GridList.Item, { span: 16, titleSpan: Math.floor(8 * 0.4), title: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", showDiff: true }, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbb")),
|
|
@@ -31,13 +31,14 @@ function CollapseDemo() {
|
|
|
31
31
|
React.createElement(GridList.Item, { span: 16, titleSpan: Math.floor(8 * 0.4), title: "\u6D4B\u8BD5" }, "\u518D\u89C1"))),
|
|
32
32
|
React.createElement(Collapse.Panel, { key: "3", header: "33" },
|
|
33
33
|
React.createElement(GridList, { border: false, showBackground: false },
|
|
34
|
-
React.createElement(GridList.Item, { span:
|
|
35
|
-
React.createElement(GridList.Item, { span:
|
|
36
|
-
React.createElement(GridList.Item, { span:
|
|
37
|
-
React.createElement(GridList.Item, { span:
|
|
38
|
-
React.createElement(GridList.Item, { span:
|
|
39
|
-
React.createElement(GridList.Item, { span:
|
|
40
|
-
React.createElement(GridList.Item, { span:
|
|
41
|
-
React.createElement(GridList.Item, { span:
|
|
34
|
+
React.createElement(GridList.Item, { span: 6, title: "\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
35
|
+
React.createElement(GridList.Item, { span: 6, title: "\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
36
|
+
React.createElement(GridList.Item, { span: 6, title: "\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
37
|
+
React.createElement(GridList.Item, { span: 6, title: "\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
38
|
+
React.createElement(GridList.Item, { span: 6, title: "\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
39
|
+
React.createElement(GridList.Item, { span: 6, title: "\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
40
|
+
React.createElement(GridList.Item, { span: 6, title: "\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
41
|
+
React.createElement(GridList.Item, { span: 6, title: "\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
42
|
+
React.createElement(GridList.Item, { span: 24, titleSpan: Math.floor(6 * 0.4), title: "\u6D4B\u8BD5" }, "\u518D\u89C1"))))));
|
|
42
43
|
}
|
|
43
44
|
export default CollapseDemo;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const getTableLayoutFullData: (columns: any, tableLayout: any) => any;
|
|
3
|
+
/**
|
|
4
|
+
* 详情拿到的数据,一般是这个样子的
|
|
5
|
+
* {
|
|
6
|
+
* cpcc: '1',
|
|
7
|
+
* pm: 'pm1',
|
|
8
|
+
* cz: 'cz1',
|
|
9
|
+
* gg: 'gg1',
|
|
10
|
+
* cd: 'cd1',
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
3
13
|
declare const TableDemo: () => JSX.Element;
|
|
4
14
|
export default TableDemo;
|
|
@@ -17,7 +17,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
17
17
|
import React, { useEffect, useState, useCallback, useRef } from 'react';
|
|
18
18
|
import Table from 'components/Table';
|
|
19
19
|
import EnhanceSelect from 'components/EnhanceSelect';
|
|
20
|
-
import
|
|
20
|
+
import MaterialComp, {
|
|
21
|
+
// clearData,
|
|
22
|
+
clearDataFn,
|
|
23
|
+
// transformDataFn,
|
|
24
|
+
} from './TestCom';
|
|
21
25
|
import { DatePicker } from 'index';
|
|
22
26
|
import dayjs from 'dayjs';
|
|
23
27
|
import update from 'immutability-helper';
|
|
@@ -25,12 +29,31 @@ import update from 'immutability-helper';
|
|
|
25
29
|
function useGetTableRecords() {
|
|
26
30
|
// 表格数据
|
|
27
31
|
var _a = useState(Array.from({ length: 4 }).map(function (item, index) {
|
|
28
|
-
|
|
32
|
+
var newItem = {
|
|
29
33
|
id: "" + (index + 1),
|
|
30
34
|
test1: index + 1 + "-test1",
|
|
31
35
|
test2: index + 1 + "-test2",
|
|
32
36
|
test3: index + 1 + "-test3",
|
|
37
|
+
materialId: 1,
|
|
38
|
+
// brand: '123',
|
|
39
|
+
// brandId: '123',
|
|
40
|
+
// texture: 'HRB400E',
|
|
41
|
+
// textureId: 1,
|
|
42
|
+
// specification: 'Φ24mm*9m',
|
|
43
|
+
// specificationId: 1,
|
|
44
|
+
// placesteel: '萍钢',
|
|
45
|
+
// placesteelId: 1,
|
|
46
|
+
prefixBrand: '123',
|
|
47
|
+
prefixBrandId: '123',
|
|
48
|
+
prefixTexture: 'HRB400E',
|
|
49
|
+
prefixTextureId: 1,
|
|
50
|
+
prefixSpecification: 'Φ24mm*9m',
|
|
51
|
+
prefixSpecificationId: 1,
|
|
52
|
+
prefixPlacesteel: '萍钢',
|
|
53
|
+
prefixPlacesteelId: 1,
|
|
33
54
|
};
|
|
55
|
+
return newItem;
|
|
56
|
+
// return transformDataFn(newItem, { prefix: 'prefix' });
|
|
34
57
|
})), records = _a[0], setRecords = _a[1];
|
|
35
58
|
useEffect(function () {
|
|
36
59
|
console.log('开始远程获取表格数据!');
|
|
@@ -109,173 +132,305 @@ export var getTableLayoutFullData = function (columns, tableLayout) {
|
|
|
109
132
|
}
|
|
110
133
|
return columns;
|
|
111
134
|
};
|
|
135
|
+
// const list1 = [
|
|
136
|
+
// {
|
|
137
|
+
// id: '010101',
|
|
138
|
+
// name: '重轨',
|
|
139
|
+
// aboutField: {
|
|
140
|
+
// // 品名
|
|
141
|
+
// brand: {
|
|
142
|
+
// isRequired: 1, // 是否必填
|
|
143
|
+
// addonBefore: null, // 前置符
|
|
144
|
+
// addonAfter: null, // 后置符
|
|
145
|
+
// unit: null, // 单位
|
|
146
|
+
// connector: ' ', // 连接符
|
|
147
|
+
// },
|
|
148
|
+
// // 材质
|
|
149
|
+
// texture: {
|
|
150
|
+
// isRequired: 1, // 是否必填
|
|
151
|
+
// addonBefore: null, // 前置符
|
|
152
|
+
// addonAfter: null, // 后置符
|
|
153
|
+
// unit: null, // 单位
|
|
154
|
+
// connector: ' ', // 连接符
|
|
155
|
+
// },
|
|
156
|
+
// // 规格,一个产品层次可能对应多个规格
|
|
157
|
+
// specification: [
|
|
158
|
+
// {
|
|
159
|
+
// title: '单位重量',
|
|
160
|
+
// isRequired: 1, // 是否必填
|
|
161
|
+
// addonBefore: '$', // 前置符
|
|
162
|
+
// addonAfter: null, // 后置符
|
|
163
|
+
// unit: 'kg/m', // 单位
|
|
164
|
+
// connector: '*', // 连接符
|
|
165
|
+
// },
|
|
166
|
+
// {
|
|
167
|
+
// title: '长度',
|
|
168
|
+
// isRequired: 1, // 是否必填
|
|
169
|
+
// addonBefore: null, // 前置符
|
|
170
|
+
// addonAfter: null, // 后置符
|
|
171
|
+
// unit: 'm', // 单位
|
|
172
|
+
// connector: null, // 连接符
|
|
173
|
+
// },
|
|
174
|
+
// ],
|
|
175
|
+
// // 产地
|
|
176
|
+
// placesteel: {
|
|
177
|
+
// isRequired: 1, // 是否必填
|
|
178
|
+
// addonBefore: null, // 前置符
|
|
179
|
+
// addonAfter: null, // 后置符
|
|
180
|
+
// unit: null, // 单位
|
|
181
|
+
// connector: null, // 连接符
|
|
182
|
+
// },
|
|
183
|
+
// // 型号
|
|
184
|
+
// model: null,
|
|
185
|
+
// },
|
|
186
|
+
// },
|
|
187
|
+
// {
|
|
188
|
+
// id: '010102',
|
|
189
|
+
// name: '轻轨',
|
|
190
|
+
// aboutField: {
|
|
191
|
+
// // 品名
|
|
192
|
+
// brand: {
|
|
193
|
+
// isRequired: 1, // 是否必填
|
|
194
|
+
// addonBefore: null, // 前置符
|
|
195
|
+
// addonAfter: null, // 后置符
|
|
196
|
+
// unit: null, // 单位
|
|
197
|
+
// connector: ' ', // 连接符
|
|
198
|
+
// },
|
|
199
|
+
// // 材质
|
|
200
|
+
// texture: null,
|
|
201
|
+
// // 规格,一个产品层次可能对应多个规格
|
|
202
|
+
// specification: [
|
|
203
|
+
// {
|
|
204
|
+
// title: '单位重量',
|
|
205
|
+
// isRequired: 1, // 是否必填
|
|
206
|
+
// addonBefore: null, // 前置符
|
|
207
|
+
// addonAfter: null, // 后置符
|
|
208
|
+
// unit: 'kg/m', // 单位
|
|
209
|
+
// connector: '*', // 连接符
|
|
210
|
+
// },
|
|
211
|
+
// {
|
|
212
|
+
// title: '长度',
|
|
213
|
+
// isRequired: 1, // 是否必填
|
|
214
|
+
// addonBefore: null, // 前置符
|
|
215
|
+
// addonAfter: null, // 后置符
|
|
216
|
+
// unit: 'm', // 单位
|
|
217
|
+
// connector: null, // 连接符
|
|
218
|
+
// },
|
|
219
|
+
// ],
|
|
220
|
+
// // 产地
|
|
221
|
+
// placesteel: {
|
|
222
|
+
// isRequired: 1, // 是否必填
|
|
223
|
+
// addonBefore: null, // 前置符
|
|
224
|
+
// addonAfter: null, // 后置符
|
|
225
|
+
// unit: null, // 单位
|
|
226
|
+
// connector: null, // 连接符
|
|
227
|
+
// },
|
|
228
|
+
// // 型号
|
|
229
|
+
// model: null,
|
|
230
|
+
// },
|
|
231
|
+
// },
|
|
232
|
+
// {
|
|
233
|
+
// id: '010203',
|
|
234
|
+
// name: '角钢',
|
|
235
|
+
// aboutField: {
|
|
236
|
+
// // 品名
|
|
237
|
+
// brand: {
|
|
238
|
+
// isRequired: 1, // 是否必填
|
|
239
|
+
// addonBefore: null, // 前置符
|
|
240
|
+
// addonAfter: null, // 后置符
|
|
241
|
+
// unit: null, // 单位
|
|
242
|
+
// connector: ' ', // 连接符
|
|
243
|
+
// },
|
|
244
|
+
// // 材质
|
|
245
|
+
// texture: {
|
|
246
|
+
// isRequired: 1, // 是否必填
|
|
247
|
+
// addonBefore: null, // 前置符
|
|
248
|
+
// addonAfter: null, // 后置符
|
|
249
|
+
// unit: null, // 单位
|
|
250
|
+
// connector: null, // 连接符
|
|
251
|
+
// },
|
|
252
|
+
// // 规格,一个产品层次可能对应多个规格
|
|
253
|
+
// specification: [
|
|
254
|
+
// {
|
|
255
|
+
// title: '边宽度1',
|
|
256
|
+
// isRequired: 1, // 是否必填
|
|
257
|
+
// addonBefore: null, // 前置符
|
|
258
|
+
// addonAfter: null, // 后置符
|
|
259
|
+
// unit: null, // 单位
|
|
260
|
+
// connector: '*', // 连接符
|
|
261
|
+
// valueType: 'select',
|
|
262
|
+
// source: '/api/test/111',
|
|
263
|
+
// },
|
|
264
|
+
// {
|
|
265
|
+
// title: '边宽度2',
|
|
266
|
+
// isRequired: 1, // 是否必填
|
|
267
|
+
// addonBefore: null, // 前置符
|
|
268
|
+
// addonAfter: null, // 后置符
|
|
269
|
+
// unit: null, // 单位
|
|
270
|
+
// connector: '*', // 连接符
|
|
271
|
+
// },
|
|
272
|
+
// {
|
|
273
|
+
// title: '边厚度',
|
|
274
|
+
// isRequired: 1, // 是否必填
|
|
275
|
+
// addonBefore: null, // 前置符
|
|
276
|
+
// addonAfter: null, // 后置符
|
|
277
|
+
// unit: 'mm', // 单位
|
|
278
|
+
// connector: ' ', // 连接符
|
|
279
|
+
// },
|
|
280
|
+
// {
|
|
281
|
+
// title: '长度',
|
|
282
|
+
// isRequired: 1, // 是否必填
|
|
283
|
+
// addonBefore: null, // 前置符
|
|
284
|
+
// addonAfter: null, // 后置符
|
|
285
|
+
// unit: 'm', // 单位
|
|
286
|
+
// connector: '', // 连接符
|
|
287
|
+
// },
|
|
288
|
+
// ],
|
|
289
|
+
// // 产地
|
|
290
|
+
// placesteel: {
|
|
291
|
+
// isRequired: 1, // 是否必填
|
|
292
|
+
// addonBefore: null, // 前置符
|
|
293
|
+
// addonAfter: null, // 后置符
|
|
294
|
+
// unit: null, // 单位
|
|
295
|
+
// connector: ' ', // 连接符
|
|
296
|
+
// },
|
|
297
|
+
// // 型号
|
|
298
|
+
// model: null,
|
|
299
|
+
// },
|
|
300
|
+
// },
|
|
301
|
+
// ];
|
|
112
302
|
var list1 = [
|
|
113
303
|
{
|
|
114
|
-
id:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
// 产地
|
|
153
|
-
placesteel: {
|
|
154
|
-
isRequired: 1,
|
|
155
|
-
addonBefore: null,
|
|
156
|
-
addonAfter: null,
|
|
157
|
-
unit: null,
|
|
158
|
-
connector: null, // 连接符
|
|
159
|
-
},
|
|
160
|
-
// 型号
|
|
161
|
-
model: null,
|
|
162
|
-
},
|
|
304
|
+
id: 1,
|
|
305
|
+
createUser: null,
|
|
306
|
+
createDept: null,
|
|
307
|
+
createTime: null,
|
|
308
|
+
updateUser: null,
|
|
309
|
+
updateTime: null,
|
|
310
|
+
status: 50,
|
|
311
|
+
isDeleted: 0,
|
|
312
|
+
xid: null,
|
|
313
|
+
materialCode: '010301060000000001',
|
|
314
|
+
materialDesc: '螺纹钢 HRB400E',
|
|
315
|
+
productLevelId: 4,
|
|
316
|
+
productLevelCode: '010207',
|
|
317
|
+
productLevelName: '带肋钢筋',
|
|
318
|
+
brandId: 1,
|
|
319
|
+
brandName: '螺纹钢',
|
|
320
|
+
textureId: 1,
|
|
321
|
+
textureName: 'HRB400E',
|
|
322
|
+
specificationId: null,
|
|
323
|
+
specificationName: null,
|
|
324
|
+
productModel: null,
|
|
325
|
+
placesteelId: null,
|
|
326
|
+
placesteelName: null,
|
|
327
|
+
workmanship: null,
|
|
328
|
+
workmanshipId: null,
|
|
329
|
+
packingMethodId: null,
|
|
330
|
+
packingMethodName: null,
|
|
331
|
+
variety: null,
|
|
332
|
+
unitCode: 'T',
|
|
333
|
+
unitName: '吨',
|
|
334
|
+
trademarkId: null,
|
|
335
|
+
trademarkName: null,
|
|
336
|
+
strengthGrade: null,
|
|
337
|
+
purpose: null,
|
|
338
|
+
materialType: '1',
|
|
339
|
+
foreignTradeFlag: '1',
|
|
340
|
+
poUnitCode: 'T',
|
|
341
|
+
poUnitName: '吨',
|
|
163
342
|
},
|
|
164
343
|
{
|
|
165
|
-
id:
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
connector: null, // 连接符
|
|
204
|
-
},
|
|
205
|
-
// 型号
|
|
206
|
-
model: null,
|
|
207
|
-
},
|
|
344
|
+
id: 2,
|
|
345
|
+
createUser: null,
|
|
346
|
+
createDept: null,
|
|
347
|
+
createTime: '2022-03-16 16:00:39',
|
|
348
|
+
updateUser: null,
|
|
349
|
+
updateTime: '2022-03-16 16:00:43',
|
|
350
|
+
status: 50,
|
|
351
|
+
isDeleted: 0,
|
|
352
|
+
xid: null,
|
|
353
|
+
materialCode: '010301060000000002',
|
|
354
|
+
materialDesc: '螺纹钢 HRB300E',
|
|
355
|
+
productLevelId: 4,
|
|
356
|
+
productLevelCode: '010207',
|
|
357
|
+
productLevelName: '带肋钢筋',
|
|
358
|
+
brandId: 1,
|
|
359
|
+
brandName: '螺纹钢',
|
|
360
|
+
textureId: 2,
|
|
361
|
+
textureName: 'HRB300E',
|
|
362
|
+
specificationId: null,
|
|
363
|
+
specificationName: '',
|
|
364
|
+
productModel: '',
|
|
365
|
+
placesteelId: null,
|
|
366
|
+
placesteelName: '',
|
|
367
|
+
workmanship: '',
|
|
368
|
+
workmanshipId: null,
|
|
369
|
+
packingMethodId: null,
|
|
370
|
+
packingMethodName: '',
|
|
371
|
+
variety: '',
|
|
372
|
+
unitCode: 'T',
|
|
373
|
+
unitName: '吨',
|
|
374
|
+
trademarkId: null,
|
|
375
|
+
trademarkName: '',
|
|
376
|
+
strengthGrade: '',
|
|
377
|
+
purpose: '',
|
|
378
|
+
materialType: '1',
|
|
379
|
+
foreignTradeFlag: '1',
|
|
380
|
+
poUnitCode: 'T',
|
|
381
|
+
poUnitName: '吨',
|
|
208
382
|
},
|
|
209
383
|
{
|
|
210
|
-
id:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
title: '边厚度',
|
|
251
|
-
isRequired: 1,
|
|
252
|
-
addonBefore: null,
|
|
253
|
-
addonAfter: null,
|
|
254
|
-
unit: 'mm',
|
|
255
|
-
connector: ' ', // 连接符
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
title: '长度',
|
|
259
|
-
isRequired: 1,
|
|
260
|
-
addonBefore: null,
|
|
261
|
-
addonAfter: null,
|
|
262
|
-
unit: 'm',
|
|
263
|
-
connector: '', // 连接符
|
|
264
|
-
},
|
|
265
|
-
],
|
|
266
|
-
// 产地
|
|
267
|
-
placesteel: {
|
|
268
|
-
isRequired: 1,
|
|
269
|
-
addonBefore: null,
|
|
270
|
-
addonAfter: null,
|
|
271
|
-
unit: null,
|
|
272
|
-
connector: ' ', // 连接符
|
|
273
|
-
},
|
|
274
|
-
// 型号
|
|
275
|
-
model: null,
|
|
276
|
-
},
|
|
384
|
+
id: 3,
|
|
385
|
+
createUser: null,
|
|
386
|
+
createDept: null,
|
|
387
|
+
createTime: '2022-03-16 16:00:39',
|
|
388
|
+
updateUser: null,
|
|
389
|
+
updateTime: '2022-03-16 16:00:43',
|
|
390
|
+
status: 50,
|
|
391
|
+
isDeleted: 0,
|
|
392
|
+
xid: null,
|
|
393
|
+
materialCode: '010301060000000003',
|
|
394
|
+
materialDesc: '方钢品名1 HRB300E',
|
|
395
|
+
productLevelId: 5,
|
|
396
|
+
productLevelCode: '010208',
|
|
397
|
+
productLevelName: '方钢',
|
|
398
|
+
brandId: 3,
|
|
399
|
+
brandName: '方钢品名1',
|
|
400
|
+
textureId: 4,
|
|
401
|
+
textureName: 'HRB300E',
|
|
402
|
+
specificationId: null,
|
|
403
|
+
specificationName: '',
|
|
404
|
+
productModel: '',
|
|
405
|
+
placesteelId: null,
|
|
406
|
+
placesteelName: '',
|
|
407
|
+
workmanship: '',
|
|
408
|
+
workmanshipId: null,
|
|
409
|
+
packingMethodId: null,
|
|
410
|
+
packingMethodName: '',
|
|
411
|
+
variety: '',
|
|
412
|
+
unitCode: 'T',
|
|
413
|
+
unitName: '吨',
|
|
414
|
+
trademarkId: null,
|
|
415
|
+
trademarkName: '',
|
|
416
|
+
strengthGrade: '',
|
|
417
|
+
purpose: '',
|
|
418
|
+
materialType: '1',
|
|
419
|
+
foreignTradeFlag: '1',
|
|
420
|
+
poUnitCode: 'T',
|
|
421
|
+
poUnitName: '吨',
|
|
277
422
|
},
|
|
278
423
|
];
|
|
424
|
+
/**
|
|
425
|
+
* 详情拿到的数据,一般是这个样子的
|
|
426
|
+
* {
|
|
427
|
+
* cpcc: '1',
|
|
428
|
+
* pm: 'pm1',
|
|
429
|
+
* cz: 'cz1',
|
|
430
|
+
* gg: 'gg1',
|
|
431
|
+
* cd: 'cd1',
|
|
432
|
+
* }
|
|
433
|
+
*/
|
|
279
434
|
var TableDemo = function () {
|
|
280
435
|
var _a = useGetTableRecords(), records = _a.records, setRecords = _a.setRecords;
|
|
281
436
|
var _b = useGetSelectList(), list = _b.list, loading = _b.loading, setLoading = _b.setLoading;
|
|
@@ -305,12 +460,11 @@ var TableDemo = function () {
|
|
|
305
460
|
render: function (_text, _record, index) { return "" + (index + 1); },
|
|
306
461
|
},
|
|
307
462
|
{
|
|
308
|
-
title: '
|
|
463
|
+
title: '物料信息列表',
|
|
309
464
|
width: 100,
|
|
310
|
-
dataIndex: '
|
|
311
|
-
key: '
|
|
465
|
+
dataIndex: 'materialId',
|
|
466
|
+
key: 'materialId',
|
|
312
467
|
shouldCellUpdate: function (record, preRecord) {
|
|
313
|
-
console.log('key2render');
|
|
314
468
|
if (lengthChange) {
|
|
315
469
|
setLengthChange(false);
|
|
316
470
|
return true;
|
|
@@ -319,22 +473,18 @@ var TableDemo = function () {
|
|
|
319
473
|
setMoveChange(false);
|
|
320
474
|
return true;
|
|
321
475
|
}
|
|
322
|
-
return record.
|
|
476
|
+
return record.materialId !== preRecord.materialId;
|
|
323
477
|
},
|
|
324
478
|
render: function (text, record, index) {
|
|
325
|
-
return (React.createElement(EnhanceSelect, { value: text, list: list1, dataKey: "id", titleKey: "
|
|
326
|
-
var newRecord = {
|
|
327
|
-
key2: value,
|
|
328
|
-
key2Name: fullData === null || fullData === void 0 ? void 0 : fullData.name,
|
|
329
|
-
aboutField: fullData === null || fullData === void 0 ? void 0 : fullData.aboutField,
|
|
330
|
-
};
|
|
479
|
+
return (React.createElement(EnhanceSelect, { value: text, list: list1, dataKey: "id", titleKey: "materialDesc", dropdownMatchSelectWidth: 130, onChange: function (value, option, fullData) {
|
|
480
|
+
var newRecord = __assign({ materialId: value, materialDesc: fullData === null || fullData === void 0 ? void 0 : fullData.materialDesc }, clearDataFn({ prefix: 'prefix' }));
|
|
331
481
|
onEditableSaveHandle(newRecord, index);
|
|
332
482
|
} }));
|
|
333
483
|
},
|
|
334
484
|
},
|
|
335
485
|
{
|
|
336
486
|
title: '物料选择相关',
|
|
337
|
-
width:
|
|
487
|
+
width: 400,
|
|
338
488
|
dataIndex: 'key1',
|
|
339
489
|
key: 'key1',
|
|
340
490
|
shouldCellUpdate: function (record, preRecord) {
|
|
@@ -346,17 +496,15 @@ var TableDemo = function () {
|
|
|
346
496
|
setMoveChange(false);
|
|
347
497
|
return true;
|
|
348
498
|
}
|
|
349
|
-
return record.key1 !== preRecord.key1 ||
|
|
499
|
+
return (record.key1 !== preRecord.key1 ||
|
|
500
|
+
record.materialId !== preRecord.materialId);
|
|
350
501
|
},
|
|
351
502
|
render: function (text, record, index) {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
console.log(err);
|
|
358
|
-
}
|
|
359
|
-
return React.createElement(TestCom, { aboutField: aboutField, controleType: "hide" });
|
|
503
|
+
return (React.createElement(MaterialComp, { value: record, materialId: record.materialId, prefix: "prefix", onChange: function (value) {
|
|
504
|
+
console.log(value);
|
|
505
|
+
var newRecord = __assign({}, value);
|
|
506
|
+
onEditableSaveHandle(newRecord, index);
|
|
507
|
+
} }));
|
|
360
508
|
},
|
|
361
509
|
},
|
|
362
510
|
{
|
|
@@ -556,10 +704,7 @@ var TableDemo = function () {
|
|
|
556
704
|
var onAddAndDelHandle = useCallback(function (type, index) {
|
|
557
705
|
var newRecords = recordsRef.current.slice();
|
|
558
706
|
if (type === 'add') {
|
|
559
|
-
var newItem = {
|
|
560
|
-
_isNewData: true,
|
|
561
|
-
id: Date.now() + "-" + index,
|
|
562
|
-
};
|
|
707
|
+
var newItem = __assign(__assign({}, newRecords[index]), { _isNewData: true, id: Date.now() + "-" + index });
|
|
563
708
|
newRecords.splice(index + 1, 0, newItem);
|
|
564
709
|
setRecords(newRecords);
|
|
565
710
|
setLengthChange(true);
|