@bit-sun/business-component 1.1.35 → 1.1.38

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.
Files changed (33) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +4 -4
  3. package/.gitlab-ci.yml +174 -174
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +28 -28
  7. package/README.md +27 -27
  8. package/dist/index.esm.js +2264 -3713
  9. package/dist/index.js +2264 -3713
  10. package/dist/utils/CheckOneUser/index.d.ts +1 -1
  11. package/docs/index.md +21 -21
  12. package/package.json +50 -50
  13. package/src/components/Business/CommodityEntry/index.md +69 -69
  14. package/src/components/Business/CommodityEntry/index.tsx +75 -75
  15. package/src/components/Business/SearchSelect/BusinessUtils.ts +1149 -1059
  16. package/src/components/Business/SearchSelect/common.ts +34 -34
  17. package/src/components/Business/SearchSelect/index.md +1061 -1061
  18. package/src/components/Business/SearchSelect/index.tsx +43 -43
  19. package/src/components/Business/SearchSelect/utils.ts +74 -74
  20. package/src/components/Functional/DataValidation/index.less +63 -63
  21. package/src/components/Functional/DataValidation/index.md +38 -38
  22. package/src/components/Functional/DataValidation/index.tsx +668 -668
  23. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  24. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  25. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  26. package/src/components/Functional/SearchSelect/index.less +115 -115
  27. package/src/components/Functional/SearchSelect/index.md +141 -141
  28. package/src/components/Functional/SearchSelect/index.tsx +714 -714
  29. package/src/index.ts +21 -21
  30. package/src/utils/CheckOneUser/index.md +39 -39
  31. package/src/utils/CheckOneUser/index.ts +51 -51
  32. package/tsconfig.json +29 -29
  33. package/typings.d.ts +2 -2
@@ -1,1061 +1,1061 @@
1
- ---
2
- nav:
3
- title: '组件'
4
- order: 1
5
- group:
6
- title: 业务组件
7
- order: 1
8
- title: 业务档案选择器
9
- order: 1
10
- ---
11
-
12
- # BusinessSearchSelect
13
-
14
-
15
- ## 供应商选择器 Select-GYS-001
16
-
17
- ```tsx
18
- import React, { useState } from 'react';
19
- import { Tabs } from 'antd';
20
- import {BusinessSearchSelect} from '../../../index.ts';
21
-
22
- const { TabPane } = Tabs;
23
-
24
- export default () => {
25
- // selectBusinessType 必传(不传默认为供应商选择器)
26
-
27
- const selectProps = {
28
- // mode: 'multiple',
29
- // maxTagCount: 1,
30
- // disabled: true
31
- }
32
- const selectPropsMultiple = {
33
- mode: 'multiple',
34
- maxTagCount: 1,
35
- }
36
-
37
- const [ tabKey, setTabKey ] = useState('single')
38
- const [value, setValue] = useState(null);
39
-
40
- const props = {
41
- value,
42
- // labelInValue: true, // 非必填 默认为false
43
- // requestConfig: {
44
- // url: `/bop/api/supplier`,
45
- // filter: 'qp-name,code-orGroup,like', // 过滤参数
46
- // otherParams: {}, // 默认参数
47
- // mappingTextField: 'name',
48
- // mappingValueField: 'code',
49
- // }, // 非必传,业务字段已根据业务默认默认
50
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' }, // 非必传,下拉框和tableForm下拉框接口前缀,默认为bop的接口
51
- selectProps, // 非必传
52
- onChange: (value: any) => {
53
- console.log(value)
54
- setValue(value)
55
- },
56
- selectBusinessType: 'supplier',
57
- };
58
-
59
- const onTabChange = (key) => {
60
- setTabKey(key)
61
- setValue(key === 'single' ? null: [])
62
- }
63
-
64
- return (
65
- <div>
66
- <Tabs onChange={onTabChange} activeKey={tabKey}>
67
- <TabPane tab='单选' key='single'>
68
- {tabKey === 'single' && (
69
- <BusinessSearchSelect {...props} />
70
- )}
71
- </TabPane>
72
- <TabPane tab='多选' key='multiple'>
73
- {tabKey === 'multiple' && (
74
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
75
- )}
76
- </TabPane>
77
- </Tabs>
78
- </div>
79
- );
80
- };
81
- ```
82
-
83
-
84
- ## 商品SKU选择器 Select-SKU-001
85
-
86
- ```tsx
87
- import React, { useState } from 'react';
88
- import { Tabs } from 'antd';
89
- import {BusinessSearchSelect} from '../../../index.ts';
90
-
91
- const { TabPane } = Tabs;
92
- export default () => {
93
- const selectProps = {
94
- // mode: 'multiple',
95
- // maxTagCount: 1,
96
- // disabled: true
97
- }
98
- const selectPropsMultiple = {
99
- mode: 'multiple',
100
- maxTagCount: 1,
101
- }
102
-
103
- const [ tabKey, setTabKey ] = useState('single')
104
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
105
-
106
- const props = {
107
- value,
108
- onChange: (value: any) => {
109
- console.log(value)
110
- setValue(value)
111
- },
112
- // requestConfig: {
113
- // url: `/bop/api/sku/pager/v2`,
114
- // filter: 'skuCodeAndSkuName',
115
- // mappingValueField: 'skuCode',
116
- // otherParams: {
117
- // sorter: 'desc-id'
118
- // }, // 默认参数
119
- // sourceName: 'skuCode',
120
- // },
121
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
122
- selectProps,
123
- selectBusinessType: 'skuCommodity',
124
- };
125
-
126
- const onTabChange = (key) => {
127
- setTabKey(key)
128
- setValue(key === 'single' ? null: [])
129
- }
130
-
131
- return (
132
- <div>
133
- <Tabs onChange={onTabChange} activeKey={tabKey}>
134
- <TabPane tab='单选' key='single'>
135
- {tabKey === 'single' && (
136
- <BusinessSearchSelect {...props} />
137
- )}
138
- </TabPane>
139
- <TabPane tab='多选' key='multiple'>
140
- {tabKey === 'multiple' && (
141
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
142
- )}
143
- </TabPane>
144
- </Tabs>
145
- </div>
146
- );
147
- };
148
- ```
149
-
150
- [comment]: <> (## 商品规格选择器 Select-SPGG-001)
151
-
152
- [comment]: <> (```tsx)
153
-
154
- [comment]: <> (import React, { useState } from 'react';)
155
-
156
- [comment]: <> (import { Tabs } from 'antd';)
157
-
158
- [comment]: <> (import {BusinessSearchSelect} from '../../../index.ts';)
159
-
160
- [comment]: <> (const { TabPane } = Tabs;)
161
-
162
- [comment]: <> (export default &#40;&#41; => {)
163
-
164
- [comment]: <> ( const selectProps = {)
165
-
166
- [comment]: <> ( // mode: 'multiple',)
167
-
168
- [comment]: <> ( // maxTagCount: 1,)
169
-
170
- [comment]: <> ( // disabled: true)
171
-
172
- [comment]: <> ( })
173
-
174
- [comment]: <> ( const selectPropsMultiple = {)
175
-
176
- [comment]: <> ( mode: 'multiple',)
177
-
178
- [comment]: <> ( maxTagCount: 1,)
179
-
180
- [comment]: <> ( })
181
-
182
- [comment]: <> ( const [ tabKey, setTabKey ] = useState&#40;'single'&#41;)
183
-
184
- [comment]: <> ( const [value, setValue] = useState&#40;selectProps?.mode ? [] : null&#41;;)
185
-
186
- [comment]: <> ( const props = {)
187
-
188
- [comment]: <> ( value,)
189
-
190
- [comment]: <> ( onChange: &#40;value: any&#41; => {)
191
-
192
- [comment]: <> ( console.log&#40;value&#41;)
193
-
194
- [comment]: <> ( setValue&#40;value&#41;)
195
-
196
- [comment]: <> ( },)
197
-
198
- [comment]: <> ( prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },)
199
-
200
- [comment]: <> ( selectProps,)
201
-
202
- [comment]: <> ( selectBusinessType: 'skuPropertyValue',)
203
-
204
- [comment]: <> ( };)
205
-
206
- [comment]: <> ( const onTabChange = &#40;key&#41; => {)
207
-
208
- [comment]: <> ( setTabKey&#40;key&#41;)
209
-
210
- [comment]: <> ( setValue&#40;key === 'single' ? null: []&#41;)
211
-
212
- [comment]: <> ( })
213
-
214
- [comment]: <> ( return &#40;)
215
-
216
- [comment]: <> ( <div>)
217
-
218
- [comment]: <> ( <Tabs onChange={onTabChange} activeKey={tabKey}>)
219
-
220
- [comment]: <> ( <TabPane tab='单选' key='single'>)
221
-
222
- [comment]: <> ( {tabKey === 'single' && &#40;)
223
-
224
- [comment]: <> ( <BusinessSearchSelect {...props} />)
225
-
226
- [comment]: <> ( &#41;})
227
-
228
- [comment]: <> ( </TabPane>)
229
-
230
- [comment]: <> ( <TabPane tab='多选' key='multiple'>)
231
-
232
- [comment]: <> ( {tabKey === 'multiple' && &#40;)
233
-
234
- [comment]: <> ( <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />)
235
-
236
- [comment]: <> ( &#41;})
237
-
238
- [comment]: <> ( </TabPane>)
239
-
240
- [comment]: <> ( </Tabs>)
241
-
242
- [comment]: <> ( </div>)
243
-
244
- [comment]: <> ( &#41;;)
245
-
246
- [comment]: <> (};)
247
-
248
- [comment]: <> (```)
249
-
250
- ## 商品SPU选择器 Select-SPU-001
251
-
252
- ```tsx
253
- import React, { useState } from 'react';
254
- import { Tabs } from 'antd';
255
- import {BusinessSearchSelect} from '../../../index.ts';
256
-
257
- const { TabPane } = Tabs;
258
- export default () => {
259
- const selectProps = {
260
- // mode: 'multiple',
261
- // maxTagCount: 1,
262
- // disabled: true
263
- }
264
- const selectPropsMultiple = {
265
- mode: 'multiple',
266
- maxTagCount: 6,
267
- }
268
-
269
- const [ tabKey, setTabKey ] = useState('single')
270
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
271
-
272
- const props = {
273
- value,
274
- onChange: (value: any) => {
275
- console.log(value)
276
- setValue(value)
277
- },
278
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
279
- selectProps,
280
- selectBusinessType: 'spuCommodity',
281
- };
282
-
283
- const onTabChange = (key) => {
284
- setTabKey(key)
285
- setValue(key === 'single' ? null: [])
286
- }
287
-
288
- return (
289
- <div>
290
- <Tabs onChange={onTabChange} activeKey={tabKey}>
291
- <TabPane tab='单选' key='single'>
292
- {tabKey === 'single' && (
293
- <BusinessSearchSelect {...props} />
294
- )}
295
- </TabPane>
296
- <TabPane tab='多选' key='multiple'>
297
- {tabKey === 'multiple' && (
298
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
299
- )}
300
- </TabPane>
301
- </Tabs>
302
- </div>
303
- );
304
- };
305
- ```
306
-
307
-
308
- ## 仓库选择器(物理仓) Select-Warehouse-001
309
-
310
- ```tsx
311
- import React, { useState } from 'react';
312
- import { Tabs } from 'antd';
313
- import {BusinessSearchSelect} from '../../../index.ts';
314
-
315
- const { TabPane } = Tabs;
316
-
317
- export default () => {
318
- const selectProps = {
319
- // mode: 'multiple',
320
- // maxTagCount: 1,
321
- // disabled: true
322
- }
323
- const selectPropsMultiple = {
324
- mode: 'multiple',
325
- maxTagCount: 1,
326
- }
327
-
328
- const [ tabKey, setTabKey ] = useState('single')
329
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
330
-
331
- const props = {
332
- value,
333
- onChange: (value: any) => {
334
- console.log(value)
335
- setValue(value)
336
- },
337
- // requestConfig: {
338
- // mappingValueField: 'physicalWarehouseCode',
339
- // sourceName: 'physicalWarehouseCode',
340
- // },
341
- // modalTableProps: {
342
- // modalTableTitle: '选择物理仓-更改title测试',
343
- // },
344
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
345
- selectProps,
346
- selectBusinessType: 'physicalWarehouse',
347
- };
348
-
349
- const onTabChange = (key) => {
350
- setTabKey(key)
351
- setValue(key === 'single' ? null: [])
352
- }
353
-
354
- return (
355
- <div>
356
- <Tabs onChange={onTabChange} activeKey={tabKey}>
357
- <TabPane tab='单选' key='single'>
358
- {tabKey === 'single' && (
359
- <BusinessSearchSelect {...props} />
360
- )}
361
- </TabPane>
362
- <TabPane tab='多选' key='multiple'>
363
- {tabKey === 'multiple' && (
364
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
365
- )}
366
- </TabPane>
367
- </Tabs>
368
- </div>
369
- );
370
- };
371
- ```
372
-
373
- ## 仓库选择器(逻辑仓) Select-Warehouse-002
374
-
375
- ```tsx
376
- import React, { useState } from 'react';
377
- import { Tabs } from 'antd';
378
- import {BusinessSearchSelect} from '../../../index.ts';
379
-
380
- const { TabPane } = Tabs;
381
-
382
- export default () => {
383
- const selectProps = {
384
- // mode: 'multiple',
385
- // maxTagCount: 1,
386
- // disabled: true
387
- }
388
- const selectPropsMultiple = {
389
- mode: 'multiple',
390
- maxTagCount: 1,
391
- }
392
-
393
- const [ tabKey, setTabKey ] = useState('single')
394
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
395
-
396
- const props = {
397
- value,
398
- onChange: (value: any) => {
399
- console.log(value)
400
- setValue(value)
401
- },
402
- // requestConfig: {
403
- // url: `/bop/api/realWarehouse`,
404
- // filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
405
- // mappingTextField: 'realWarehouseName',
406
- // mappingValueField: 'realWarehouseCode',
407
- // otherParams: {
408
- // sorter: 'desc-id'
409
- // }, // 默认参数
410
- // sourceName: 'warehouseIds',
411
- // },
412
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
413
- selectProps,
414
- selectBusinessType: 'realWarehouse',
415
- };
416
-
417
- const onTabChange = (key) => {
418
- setTabKey(key)
419
- setValue(key === 'single' ? null: [])
420
- }
421
-
422
- return (
423
- <div>
424
- <Tabs onChange={onTabChange} activeKey={tabKey}>
425
- <TabPane tab='单选' key='single'>
426
- {tabKey === 'single' && (
427
- <BusinessSearchSelect {...props} />
428
- )}
429
- </TabPane>
430
- <TabPane tab='多选' key='multiple'>
431
- {tabKey === 'multiple' && (
432
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
433
- )}
434
- </TabPane>
435
- </Tabs>
436
- </div>
437
- );
438
- };
439
- ```
440
-
441
- ## 仓库选择器(虚拟仓) Select-Warehouse-003
442
-
443
- ```tsx
444
- import React, { useState } from 'react';
445
- import { Tabs } from 'antd';
446
- import {BusinessSearchSelect} from '../../../index.ts';
447
-
448
- const { TabPane } = Tabs;
449
-
450
- export default () => {
451
- const selectProps = {
452
- // mode: 'multiple',
453
- // maxTagCount: 1,
454
- // disabled: true
455
- }
456
- const selectPropsMultiple = {
457
- mode: 'multiple',
458
- maxTagCount: 1,
459
- }
460
-
461
- const [ tabKey, setTabKey ] = useState('single')
462
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
463
-
464
- const props = {
465
- value,
466
- onChange: (value: any) => {
467
- console.log(value)
468
- setValue(value)
469
- },
470
- // requestConfig: {
471
- // url: `/bop/api/virtualWarehouse`,
472
- // filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
473
- // mappingTextField: 'virtualWarehouseName',
474
- // mappingValueField: 'virtualWarehouseCode',
475
- // otherParams: {
476
- // sorter: 'desc-id'
477
- // }, // 默认参数
478
- // sourceName: 'warehouseIds',
479
- // },
480
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
481
- selectProps,
482
- selectBusinessType: 'virtualWarehouse',
483
- };
484
-
485
- const onTabChange = (key) => {
486
- setTabKey(key)
487
- setValue(key === 'single' ? null: [])
488
- }
489
-
490
- return (
491
- <div>
492
- <Tabs onChange={onTabChange} activeKey={tabKey}>
493
- <TabPane tab='单选' key='single'>
494
- {tabKey === 'single' && (
495
- <BusinessSearchSelect {...props} />
496
- )}
497
- </TabPane>
498
- <TabPane tab='多选' key='multiple'>
499
- {tabKey === 'multiple' && (
500
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
501
- )}
502
- </TabPane>
503
- </Tabs>
504
- </div>
505
- );
506
- };
507
- ```
508
-
509
- ## 仓库选择器(渠道仓) Select-Warehouse-004
510
-
511
- ```tsx
512
- import React, { useState } from 'react';
513
- import { Tabs } from 'antd';
514
- import {BusinessSearchSelect} from '../../../index.ts';
515
-
516
- const { TabPane } = Tabs;
517
-
518
- export default () => {
519
- const selectProps = {
520
- // mode: 'multiple',
521
- // maxTagCount: 1,
522
- // disabled: true
523
- }
524
- const selectPropsMultiple = {
525
- mode: 'multiple',
526
- maxTagCount: 1,
527
- }
528
-
529
- const [ tabKey, setTabKey ] = useState('single')
530
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
531
-
532
- const props = {
533
- value,
534
- onChange: (value: any) => {
535
- console.log(value)
536
- setValue(value)
537
- },
538
- // requestConfig: {
539
- // url: `/bop/api/channelWarehouse`,
540
- // filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
541
- // mappingTextField: 'channelWarehouseName',
542
- // mappingValueField: 'channelWarehouseCode',
543
- // otherParams: {
544
- // sorter: 'desc-id'
545
- // }, // 默认参数
546
- // sourceName: 'warehouseIds',
547
- // },
548
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
549
- selectProps,
550
- selectBusinessType: 'channelWarehouse',
551
- };
552
-
553
- const onTabChange = (key) => {
554
- setTabKey(key)
555
- setValue(key === 'single' ? null: [])
556
- }
557
-
558
- return (
559
- <div>
560
- <Tabs onChange={onTabChange} activeKey={tabKey}>
561
- <TabPane tab='单选' key='single'>
562
- {tabKey === 'single' && (
563
- <BusinessSearchSelect {...props} />
564
- )}
565
- </TabPane>
566
- <TabPane tab='多选' key='multiple'>
567
- {tabKey === 'multiple' && (
568
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
569
- )}
570
- </TabPane>
571
- </Tabs>
572
- </div>
573
- );
574
- };
575
- ```
576
-
577
-
578
- ## 客户选择器 Select-KH-001
579
-
580
- ```tsx
581
- import React, { useState } from 'react';
582
- import { Tabs } from 'antd';
583
- import {BusinessSearchSelect} from '../../../index.ts';
584
-
585
- const { TabPane } = Tabs;
586
-
587
- export default () => {
588
- const selectProps = {
589
- // mode: 'multiple',
590
- // maxTagCount: 1,
591
- // disabled: true
592
- }
593
- const selectPropsMultiple = {
594
- mode: 'multiple',
595
- maxTagCount: 1,
596
- }
597
-
598
- const [ tabKey, setTabKey ] = useState('single')
599
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
600
-
601
- const props = {
602
- value,
603
- onChange: (value: any) => {
604
- console.log(value)
605
- setValue(value)
606
- },
607
- // requestConfig: {
608
- // url: `/bop/api/customer`,
609
- // filter: 'qp-name,code-orGroup,like', // 过滤参数
610
- // mappingTextField: 'name',
611
- // mappingValueField: 'code',
612
- // otherParams: {
613
- // sorter: 'desc-id'
614
- // }, // 默认参数
615
- // sourceName: 'customerCode',
616
- // },
617
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
618
- selectProps,
619
- selectBusinessType: 'customer',
620
- };
621
-
622
- const onTabChange = (key) => {
623
- setTabKey(key)
624
- setValue(key === 'single' ? null: [])
625
- }
626
-
627
- return (
628
- <div>
629
- <Tabs onChange={onTabChange} activeKey={tabKey}>
630
- <TabPane tab='单选' key='single'>
631
- {tabKey === 'single' && (
632
- <BusinessSearchSelect {...props} />
633
- )}
634
- </TabPane>
635
- <TabPane tab='多选' key='multiple'>
636
- {tabKey === 'multiple' && (
637
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
638
- )}
639
- </TabPane>
640
- </Tabs>
641
- </div>
642
- );
643
- };
644
- ```
645
-
646
-
647
- ## 店铺选择器 Select-DP-001
648
-
649
- ```tsx
650
- import React, { useState } from 'react';
651
- import { Tabs } from 'antd';
652
- import {BusinessSearchSelect} from '../../../index.ts';
653
-
654
- const { TabPane } = Tabs;
655
-
656
- export default () => {
657
- const selectProps = {
658
- // mode: 'multiple',
659
- // maxTagCount: 1,
660
- // disabled: true
661
- }
662
- const selectPropsMultiple = {
663
- mode: 'multiple',
664
- maxTagCount: 1,
665
- }
666
-
667
- const [ tabKey, setTabKey ] = useState('single')
668
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
669
-
670
- const props = {
671
- value,
672
- onChange: (value: any) => {
673
- console.log(value)
674
- setValue(value)
675
- },
676
- // requestConfig: {
677
- // url: `/bop/api/store`,
678
- // filter: 'qp-name,code-orGroup,like',,
679
- // mappingTextField: 'name',
680
- // mappingValueField: 'code',
681
- // otherParams: {
682
- // sorter: 'desc-id'
683
- // }, // 默认参数
684
- // sourceName: 'code',
685
- // },
686
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
687
- selectProps,
688
- selectBusinessType: 'shopFile',
689
- };
690
-
691
- const onTabChange = (key) => {
692
- setTabKey(key)
693
- setValue(key === 'single' ? null: [])
694
- }
695
-
696
- return (
697
- <div>
698
- <Tabs onChange={onTabChange} activeKey={tabKey}>
699
- <TabPane tab='单选' key='single'>
700
- {tabKey === 'single' && (
701
- <BusinessSearchSelect {...props} />
702
- )}
703
- </TabPane>
704
- <TabPane tab='多选' key='multiple'>
705
- {tabKey === 'multiple' && (
706
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
707
- )}
708
- </TabPane>
709
- </Tabs>
710
- </div>
711
- );
712
- };
713
- ```
714
-
715
-
716
- ## 核算主体选择器 Select-HSZT-001
717
-
718
- ```tsx
719
- import React, { useState } from 'react';
720
- import { Tabs } from 'antd';
721
- import {BusinessSearchSelect} from '../../../index.ts';
722
-
723
- const { TabPane } = Tabs;
724
-
725
- export default () => {
726
- const selectProps = {
727
- // mode: 'multiple',
728
- // maxTagCount: 1,
729
- // disabled: true
730
- }
731
- const selectPropsMultiple = {
732
- mode: 'multiple',
733
- maxTagCount: 1,
734
- }
735
-
736
- const [ tabKey, setTabKey ] = useState('single')
737
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
738
-
739
- const props = {
740
- value,
741
- onChange: (value: any) => {
742
- console.log(value)
743
- setValue(value)
744
- },
745
- // requestConfig: {
746
- // url: `/bop/api/accountingSubject`,
747
- // filter: 'qp-name,code-orGroup,like',
748
- // mappingTextField: 'name',
749
- // mappingValueField: 'code',
750
- // otherParams: {
751
- // sorter: 'desc-id'
752
- // }, // 默认参数
753
- // sourceName: 'accountingCode',
754
- // },
755
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
756
- selectProps,
757
- selectBusinessType: 'accountingSubject',
758
- };
759
-
760
- const onTabChange = (key) => {
761
- setTabKey(key)
762
- setValue(key === 'single' ? null: [])
763
- }
764
-
765
- return (
766
- <div>
767
- <Tabs onChange={onTabChange} activeKey={tabKey}>
768
- <TabPane tab='单选' key='single'>
769
- {tabKey === 'single' && (
770
- <BusinessSearchSelect {...props} />
771
- )}
772
- </TabPane>
773
- <TabPane tab='多选' key='multiple'>
774
- {tabKey === 'multiple' && (
775
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
776
- )}
777
- </TabPane>
778
- </Tabs>
779
- </div>
780
- );
781
- };
782
- ```
783
-
784
-
785
- ## 库存组织选择器 Select-KCZZ-001
786
-
787
- ```tsx
788
- import React, { useState } from 'react';
789
- import { Tabs } from 'antd';
790
- import {BusinessSearchSelect} from '../../../index.ts';
791
-
792
- const { TabPane } = Tabs;
793
-
794
- export default () => {
795
- const selectProps = {
796
- // mode: 'multiple',
797
- // maxTagCount: 1,
798
- // disabled: true
799
- }
800
- const selectPropsMultiple = {
801
- mode: 'multiple',
802
- maxTagCount: 1,
803
- }
804
-
805
- const [ tabKey, setTabKey ] = useState('single')
806
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
807
-
808
- const props = {
809
- value,
810
- onChange: (value: any) => {
811
- console.log(value)
812
- setValue(value)
813
- },
814
- // requestConfig: {
815
- // url: `/bop/api/inventoryOrg`,
816
- // filter: 'qp-name,code-orGroup,like',
817
- // mappingTextField: 'name',
818
- // mappingValueField: 'code',
819
- // otherParams: {
820
- // sorter: 'desc-id'
821
- // }, // 默认参数
822
- // sourceName: 'inventoryOrgCode',
823
- // },
824
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
825
- selectProps,
826
- selectBusinessType: 'inventoryOrg',
827
- };
828
-
829
- const onTabChange = (key) => {
830
- setTabKey(key)
831
- setValue(key === 'single' ? null: [])
832
- }
833
-
834
- return (
835
- <div>
836
- <Tabs onChange={onTabChange} activeKey={tabKey}>
837
- <TabPane tab='单选' key='single'>
838
- {tabKey === 'single' && (
839
- <BusinessSearchSelect {...props} />
840
- )}
841
- </TabPane>
842
- <TabPane tab='多选' key='multiple'>
843
- {tabKey === 'multiple' && (
844
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
845
- )}
846
- </TabPane>
847
- </Tabs>
848
- </div>
849
- );
850
- };
851
- ```
852
-
853
-
854
- ## 法人公司选择器 Select-FRGS-001
855
-
856
- ```tsx
857
- import React, { useState } from 'react';
858
- import { Tabs } from 'antd';
859
- import {BusinessSearchSelect} from '../../../index.ts';
860
-
861
- const { TabPane } = Tabs;
862
-
863
- export default () => {
864
- const selectProps = {
865
- // mode: 'multiple',
866
- // maxTagCount: 1,
867
- // disabled: true
868
- }
869
- const selectPropsMultiple = {
870
- mode: 'multiple',
871
- maxTagCount: 1,
872
- }
873
-
874
- const [ tabKey, setTabKey ] = useState('single')
875
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
876
-
877
- const props = {
878
- value,
879
- onChange: (value: any) => {
880
- console.log(value)
881
- setValue(value)
882
- },
883
- // requestConfig: {
884
- // url: `/bop/api/company`,
885
- // filter: 'qp-name,code-orGroup,like',
886
- // mappingTextField: 'name',
887
- // mappingValueField: 'code',
888
- // otherParams: {
889
- // 'qp-companyType-eq': '20',
890
- // sorter: 'desc-id'
891
- // }, // 默认参数
892
- // sourceName: 'companyCode',
893
- // },
894
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
895
- selectProps,
896
- selectBusinessType: 'corporationCompany',
897
- };
898
-
899
- const onTabChange = (key) => {
900
- setTabKey(key)
901
- setValue(key === 'single' ? null: [])
902
- }
903
-
904
- return (
905
- <div>
906
- <Tabs onChange={onTabChange} activeKey={tabKey}>
907
- <TabPane tab='单选' key='single'>
908
- {tabKey === 'single' && (
909
- <BusinessSearchSelect {...props} />
910
- )}
911
- </TabPane>
912
- <TabPane tab='多选' key='multiple'>
913
- {tabKey === 'multiple' && (
914
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
915
- )}
916
- </TabPane>
917
- </Tabs>
918
- </div>
919
- );
920
- };
921
- ```
922
-
923
-
924
- ## 员工选择器 Select-YG-001
925
-
926
- ```tsx
927
- import React, { useState } from 'react';
928
- import { Tabs } from 'antd';
929
- import {BusinessSearchSelect} from '../../../index.ts';
930
-
931
- const { TabPane } = Tabs;
932
-
933
- export default () => {
934
- const selectProps = {
935
- // mode: 'multiple',
936
- // maxTagCount: 1,
937
- // disabled: true
938
- }
939
- const selectPropsMultiple = {
940
- mode: 'multiple',
941
- maxTagCount: 1,
942
- }
943
-
944
- const [ tabKey, setTabKey ] = useState('single')
945
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
946
-
947
- const props = {
948
- value,
949
- onChange: (value: any) => {
950
- console.log(value)
951
- setValue(value)
952
- },
953
- // requestConfig: {
954
- // url: `/bop/api/employee`,
955
- // filter: 'qp-name,code-orGroup,like',
956
- // mappingTextField: 'name',
957
- // mappingValueField: 'code',
958
- // otherParams: {
959
- // sorter: 'desc-id'
960
- // }, // 默认参数
961
- // sourceName: 'code',
962
- // },
963
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
964
- selectProps,
965
- selectBusinessType: 'employee',
966
- };
967
-
968
- const onTabChange = (key) => {
969
- setTabKey(key)
970
- setValue(key === 'single' ? null: [])
971
- }
972
-
973
- return (
974
- <div>
975
- <Tabs onChange={onTabChange} activeKey={tabKey}>
976
- <TabPane tab='单选' key='single'>
977
- {tabKey === 'single' && (
978
- <BusinessSearchSelect {...props} />
979
- )}
980
- </TabPane>
981
- <TabPane tab='多选' key='multiple'>
982
- {tabKey === 'multiple' && (
983
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
984
- )}
985
- </TabPane>
986
- </Tabs>
987
- </div>
988
- );
989
- };
990
- ```
991
-
992
-
993
- ## 配送方式选择器 Select-PSFS-001
994
-
995
- ```tsx
996
- import React, { useState } from 'react';
997
- import { Tabs } from 'antd';
998
- import {BusinessSearchSelect} from '../../../index.ts';
999
-
1000
- const { TabPane } = Tabs;
1001
-
1002
- export default () => {
1003
- const selectProps = {
1004
- // mode: 'multiple',
1005
- // maxTagCount: 1,
1006
- // disabled: true
1007
- }
1008
- const selectPropsMultiple = {
1009
- mode: 'multiple',
1010
- maxTagCount: 1,
1011
- }
1012
-
1013
- const [ tabKey, setTabKey ] = useState('single')
1014
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
1015
-
1016
- const props = {
1017
- value,
1018
- onChange: (value: any) => {
1019
- console.log(value)
1020
- setValue(value)
1021
- },
1022
- // requestConfig: {
1023
- // url: `/bop/api/getDeliveryModeCodeNameMap`,
1024
- // filter: 'qp-name,code-orGroup,like',
1025
- // mappingTextField: 'name',
1026
- // mappingValueField: 'code',
1027
- // otherParams: {
1028
- // sorter: 'desc-id'
1029
- // }, // 默认参数
1030
- // sourceName: 'deliveryModeCode',
1031
- // },
1032
- prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
1033
- selectProps,
1034
- selectBusinessType: 'deliveryMode',
1035
- };
1036
-
1037
- const onTabChange = (key) => {
1038
- setTabKey(key)
1039
- setValue(key === 'single' ? null: [])
1040
- }
1041
-
1042
- return (
1043
- <div>
1044
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1045
- <TabPane tab='单选' key='single'>
1046
- {tabKey === 'single' && (
1047
- <BusinessSearchSelect {...props} />
1048
- )}
1049
- </TabPane>
1050
- <TabPane tab='多选' key='multiple'>
1051
- {tabKey === 'multiple' && (
1052
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1053
- )}
1054
- </TabPane>
1055
- </Tabs>
1056
- </div>
1057
- );
1058
- };
1059
- ```
1060
-
1061
- More skills for writing demo: https://d.umijs.org/guide/demo-principle
1
+ ---
2
+ nav:
3
+ title: '组件'
4
+ order: 1
5
+ group:
6
+ title: 业务组件
7
+ order: 1
8
+ title: 业务档案选择器
9
+ order: 1
10
+ ---
11
+
12
+ # BusinessSearchSelect
13
+
14
+
15
+ ## 供应商选择器 Select-GYS-001
16
+
17
+ ```tsx
18
+ import React, { useState } from 'react';
19
+ import { Tabs } from 'antd';
20
+ import {BusinessSearchSelect} from '../../../index.ts';
21
+
22
+ const { TabPane } = Tabs;
23
+
24
+ export default () => {
25
+ // selectBusinessType 必传(不传默认为供应商选择器)
26
+
27
+ const selectProps = {
28
+ // mode: 'multiple',
29
+ // maxTagCount: 1,
30
+ // disabled: true
31
+ }
32
+ const selectPropsMultiple = {
33
+ mode: 'multiple',
34
+ maxTagCount: 1,
35
+ }
36
+
37
+ const [ tabKey, setTabKey ] = useState('single')
38
+ const [value, setValue] = useState(null);
39
+
40
+ const props = {
41
+ value,
42
+ // labelInValue: true, // 非必填 默认为false
43
+ // requestConfig: {
44
+ // url: `/bop/api/supplier`,
45
+ // filter: 'qp-name,code-orGroup,like', // 过滤参数
46
+ // otherParams: {}, // 默认参数
47
+ // mappingTextField: 'name',
48
+ // mappingValueField: 'code',
49
+ // }, // 非必传,业务字段已根据业务默认默认
50
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' }, // 非必传,下拉框和tableForm下拉框接口前缀,默认为bop的接口
51
+ selectProps, // 非必传
52
+ onChange: (value: any) => {
53
+ console.log(value)
54
+ setValue(value)
55
+ },
56
+ selectBusinessType: 'supplier',
57
+ };
58
+
59
+ const onTabChange = (key) => {
60
+ setTabKey(key)
61
+ setValue(key === 'single' ? null: [])
62
+ }
63
+
64
+ return (
65
+ <div>
66
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
67
+ <TabPane tab='单选' key='single'>
68
+ {tabKey === 'single' && (
69
+ <BusinessSearchSelect {...props} />
70
+ )}
71
+ </TabPane>
72
+ <TabPane tab='多选' key='multiple'>
73
+ {tabKey === 'multiple' && (
74
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
75
+ )}
76
+ </TabPane>
77
+ </Tabs>
78
+ </div>
79
+ );
80
+ };
81
+ ```
82
+
83
+
84
+ ## 商品SKU选择器 Select-SKU-001
85
+
86
+ ```tsx
87
+ import React, { useState } from 'react';
88
+ import { Tabs } from 'antd';
89
+ import {BusinessSearchSelect} from '../../../index.ts';
90
+
91
+ const { TabPane } = Tabs;
92
+ export default () => {
93
+ const selectProps = {
94
+ // mode: 'multiple',
95
+ // maxTagCount: 1,
96
+ // disabled: true
97
+ }
98
+ const selectPropsMultiple = {
99
+ mode: 'multiple',
100
+ maxTagCount: 1,
101
+ }
102
+
103
+ const [ tabKey, setTabKey ] = useState('single')
104
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
105
+
106
+ const props = {
107
+ value,
108
+ onChange: (value: any) => {
109
+ console.log(value)
110
+ setValue(value)
111
+ },
112
+ // requestConfig: {
113
+ // url: `/bop/api/sku/pager/v2`,
114
+ // filter: 'skuCodeAndSkuName',
115
+ // mappingValueField: 'skuCode',
116
+ // otherParams: {
117
+ // sorter: 'desc-id'
118
+ // }, // 默认参数
119
+ // sourceName: 'skuCode',
120
+ // },
121
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
122
+ selectProps,
123
+ selectBusinessType: 'skuCommodity',
124
+ };
125
+
126
+ const onTabChange = (key) => {
127
+ setTabKey(key)
128
+ setValue(key === 'single' ? null: [])
129
+ }
130
+
131
+ return (
132
+ <div>
133
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
134
+ <TabPane tab='单选' key='single'>
135
+ {tabKey === 'single' && (
136
+ <BusinessSearchSelect {...props} />
137
+ )}
138
+ </TabPane>
139
+ <TabPane tab='多选' key='multiple'>
140
+ {tabKey === 'multiple' && (
141
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
142
+ )}
143
+ </TabPane>
144
+ </Tabs>
145
+ </div>
146
+ );
147
+ };
148
+ ```
149
+
150
+ [comment]: <> (## 商品规格选择器 Select-SPGG-001)
151
+
152
+ [comment]: <> (```tsx)
153
+
154
+ [comment]: <> (import React, { useState } from 'react';)
155
+
156
+ [comment]: <> (import { Tabs } from 'antd';)
157
+
158
+ [comment]: <> (import {BusinessSearchSelect} from '../../../index.ts';)
159
+
160
+ [comment]: <> (const { TabPane } = Tabs;)
161
+
162
+ [comment]: <> (export default &#40;&#41; => {)
163
+
164
+ [comment]: <> ( const selectProps = {)
165
+
166
+ [comment]: <> ( // mode: 'multiple',)
167
+
168
+ [comment]: <> ( // maxTagCount: 1,)
169
+
170
+ [comment]: <> ( // disabled: true)
171
+
172
+ [comment]: <> ( })
173
+
174
+ [comment]: <> ( const selectPropsMultiple = {)
175
+
176
+ [comment]: <> ( mode: 'multiple',)
177
+
178
+ [comment]: <> ( maxTagCount: 1,)
179
+
180
+ [comment]: <> ( })
181
+
182
+ [comment]: <> ( const [ tabKey, setTabKey ] = useState&#40;'single'&#41;)
183
+
184
+ [comment]: <> ( const [value, setValue] = useState&#40;selectProps?.mode ? [] : null&#41;;)
185
+
186
+ [comment]: <> ( const props = {)
187
+
188
+ [comment]: <> ( value,)
189
+
190
+ [comment]: <> ( onChange: &#40;value: any&#41; => {)
191
+
192
+ [comment]: <> ( console.log&#40;value&#41;)
193
+
194
+ [comment]: <> ( setValue&#40;value&#41;)
195
+
196
+ [comment]: <> ( },)
197
+
198
+ [comment]: <> ( prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },)
199
+
200
+ [comment]: <> ( selectProps,)
201
+
202
+ [comment]: <> ( selectBusinessType: 'skuPropertyValue',)
203
+
204
+ [comment]: <> ( };)
205
+
206
+ [comment]: <> ( const onTabChange = &#40;key&#41; => {)
207
+
208
+ [comment]: <> ( setTabKey&#40;key&#41;)
209
+
210
+ [comment]: <> ( setValue&#40;key === 'single' ? null: []&#41;)
211
+
212
+ [comment]: <> ( })
213
+
214
+ [comment]: <> ( return &#40;)
215
+
216
+ [comment]: <> ( <div>)
217
+
218
+ [comment]: <> ( <Tabs onChange={onTabChange} activeKey={tabKey}>)
219
+
220
+ [comment]: <> ( <TabPane tab='单选' key='single'>)
221
+
222
+ [comment]: <> ( {tabKey === 'single' && &#40;)
223
+
224
+ [comment]: <> ( <BusinessSearchSelect {...props} />)
225
+
226
+ [comment]: <> ( &#41;})
227
+
228
+ [comment]: <> ( </TabPane>)
229
+
230
+ [comment]: <> ( <TabPane tab='多选' key='multiple'>)
231
+
232
+ [comment]: <> ( {tabKey === 'multiple' && &#40;)
233
+
234
+ [comment]: <> ( <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />)
235
+
236
+ [comment]: <> ( &#41;})
237
+
238
+ [comment]: <> ( </TabPane>)
239
+
240
+ [comment]: <> ( </Tabs>)
241
+
242
+ [comment]: <> ( </div>)
243
+
244
+ [comment]: <> ( &#41;;)
245
+
246
+ [comment]: <> (};)
247
+
248
+ [comment]: <> (```)
249
+
250
+ ## 商品SPU选择器 Select-SPU-001
251
+
252
+ ```tsx
253
+ import React, { useState } from 'react';
254
+ import { Tabs } from 'antd';
255
+ import {BusinessSearchSelect} from '../../../index.ts';
256
+
257
+ const { TabPane } = Tabs;
258
+ export default () => {
259
+ const selectProps = {
260
+ // mode: 'multiple',
261
+ // maxTagCount: 1,
262
+ // disabled: true
263
+ }
264
+ const selectPropsMultiple = {
265
+ mode: 'multiple',
266
+ maxTagCount: 6,
267
+ }
268
+
269
+ const [ tabKey, setTabKey ] = useState('single')
270
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
271
+
272
+ const props = {
273
+ value,
274
+ onChange: (value: any) => {
275
+ console.log(value)
276
+ setValue(value)
277
+ },
278
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
279
+ selectProps,
280
+ selectBusinessType: 'spuCommodity',
281
+ };
282
+
283
+ const onTabChange = (key) => {
284
+ setTabKey(key)
285
+ setValue(key === 'single' ? null: [])
286
+ }
287
+
288
+ return (
289
+ <div>
290
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
291
+ <TabPane tab='单选' key='single'>
292
+ {tabKey === 'single' && (
293
+ <BusinessSearchSelect {...props} />
294
+ )}
295
+ </TabPane>
296
+ <TabPane tab='多选' key='multiple'>
297
+ {tabKey === 'multiple' && (
298
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
299
+ )}
300
+ </TabPane>
301
+ </Tabs>
302
+ </div>
303
+ );
304
+ };
305
+ ```
306
+
307
+
308
+ ## 仓库选择器(物理仓) Select-Warehouse-001
309
+
310
+ ```tsx
311
+ import React, { useState } from 'react';
312
+ import { Tabs } from 'antd';
313
+ import {BusinessSearchSelect} from '../../../index.ts';
314
+
315
+ const { TabPane } = Tabs;
316
+
317
+ export default () => {
318
+ const selectProps = {
319
+ // mode: 'multiple',
320
+ // maxTagCount: 1,
321
+ // disabled: true
322
+ }
323
+ const selectPropsMultiple = {
324
+ mode: 'multiple',
325
+ maxTagCount: 1,
326
+ }
327
+
328
+ const [ tabKey, setTabKey ] = useState('single')
329
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
330
+
331
+ const props = {
332
+ value,
333
+ onChange: (value: any) => {
334
+ console.log(value)
335
+ setValue(value)
336
+ },
337
+ // requestConfig: {
338
+ // mappingValueField: 'physicalWarehouseCode',
339
+ // sourceName: 'physicalWarehouseCode',
340
+ // },
341
+ // modalTableProps: {
342
+ // modalTableTitle: '选择物理仓-更改title测试',
343
+ // },
344
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
345
+ selectProps,
346
+ selectBusinessType: 'physicalWarehouse',
347
+ };
348
+
349
+ const onTabChange = (key) => {
350
+ setTabKey(key)
351
+ setValue(key === 'single' ? null: [])
352
+ }
353
+
354
+ return (
355
+ <div>
356
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
357
+ <TabPane tab='单选' key='single'>
358
+ {tabKey === 'single' && (
359
+ <BusinessSearchSelect {...props} />
360
+ )}
361
+ </TabPane>
362
+ <TabPane tab='多选' key='multiple'>
363
+ {tabKey === 'multiple' && (
364
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
365
+ )}
366
+ </TabPane>
367
+ </Tabs>
368
+ </div>
369
+ );
370
+ };
371
+ ```
372
+
373
+ ## 仓库选择器(逻辑仓) Select-Warehouse-002
374
+
375
+ ```tsx
376
+ import React, { useState } from 'react';
377
+ import { Tabs } from 'antd';
378
+ import {BusinessSearchSelect} from '../../../index.ts';
379
+
380
+ const { TabPane } = Tabs;
381
+
382
+ export default () => {
383
+ const selectProps = {
384
+ // mode: 'multiple',
385
+ // maxTagCount: 1,
386
+ // disabled: true
387
+ }
388
+ const selectPropsMultiple = {
389
+ mode: 'multiple',
390
+ maxTagCount: 1,
391
+ }
392
+
393
+ const [ tabKey, setTabKey ] = useState('single')
394
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
395
+
396
+ const props = {
397
+ value,
398
+ onChange: (value: any) => {
399
+ console.log(value)
400
+ setValue(value)
401
+ },
402
+ // requestConfig: {
403
+ // url: `/bop/api/realWarehouse`,
404
+ // filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
405
+ // mappingTextField: 'realWarehouseName',
406
+ // mappingValueField: 'realWarehouseCode',
407
+ // otherParams: {
408
+ // sorter: 'desc-id'
409
+ // }, // 默认参数
410
+ // sourceName: 'warehouseIds',
411
+ // },
412
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
413
+ selectProps,
414
+ selectBusinessType: 'realWarehouse',
415
+ };
416
+
417
+ const onTabChange = (key) => {
418
+ setTabKey(key)
419
+ setValue(key === 'single' ? null: [])
420
+ }
421
+
422
+ return (
423
+ <div>
424
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
425
+ <TabPane tab='单选' key='single'>
426
+ {tabKey === 'single' && (
427
+ <BusinessSearchSelect {...props} />
428
+ )}
429
+ </TabPane>
430
+ <TabPane tab='多选' key='multiple'>
431
+ {tabKey === 'multiple' && (
432
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
433
+ )}
434
+ </TabPane>
435
+ </Tabs>
436
+ </div>
437
+ );
438
+ };
439
+ ```
440
+
441
+ ## 仓库选择器(虚拟仓) Select-Warehouse-003
442
+
443
+ ```tsx
444
+ import React, { useState } from 'react';
445
+ import { Tabs } from 'antd';
446
+ import {BusinessSearchSelect} from '../../../index.ts';
447
+
448
+ const { TabPane } = Tabs;
449
+
450
+ export default () => {
451
+ const selectProps = {
452
+ // mode: 'multiple',
453
+ // maxTagCount: 1,
454
+ // disabled: true
455
+ }
456
+ const selectPropsMultiple = {
457
+ mode: 'multiple',
458
+ maxTagCount: 1,
459
+ }
460
+
461
+ const [ tabKey, setTabKey ] = useState('single')
462
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
463
+
464
+ const props = {
465
+ value,
466
+ onChange: (value: any) => {
467
+ console.log(value)
468
+ setValue(value)
469
+ },
470
+ // requestConfig: {
471
+ // url: `/bop/api/virtualWarehouse`,
472
+ // filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
473
+ // mappingTextField: 'virtualWarehouseName',
474
+ // mappingValueField: 'virtualWarehouseCode',
475
+ // otherParams: {
476
+ // sorter: 'desc-id'
477
+ // }, // 默认参数
478
+ // sourceName: 'warehouseIds',
479
+ // },
480
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
481
+ selectProps,
482
+ selectBusinessType: 'virtualWarehouse',
483
+ };
484
+
485
+ const onTabChange = (key) => {
486
+ setTabKey(key)
487
+ setValue(key === 'single' ? null: [])
488
+ }
489
+
490
+ return (
491
+ <div>
492
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
493
+ <TabPane tab='单选' key='single'>
494
+ {tabKey === 'single' && (
495
+ <BusinessSearchSelect {...props} />
496
+ )}
497
+ </TabPane>
498
+ <TabPane tab='多选' key='multiple'>
499
+ {tabKey === 'multiple' && (
500
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
501
+ )}
502
+ </TabPane>
503
+ </Tabs>
504
+ </div>
505
+ );
506
+ };
507
+ ```
508
+
509
+ ## 仓库选择器(渠道仓) Select-Warehouse-004
510
+
511
+ ```tsx
512
+ import React, { useState } from 'react';
513
+ import { Tabs } from 'antd';
514
+ import {BusinessSearchSelect} from '../../../index.ts';
515
+
516
+ const { TabPane } = Tabs;
517
+
518
+ export default () => {
519
+ const selectProps = {
520
+ // mode: 'multiple',
521
+ // maxTagCount: 1,
522
+ // disabled: true
523
+ }
524
+ const selectPropsMultiple = {
525
+ mode: 'multiple',
526
+ maxTagCount: 1,
527
+ }
528
+
529
+ const [ tabKey, setTabKey ] = useState('single')
530
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
531
+
532
+ const props = {
533
+ value,
534
+ onChange: (value: any) => {
535
+ console.log(value)
536
+ setValue(value)
537
+ },
538
+ // requestConfig: {
539
+ // url: `/bop/api/channelWarehouse`,
540
+ // filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
541
+ // mappingTextField: 'channelWarehouseName',
542
+ // mappingValueField: 'channelWarehouseCode',
543
+ // otherParams: {
544
+ // sorter: 'desc-id'
545
+ // }, // 默认参数
546
+ // sourceName: 'warehouseIds',
547
+ // },
548
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
549
+ selectProps,
550
+ selectBusinessType: 'channelWarehouse',
551
+ };
552
+
553
+ const onTabChange = (key) => {
554
+ setTabKey(key)
555
+ setValue(key === 'single' ? null: [])
556
+ }
557
+
558
+ return (
559
+ <div>
560
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
561
+ <TabPane tab='单选' key='single'>
562
+ {tabKey === 'single' && (
563
+ <BusinessSearchSelect {...props} />
564
+ )}
565
+ </TabPane>
566
+ <TabPane tab='多选' key='multiple'>
567
+ {tabKey === 'multiple' && (
568
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
569
+ )}
570
+ </TabPane>
571
+ </Tabs>
572
+ </div>
573
+ );
574
+ };
575
+ ```
576
+
577
+
578
+ ## 客户选择器 Select-KH-001
579
+
580
+ ```tsx
581
+ import React, { useState } from 'react';
582
+ import { Tabs } from 'antd';
583
+ import {BusinessSearchSelect} from '../../../index.ts';
584
+
585
+ const { TabPane } = Tabs;
586
+
587
+ export default () => {
588
+ const selectProps = {
589
+ // mode: 'multiple',
590
+ // maxTagCount: 1,
591
+ // disabled: true
592
+ }
593
+ const selectPropsMultiple = {
594
+ mode: 'multiple',
595
+ maxTagCount: 1,
596
+ }
597
+
598
+ const [ tabKey, setTabKey ] = useState('single')
599
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
600
+
601
+ const props = {
602
+ value,
603
+ onChange: (value: any) => {
604
+ console.log(value)
605
+ setValue(value)
606
+ },
607
+ // requestConfig: {
608
+ // url: `/bop/api/customer`,
609
+ // filter: 'qp-name,code-orGroup,like', // 过滤参数
610
+ // mappingTextField: 'name',
611
+ // mappingValueField: 'code',
612
+ // otherParams: {
613
+ // sorter: 'desc-id'
614
+ // }, // 默认参数
615
+ // sourceName: 'customerCode',
616
+ // },
617
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
618
+ selectProps,
619
+ selectBusinessType: 'customer',
620
+ };
621
+
622
+ const onTabChange = (key) => {
623
+ setTabKey(key)
624
+ setValue(key === 'single' ? null: [])
625
+ }
626
+
627
+ return (
628
+ <div>
629
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
630
+ <TabPane tab='单选' key='single'>
631
+ {tabKey === 'single' && (
632
+ <BusinessSearchSelect {...props} />
633
+ )}
634
+ </TabPane>
635
+ <TabPane tab='多选' key='multiple'>
636
+ {tabKey === 'multiple' && (
637
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
638
+ )}
639
+ </TabPane>
640
+ </Tabs>
641
+ </div>
642
+ );
643
+ };
644
+ ```
645
+
646
+
647
+ ## 店铺选择器 Select-DP-001
648
+
649
+ ```tsx
650
+ import React, { useState } from 'react';
651
+ import { Tabs } from 'antd';
652
+ import {BusinessSearchSelect} from '../../../index.ts';
653
+
654
+ const { TabPane } = Tabs;
655
+
656
+ export default () => {
657
+ const selectProps = {
658
+ // mode: 'multiple',
659
+ // maxTagCount: 1,
660
+ // disabled: true
661
+ }
662
+ const selectPropsMultiple = {
663
+ mode: 'multiple',
664
+ maxTagCount: 1,
665
+ }
666
+
667
+ const [ tabKey, setTabKey ] = useState('single')
668
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
669
+
670
+ const props = {
671
+ value,
672
+ onChange: (value: any) => {
673
+ console.log(value)
674
+ setValue(value)
675
+ },
676
+ // requestConfig: {
677
+ // url: `/bop/api/store`,
678
+ // filter: 'qp-name,code-orGroup,like',,
679
+ // mappingTextField: 'name',
680
+ // mappingValueField: 'code',
681
+ // otherParams: {
682
+ // sorter: 'desc-id'
683
+ // }, // 默认参数
684
+ // sourceName: 'code',
685
+ // },
686
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
687
+ selectProps,
688
+ selectBusinessType: 'shopFile',
689
+ };
690
+
691
+ const onTabChange = (key) => {
692
+ setTabKey(key)
693
+ setValue(key === 'single' ? null: [])
694
+ }
695
+
696
+ return (
697
+ <div>
698
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
699
+ <TabPane tab='单选' key='single'>
700
+ {tabKey === 'single' && (
701
+ <BusinessSearchSelect {...props} />
702
+ )}
703
+ </TabPane>
704
+ <TabPane tab='多选' key='multiple'>
705
+ {tabKey === 'multiple' && (
706
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
707
+ )}
708
+ </TabPane>
709
+ </Tabs>
710
+ </div>
711
+ );
712
+ };
713
+ ```
714
+
715
+
716
+ ## 核算主体选择器 Select-HSZT-001
717
+
718
+ ```tsx
719
+ import React, { useState } from 'react';
720
+ import { Tabs } from 'antd';
721
+ import {BusinessSearchSelect} from '../../../index.ts';
722
+
723
+ const { TabPane } = Tabs;
724
+
725
+ export default () => {
726
+ const selectProps = {
727
+ // mode: 'multiple',
728
+ // maxTagCount: 1,
729
+ // disabled: true
730
+ }
731
+ const selectPropsMultiple = {
732
+ mode: 'multiple',
733
+ maxTagCount: 1,
734
+ }
735
+
736
+ const [ tabKey, setTabKey ] = useState('single')
737
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
738
+
739
+ const props = {
740
+ value,
741
+ onChange: (value: any) => {
742
+ console.log(value)
743
+ setValue(value)
744
+ },
745
+ // requestConfig: {
746
+ // url: `/bop/api/accountingSubject`,
747
+ // filter: 'qp-name,code-orGroup,like',
748
+ // mappingTextField: 'name',
749
+ // mappingValueField: 'code',
750
+ // otherParams: {
751
+ // sorter: 'desc-id'
752
+ // }, // 默认参数
753
+ // sourceName: 'accountingCode',
754
+ // },
755
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
756
+ selectProps,
757
+ selectBusinessType: 'accountingSubject',
758
+ };
759
+
760
+ const onTabChange = (key) => {
761
+ setTabKey(key)
762
+ setValue(key === 'single' ? null: [])
763
+ }
764
+
765
+ return (
766
+ <div>
767
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
768
+ <TabPane tab='单选' key='single'>
769
+ {tabKey === 'single' && (
770
+ <BusinessSearchSelect {...props} />
771
+ )}
772
+ </TabPane>
773
+ <TabPane tab='多选' key='multiple'>
774
+ {tabKey === 'multiple' && (
775
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
776
+ )}
777
+ </TabPane>
778
+ </Tabs>
779
+ </div>
780
+ );
781
+ };
782
+ ```
783
+
784
+
785
+ ## 库存组织选择器 Select-KCZZ-001
786
+
787
+ ```tsx
788
+ import React, { useState } from 'react';
789
+ import { Tabs } from 'antd';
790
+ import {BusinessSearchSelect} from '../../../index.ts';
791
+
792
+ const { TabPane } = Tabs;
793
+
794
+ export default () => {
795
+ const selectProps = {
796
+ // mode: 'multiple',
797
+ // maxTagCount: 1,
798
+ // disabled: true
799
+ }
800
+ const selectPropsMultiple = {
801
+ mode: 'multiple',
802
+ maxTagCount: 1,
803
+ }
804
+
805
+ const [ tabKey, setTabKey ] = useState('single')
806
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
807
+
808
+ const props = {
809
+ value,
810
+ onChange: (value: any) => {
811
+ console.log(value)
812
+ setValue(value)
813
+ },
814
+ // requestConfig: {
815
+ // url: `/bop/api/inventoryOrg`,
816
+ // filter: 'qp-name,code-orGroup,like',
817
+ // mappingTextField: 'name',
818
+ // mappingValueField: 'code',
819
+ // otherParams: {
820
+ // sorter: 'desc-id'
821
+ // }, // 默认参数
822
+ // sourceName: 'inventoryOrgCode',
823
+ // },
824
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
825
+ selectProps,
826
+ selectBusinessType: 'inventoryOrg',
827
+ };
828
+
829
+ const onTabChange = (key) => {
830
+ setTabKey(key)
831
+ setValue(key === 'single' ? null: [])
832
+ }
833
+
834
+ return (
835
+ <div>
836
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
837
+ <TabPane tab='单选' key='single'>
838
+ {tabKey === 'single' && (
839
+ <BusinessSearchSelect {...props} />
840
+ )}
841
+ </TabPane>
842
+ <TabPane tab='多选' key='multiple'>
843
+ {tabKey === 'multiple' && (
844
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
845
+ )}
846
+ </TabPane>
847
+ </Tabs>
848
+ </div>
849
+ );
850
+ };
851
+ ```
852
+
853
+
854
+ ## 法人公司选择器 Select-FRGS-001
855
+
856
+ ```tsx
857
+ import React, { useState } from 'react';
858
+ import { Tabs } from 'antd';
859
+ import {BusinessSearchSelect} from '../../../index.ts';
860
+
861
+ const { TabPane } = Tabs;
862
+
863
+ export default () => {
864
+ const selectProps = {
865
+ // mode: 'multiple',
866
+ // maxTagCount: 1,
867
+ // disabled: true
868
+ }
869
+ const selectPropsMultiple = {
870
+ mode: 'multiple',
871
+ maxTagCount: 1,
872
+ }
873
+
874
+ const [ tabKey, setTabKey ] = useState('single')
875
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
876
+
877
+ const props = {
878
+ value,
879
+ onChange: (value: any) => {
880
+ console.log(value)
881
+ setValue(value)
882
+ },
883
+ // requestConfig: {
884
+ // url: `/bop/api/company`,
885
+ // filter: 'qp-name,code-orGroup,like',
886
+ // mappingTextField: 'name',
887
+ // mappingValueField: 'code',
888
+ // otherParams: {
889
+ // 'qp-companyType-eq': '20',
890
+ // sorter: 'desc-id'
891
+ // }, // 默认参数
892
+ // sourceName: 'companyCode',
893
+ // },
894
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
895
+ selectProps,
896
+ selectBusinessType: 'corporationCompany',
897
+ };
898
+
899
+ const onTabChange = (key) => {
900
+ setTabKey(key)
901
+ setValue(key === 'single' ? null: [])
902
+ }
903
+
904
+ return (
905
+ <div>
906
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
907
+ <TabPane tab='单选' key='single'>
908
+ {tabKey === 'single' && (
909
+ <BusinessSearchSelect {...props} />
910
+ )}
911
+ </TabPane>
912
+ <TabPane tab='多选' key='multiple'>
913
+ {tabKey === 'multiple' && (
914
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
915
+ )}
916
+ </TabPane>
917
+ </Tabs>
918
+ </div>
919
+ );
920
+ };
921
+ ```
922
+
923
+
924
+ ## 员工选择器 Select-YG-001
925
+
926
+ ```tsx
927
+ import React, { useState } from 'react';
928
+ import { Tabs } from 'antd';
929
+ import {BusinessSearchSelect} from '../../../index.ts';
930
+
931
+ const { TabPane } = Tabs;
932
+
933
+ export default () => {
934
+ const selectProps = {
935
+ // mode: 'multiple',
936
+ // maxTagCount: 1,
937
+ // disabled: true
938
+ }
939
+ const selectPropsMultiple = {
940
+ mode: 'multiple',
941
+ maxTagCount: 1,
942
+ }
943
+
944
+ const [ tabKey, setTabKey ] = useState('single')
945
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
946
+
947
+ const props = {
948
+ value,
949
+ onChange: (value: any) => {
950
+ console.log(value)
951
+ setValue(value)
952
+ },
953
+ // requestConfig: {
954
+ // url: `/bop/api/employee`,
955
+ // filter: 'qp-name,code-orGroup,like',
956
+ // mappingTextField: 'name',
957
+ // mappingValueField: 'code',
958
+ // otherParams: {
959
+ // sorter: 'desc-id'
960
+ // }, // 默认参数
961
+ // sourceName: 'code',
962
+ // },
963
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
964
+ selectProps,
965
+ selectBusinessType: 'employee',
966
+ };
967
+
968
+ const onTabChange = (key) => {
969
+ setTabKey(key)
970
+ setValue(key === 'single' ? null: [])
971
+ }
972
+
973
+ return (
974
+ <div>
975
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
976
+ <TabPane tab='单选' key='single'>
977
+ {tabKey === 'single' && (
978
+ <BusinessSearchSelect {...props} />
979
+ )}
980
+ </TabPane>
981
+ <TabPane tab='多选' key='multiple'>
982
+ {tabKey === 'multiple' && (
983
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
984
+ )}
985
+ </TabPane>
986
+ </Tabs>
987
+ </div>
988
+ );
989
+ };
990
+ ```
991
+
992
+
993
+ ## 配送方式选择器 Select-PSFS-001
994
+
995
+ ```tsx
996
+ import React, { useState } from 'react';
997
+ import { Tabs } from 'antd';
998
+ import {BusinessSearchSelect} from '../../../index.ts';
999
+
1000
+ const { TabPane } = Tabs;
1001
+
1002
+ export default () => {
1003
+ const selectProps = {
1004
+ // mode: 'multiple',
1005
+ // maxTagCount: 1,
1006
+ // disabled: true
1007
+ }
1008
+ const selectPropsMultiple = {
1009
+ mode: 'multiple',
1010
+ maxTagCount: 1,
1011
+ }
1012
+
1013
+ const [ tabKey, setTabKey ] = useState('single')
1014
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1015
+
1016
+ const props = {
1017
+ value,
1018
+ onChange: (value: any) => {
1019
+ console.log(value)
1020
+ setValue(value)
1021
+ },
1022
+ // requestConfig: {
1023
+ // url: `/bop/api/getDeliveryModeCodeNameMap`,
1024
+ // filter: 'qp-name,code-orGroup,like',
1025
+ // mappingTextField: 'name',
1026
+ // mappingValueField: 'code',
1027
+ // otherParams: {
1028
+ // sorter: 'desc-id'
1029
+ // }, // 默认参数
1030
+ // sourceName: 'deliveryModeCode',
1031
+ // },
1032
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
1033
+ selectProps,
1034
+ selectBusinessType: 'deliveryMode',
1035
+ };
1036
+
1037
+ const onTabChange = (key) => {
1038
+ setTabKey(key)
1039
+ setValue(key === 'single' ? null: [])
1040
+ }
1041
+
1042
+ return (
1043
+ <div>
1044
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1045
+ <TabPane tab='单选' key='single'>
1046
+ {tabKey === 'single' && (
1047
+ <BusinessSearchSelect {...props} />
1048
+ )}
1049
+ </TabPane>
1050
+ <TabPane tab='多选' key='multiple'>
1051
+ {tabKey === 'multiple' && (
1052
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1053
+ )}
1054
+ </TabPane>
1055
+ </Tabs>
1056
+ </div>
1057
+ );
1058
+ };
1059
+ ```
1060
+
1061
+ More skills for writing demo: https://d.umijs.org/guide/demo-principle