@bit-sun/business-component 4.2.1-alpha.7-longya → 4.2.1-alpha.8
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/.claude/settings.local.json +8 -0
- package/dist/components/Functional/SearchSelect/pagination.d.ts +3 -3
- package/dist/index.esm.js +416 -953
- package/dist/index.js +415 -952
- package/docs/error-record.md +0 -9
- package/package.json +1 -1
- package/src/components/Business/AddSelectBusiness/index.tsx +8 -124
- package/src/components/Business/SearchSelect/BusinessUtils.tsx +12 -106
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +1 -1
- package/src/components/Functional/AddSelect/helps.ts +0 -2
- package/src/components/Functional/AddSelect/index.less +0 -17
- package/src/components/Functional/AddSelect/index.tsx +9 -66
- package/src/components/Functional/SearchSelect/index.less +0 -16
- package/src/components/Functional/SearchSelect/index.md +2 -0
- package/src/components/Functional/SearchSelect/index.tsx +65 -77
- package/src/components/Functional/SearchSelect/pagination.ts +4 -4
- package/src/components/Solution/RuleComponent/ruleFiled.js +155 -176
- package/dist/components/Functional/QueryAutoComplete/buildOptions.d.ts +0 -3
- package/dist/components/Functional/QueryAutoComplete/buildOptions.test.d.ts +0 -1
- package/dist/components/Functional/QueryAutoComplete/index.d.ts +0 -23
- package/dist/components/Functional/SearchSelect/currentPageFilter.d.ts +0 -41
- package/docs/superpowers/plans/2026-10-12-IKJX29-sku-name-autocomplete.md +0 -489
- package/docs/superpowers/specs/2026-10-12-IKJX29-sku-name-autocomplete-design.md +0 -115
- package/src/components/Functional/QueryAutoComplete/buildOptions.test.ts +0 -22
- package/src/components/Functional/QueryAutoComplete/buildOptions.ts +0 -17
- package/src/components/Functional/QueryAutoComplete/index.tsx +0 -140
- package/src/components/Functional/SearchSelect/currentPageFilter.ts +0 -135
package/docs/error-record.md
CHANGED
|
@@ -50,12 +50,3 @@
|
|
|
50
50
|
- 原因:当前 `distribution-front` 本地依赖环境没有生成 `umi-test` 可执行文件。
|
|
51
51
|
- 处理:不下载或改动依赖,改为执行与目标测试一致的源码静态断言,并确认旧服务适配引用已清零。
|
|
52
52
|
- 后续规则:消费端依赖未完整安装时,不宣称测试套件通过;应明确区分正式测试结果和等价静态验证结果。
|
|
53
|
-
|
|
54
|
-
## 2026-08-19 SKU 选择器多值查询
|
|
55
|
-
|
|
56
|
-
### 测试断言残留旧参数转换方案
|
|
57
|
-
|
|
58
|
-
- 现象:提交前复跑 SKU 选择器测试时,多值查询转换断言失败。
|
|
59
|
-
- 原因:查询配置已直接切换为批量参数,测试和任务记录仍保留单值精确参数转批量参数的旧方案。
|
|
60
|
-
- 修正:删除不再使用的转换断言,按两个弹窗当前的批量查询参数更新任务记录。
|
|
61
|
-
- 后续规则:查询参数方案调整后必须重新读取最终配置并复跑测试,禁止沿用中间方案的断言和完成记录。
|
package/package.json
CHANGED
|
@@ -13,7 +13,6 @@ import { tableColumnsImage } from '@/components/Business/BsSulaQueryTable/utils'
|
|
|
13
13
|
import { getSkuImg } from '@/utils/TableUtils';
|
|
14
14
|
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
15
15
|
import { getEmployeeId } from '@/utils/LocalstorageUtils';
|
|
16
|
-
import { SEARCH_SELECT_MODAL_PAGE_SIZE_OPTIONS, SEARCH_SELECT_MODAL_DEFAULT_PAGE_SIZE } from '@/components/Functional/SearchSelect/pagination';
|
|
17
16
|
// import { getCurrentTargetBgId } from '@/utils/LocalstorageUtils';
|
|
18
17
|
|
|
19
18
|
function handleSelectColumn(c: any, parentProps: any) {
|
|
@@ -153,46 +152,17 @@ export const AddSkuSelect = (parProps: any) => {
|
|
|
153
152
|
]),
|
|
154
153
|
{
|
|
155
154
|
title: 'SKU名称',
|
|
156
|
-
width:
|
|
155
|
+
width: 200,
|
|
157
156
|
ellipsis: {
|
|
158
157
|
showTitle: false,
|
|
159
158
|
},
|
|
160
159
|
render: (text: any) => (
|
|
161
160
|
<Tooltip placement="topLeft" title={text}>
|
|
162
|
-
|
|
163
|
-
style={{
|
|
164
|
-
display: 'block',
|
|
165
|
-
overflow: 'hidden',
|
|
166
|
-
textOverflow: 'ellipsis',
|
|
167
|
-
whiteSpace: 'nowrap',
|
|
168
|
-
}}
|
|
169
|
-
>
|
|
170
|
-
{text}
|
|
171
|
-
</span>
|
|
161
|
+
{text}
|
|
172
162
|
</Tooltip>
|
|
173
163
|
),
|
|
174
164
|
dataIndex: 'name',
|
|
175
165
|
},
|
|
176
|
-
{
|
|
177
|
-
title: '龙牙款号',
|
|
178
|
-
width: 150,
|
|
179
|
-
dataIndex: 'longyaStyleCode',
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
title: '龙牙品号',
|
|
183
|
-
width: 150,
|
|
184
|
-
dataIndex: 'longyaPinCode',
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
title: '颜色名称',
|
|
188
|
-
width: 140,
|
|
189
|
-
dataIndex: 'colorName',
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
title: '尺码名称',
|
|
193
|
-
width: 140,
|
|
194
|
-
dataIndex: 'sizeName',
|
|
195
|
-
},
|
|
196
166
|
{
|
|
197
167
|
title: '图片',
|
|
198
168
|
dataIndex: 'itemUrl',
|
|
@@ -267,46 +237,17 @@ export const AddSkuSelect = (parProps: any) => {
|
|
|
267
237
|
},
|
|
268
238
|
{
|
|
269
239
|
title: 'SKU名称',
|
|
270
|
-
width:
|
|
240
|
+
width: 200,
|
|
271
241
|
ellipsis: {
|
|
272
242
|
showTitle: false,
|
|
273
243
|
},
|
|
274
244
|
render: (text: any) => (
|
|
275
245
|
<Tooltip placement="topLeft" title={text}>
|
|
276
|
-
|
|
277
|
-
style={{
|
|
278
|
-
display: 'block',
|
|
279
|
-
overflow: 'hidden',
|
|
280
|
-
textOverflow: 'ellipsis',
|
|
281
|
-
whiteSpace: 'nowrap',
|
|
282
|
-
}}
|
|
283
|
-
>
|
|
284
|
-
{text}
|
|
285
|
-
</span>
|
|
246
|
+
{text}
|
|
286
247
|
</Tooltip>
|
|
287
248
|
),
|
|
288
249
|
dataIndex: 'name',
|
|
289
250
|
},
|
|
290
|
-
{
|
|
291
|
-
title: '龙牙款号',
|
|
292
|
-
width: 150,
|
|
293
|
-
dataIndex: 'longyaStyleCode',
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
title: '龙牙品号',
|
|
297
|
-
width: 150,
|
|
298
|
-
dataIndex: 'longyaPinCode',
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
title: '颜色名称',
|
|
302
|
-
width: 140,
|
|
303
|
-
dataIndex: 'colorName',
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
title: '尺码名称',
|
|
307
|
-
width: 140,
|
|
308
|
-
dataIndex: 'sizeName',
|
|
309
|
-
},
|
|
310
251
|
{
|
|
311
252
|
title: '图片',
|
|
312
253
|
dataIndex: 'itemUrl',
|
|
@@ -438,54 +379,7 @@ export const AddSkuSelect = (parProps: any) => {
|
|
|
438
379
|
name: 'qp-skuCode-like', label: 'SKU编码',type:'multipleQueryInput'
|
|
439
380
|
},
|
|
440
381
|
{ name: 'qp-itemCode-like', label: '款号(SPU)', type: 'multipleQueryInput', },
|
|
441
|
-
{
|
|
442
|
-
name: 'qp-skuName-like',
|
|
443
|
-
label: 'SKU名称',
|
|
444
|
-
type: 'autoComplete',
|
|
445
|
-
field: {
|
|
446
|
-
type: 'autoComplete',
|
|
447
|
-
props: {
|
|
448
|
-
requestConfig: {
|
|
449
|
-
url: '/items/sku/pager/v2',
|
|
450
|
-
otherParams: {
|
|
451
|
-
'qp-combination-eq': false,
|
|
452
|
-
'qp-approveStatus-eq': 1,
|
|
453
|
-
'qp-status-eq': 1,
|
|
454
|
-
...(parProps?.requestConfig?.addOtherParams || {}),
|
|
455
|
-
},
|
|
456
|
-
mappingTextField: 'name',
|
|
457
|
-
pageSize: 50,
|
|
458
|
-
debounceWait: 300,
|
|
459
|
-
likeParamName: 'qp-skuName-like',
|
|
460
|
-
},
|
|
461
|
-
},
|
|
462
|
-
},
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
name: 'qp-itemName-like',
|
|
466
|
-
label: '商品名称',
|
|
467
|
-
type: 'autoComplete',
|
|
468
|
-
field: {
|
|
469
|
-
type: 'autoComplete',
|
|
470
|
-
props: {
|
|
471
|
-
requestConfig: {
|
|
472
|
-
url: '/items/sku/pager/v2',
|
|
473
|
-
otherParams: {
|
|
474
|
-
'qp-combination-eq': false,
|
|
475
|
-
'qp-approveStatus-eq': 1,
|
|
476
|
-
'qp-status-eq': 1,
|
|
477
|
-
...(parProps?.requestConfig?.addOtherParams || {}),
|
|
478
|
-
},
|
|
479
|
-
mappingTextField: 'itemName',
|
|
480
|
-
pageSize: 50,
|
|
481
|
-
debounceWait: 300,
|
|
482
|
-
likeParamName: 'qp-itemName-like',
|
|
483
|
-
},
|
|
484
|
-
},
|
|
485
|
-
},
|
|
486
|
-
},
|
|
487
|
-
{ name: 'qp-longyaStyleCode-in', label: '龙牙款号', type: 'multipleQueryInput' },
|
|
488
|
-
{ name: 'qp-longyaPinCode-in', label: '龙牙品号', type: 'multipleQueryInput' },
|
|
382
|
+
{ name: 'qp-skuName-like', label: 'SKU名称' },
|
|
489
383
|
{ name: 'qp-externalCode-like', label: '外部SPU编码' },
|
|
490
384
|
...(isNoUseItemBarcode ? []: [
|
|
491
385
|
{ name: 'qp-code-in', label: '商品条码', field: {
|
|
@@ -539,7 +433,7 @@ export const AddSkuSelect = (parProps: any) => {
|
|
|
539
433
|
'ctl-withAuth': true
|
|
540
434
|
},
|
|
541
435
|
resType: 'list',
|
|
542
|
-
resPosition:
|
|
436
|
+
resPosition: isNoUseItemBarcode ? 4 : 5,
|
|
543
437
|
resKeyValue: ['id','name']
|
|
544
438
|
},
|
|
545
439
|
{
|
|
@@ -549,15 +443,10 @@ export const AddSkuSelect = (parProps: any) => {
|
|
|
549
443
|
currentPage: 1,
|
|
550
444
|
},
|
|
551
445
|
resType: 'treeList',
|
|
552
|
-
resPosition:
|
|
446
|
+
resPosition: isNoUseItemBarcode ? 5 : 6
|
|
553
447
|
},
|
|
554
448
|
]
|
|
555
449
|
const mTpPromiseLoadList = handleFormSearchSourceLoad(initialPromiseLoadList, parProps);
|
|
556
|
-
const topTablePagination = parProps?.pagination || {};
|
|
557
|
-
const pageSizeOptions = Array.from(new Set([
|
|
558
|
-
...SEARCH_SELECT_MODAL_PAGE_SIZE_OPTIONS,
|
|
559
|
-
...(topTablePagination.pageSizeOptions || []),
|
|
560
|
-
].map((option) => String(option)))).sort((left, right) => Number(left) - Number(right));
|
|
561
450
|
|
|
562
451
|
const props = {
|
|
563
452
|
buttonText: parProps.buttonText || '新增',
|
|
@@ -597,12 +486,7 @@ export const AddSkuSelect = (parProps: any) => {
|
|
|
597
486
|
tableColumns: mTpTableColumn,
|
|
598
487
|
selectColumn: mTpSelectColumn,
|
|
599
488
|
promiseLoadList: mTpPromiseLoadList,
|
|
600
|
-
topTablePagination: {
|
|
601
|
-
...topTablePagination,
|
|
602
|
-
pageSize: topTablePagination.pageSize ?? SEARCH_SELECT_MODAL_DEFAULT_PAGE_SIZE,
|
|
603
|
-
showSizeChanger: topTablePagination.showSizeChanger ?? true,
|
|
604
|
-
pageSizeOptions,
|
|
605
|
-
},
|
|
489
|
+
topTablePagination: parProps?.pagination || {},
|
|
606
490
|
}
|
|
607
491
|
|
|
608
492
|
return (
|
|
@@ -378,50 +378,7 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
378
378
|
},
|
|
379
379
|
}
|
|
380
380
|
} },
|
|
381
|
-
{
|
|
382
|
-
name: 'qp-skuName-like',
|
|
383
|
-
label: 'SKU名称',
|
|
384
|
-
type: 'autoComplete',
|
|
385
|
-
field: {
|
|
386
|
-
type: 'autoComplete',
|
|
387
|
-
props: {
|
|
388
|
-
requestConfig: {
|
|
389
|
-
url: `${prefixUrl.selectPrefix}/sku/doPageBySelect/v4`,
|
|
390
|
-
method: 'post',
|
|
391
|
-
otherParams: {
|
|
392
|
-
ownOrgSign: getCurrentTargetBgId(),
|
|
393
|
-
...(requestConfigProp?.addOtherParams || {}),
|
|
394
|
-
},
|
|
395
|
-
mappingTextField: 'skuName',
|
|
396
|
-
pageSize: 50,
|
|
397
|
-
debounceWait: 300,
|
|
398
|
-
likeParamName: 'qp-skuName-like',
|
|
399
|
-
},
|
|
400
|
-
},
|
|
401
|
-
},
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
name: 'qp-itemName-like',
|
|
405
|
-
label: '商品名称',
|
|
406
|
-
type: 'autoComplete',
|
|
407
|
-
field: {
|
|
408
|
-
type: 'autoComplete',
|
|
409
|
-
props: {
|
|
410
|
-
requestConfig: {
|
|
411
|
-
url: `${prefixUrl.selectPrefix}/sku/doPageBySelect/v4`,
|
|
412
|
-
method: 'post',
|
|
413
|
-
otherParams: {
|
|
414
|
-
ownOrgSign: getCurrentTargetBgId(),
|
|
415
|
-
...(requestConfigProp?.addOtherParams || {}),
|
|
416
|
-
},
|
|
417
|
-
mappingTextField: 'itemName',
|
|
418
|
-
pageSize: 50,
|
|
419
|
-
debounceWait: 300,
|
|
420
|
-
likeParamName: 'qp-itemName-like',
|
|
421
|
-
},
|
|
422
|
-
},
|
|
423
|
-
},
|
|
424
|
-
},
|
|
381
|
+
{ name: 'qp-skuName-like', label: 'SKU名称' },
|
|
425
382
|
{ name: 'qp-itemCode-in', label: 'SPU编码', field: {
|
|
426
383
|
type:'multipleQuerySearchSelect',
|
|
427
384
|
props: {
|
|
@@ -442,16 +399,6 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
442
399
|
},
|
|
443
400
|
}
|
|
444
401
|
} },
|
|
445
|
-
{
|
|
446
|
-
name: 'qp-styleCode-in',
|
|
447
|
-
label: '龙牙款号',
|
|
448
|
-
type: 'multipleQueryInput',
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
name: 'qp-pinCode-in',
|
|
452
|
-
label: '龙牙品号',
|
|
453
|
-
type: 'multipleQueryInput',
|
|
454
|
-
},
|
|
455
402
|
// { name: 'qp-eancode-in', label: '商品条码', field: {
|
|
456
403
|
// type: 'multipleQueryInput',
|
|
457
404
|
// props: {
|
|
@@ -533,9 +480,9 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
533
480
|
'qp-labelType-eq': 1,
|
|
534
481
|
},getQueryHeadersItem(queryHeaderParams,'qp-itemLabelId-in')),
|
|
535
482
|
]).then((x: any)=>{
|
|
536
|
-
formatSource(x,0,
|
|
537
|
-
formatTreeDataSource(x,1,
|
|
538
|
-
formatSource(x,2,
|
|
483
|
+
formatSource(x,0, 3, tableSearchForm,['id','name'])
|
|
484
|
+
formatTreeDataSource(x,1, 4, tableSearchForm)
|
|
485
|
+
formatSource(x,2, 6, tableSearchForm,['id','name'])
|
|
539
486
|
})
|
|
540
487
|
modalTableProps = {
|
|
541
488
|
modalTableTitle: '选择SKU',
|
|
@@ -545,101 +492,60 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
545
492
|
{
|
|
546
493
|
title: '序号',
|
|
547
494
|
dataIndex: 'keyIndex',
|
|
548
|
-
width: 60,
|
|
549
495
|
defaultSort: 0,
|
|
550
496
|
},
|
|
551
497
|
{
|
|
552
|
-
title: '
|
|
553
|
-
dataIndex: '
|
|
554
|
-
|
|
555
|
-
defaultSort: 1,
|
|
556
|
-
render: (text: any,record: any) => tableColumnsImage(getSkuImg(record), { width: 16, height: 16 }),
|
|
498
|
+
title: 'SKU编码',
|
|
499
|
+
dataIndex: 'skuCode',
|
|
500
|
+
defaultSort: 2,
|
|
557
501
|
},
|
|
558
502
|
{
|
|
559
503
|
title: 'SKU名称',
|
|
560
504
|
dataIndex: 'skuName',
|
|
561
|
-
width: 200,
|
|
562
|
-
defaultSort: 2,
|
|
563
|
-
ellipsis: {
|
|
564
|
-
showTitle: false,
|
|
565
|
-
},
|
|
566
|
-
render: (text: any) => handleTextOverflow(text, 200),
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
title: '颜色名称',
|
|
570
|
-
dataIndex: 'colorName',
|
|
571
|
-
width: 140,
|
|
572
505
|
defaultSort: 3,
|
|
573
506
|
},
|
|
574
507
|
{
|
|
575
|
-
title: '
|
|
576
|
-
dataIndex: '
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
title: 'SKU编码',
|
|
582
|
-
dataIndex: 'skuCode',
|
|
583
|
-
width: 160,
|
|
584
|
-
defaultSort: 5,
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
title: '龙牙款号',
|
|
588
|
-
dataIndex: 'styleCode',
|
|
589
|
-
width: 160,
|
|
590
|
-
defaultSort: 6,
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
title: '龙牙品号',
|
|
594
|
-
dataIndex: 'pinCode',
|
|
595
|
-
width: 160,
|
|
596
|
-
defaultSort: 7,
|
|
508
|
+
title: '图片',
|
|
509
|
+
dataIndex: 'itemUrl',
|
|
510
|
+
defaultSort: 1,
|
|
511
|
+
render: (text: any,record: any) => tableColumnsImage(getSkuImg(record), { width: 16, height: 16 }),
|
|
597
512
|
},
|
|
598
513
|
{
|
|
599
514
|
title: '商品条码',
|
|
600
515
|
dataIndex: 'eancode',
|
|
601
|
-
width: 140,
|
|
602
516
|
},
|
|
603
517
|
{
|
|
604
518
|
title: 'SKC编码',
|
|
605
519
|
dataIndex: 'skcCode',
|
|
606
|
-
width: 140,
|
|
607
520
|
},
|
|
608
521
|
{
|
|
609
522
|
title: '所属SPU名称',
|
|
610
523
|
dataIndex: 'itemName',
|
|
611
|
-
width: 160,
|
|
612
524
|
},
|
|
613
525
|
{
|
|
614
526
|
title: '所属SPU编码',
|
|
615
527
|
dataIndex: 'itemCode',
|
|
616
|
-
width: 140,
|
|
617
528
|
},
|
|
618
529
|
{
|
|
619
530
|
title: '外部编码',
|
|
620
531
|
dataIndex: 'externalCode',
|
|
621
|
-
width: 140,
|
|
622
532
|
},
|
|
623
533
|
{
|
|
624
534
|
title: '规格',
|
|
625
535
|
dataIndex: 'propertyNameAndValue',
|
|
626
|
-
width: 140,
|
|
627
536
|
},
|
|
628
537
|
{
|
|
629
538
|
title: '类目',
|
|
630
539
|
dataIndex: 'categoryName',
|
|
631
|
-
width: 120,
|
|
632
540
|
},
|
|
633
541
|
{
|
|
634
542
|
title: '品类',
|
|
635
543
|
dataIndex: 'className',
|
|
636
|
-
width: 120,
|
|
637
544
|
},
|
|
638
545
|
{
|
|
639
546
|
title: '品牌',
|
|
640
547
|
dataIndex: 'brandName',
|
|
641
|
-
|
|
642
|
-
defaultSort: 8,
|
|
548
|
+
defaultSort: 4,
|
|
643
549
|
},
|
|
644
550
|
],
|
|
645
551
|
...modalTableBusProps
|
|
@@ -39,7 +39,6 @@ export const loadSelectSource = (url: string, params?: any) => {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export const formatSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['code', 'name']) => {
|
|
42
|
-
if (!Array.isArray(changeSearchForm) || !changeSearchForm[changePosition]) return;
|
|
43
42
|
const data = reData && reData[position]?.data;
|
|
44
43
|
const list = Array.isArray(data) ? data :(data?.items || data?.list || data?.children || []);
|
|
45
44
|
const formatData = list?.length ? list.map((v: any) => ({ text: v[resKeyValue[1]], value: v[resKeyValue[0]] })) : [];
|
|
@@ -59,7 +58,6 @@ export const mapSearchTree = (treeDataItem: any, resKeyValue: any) => {
|
|
|
59
58
|
};
|
|
60
59
|
};
|
|
61
60
|
export const formatTreeDataSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['id', 'name']) => {
|
|
62
|
-
if (!Array.isArray(changeSearchForm) || !changeSearchForm[changePosition]?.field?.props) return;
|
|
63
61
|
const data = reData && reData[position]?.data;
|
|
64
62
|
const formatData = (data &&
|
|
65
63
|
Array.isArray(data) &&
|
|
@@ -127,23 +127,6 @@
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
.search_select_current_page_filter_column {
|
|
131
|
-
min-width: 140px;
|
|
132
|
-
|
|
133
|
-
.ant-table-filter-column {
|
|
134
|
-
min-width: 108px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.ant-table-column-title {
|
|
138
|
-
min-width: 64px;
|
|
139
|
-
white-space: nowrap;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.ant-table-filter-trigger {
|
|
143
|
-
flex: 0 0 32px;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
130
|
.ant-modal-body {
|
|
148
131
|
padding: 10px;
|
|
149
132
|
}
|
|
@@ -16,9 +16,6 @@ import { handleAntdColumnsSpecialParams, uuid, parseWidth } from '@/utils/utils'
|
|
|
16
16
|
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
17
17
|
import { getItemDefaultWidth, noEmptyArray } from '@/components/Business/columnSettingTable/utils';
|
|
18
18
|
import { getSelectDataList, loadSelectSource, formatFormSourceList } from './helps';
|
|
19
|
-
import { buildCurrentPageFilterColumns, markCurrentPageFilterByDataIndex } from '../SearchSelect/currentPageFilter';
|
|
20
|
-
import { SEARCH_SELECT_MODAL_DEFAULT_PAGE_SIZE } from '../SearchSelect/pagination';
|
|
21
|
-
import QueryAutoComplete from '../QueryAutoComplete';
|
|
22
19
|
|
|
23
20
|
interface SearchFormItem {
|
|
24
21
|
name: string;
|
|
@@ -101,7 +98,7 @@ const AddSelect = (props: any) => {
|
|
|
101
98
|
const selectMode = selectProps?.mode // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
|
|
102
99
|
const initVal = value || (selectMode ? [] : null);
|
|
103
100
|
const pageSize = 100 // 下拉框默认分页 条数
|
|
104
|
-
const tableInitPageSize = modalTableProps?.topTablePagination?.pageSize ||
|
|
101
|
+
const tableInitPageSize = modalTableProps?.topTablePagination?.pageSize || 10 // 弹框默认分页 条数
|
|
105
102
|
const currentPage = 1
|
|
106
103
|
|
|
107
104
|
const [fetching, setFetching] = useState(false);
|
|
@@ -114,7 +111,6 @@ const AddSelect = (props: any) => {
|
|
|
114
111
|
const [caretLeftFlag, setCaretLeftFlag] = useState(true);
|
|
115
112
|
const [tableData, setTableData] = useState([]);
|
|
116
113
|
const [tablePagination, setTablePagination] = useState({ total: 0, size: "small", current: 1, pageSize: tableInitPageSize, ...(modalTableProps?.topTablePagination) })
|
|
117
|
-
const [currentPageFilters, setCurrentPageFilters] = useState({});
|
|
118
114
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
119
115
|
const [tableFormParams, setTableFormParams] = useState({});
|
|
120
116
|
const [confirmLoading, setConfirmLoading] = useState(false);
|
|
@@ -675,8 +671,7 @@ const AddSelect = (props: any) => {
|
|
|
675
671
|
source = Array.isArray(source) ? _.uniqBy(source, 'value') : [];
|
|
676
672
|
|
|
677
673
|
setTableData(source)
|
|
678
|
-
|
|
679
|
-
setTablePagination((previousPagination) => ({ ...previousPagination, total: Number(res?.total || res?.totalCount || source.length), pageSize: Number(res?.size || res?.pageSize || (params?.pageSize || pageSize)), current: Number(res?.page || res?.currentPage || (params?.currentPage || currentPage)) }))
|
|
674
|
+
setTablePagination({ ...tablePagination, total: Number(res?.total || res?.totalCount || source.length), pageSize: Number(res?.size || res?.pageSize || (params?.pageSize || pageSize)), current: Number(res?.page || res?.currentPage || (params?.currentPage || currentPage)) })
|
|
680
675
|
})
|
|
681
676
|
.catch((err: any) => { setFetching(false) });
|
|
682
677
|
}
|
|
@@ -704,7 +699,6 @@ const AddSelect = (props: any) => {
|
|
|
704
699
|
|
|
705
700
|
const showModal = () => {
|
|
706
701
|
// getData({ pageSize: tableInitPageSize, currentPage: 1 }, 2)
|
|
707
|
-
setCurrentPageFilters({});
|
|
708
702
|
setIsModalVisible(true);
|
|
709
703
|
// 回显
|
|
710
704
|
if (value) {
|
|
@@ -783,7 +777,6 @@ const AddSelect = (props: any) => {
|
|
|
783
777
|
const handleCancel = () => {
|
|
784
778
|
form.resetFields();
|
|
785
779
|
setTableFormParams({});
|
|
786
|
-
setCurrentPageFilters({});
|
|
787
780
|
setIsModalVisible(false);
|
|
788
781
|
setTableData([])
|
|
789
782
|
onCancelCallback && onCancelCallback();
|
|
@@ -796,39 +789,26 @@ const AddSelect = (props: any) => {
|
|
|
796
789
|
form.validateFields()
|
|
797
790
|
.then(() => {
|
|
798
791
|
const params = form.getFieldsValue();
|
|
799
|
-
const currentTablePageSize = businessType === 'sku'
|
|
800
|
-
? Number(tablePagination?.pageSize || tableInitPageSize)
|
|
801
|
-
: tableInitPageSize;
|
|
802
792
|
setTableFormParams(params);
|
|
803
|
-
|
|
804
|
-
getData({ ...params, pageSize: currentTablePageSize, currentPage: 1 }, 2)
|
|
793
|
+
getData({ ...params, pageSize: tableInitPageSize }, 2)
|
|
805
794
|
})
|
|
806
795
|
}
|
|
807
796
|
|
|
808
797
|
const onResetTable = () => {
|
|
809
798
|
form.resetFields();
|
|
810
799
|
setTableFormParams({});
|
|
811
|
-
setCurrentPageFilters({});
|
|
812
800
|
form.validateFields()
|
|
813
801
|
.then(() => {
|
|
814
|
-
|
|
815
|
-
? Number(tablePagination?.pageSize || tableInitPageSize)
|
|
816
|
-
: tableInitPageSize;
|
|
817
|
-
getData({ pageSize: currentTablePageSize, currentPage: 1 }, 2)
|
|
802
|
+
getData({ pageSize: tableInitPageSize, currentPage: 1 }, 2)
|
|
818
803
|
})
|
|
819
804
|
.catch(() => {
|
|
820
805
|
setTableData([]);
|
|
821
806
|
})
|
|
822
807
|
}
|
|
823
808
|
|
|
824
|
-
const handleTableChange = (pagination
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
return;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
setCurrentPageFilters({});
|
|
831
|
-
setTablePagination((previousPagination) => ({ ...previousPagination, ...pagination }))
|
|
809
|
+
const handleTableChange = (pagination) => {
|
|
810
|
+
// 设置分页tablePagination
|
|
811
|
+
setTablePagination({ ...tablePagination, ...pagination })
|
|
832
812
|
getData({ ...tableFormParams, pageSize: pagination.pageSize, currentPage: pagination.current }, 2)
|
|
833
813
|
}
|
|
834
814
|
|
|
@@ -959,17 +939,6 @@ const AddSelect = (props: any) => {
|
|
|
959
939
|
);
|
|
960
940
|
}
|
|
961
941
|
|
|
962
|
-
if (type === 'autoComplete' || field?.type === 'autoComplete') {
|
|
963
|
-
return (
|
|
964
|
-
<Form.Item name={name} label={label} key={name} {...restProps}>
|
|
965
|
-
<QueryAutoComplete
|
|
966
|
-
onPressEnter={onSearchTable}
|
|
967
|
-
{...(field?.props || {})}
|
|
968
|
-
/>
|
|
969
|
-
</Form.Item>
|
|
970
|
-
);
|
|
971
|
-
}
|
|
972
|
-
|
|
973
942
|
// 默认type是input
|
|
974
943
|
return (
|
|
975
944
|
<Form.Item name={name} label={label} key={name} {...restProps}>
|
|
@@ -1073,33 +1042,12 @@ const AddSelect = (props: any) => {
|
|
|
1073
1042
|
return ({ ...item })
|
|
1074
1043
|
})
|
|
1075
1044
|
handleColumns(showToChooseCol, [],(res)=> setShowToChooseColumnsCallback(res));
|
|
1076
|
-
const currentPageTableColumns = buildCurrentPageFilterColumns(
|
|
1077
|
-
businessType === 'sku'
|
|
1078
|
-
? markCurrentPageFilterByDataIndex(showToChooseCol)
|
|
1079
|
-
: showToChooseCol,
|
|
1080
|
-
tableData,
|
|
1081
|
-
currentPageFilters,
|
|
1082
|
-
);
|
|
1083
1045
|
let showSelectedCol = showColumns.map((item: any) => {
|
|
1084
1046
|
handleAntdColumnsSpecialParams(item);
|
|
1085
1047
|
return ({ ...item })
|
|
1086
1048
|
})
|
|
1087
1049
|
handleColumns(showSelectedCol, [],(res)=> setShowColumnsCallback(res));
|
|
1088
1050
|
|
|
1089
|
-
// sku 上表勿用 scroll.x=max-content:会按当前页单元格内容重算列宽,分页切换时 SKU名称等列会忽宽忽窄
|
|
1090
|
-
const sumColumnScrollX = (columns: any[], extraWidth = 0) => {
|
|
1091
|
-
const sum = (columns || []).reduce((total: number, col: any) => {
|
|
1092
|
-
if (typeof col?.width === 'number') return total + col.width;
|
|
1093
|
-
if (typeof col?.width === 'string') {
|
|
1094
|
-
const parsed = parseFloat(col.width);
|
|
1095
|
-
return Number.isFinite(parsed) ? total + parsed : total;
|
|
1096
|
-
}
|
|
1097
|
-
return total;
|
|
1098
|
-
}, extraWidth);
|
|
1099
|
-
return sum > extraWidth ? sum : undefined;
|
|
1100
|
-
};
|
|
1101
|
-
const skuTopTableScrollX = sumColumnScrollX(currentPageTableColumns, selectMode ? 60 : 0);
|
|
1102
|
-
|
|
1103
1051
|
const selectLength = isAllowRepeatedSelect ? (popvalue?.length || 0) : (selectedRowKeys?.length || 0)
|
|
1104
1052
|
return (
|
|
1105
1053
|
<div className={'add_select'}>
|
|
@@ -1179,19 +1127,14 @@ const AddSelect = (props: any) => {
|
|
|
1179
1127
|
<Table
|
|
1180
1128
|
size='small'
|
|
1181
1129
|
rowSelection={rowSelection}
|
|
1182
|
-
columns={
|
|
1130
|
+
columns={showToChooseCol}
|
|
1183
1131
|
dataSource={tableData}
|
|
1184
|
-
getPopupContainer={(triggerNode) =>
|
|
1185
|
-
modalTableProps?.getFilterPopupContainer?.(triggerNode) || document.body
|
|
1186
|
-
}
|
|
1187
1132
|
pagination={tablePagination}
|
|
1188
1133
|
loading={fetching}
|
|
1189
1134
|
onChange={handleTableChange}
|
|
1190
1135
|
rowKey={mappingValueField}
|
|
1191
1136
|
rowClassName={'row-class'}
|
|
1192
|
-
scroll={
|
|
1193
|
-
? { x: skuTopTableScrollX || true, y: 500 }
|
|
1194
|
-
: { y: 500 }}
|
|
1137
|
+
scroll={{ y: 500 }}
|
|
1195
1138
|
components={{
|
|
1196
1139
|
header: {
|
|
1197
1140
|
cell: ResizeableTitle,
|
|
@@ -138,22 +138,6 @@
|
|
|
138
138
|
height: calc(100vh - 235px); // modal弹窗760 调整为700 适应小屏
|
|
139
139
|
overflow: hidden;
|
|
140
140
|
}
|
|
141
|
-
.search_select_current_page_filter_column {
|
|
142
|
-
min-width: 140px;
|
|
143
|
-
|
|
144
|
-
.ant-table-filter-column {
|
|
145
|
-
min-width: 108px;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.ant-table-column-title {
|
|
149
|
-
min-width: 64px;
|
|
150
|
-
white-space: nowrap;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.ant-table-filter-trigger {
|
|
154
|
-
flex: 0 0 32px;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
141
|
.ant-modal-footer {
|
|
158
142
|
.ant-btn.ant-btn-default {
|
|
159
143
|
color: @primary-color;
|