ztxkui 4.2.18-106 → 4.2.18-107

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.
@@ -7,6 +7,11 @@ import React, { useState } from 'react';
7
7
  // redux
8
8
  // ztxkui公共组件
9
9
  import { Table } from '../index';
10
+ // 路由配置
11
+ // store
12
+ // 自定义组件
13
+ // 其他文件
14
+ import { hrData } from './data';
10
15
  var dataObj = {
11
16
  1: [
12
17
  { id: 1, test1: '1', test2: '2', test3: '3', test4: '4' },
@@ -143,6 +148,128 @@ var BasicTable = function (_a) {
143
148
  key: 'test10',
144
149
  },
145
150
  ];
151
+ var columns1 = [
152
+ {
153
+ title: '序',
154
+ width: 80,
155
+ fixed: 'left',
156
+ align: 'center',
157
+ render: function (text, record, index) { return "" + (index + 1); },
158
+ },
159
+ {
160
+ title: '一级单位',
161
+ dataIndex: 'firstDepName',
162
+ key: 'firstDepName',
163
+ width: 110,
164
+ fixed: 'left',
165
+ },
166
+ {
167
+ title: '开票公司',
168
+ dataIndex: 'invoicingCompanyName',
169
+ key: 'invoicingCompanyName',
170
+ width: 200,
171
+ fixed: 'left',
172
+ },
173
+ {
174
+ title: '员工工号',
175
+ dataIndex: 'workCode',
176
+ key: 'workCode',
177
+ width: 100,
178
+ align: 'center',
179
+ fixed: 'left',
180
+ },
181
+ {
182
+ title: '姓名',
183
+ dataIndex: 'empName',
184
+ key: 'empName',
185
+ width: 80,
186
+ fixed: 'left',
187
+ align: 'center',
188
+ },
189
+ {
190
+ title: '身份证号',
191
+ dataIndex: 'idNumber',
192
+ key: 'idNumber',
193
+ width: 150,
194
+ align: 'center',
195
+ },
196
+ {
197
+ title: '性别',
198
+ dataIndex: 'sexName',
199
+ key: 'sexName',
200
+ width: 60,
201
+ align: 'center',
202
+ },
203
+ {
204
+ title: '年度',
205
+ dataIndex: 'year',
206
+ key: 'year',
207
+ width: 80,
208
+ align: 'center',
209
+ render: function (text) { return (text ? text + "\u5E74" : '— —'); },
210
+ },
211
+ {
212
+ title: '年化人数',
213
+ dataIndex: 'annualCount',
214
+ key: 'annualCount',
215
+ width: 80,
216
+ align: 'center',
217
+ },
218
+ {
219
+ title: '是否新参加',
220
+ dataIndex: 'isNewJoinName',
221
+ key: 'isNewJoinName',
222
+ width: 90,
223
+ align: 'center',
224
+ },
225
+ {
226
+ title: '企业年金缴费基数',
227
+ dataIndex: 'baseAmount',
228
+ key: 'baseAmount',
229
+ width: 130,
230
+ align: 'center',
231
+ },
232
+ {
233
+ title: '公司缴费',
234
+ dataIndex: 'companyPayment',
235
+ key: 'companyPayment',
236
+ width: 120,
237
+ },
238
+ {
239
+ title: '个人缴费',
240
+ dataIndex: 'personalPayment',
241
+ key: 'personalPayment',
242
+ width: 120,
243
+ },
244
+ {
245
+ title: '合计',
246
+ dataIndex: 'totalAmount',
247
+ key: 'totalAmount',
248
+ width: 120,
249
+ },
250
+ {
251
+ title: '备注',
252
+ dataIndex: 'remark',
253
+ key: 'remark',
254
+ width: 280,
255
+ },
256
+ {
257
+ title: '更新人',
258
+ dataIndex: 'updateUserName',
259
+ key: 'updateUserName',
260
+ width: 100,
261
+ align: 'center',
262
+ render: function (text) { return text || '— —'; },
263
+ },
264
+ {
265
+ title: '更新时间',
266
+ dataIndex: 'updateTime',
267
+ key: 'updateTime',
268
+ width: 160,
269
+ align: 'center',
270
+ render: function (text) { return text || '— —'; },
271
+ },
272
+ ];
146
273
  return (React.createElement("div", null,
147
274
  React.createElement("div", null,
148
275
  i18next.t('基础展示表格;'),
@@ -165,6 +292,6 @@ var BasicTable = function (_a) {
165
292
  } },
166
293
  i18next.t('--切换数据'),
167
294
  i),
168
- React.createElement(Table, { dataSource: data, columns: columns, rowKey: "id", scroll: { x: 400, y: 300 }, isOpenVirtualScrollBar: true })));
295
+ React.createElement(Table, { dataSource: hrData, columns: columns1, rowKey: "id", scroll: { x: 400, y: 300 }, isOpenVirtualScrollBar: true })));
169
296
  };
170
297
  export default BasicTable;
@@ -234,6 +234,44 @@ var EditableTable = function () {
234
234
  key: 'index',
235
235
  render: function (_text, _record, index) { return "" + (index + 1); },
236
236
  },
237
+ {
238
+ title: i18next.t('测试3'),
239
+ width: 100,
240
+ dataIndex: 'test3',
241
+ key: 'test3',
242
+ fixed: 'left',
243
+ shouldCellUpdate: function (record, preRecord) {
244
+ if (lengthChange) {
245
+ setLengthChange(false);
246
+ return true;
247
+ }
248
+ if (moveChange) {
249
+ setMoveChange(false);
250
+ return true;
251
+ }
252
+ return record.test3 !== preRecord.test3;
253
+ },
254
+ validate: {},
255
+ render: function (text, record, index) {
256
+ return (React.createElement(EnhanceSelect, { value: text, list: list1, dataKey: "id", titleKey: "name", dropdownMatchSelectWidth: 130, onChange: function (value, option, fullData) {
257
+ var _a, _b;
258
+ tableHandleRef.current.clearErrorClass(index);
259
+ var newRecord = {
260
+ test3: value,
261
+ test3Name: fullData === null || fullData === void 0 ? void 0 : fullData.name,
262
+ };
263
+ var realyIndex = (_b = (_a = tableHandleRef.current) === null || _a === void 0 ? void 0 : _a.getRealyIndex) === null || _b === void 0 ? void 0 : _b.call(_a, index);
264
+ onEditableSaveHandle(newRecord, realyIndex);
265
+ } }));
266
+ },
267
+ },
268
+ {
269
+ title: i18next.t('测试4'),
270
+ width: 100,
271
+ dataIndex: 'test4',
272
+ key: 'test4',
273
+ fixed: 'left',
274
+ },
237
275
  {
238
276
  title: i18next.t('测试1'),
239
277
  width: 400,
@@ -243,6 +281,7 @@ var EditableTable = function () {
243
281
  editableConfig: {
244
282
  type: 'textArea',
245
283
  maxLength: 100,
284
+ showCount: true,
246
285
  },
247
286
  showCopy: true,
248
287
  validate: {},
@@ -365,42 +404,6 @@ var EditableTable = function () {
365
404
  return React.createElement("div", null, toThousand(exactRound(value || 0, 2)));
366
405
  },
367
406
  },
368
- {
369
- title: i18next.t('测试3'),
370
- width: 100,
371
- dataIndex: 'test3',
372
- key: 'test3',
373
- shouldCellUpdate: function (record, preRecord) {
374
- if (lengthChange) {
375
- setLengthChange(false);
376
- return true;
377
- }
378
- if (moveChange) {
379
- setMoveChange(false);
380
- return true;
381
- }
382
- return record.test3 !== preRecord.test3;
383
- },
384
- validate: {},
385
- render: function (text, record, index) {
386
- return (React.createElement(EnhanceSelect, { value: text, list: list1, dataKey: "id", titleKey: "name", dropdownMatchSelectWidth: 130, onChange: function (value, option, fullData) {
387
- var _a, _b;
388
- tableHandleRef.current.clearErrorClass(index);
389
- var newRecord = {
390
- test3: value,
391
- test3Name: fullData === null || fullData === void 0 ? void 0 : fullData.name,
392
- };
393
- var realyIndex = (_b = (_a = tableHandleRef.current) === null || _a === void 0 ? void 0 : _a.getRealyIndex) === null || _b === void 0 ? void 0 : _b.call(_a, index);
394
- onEditableSaveHandle(newRecord, realyIndex);
395
- } }));
396
- },
397
- },
398
- {
399
- title: i18next.t('测试4'),
400
- width: 100,
401
- dataIndex: 'test4',
402
- key: 'test4',
403
- },
404
407
  {
405
408
  title: i18next.t('测试5'),
406
409
  // width: 100,
@@ -32,3 +32,37 @@ export declare const list1: {
32
32
  name: string;
33
33
  id: string;
34
34
  }[];
35
+ export declare const hrData: {
36
+ id: string;
37
+ createUser: string;
38
+ createDept: string;
39
+ createTime: string;
40
+ updateUser: string;
41
+ updateTime: string;
42
+ status: number;
43
+ isDeleted: number;
44
+ xid: any;
45
+ empId: string;
46
+ workCode: string;
47
+ empName: string;
48
+ year: string;
49
+ officeId: string;
50
+ officeName: string;
51
+ firstDepId: string;
52
+ firstDepName: string;
53
+ annualCount: string;
54
+ isNewJoin: number;
55
+ baseAmount: string;
56
+ companyPayment: string;
57
+ personalPayment: string;
58
+ invoicingCompany: string;
59
+ remark: string;
60
+ invoicingCompanyName: string;
61
+ idNumber: string;
62
+ isNewJoinName: string;
63
+ sex: string;
64
+ sexName: string;
65
+ totalAmount: string;
66
+ updateUserName: string;
67
+ scId: string;
68
+ }[];
@@ -90,3 +90,379 @@ export var list1 = [
90
90
  id: 'test3-9',
91
91
  },
92
92
  ];
93
+ export var hrData = [
94
+ {
95
+ id: '2172276398885249032',
96
+ createUser: '1517082745910132738',
97
+ createDept: '381761329295575035',
98
+ createTime: '2026-09-17 09:38:19',
99
+ updateUser: '1517082745910132738',
100
+ updateTime: '2026-09-17 09:38:19',
101
+ status: 1,
102
+ isDeleted: 0,
103
+ xid: null,
104
+ empId: '1462407033135728412',
105
+ workCode: '10002696',
106
+ empName: '曹翰',
107
+ year: '2025',
108
+ officeId: '1457527765918515203',
109
+ officeName: '浙商中拓职能部室',
110
+ firstDepId: '1457527765918515208',
111
+ firstDepName: '人力资源部(机构改革办公室)',
112
+ annualCount: '0.91',
113
+ isNewJoin: 2,
114
+ baseAmount: '4000.00',
115
+ companyPayment: '1000.00',
116
+ personalPayment: '500.00',
117
+ invoicingCompany: 'K000',
118
+ remark: null,
119
+ invoicingCompanyName: '浙商中拓集团股份有限公司',
120
+ idNumber: '462407033135728412',
121
+ isNewJoinName: '是',
122
+ sex: '1',
123
+ sexName: '男',
124
+ totalAmount: '1500.00',
125
+ updateUserName: '杨辉',
126
+ scId: '1553910554926944258',
127
+ },
128
+ {
129
+ id: '2172276398885249033',
130
+ createUser: '1517082745910132738',
131
+ createDept: '381761329295575035',
132
+ createTime: '2026-09-17 09:38:19',
133
+ updateUser: '1517082745910132738',
134
+ updateTime: '2026-09-17 09:38:19',
135
+ status: 1,
136
+ isDeleted: 0,
137
+ xid: null,
138
+ empId: '1462407033135727018',
139
+ workCode: '00136267',
140
+ empName: '杨海琴',
141
+ year: '2025',
142
+ officeId: '1457527765918515203',
143
+ officeName: '浙商中拓职能部室',
144
+ firstDepId: '1457527765918515208',
145
+ firstDepName: '人力资源部(机构改革办公室)',
146
+ annualCount: '1.00',
147
+ isNewJoin: 2,
148
+ baseAmount: '8989.00',
149
+ companyPayment: '676.00',
150
+ personalPayment: '2.00',
151
+ invoicingCompany: 'K000',
152
+ remark: '这是一个测试备注数据这是一个测试备注数据这是一个测试备注数据这是一个测试备注数据这是一个测试备注数据这是一个测试备注数据这是一个测试备注数据这是一个测试备注数据这是一个测试备注数据这是一个测试备注数据',
153
+ invoicingCompanyName: '浙商中拓集团股份有限公司',
154
+ idNumber: '462407033135727018',
155
+ isNewJoinName: '是',
156
+ sex: '2',
157
+ sexName: '女',
158
+ totalAmount: '678.00',
159
+ updateUserName: '杨辉',
160
+ scId: '1553910554926944258',
161
+ },
162
+ {
163
+ id: '2172276398885249034',
164
+ createUser: '1517082745910132738',
165
+ createDept: '381761329295575035',
166
+ createTime: '2026-09-17 09:38:19',
167
+ updateUser: '1517082745910132738',
168
+ updateTime: '2026-09-17 09:38:19',
169
+ status: 1,
170
+ isDeleted: 0,
171
+ xid: null,
172
+ empId: '1462407033135728573',
173
+ workCode: '10002930',
174
+ empName: '朱晓东',
175
+ year: '2025',
176
+ officeId: '1457527765918515203',
177
+ officeName: '浙商中拓职能部室',
178
+ firstDepId: '1457527765918515208',
179
+ firstDepName: '人力资源部(机构改革办公室)',
180
+ annualCount: '0.00',
181
+ isNewJoin: 2,
182
+ baseAmount: '10000.00',
183
+ companyPayment: '1000.00',
184
+ personalPayment: '500.00',
185
+ invoicingCompany: 'K000',
186
+ remark: null,
187
+ invoicingCompanyName: '浙商中拓集团股份有限公司',
188
+ idNumber: '462407033135728573',
189
+ isNewJoinName: '是',
190
+ sex: '1',
191
+ sexName: '男',
192
+ totalAmount: '1500.00',
193
+ updateUserName: '杨辉',
194
+ scId: '1553910554926944258',
195
+ },
196
+ {
197
+ id: '1791244458154009332',
198
+ createUser: '1462749618414104578',
199
+ createDept: '1514843300834004994',
200
+ createTime: '2026-05-11 11:30:01',
201
+ updateUser: '1517082745910132738',
202
+ updateTime: '2026-09-17 09:38:19',
203
+ status: 1,
204
+ isDeleted: 0,
205
+ xid: null,
206
+ empId: '1462407033135727161',
207
+ workCode: '00139725',
208
+ empName: '聂将军',
209
+ year: '2025',
210
+ officeId: '1457527765918515203',
211
+ officeName: '浙商中拓职能部室',
212
+ firstDepId: '1457527765918515208',
213
+ firstDepName: '人力资源部(机构改革办公室)',
214
+ annualCount: '0.68',
215
+ isNewJoin: 2,
216
+ baseAmount: '10000.00',
217
+ companyPayment: '1000.00',
218
+ personalPayment: '500.00',
219
+ invoicingCompany: 'K000',
220
+ remark: '1212\n换行',
221
+ invoicingCompanyName: '浙商中拓集团股份有限公司',
222
+ idNumber: '462407033135727161',
223
+ isNewJoinName: '是',
224
+ sex: '1',
225
+ sexName: '男',
226
+ totalAmount: '1500.00',
227
+ updateUserName: '杨辉',
228
+ scId: '1553910554926944258',
229
+ },
230
+ {
231
+ id: '1714784453909946452',
232
+ createUser: '1517082745910132738',
233
+ createDept: '381761329295575035',
234
+ createTime: '2026-04-15 15:44:32',
235
+ updateUser: '1517082745910132738',
236
+ updateTime: '2026-09-10 19:51:26',
237
+ status: 1,
238
+ isDeleted: 0,
239
+ xid: null,
240
+ empId: '1462407033135727263',
241
+ workCode: '00140433',
242
+ empName: '方启稳',
243
+ year: '2025',
244
+ officeId: '1457527765918515203',
245
+ officeName: '浙商中拓职能部室',
246
+ firstDepId: '1457527765918515208',
247
+ firstDepName: '人力资源部(机构改革办公室)',
248
+ annualCount: '1',
249
+ isNewJoin: 2,
250
+ baseAmount: '10000.00',
251
+ companyPayment: '1000.00',
252
+ personalPayment: '500.00',
253
+ invoicingCompany: 'K000',
254
+ remark: null,
255
+ invoicingCompanyName: '浙商中拓集团股份有限公司',
256
+ idNumber: '462407033135727263',
257
+ isNewJoinName: '是',
258
+ sex: '1',
259
+ sexName: '男',
260
+ totalAmount: '1500.00',
261
+ updateUserName: '杨辉',
262
+ scId: '1553910554926944258',
263
+ },
264
+ {
265
+ id: '2085434874569359360',
266
+ createUser: '1529631405760364511',
267
+ createDept: '1397081930328424449',
268
+ createTime: '2026-08-18 11:34:28',
269
+ updateUser: '1529631405760364511',
270
+ updateTime: '2026-08-18 11:34:28',
271
+ status: 1,
272
+ isDeleted: 0,
273
+ xid: null,
274
+ empId: '1462407033135728457',
275
+ workCode: '10002766',
276
+ empName: '彭贝贝',
277
+ year: '2025',
278
+ officeId: '1457527765918515330',
279
+ officeName: '浙商中拓国际事业部',
280
+ firstDepId: '1457527765918515332',
281
+ firstDepName: '国际拓展部',
282
+ annualCount: '1',
283
+ isNewJoin: 2,
284
+ baseAmount: '20000.00',
285
+ companyPayment: '198.00',
286
+ personalPayment: '250.00',
287
+ invoicingCompany: 'K000',
288
+ remark: null,
289
+ invoicingCompanyName: '浙商中拓集团股份有限公司',
290
+ idNumber: '610526198507136005',
291
+ isNewJoinName: '是',
292
+ sex: '2',
293
+ sexName: '女',
294
+ totalAmount: '448.00',
295
+ updateUserName: '黄政梁',
296
+ scId: '1553910554926944258',
297
+ },
298
+ {
299
+ id: '1714784453909946473',
300
+ createUser: '1462749618414104578',
301
+ createDept: '1514843300834004994',
302
+ createTime: '2026-04-15 15:59:58',
303
+ updateUser: '1462749618414104578',
304
+ updateTime: '2026-04-16 10:56:53',
305
+ status: 1,
306
+ isDeleted: 0,
307
+ xid: null,
308
+ empId: '1462407033135728278',
309
+ workCode: '10002472',
310
+ empName: '黄莎莎',
311
+ year: '2025',
312
+ officeId: '1457527765918515520',
313
+ officeName: '浙商中拓其他板块',
314
+ firstDepId: '1457527765918515535',
315
+ firstDepName: '中拓信科',
316
+ annualCount: '0',
317
+ isNewJoin: 2,
318
+ baseAmount: '3000',
319
+ companyPayment: '4000',
320
+ personalPayment: '0',
321
+ invoicingCompany: 'K150',
322
+ remark: null,
323
+ invoicingCompanyName: '湖南中拓信息科技有限公司',
324
+ idNumber: '462407033135728278',
325
+ isNewJoinName: '是',
326
+ sex: '2',
327
+ sexName: '女',
328
+ totalAmount: '4000',
329
+ updateUserName: '黄莎莎',
330
+ scId: '1553910554952110093',
331
+ },
332
+ {
333
+ id: '1791244458154009333',
334
+ createUser: '1462749618414104578',
335
+ createDept: '1514843300834004994',
336
+ createTime: '2026-05-11 11:31:07',
337
+ updateUser: '1462749618414104578',
338
+ updateTime: '2026-05-11 11:31:07',
339
+ status: 1,
340
+ isDeleted: 0,
341
+ xid: null,
342
+ empId: '1462407033135727294',
343
+ workCode: '00140548',
344
+ empName: '吴勤',
345
+ year: '2025',
346
+ officeId: '1457527765918515520',
347
+ officeName: '浙商中拓其他板块',
348
+ firstDepId: null,
349
+ firstDepName: '中拓信科',
350
+ annualCount: '1',
351
+ isNewJoin: 1,
352
+ baseAmount: '10000.00',
353
+ companyPayment: '1000.00',
354
+ personalPayment: '500.00',
355
+ invoicingCompany: 'K150',
356
+ remark: null,
357
+ invoicingCompanyName: '湖南中拓信息科技有限公司',
358
+ idNumber: '462407033135727294',
359
+ isNewJoinName: '否',
360
+ sex: '1',
361
+ sexName: '男',
362
+ totalAmount: '1500.00',
363
+ updateUserName: '黄莎莎',
364
+ scId: '1553910554952110093',
365
+ },
366
+ {
367
+ id: '2165598240133070940',
368
+ createUser: '1517082745910132738',
369
+ createDept: '381761329295575035',
370
+ createTime: '2026-09-15 09:17:59',
371
+ updateUser: '1517082745910132738',
372
+ updateTime: '2026-09-15 09:17:59',
373
+ status: 1,
374
+ isDeleted: 0,
375
+ xid: null,
376
+ empId: null,
377
+ workCode: null,
378
+ empName: '洪晓成',
379
+ year: '2025',
380
+ officeId: '1457527765918515202',
381
+ officeName: '股份公司领导',
382
+ firstDepId: '1494616732268539906',
383
+ firstDepName: '浙商中拓公司领导',
384
+ annualCount: '0.83',
385
+ isNewJoin: 2,
386
+ baseAmount: '40000.00',
387
+ companyPayment: '3200.00',
388
+ personalPayment: '800.00',
389
+ invoicingCompany: 'K000',
390
+ remark: null,
391
+ invoicingCompanyName: '浙商中拓集团股份有限公司',
392
+ idNumber: null,
393
+ isNewJoinName: '是',
394
+ sex: null,
395
+ sexName: null,
396
+ totalAmount: '4000.00',
397
+ updateUserName: '杨辉',
398
+ scId: '1553910554926944258',
399
+ },
400
+ {
401
+ id: '2154635559448002587',
402
+ createUser: '1517082745910132738',
403
+ createDept: '381761329295575035',
404
+ createTime: '2026-09-10 19:55:03',
405
+ updateUser: '1517082745910132738',
406
+ updateTime: '2026-09-10 19:55:03',
407
+ status: 1,
408
+ isDeleted: 0,
409
+ xid: null,
410
+ empId: '1462407033135727263',
411
+ workCode: '00140433',
412
+ empName: '方启稳',
413
+ year: '2024',
414
+ officeId: '1457527765918515203',
415
+ officeName: '浙商中拓职能部室',
416
+ firstDepId: '1457527765918515208',
417
+ firstDepName: '人资部',
418
+ annualCount: '1',
419
+ isNewJoin: 2,
420
+ baseAmount: '10000.00',
421
+ companyPayment: '1000.00',
422
+ personalPayment: '500.00',
423
+ invoicingCompany: 'K000',
424
+ remark: null,
425
+ invoicingCompanyName: '浙商中拓集团股份有限公司',
426
+ idNumber: '462407033135727263',
427
+ isNewJoinName: '是',
428
+ sex: '1',
429
+ sexName: '男',
430
+ totalAmount: '1500.00',
431
+ updateUserName: '杨辉',
432
+ scId: '1553910554926944258',
433
+ },
434
+ {
435
+ id: '1717076523337474519',
436
+ createUser: '1462749618414104578',
437
+ createDept: '1514843300834004994',
438
+ createTime: '2026-04-16 10:56:25',
439
+ updateUser: '1462749618414104578',
440
+ updateTime: '2026-04-16 10:56:53',
441
+ status: 1,
442
+ isDeleted: 0,
443
+ xid: null,
444
+ empId: '1493770817254313986',
445
+ workCode: '22021601',
446
+ empName: '校招1',
447
+ year: '2024',
448
+ officeId: '1457527765918515520',
449
+ officeName: '浙商中拓其他板块',
450
+ firstDepId: '1457527765918515535',
451
+ firstDepName: '中拓信科',
452
+ annualCount: '1',
453
+ isNewJoin: 2,
454
+ baseAmount: '1956.6',
455
+ companyPayment: '3097.7',
456
+ personalPayment: '0',
457
+ invoicingCompany: 'K150',
458
+ remark: null,
459
+ invoicingCompanyName: '湖南中拓信息科技有限公司',
460
+ idNumber: '493770817254313986',
461
+ isNewJoinName: '是',
462
+ sex: '1',
463
+ sexName: '男',
464
+ totalAmount: '3097.7',
465
+ updateUserName: '黄莎莎',
466
+ scId: '1553910554952110093',
467
+ },
468
+ ];
@@ -301,18 +301,34 @@ function Table(props) {
301
301
  onChange(null, null, { field: field_1, order: order }, null);
302
302
  return;
303
303
  }
304
+ // const handle = (a, b) => {
305
+ // const result = a[field] - b[field];
306
+ // if (!isNaN(result)) {
307
+ // return result;
308
+ // }
309
+ // if (a[field] < b[field]) {
310
+ // return -1;
311
+ // } else if (a[field] > b[field]) {
312
+ // return 1;
313
+ // }
314
+ // return 0;
315
+ // };
304
316
  var handle_1 = function (a, b) {
305
- var result = a[field_1] - b[field_1];
306
- if (!isNaN(result)) {
307
- return result;
308
- }
309
- if (a[field_1] < b[field_1]) {
310
- return -1;
311
- }
312
- else if (a[field_1] > b[field_1]) {
317
+ var va = a[field_1];
318
+ var vb = b[field_1];
319
+ // 空值统一沉底(降序取反后会浮到最前,若要求“始终沉底”需在外层单独处理)
320
+ if (va == null && vb == null)
321
+ return 0;
322
+ if (va == null)
313
323
  return 1;
324
+ if (vb == null)
325
+ return -1;
326
+ var na = Number(va);
327
+ var nb = Number(vb);
328
+ if (va !== '' && vb !== '' && !isNaN(na) && !isNaN(nb)) {
329
+ return na - nb; // 数字(含数字字符串)
314
330
  }
315
- return 0;
331
+ return String(va).localeCompare(String(vb), 'zh-CN'); // 中文拼音序
316
332
  };
317
333
  if (order === 'ascend') {
318
334
  setSortDataSource(expandableDataSource.slice().sort(function (a, b) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "4.2.18-106",
3
+ "version": "4.2.18-107",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",