@bit-sun/business-component 2.0.37 → 2.0.39-alpha.0

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 (153) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +5 -4
  3. package/.gitlab-ci.yml +174 -174
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +77 -74
  7. package/README.md +27 -27
  8. package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +4 -0
  9. package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +4 -0
  10. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +4 -0
  11. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +17 -0
  12. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +30 -0
  13. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +3 -0
  14. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +2 -0
  15. package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +4 -0
  16. package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +4 -0
  17. package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +2 -0
  18. package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +8 -0
  19. package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +8 -0
  20. package/dist/components/Business/BsLayouts/index.d.ts +18 -0
  21. package/dist/components/Business/BsLayouts/service.d.ts +1 -0
  22. package/dist/components/Business/BsLayouts/utils.d.ts +22 -0
  23. package/dist/components/Business/DetailPageWrapper/utils.d.ts +1 -2
  24. package/dist/index.d.ts +4 -0
  25. package/dist/index.esm.js +11703 -44
  26. package/dist/index.js +11678 -11
  27. package/dist/utils/enumConfig.d.ts +10 -0
  28. package/dist/utils/utils.d.ts +2 -1
  29. package/docs/index.md +21 -21
  30. package/lib/assets/drag.svg +17 -17
  31. package/lib/assets/exportFail.svg +37 -37
  32. package/lib/assets/exportProcessing.svg +28 -28
  33. package/lib/assets/exportSuccess.svg +34 -34
  34. package/lib/assets/label_icon_bottom.svg +25 -25
  35. package/lib/assets/upExport.svg +22 -22
  36. package/package.json +70 -66
  37. package/src/assets/32.svg +28 -0
  38. package/src/assets/addIcon.svg +18 -0
  39. package/src/assets/allfunc.svg +28 -0
  40. package/src/assets/arrowRight.svg +25 -0
  41. package/src/assets/btn-delete.svg +29 -29
  42. package/src/assets/btn-edit.svg +19 -19
  43. package/src/assets/btn-more.svg +17 -17
  44. package/src/assets/btn-submit.svg +19 -19
  45. package/src/assets/caidan.svg +12 -0
  46. package/src/assets/close.svg +26 -26
  47. package/src/assets/closeicon.png +0 -0
  48. package/src/assets/drag.svg +17 -17
  49. package/src/assets/exportFail.svg +37 -37
  50. package/src/assets/exportProcessing.svg +28 -28
  51. package/src/assets/exportSuccess.svg +34 -34
  52. package/src/assets/fixed-left-active.svg +11 -11
  53. package/src/assets/fixed-left.svg +15 -15
  54. package/src/assets/fixed-right-active.svg +11 -11
  55. package/src/assets/fixed-right.svg +15 -15
  56. package/src/assets/guanbi.svg +16 -0
  57. package/src/assets/icon-quanping.svg +15 -15
  58. package/src/assets/icon-shezhi.svg +17 -17
  59. package/src/assets/label_icon_bottom.svg +25 -25
  60. package/src/assets/morentouxiang-32.svg +24 -0
  61. package/src/assets/right.png +0 -0
  62. package/src/assets/scanning.svg +24 -24
  63. package/src/assets/upExport.svg +22 -22
  64. package/src/assets/xinglan-icon-out.png +0 -0
  65. package/src/components/Business/AddSelectBusiness/index.md +41 -41
  66. package/src/components/Business/AddSelectBusiness/index.tsx +290 -290
  67. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -0
  68. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -0
  69. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -0
  70. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -0
  71. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +38 -0
  72. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +243 -0
  73. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +385 -0
  74. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +286 -0
  75. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +75 -0
  76. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +171 -0
  77. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +65 -0
  78. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +154 -0
  79. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +73 -0
  80. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +158 -0
  81. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -0
  82. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -0
  83. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +156 -0
  84. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +162 -0
  85. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +76 -0
  86. package/src/components/Business/BsLayouts/index.less +80 -0
  87. package/src/components/Business/BsLayouts/index.tsx +1495 -0
  88. package/src/components/Business/BsLayouts/service.ts +11 -0
  89. package/src/components/Business/BsLayouts/utils.tsx +350 -0
  90. package/src/components/Business/BsSulaQueryTable/index.less +219 -219
  91. package/src/components/Business/BsSulaQueryTable/index.tsx +535 -534
  92. package/src/components/Business/BsSulaQueryTable/setting.tsx +818 -817
  93. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  94. package/src/components/Business/BsSulaQueryTable/utils.tsx +691 -690
  95. package/src/components/Business/CommodityEntry/index.md +70 -70
  96. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  97. package/src/components/Business/CommonAlert/index.tsx +23 -23
  98. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  99. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  100. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  101. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  102. package/src/components/Business/DetailPageWrapper/index.tsx +335 -324
  103. package/src/components/Business/DetailPageWrapper/utils.tsx +101 -111
  104. package/src/components/Business/HomePageWrapper/index.less +33 -33
  105. package/src/components/Business/HomePageWrapper/index.md +45 -45
  106. package/src/components/Business/HomePageWrapper/index.tsx +162 -150
  107. package/src/components/Business/SearchSelect/BusinessUtils.ts +1458 -1457
  108. package/src/components/Business/SearchSelect/common.ts +53 -53
  109. package/src/components/Business/SearchSelect/index.md +1137 -1137
  110. package/src/components/Business/SearchSelect/index.tsx +51 -51
  111. package/src/components/Business/SearchSelect/utils.ts +100 -99
  112. package/src/components/Business/StateFlow/index.less +130 -130
  113. package/src/components/Business/StateFlow/index.md +60 -60
  114. package/src/components/Business/StateFlow/index.tsx +29 -29
  115. package/src/components/Business/TreeSearchSelect/index.md +126 -126
  116. package/src/components/Business/TreeSearchSelect/index.tsx +34 -34
  117. package/src/components/Business/TreeSearchSelect/utils.ts +60 -60
  118. package/src/components/Business/columnSettingTable/columnSetting.tsx +763 -762
  119. package/src/components/Business/columnSettingTable/index.less +247 -247
  120. package/src/components/Business/columnSettingTable/index.md +357 -357
  121. package/src/components/Business/columnSettingTable/index.tsx +226 -225
  122. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +234 -233
  123. package/src/components/Business/columnSettingTable/utils.tsx +68 -68
  124. package/src/components/Functional/AddSelect/index.less +367 -367
  125. package/src/components/Functional/AddSelect/index.md +122 -122
  126. package/src/components/Functional/AddSelect/index.tsx +962 -962
  127. package/src/components/Functional/BillEntry/index.less +371 -371
  128. package/src/components/Functional/BillEntry/index.md +39 -39
  129. package/src/components/Functional/BillEntry/index.tsx +613 -607
  130. package/src/components/Functional/DataImport/index.less +63 -63
  131. package/src/components/Functional/DataImport/index.md +44 -44
  132. package/src/components/Functional/DataImport/index.tsx +689 -689
  133. package/src/components/Functional/DataValidation/index.less +63 -63
  134. package/src/components/Functional/DataValidation/index.md +38 -38
  135. package/src/components/Functional/DataValidation/index.tsx +681 -681
  136. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  137. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
  138. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  139. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  140. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  141. package/src/components/Functional/SearchSelect/index.less +115 -115
  142. package/src/components/Functional/SearchSelect/index.md +141 -141
  143. package/src/components/Functional/SearchSelect/index.tsx +812 -812
  144. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  145. package/src/components/Functional/TreeSearchSelect/index.tsx +149 -149
  146. package/src/index.ts +31 -30
  147. package/src/utils/CheckOneUser/index.md +39 -39
  148. package/src/utils/CheckOneUser/index.ts +51 -51
  149. package/src/utils/enumConfig.ts +10 -0
  150. package/src/utils/requestUtils.ts +33 -32
  151. package/src/utils/utils.ts +52 -22
  152. package/tsconfig.json +29 -29
  153. package/typings.d.ts +4 -4
@@ -1,1137 +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: 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
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