@bit-sun/business-component 1.1.21 → 1.1.24

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 (29) hide show
  1. package/package.json +1 -1
  2. package/src/components/Business/CommodityEntry/index.md +69 -0
  3. package/src/components/Business/CommodityEntry/index.tsx +75 -0
  4. package/src/components/Business/SearchSelect/BusinessUtils.ts +888 -0
  5. package/src/components/Business/SearchSelect/common.ts +34 -0
  6. package/src/components/Business/SearchSelect/index.md +906 -0
  7. package/src/components/{SearchSelect/business/BusinessSearchSelect.tsx → Business/SearchSelect/index.tsx} +3 -2
  8. package/src/components/Business/SearchSelect/utils.ts +71 -0
  9. package/src/components/{DataValidation → Functional/DataValidation}/index.less +0 -0
  10. package/src/components/{DataValidation → Functional/DataValidation}/index.md +3 -3
  11. package/src/components/{DataValidation → Functional/DataValidation}/index.tsx +1 -1
  12. package/src/components/{QueryMutipleInput → Functional/QueryMutipleInput}/index.less +0 -0
  13. package/src/components/{QueryMutipleInput → Functional/QueryMutipleInput}/index.md +3 -3
  14. package/src/components/{QueryMutipleInput → Functional/QueryMutipleInput}/index.tsx +0 -0
  15. package/src/components/{SearchSelect → Functional/SearchSelect}/index.less +0 -0
  16. package/src/components/{SearchSelect → Functional/SearchSelect}/index.md +14 -11
  17. package/src/components/{SearchSelect → Functional/SearchSelect}/index.tsx +226 -106
  18. package/src/index.ts +5 -4
  19. package/dist/components/DataValidation/index.d.ts +0 -144
  20. package/dist/components/QueryMutipleInput/index.d.ts +0 -5
  21. package/dist/components/SearchSelect/business/BusinessSearchSelect.d.ts +0 -2
  22. package/dist/components/SearchSelect/business/BusinessUtils.d.ts +0 -22
  23. package/dist/components/SearchSelect/index.d.ts +0 -3
  24. package/dist/index.d.ts +0 -5
  25. package/dist/index.esm.js +0 -3723
  26. package/dist/index.js +0 -3738
  27. package/dist/utils/CheckOneUser/index.d.ts +0 -2
  28. package/src/components/SearchSelect/business/BusinessUtils.ts +0 -464
  29. package/src/components/SearchSelect/business/index.md +0 -181
@@ -0,0 +1,906 @@
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`,
114
+ // filter: 'qp-name,skuCode-orGroup,like',
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
+ ## 仓库选择器(物理仓) Select-Warehouse-001
151
+
152
+ ```tsx
153
+ import React, { useState } from 'react';
154
+ import { Tabs } from 'antd';
155
+ import {BusinessSearchSelect} from '../../../index.ts';
156
+
157
+ const { TabPane } = Tabs;
158
+
159
+ export default () => {
160
+ const selectProps = {
161
+ // mode: 'multiple',
162
+ // maxTagCount: 1,
163
+ // disabled: true
164
+ }
165
+ const selectPropsMultiple = {
166
+ mode: 'multiple',
167
+ maxTagCount: 1,
168
+ }
169
+
170
+ const [ tabKey, setTabKey ] = useState('single')
171
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
172
+
173
+ const props = {
174
+ value,
175
+ onChange: (value: any) => {
176
+ console.log(value)
177
+ setValue(value)
178
+ },
179
+ // requestConfig: {
180
+ // url: `/bop/api/physicalWarehouse`,
181
+ // filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like',
182
+ // mappingTextField: 'physicalWarehouseName',
183
+ // mappingValueField: 'physicalWarehouseCode',
184
+ // otherParams: {
185
+ // sorter: 'desc-id'
186
+ // }, // 默认参数
187
+ // sourceName: 'warehouseIds',
188
+ // },
189
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
190
+ selectProps,
191
+ selectBusinessType: 'physicalWarehouse',
192
+ };
193
+
194
+ const onTabChange = (key) => {
195
+ setTabKey(key)
196
+ setValue(key === 'single' ? null: [])
197
+ }
198
+
199
+ return (
200
+ <div>
201
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
202
+ <TabPane tab='单选' key='single'>
203
+ {tabKey === 'single' && (
204
+ <BusinessSearchSelect {...props} />
205
+ )}
206
+ </TabPane>
207
+ <TabPane tab='多选' key='multiple'>
208
+ {tabKey === 'multiple' && (
209
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
210
+ )}
211
+ </TabPane>
212
+ </Tabs>
213
+ </div>
214
+ );
215
+ };
216
+ ```
217
+
218
+ ## 仓库选择器(逻辑仓) Select-Warehouse-002
219
+
220
+ ```tsx
221
+ import React, { useState } from 'react';
222
+ import { Tabs } from 'antd';
223
+ import {BusinessSearchSelect} from '../../../index.ts';
224
+
225
+ const { TabPane } = Tabs;
226
+
227
+ export default () => {
228
+ const selectProps = {
229
+ // mode: 'multiple',
230
+ // maxTagCount: 1,
231
+ // disabled: true
232
+ }
233
+ const selectPropsMultiple = {
234
+ mode: 'multiple',
235
+ maxTagCount: 1,
236
+ }
237
+
238
+ const [ tabKey, setTabKey ] = useState('single')
239
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
240
+
241
+ const props = {
242
+ value,
243
+ onChange: (value: any) => {
244
+ console.log(value)
245
+ setValue(value)
246
+ },
247
+ // requestConfig: {
248
+ // url: `/bop/api/realWarehouse`,
249
+ // filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
250
+ // mappingTextField: 'realWarehouseName',
251
+ // mappingValueField: 'realWarehouseCode',
252
+ // otherParams: {
253
+ // sorter: 'desc-id'
254
+ // }, // 默认参数
255
+ // sourceName: 'warehouseIds',
256
+ // },
257
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
258
+ selectProps,
259
+ selectBusinessType: 'realWarehouse',
260
+ };
261
+
262
+ const onTabChange = (key) => {
263
+ setTabKey(key)
264
+ setValue(key === 'single' ? null: [])
265
+ }
266
+
267
+ return (
268
+ <div>
269
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
270
+ <TabPane tab='单选' key='single'>
271
+ {tabKey === 'single' && (
272
+ <BusinessSearchSelect {...props} />
273
+ )}
274
+ </TabPane>
275
+ <TabPane tab='多选' key='multiple'>
276
+ {tabKey === 'multiple' && (
277
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
278
+ )}
279
+ </TabPane>
280
+ </Tabs>
281
+ </div>
282
+ );
283
+ };
284
+ ```
285
+
286
+ ## 仓库选择器(虚拟仓) Select-Warehouse-003
287
+
288
+ ```tsx
289
+ import React, { useState } from 'react';
290
+ import { Tabs } from 'antd';
291
+ import {BusinessSearchSelect} from '../../../index.ts';
292
+
293
+ const { TabPane } = Tabs;
294
+
295
+ export default () => {
296
+ const selectProps = {
297
+ // mode: 'multiple',
298
+ // maxTagCount: 1,
299
+ // disabled: true
300
+ }
301
+ const selectPropsMultiple = {
302
+ mode: 'multiple',
303
+ maxTagCount: 1,
304
+ }
305
+
306
+ const [ tabKey, setTabKey ] = useState('single')
307
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
308
+
309
+ const props = {
310
+ value,
311
+ onChange: (value: any) => {
312
+ console.log(value)
313
+ setValue(value)
314
+ },
315
+ // requestConfig: {
316
+ // url: `/bop/api/virtualWarehouse`,
317
+ // filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
318
+ // mappingTextField: 'virtualWarehouseName',
319
+ // mappingValueField: 'virtualWarehouseCode',
320
+ // otherParams: {
321
+ // sorter: 'desc-id'
322
+ // }, // 默认参数
323
+ // sourceName: 'warehouseIds',
324
+ // },
325
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
326
+ selectProps,
327
+ selectBusinessType: 'virtualWarehouse',
328
+ };
329
+
330
+ const onTabChange = (key) => {
331
+ setTabKey(key)
332
+ setValue(key === 'single' ? null: [])
333
+ }
334
+
335
+ return (
336
+ <div>
337
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
338
+ <TabPane tab='单选' key='single'>
339
+ {tabKey === 'single' && (
340
+ <BusinessSearchSelect {...props} />
341
+ )}
342
+ </TabPane>
343
+ <TabPane tab='多选' key='multiple'>
344
+ {tabKey === 'multiple' && (
345
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
346
+ )}
347
+ </TabPane>
348
+ </Tabs>
349
+ </div>
350
+ );
351
+ };
352
+ ```
353
+
354
+ ## 仓库选择器(渠道仓) Select-Warehouse-004
355
+
356
+ ```tsx
357
+ import React, { useState } from 'react';
358
+ import { Tabs } from 'antd';
359
+ import {BusinessSearchSelect} from '../../../index.ts';
360
+
361
+ const { TabPane } = Tabs;
362
+
363
+ export default () => {
364
+ const selectProps = {
365
+ // mode: 'multiple',
366
+ // maxTagCount: 1,
367
+ // disabled: true
368
+ }
369
+ const selectPropsMultiple = {
370
+ mode: 'multiple',
371
+ maxTagCount: 1,
372
+ }
373
+
374
+ const [ tabKey, setTabKey ] = useState('single')
375
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
376
+
377
+ const props = {
378
+ value,
379
+ onChange: (value: any) => {
380
+ console.log(value)
381
+ setValue(value)
382
+ },
383
+ // requestConfig: {
384
+ // url: `/bop/api/channelWarehouse`,
385
+ // filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
386
+ // mappingTextField: 'channelWarehouseName',
387
+ // mappingValueField: 'channelWarehouseCode',
388
+ // otherParams: {
389
+ // sorter: 'desc-id'
390
+ // }, // 默认参数
391
+ // sourceName: 'warehouseIds',
392
+ // },
393
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
394
+ selectProps,
395
+ selectBusinessType: 'channelWarehouse',
396
+ };
397
+
398
+ const onTabChange = (key) => {
399
+ setTabKey(key)
400
+ setValue(key === 'single' ? null: [])
401
+ }
402
+
403
+ return (
404
+ <div>
405
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
406
+ <TabPane tab='单选' key='single'>
407
+ {tabKey === 'single' && (
408
+ <BusinessSearchSelect {...props} />
409
+ )}
410
+ </TabPane>
411
+ <TabPane tab='多选' key='multiple'>
412
+ {tabKey === 'multiple' && (
413
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
414
+ )}
415
+ </TabPane>
416
+ </Tabs>
417
+ </div>
418
+ );
419
+ };
420
+ ```
421
+
422
+
423
+ ## 客户选择器 Select-KH-001
424
+
425
+ ```tsx
426
+ import React, { useState } from 'react';
427
+ import { Tabs } from 'antd';
428
+ import {BusinessSearchSelect} from '../../../index.ts';
429
+
430
+ const { TabPane } = Tabs;
431
+
432
+ export default () => {
433
+ const selectProps = {
434
+ // mode: 'multiple',
435
+ // maxTagCount: 1,
436
+ // disabled: true
437
+ }
438
+ const selectPropsMultiple = {
439
+ mode: 'multiple',
440
+ maxTagCount: 1,
441
+ }
442
+
443
+ const [ tabKey, setTabKey ] = useState('single')
444
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
445
+
446
+ const props = {
447
+ value,
448
+ onChange: (value: any) => {
449
+ console.log(value)
450
+ setValue(value)
451
+ },
452
+ // requestConfig: {
453
+ // url: `/bop/api/customer`,
454
+ // filter: 'qp-name,code-orGroup,like', // 过滤参数
455
+ // mappingTextField: 'name',
456
+ // mappingValueField: 'code',
457
+ // otherParams: {
458
+ // sorter: 'desc-id'
459
+ // }, // 默认参数
460
+ // sourceName: 'customerCode',
461
+ // },
462
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
463
+ selectProps,
464
+ selectBusinessType: 'customer',
465
+ };
466
+
467
+ const onTabChange = (key) => {
468
+ setTabKey(key)
469
+ setValue(key === 'single' ? null: [])
470
+ }
471
+
472
+ return (
473
+ <div>
474
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
475
+ <TabPane tab='单选' key='single'>
476
+ {tabKey === 'single' && (
477
+ <BusinessSearchSelect {...props} />
478
+ )}
479
+ </TabPane>
480
+ <TabPane tab='多选' key='multiple'>
481
+ {tabKey === 'multiple' && (
482
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
483
+ )}
484
+ </TabPane>
485
+ </Tabs>
486
+ </div>
487
+ );
488
+ };
489
+ ```
490
+
491
+
492
+ ## 店铺选择器 Select-DP-001
493
+
494
+ ```tsx
495
+ import React, { useState } from 'react';
496
+ import { Tabs } from 'antd';
497
+ import {BusinessSearchSelect} from '../../../index.ts';
498
+
499
+ const { TabPane } = Tabs;
500
+
501
+ export default () => {
502
+ const selectProps = {
503
+ // mode: 'multiple',
504
+ // maxTagCount: 1,
505
+ // disabled: true
506
+ }
507
+ const selectPropsMultiple = {
508
+ mode: 'multiple',
509
+ maxTagCount: 1,
510
+ }
511
+
512
+ const [ tabKey, setTabKey ] = useState('single')
513
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
514
+
515
+ const props = {
516
+ value,
517
+ onChange: (value: any) => {
518
+ console.log(value)
519
+ setValue(value)
520
+ },
521
+ // requestConfig: {
522
+ // url: `/bop/api/store`,
523
+ // filter: 'qp-name,code-orGroup,like',,
524
+ // mappingTextField: 'name',
525
+ // mappingValueField: 'code',
526
+ // otherParams: {
527
+ // sorter: 'desc-id'
528
+ // }, // 默认参数
529
+ // sourceName: 'code',
530
+ // },
531
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
532
+ selectProps,
533
+ selectBusinessType: 'shopFile',
534
+ };
535
+
536
+ const onTabChange = (key) => {
537
+ setTabKey(key)
538
+ setValue(key === 'single' ? null: [])
539
+ }
540
+
541
+ return (
542
+ <div>
543
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
544
+ <TabPane tab='单选' key='single'>
545
+ {tabKey === 'single' && (
546
+ <BusinessSearchSelect {...props} />
547
+ )}
548
+ </TabPane>
549
+ <TabPane tab='多选' key='multiple'>
550
+ {tabKey === 'multiple' && (
551
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
552
+ )}
553
+ </TabPane>
554
+ </Tabs>
555
+ </div>
556
+ );
557
+ };
558
+ ```
559
+
560
+
561
+ ## 核算主体选择器 Select-HSZT-001
562
+
563
+ ```tsx
564
+ import React, { useState } from 'react';
565
+ import { Tabs } from 'antd';
566
+ import {BusinessSearchSelect} from '../../../index.ts';
567
+
568
+ const { TabPane } = Tabs;
569
+
570
+ export default () => {
571
+ const selectProps = {
572
+ // mode: 'multiple',
573
+ // maxTagCount: 1,
574
+ // disabled: true
575
+ }
576
+ const selectPropsMultiple = {
577
+ mode: 'multiple',
578
+ maxTagCount: 1,
579
+ }
580
+
581
+ const [ tabKey, setTabKey ] = useState('single')
582
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
583
+
584
+ const props = {
585
+ value,
586
+ onChange: (value: any) => {
587
+ console.log(value)
588
+ setValue(value)
589
+ },
590
+ // requestConfig: {
591
+ // url: `/bop/api/accountingSubject`,
592
+ // filter: 'qp-name,code-orGroup,like',
593
+ // mappingTextField: 'name',
594
+ // mappingValueField: 'code',
595
+ // otherParams: {
596
+ // sorter: 'desc-id'
597
+ // }, // 默认参数
598
+ // sourceName: 'accountingCode',
599
+ // },
600
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
601
+ selectProps,
602
+ selectBusinessType: 'accountingSubject',
603
+ };
604
+
605
+ const onTabChange = (key) => {
606
+ setTabKey(key)
607
+ setValue(key === 'single' ? null: [])
608
+ }
609
+
610
+ return (
611
+ <div>
612
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
613
+ <TabPane tab='单选' key='single'>
614
+ {tabKey === 'single' && (
615
+ <BusinessSearchSelect {...props} />
616
+ )}
617
+ </TabPane>
618
+ <TabPane tab='多选' key='multiple'>
619
+ {tabKey === 'multiple' && (
620
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
621
+ )}
622
+ </TabPane>
623
+ </Tabs>
624
+ </div>
625
+ );
626
+ };
627
+ ```
628
+
629
+
630
+ ## 库存组织选择器 Select-KCZZ-001
631
+
632
+ ```tsx
633
+ import React, { useState } from 'react';
634
+ import { Tabs } from 'antd';
635
+ import {BusinessSearchSelect} from '../../../index.ts';
636
+
637
+ const { TabPane } = Tabs;
638
+
639
+ export default () => {
640
+ const selectProps = {
641
+ // mode: 'multiple',
642
+ // maxTagCount: 1,
643
+ // disabled: true
644
+ }
645
+ const selectPropsMultiple = {
646
+ mode: 'multiple',
647
+ maxTagCount: 1,
648
+ }
649
+
650
+ const [ tabKey, setTabKey ] = useState('single')
651
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
652
+
653
+ const props = {
654
+ value,
655
+ onChange: (value: any) => {
656
+ console.log(value)
657
+ setValue(value)
658
+ },
659
+ // requestConfig: {
660
+ // url: `/bop/api/inventoryOrg`,
661
+ // filter: 'qp-name,code-orGroup,like',
662
+ // mappingTextField: 'name',
663
+ // mappingValueField: 'code',
664
+ // otherParams: {
665
+ // sorter: 'desc-id'
666
+ // }, // 默认参数
667
+ // sourceName: 'inventoryOrgCode',
668
+ // },
669
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
670
+ selectProps,
671
+ selectBusinessType: 'inventoryOrg',
672
+ };
673
+
674
+ const onTabChange = (key) => {
675
+ setTabKey(key)
676
+ setValue(key === 'single' ? null: [])
677
+ }
678
+
679
+ return (
680
+ <div>
681
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
682
+ <TabPane tab='单选' key='single'>
683
+ {tabKey === 'single' && (
684
+ <BusinessSearchSelect {...props} />
685
+ )}
686
+ </TabPane>
687
+ <TabPane tab='多选' key='multiple'>
688
+ {tabKey === 'multiple' && (
689
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
690
+ )}
691
+ </TabPane>
692
+ </Tabs>
693
+ </div>
694
+ );
695
+ };
696
+ ```
697
+
698
+
699
+ ## 法人公司选择器 Select-FRGS-001
700
+
701
+ ```tsx
702
+ import React, { useState } from 'react';
703
+ import { Tabs } from 'antd';
704
+ import {BusinessSearchSelect} from '../../../index.ts';
705
+
706
+ const { TabPane } = Tabs;
707
+
708
+ export default () => {
709
+ const selectProps = {
710
+ // mode: 'multiple',
711
+ // maxTagCount: 1,
712
+ // disabled: true
713
+ }
714
+ const selectPropsMultiple = {
715
+ mode: 'multiple',
716
+ maxTagCount: 1,
717
+ }
718
+
719
+ const [ tabKey, setTabKey ] = useState('single')
720
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
721
+
722
+ const props = {
723
+ value,
724
+ onChange: (value: any) => {
725
+ console.log(value)
726
+ setValue(value)
727
+ },
728
+ // requestConfig: {
729
+ // url: `/bop/api/company`,
730
+ // filter: 'qp-name,code-orGroup,like',
731
+ // mappingTextField: 'name',
732
+ // mappingValueField: 'code',
733
+ // otherParams: {
734
+ // 'qp-companyType-eq': '20',
735
+ // sorter: 'desc-id'
736
+ // }, // 默认参数
737
+ // sourceName: 'companyCode',
738
+ // },
739
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
740
+ selectProps,
741
+ selectBusinessType: 'corporationCompany',
742
+ };
743
+
744
+ const onTabChange = (key) => {
745
+ setTabKey(key)
746
+ setValue(key === 'single' ? null: [])
747
+ }
748
+
749
+ return (
750
+ <div>
751
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
752
+ <TabPane tab='单选' key='single'>
753
+ {tabKey === 'single' && (
754
+ <BusinessSearchSelect {...props} />
755
+ )}
756
+ </TabPane>
757
+ <TabPane tab='多选' key='multiple'>
758
+ {tabKey === 'multiple' && (
759
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
760
+ )}
761
+ </TabPane>
762
+ </Tabs>
763
+ </div>
764
+ );
765
+ };
766
+ ```
767
+
768
+
769
+ ## 员工选择器 Select-YG-001
770
+
771
+ ```tsx
772
+ import React, { useState } from 'react';
773
+ import { Tabs } from 'antd';
774
+ import {BusinessSearchSelect} from '../../../index.ts';
775
+
776
+ const { TabPane } = Tabs;
777
+
778
+ export default () => {
779
+ const selectProps = {
780
+ // mode: 'multiple',
781
+ // maxTagCount: 1,
782
+ // disabled: true
783
+ }
784
+ const selectPropsMultiple = {
785
+ mode: 'multiple',
786
+ maxTagCount: 1,
787
+ }
788
+
789
+ const [ tabKey, setTabKey ] = useState('single')
790
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
791
+
792
+ const props = {
793
+ value,
794
+ onChange: (value: any) => {
795
+ console.log(value)
796
+ setValue(value)
797
+ },
798
+ // requestConfig: {
799
+ // url: `/bop/api/employee`,
800
+ // filter: 'qp-name,code-orGroup,like',
801
+ // mappingTextField: 'name',
802
+ // mappingValueField: 'code',
803
+ // otherParams: {
804
+ // sorter: 'desc-id'
805
+ // }, // 默认参数
806
+ // sourceName: 'code',
807
+ // },
808
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
809
+ selectProps,
810
+ selectBusinessType: 'employee',
811
+ };
812
+
813
+ const onTabChange = (key) => {
814
+ setTabKey(key)
815
+ setValue(key === 'single' ? null: [])
816
+ }
817
+
818
+ return (
819
+ <div>
820
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
821
+ <TabPane tab='单选' key='single'>
822
+ {tabKey === 'single' && (
823
+ <BusinessSearchSelect {...props} />
824
+ )}
825
+ </TabPane>
826
+ <TabPane tab='多选' key='multiple'>
827
+ {tabKey === 'multiple' && (
828
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
829
+ )}
830
+ </TabPane>
831
+ </Tabs>
832
+ </div>
833
+ );
834
+ };
835
+ ```
836
+
837
+
838
+ ## 配送方式选择器 Select-PSFS-001
839
+
840
+ ```tsx
841
+ import React, { useState } from 'react';
842
+ import { Tabs } from 'antd';
843
+ import {BusinessSearchSelect} from '../../../index.ts';
844
+
845
+ const { TabPane } = Tabs;
846
+
847
+ export default () => {
848
+ const selectProps = {
849
+ // mode: 'multiple',
850
+ // maxTagCount: 1,
851
+ // disabled: true
852
+ }
853
+ const selectPropsMultiple = {
854
+ mode: 'multiple',
855
+ maxTagCount: 1,
856
+ }
857
+
858
+ const [ tabKey, setTabKey ] = useState('single')
859
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
860
+
861
+ const props = {
862
+ value,
863
+ onChange: (value: any) => {
864
+ console.log(value)
865
+ setValue(value)
866
+ },
867
+ // requestConfig: {
868
+ // url: `/bop/api/getDeliveryModeCodeNameMap`,
869
+ // filter: 'qp-name,code-orGroup,like',
870
+ // mappingTextField: 'name',
871
+ // mappingValueField: 'code',
872
+ // otherParams: {
873
+ // sorter: 'desc-id'
874
+ // }, // 默认参数
875
+ // sourceName: 'deliveryModeCode',
876
+ // },
877
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
878
+ selectProps,
879
+ selectBusinessType: 'deliveryMode',
880
+ };
881
+
882
+ const onTabChange = (key) => {
883
+ setTabKey(key)
884
+ setValue(key === 'single' ? null: [])
885
+ }
886
+
887
+ return (
888
+ <div>
889
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
890
+ <TabPane tab='单选' key='single'>
891
+ {tabKey === 'single' && (
892
+ <BusinessSearchSelect {...props} />
893
+ )}
894
+ </TabPane>
895
+ <TabPane tab='多选' key='multiple'>
896
+ {tabKey === 'multiple' && (
897
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
898
+ )}
899
+ </TabPane>
900
+ </Tabs>
901
+ </div>
902
+ );
903
+ };
904
+ ```
905
+
906
+ More skills for writing demo: https://d.umijs.org/guide/demo-principle