@bit-sun/business-component 2.0.12 → 2.0.13

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