@bit-sun/business-component 2.2.13 → 2.2.14

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 (177) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +5 -5
  3. package/.gitlab-ci.yml +179 -179
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +74 -74
  7. package/README.md +27 -27
  8. package/dist/index.esm.js +2 -1
  9. package/dist/index.js +2 -1
  10. package/docs/index.md +21 -21
  11. package/lib/assets/drag.svg +17 -17
  12. package/lib/assets/exportFail.svg +37 -37
  13. package/lib/assets/exportProcessing.svg +28 -28
  14. package/lib/assets/exportSuccess.svg +34 -34
  15. package/lib/assets/label_icon_bottom.svg +25 -25
  16. package/lib/assets/upExport.svg +22 -22
  17. package/package.json +77 -77
  18. package/src/assets/32.svg +27 -27
  19. package/src/assets/addIcon.svg +17 -17
  20. package/src/assets/allfunc.svg +27 -27
  21. package/src/assets/arrowRight.svg +24 -24
  22. package/src/assets/btn-delete.svg +29 -29
  23. package/src/assets/btn-edit.svg +19 -19
  24. package/src/assets/btn-more.svg +17 -17
  25. package/src/assets/btn-submit.svg +19 -19
  26. package/src/assets/caidan.svg +11 -11
  27. package/src/assets/close.svg +26 -26
  28. package/src/assets/drag.svg +17 -17
  29. package/src/assets/exportFail.svg +37 -37
  30. package/src/assets/exportProcessing.svg +28 -28
  31. package/src/assets/exportSuccess.svg +34 -34
  32. package/src/assets/fixed-left-active.svg +11 -11
  33. package/src/assets/fixed-left.svg +15 -15
  34. package/src/assets/fixed-right-active.svg +11 -11
  35. package/src/assets/fixed-right.svg +15 -15
  36. package/src/assets/guanbi.svg +15 -15
  37. package/src/assets/icon-quanping.svg +15 -15
  38. package/src/assets/icon-shezhi.svg +17 -17
  39. package/src/assets/label_icon_bottom.svg +25 -25
  40. package/src/assets/list-no-img.svg +21 -21
  41. package/src/assets/morentouxiang-32.svg +23 -23
  42. package/src/assets/scanning.svg +24 -24
  43. package/src/assets/upExport.svg +22 -22
  44. package/src/components/Business/AddSelectBusiness/index.md +93 -93
  45. package/src/components/Business/AddSelectBusiness/index.tsx +602 -601
  46. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
  47. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  48. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  49. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  50. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  51. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  52. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  53. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  54. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  55. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  56. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  57. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  58. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  59. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +157 -157
  60. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  61. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  62. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +156 -156
  63. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  64. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  65. package/src/components/Business/BsLayouts/index.less +79 -79
  66. package/src/components/Business/BsLayouts/index.tsx +1479 -1479
  67. package/src/components/Business/BsLayouts/service.ts +10 -10
  68. package/src/components/Business/BsLayouts/utils.tsx +225 -225
  69. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +538 -538
  70. package/src/components/Business/BsSulaQueryTable/index.less +219 -219
  71. package/src/components/Business/BsSulaQueryTable/index.tsx +527 -527
  72. package/src/components/Business/BsSulaQueryTable/setting.tsx +802 -802
  73. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  74. package/src/components/Business/BsSulaQueryTable/utils.tsx +688 -688
  75. package/src/components/Business/CommodityEntry/index.md +70 -70
  76. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  77. package/src/components/Business/CommonAlert/index.tsx +23 -23
  78. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  79. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  80. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  81. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  82. package/src/components/Business/DetailPageWrapper/index.tsx +313 -313
  83. package/src/components/Business/DetailPageWrapper/utils.tsx +100 -100
  84. package/src/components/Business/HomePageWrapper/index.less +33 -33
  85. package/src/components/Business/HomePageWrapper/index.md +45 -45
  86. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  87. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
  88. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +201 -201
  89. package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -205
  90. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  91. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
  92. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
  93. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
  94. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
  95. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
  96. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
  97. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
  98. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
  99. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
  100. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
  101. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
  102. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  103. package/src/components/Business/JsonQueryTable/index.less +16 -16
  104. package/src/components/Business/JsonQueryTable/index.md +328 -328
  105. package/src/components/Business/JsonQueryTable/index.tsx +320 -320
  106. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
  107. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
  108. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
  109. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
  110. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
  111. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
  112. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
  113. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
  114. package/src/components/Business/JsonQueryTable/static.ts +356 -356
  115. package/src/components/Business/SearchSelect/BusinessUtils.ts +1723 -1723
  116. package/src/components/Business/SearchSelect/common.ts +53 -53
  117. package/src/components/Business/SearchSelect/index.md +1310 -1310
  118. package/src/components/Business/SearchSelect/index.tsx +51 -51
  119. package/src/components/Business/SearchSelect/utils.ts +100 -100
  120. package/src/components/Business/StateFlow/index.less +130 -130
  121. package/src/components/Business/StateFlow/index.md +60 -60
  122. package/src/components/Business/StateFlow/index.tsx +29 -29
  123. package/src/components/Business/TreeSearchSelect/index.md +126 -126
  124. package/src/components/Business/TreeSearchSelect/index.tsx +34 -34
  125. package/src/components/Business/TreeSearchSelect/utils.ts +60 -60
  126. package/src/components/Business/columnSettingTable/columnSetting.tsx +764 -764
  127. package/src/components/Business/columnSettingTable/index.less +247 -247
  128. package/src/components/Business/columnSettingTable/index.md +357 -357
  129. package/src/components/Business/columnSettingTable/index.tsx +232 -232
  130. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +240 -240
  131. package/src/components/Business/columnSettingTable/utils.tsx +68 -68
  132. package/src/components/Business/moreTreeTable/index.less +99 -99
  133. package/src/components/Business/moreTreeTable/index.md +508 -508
  134. package/src/components/Business/moreTreeTable/index.tsx +315 -315
  135. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  136. package/src/components/Functional/AddSelect/index.less +367 -367
  137. package/src/components/Functional/AddSelect/index.md +155 -155
  138. package/src/components/Functional/AddSelect/index.tsx +1165 -1165
  139. package/src/components/Functional/BillEntry/index.less +371 -371
  140. package/src/components/Functional/BillEntry/index.md +39 -39
  141. package/src/components/Functional/BillEntry/index.tsx +766 -766
  142. package/src/components/Functional/DataImport/index.less +63 -63
  143. package/src/components/Functional/DataImport/index.md +44 -44
  144. package/src/components/Functional/DataImport/index.tsx +695 -695
  145. package/src/components/Functional/DataValidation/index.less +63 -63
  146. package/src/components/Functional/DataValidation/index.md +39 -39
  147. package/src/components/Functional/DataValidation/index.tsx +687 -687
  148. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  149. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
  150. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  151. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  152. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  153. package/src/components/Functional/SearchSelect/index.less +115 -115
  154. package/src/components/Functional/SearchSelect/index.md +141 -141
  155. package/src/components/Functional/SearchSelect/index.tsx +813 -813
  156. package/src/components/Functional/SearchSelect/utils.ts +3 -3
  157. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  158. package/src/components/Functional/TreeSearchSelect/index.tsx +160 -160
  159. package/src/index.ts +34 -34
  160. package/src/plugin/TableColumnSetting/index.less +247 -247
  161. package/src/plugin/TableColumnSetting/index.md +50 -50
  162. package/src/plugin/TableColumnSetting/index.tsx +724 -724
  163. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  164. package/src/styles/bsDefault.less +1912 -1912
  165. package/src/utils/CheckOneUser/index.md +39 -39
  166. package/src/utils/CheckOneUser/index.ts +51 -51
  167. package/src/utils/LocalstorageUtils.ts +58 -58
  168. package/src/utils/TableUtils.tsx +18 -18
  169. package/src/utils/checkUtils.ts +39 -39
  170. package/src/utils/enumConfig.ts +11 -11
  171. package/src/utils/getFormMode.js +12 -12
  172. package/src/utils/index.ts +2 -2
  173. package/src/utils/requestUtils.ts +36 -36
  174. package/src/utils/serialize.js +7 -7
  175. package/src/utils/utils.ts +183 -183
  176. package/tsconfig.json +29 -29
  177. package/typings.d.ts +4 -4
@@ -1,1310 +1,1310 @@
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
- ## 商品SKC选择器 Select-SKC-001
325
-
326
- ```tsx
327
- import React, { useState } from 'react';
328
- import { Tabs } from 'antd';
329
- import {BusinessSearchSelect} from '../../../index.ts';
330
-
331
- const { TabPane } = Tabs;
332
- export default () => {
333
- const selectProps = {
334
- // mode: 'multiple',
335
- // maxTagCount: 1,
336
- // disabled: true
337
- }
338
- const selectPropsMultiple = {
339
- mode: 'multiple',
340
- maxTagCount: 6,
341
- }
342
-
343
- const [ tabKey, setTabKey ] = useState('single')
344
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
345
-
346
- const props = {
347
- value,
348
- onChange: (value: any) => {
349
- console.log(value)
350
- setValue(value)
351
- },
352
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
353
- selectProps,
354
- selectBusinessType: 'skcCommodity',
355
- };
356
-
357
- const onTabChange = (key) => {
358
- setTabKey(key)
359
- setValue(key === 'single' ? null: [])
360
- }
361
-
362
- return (
363
- <div>
364
- <Tabs onChange={onTabChange} activeKey={tabKey}>
365
- <TabPane tab='单选' key='single'>
366
- {tabKey === 'single' && (
367
- <BusinessSearchSelect {...props} />
368
- )}
369
- </TabPane>
370
- <TabPane tab='多选' key='multiple'>
371
- {tabKey === 'multiple' && (
372
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
373
- )}
374
- </TabPane>
375
- </Tabs>
376
- </div>
377
- );
378
- };
379
- ```
380
-
381
- ## 仓库选择器(物理仓) Select-Warehouse-001
382
-
383
- ```tsx
384
- import React, { useState, useEffect } from 'react';
385
- import { Tabs } from 'antd';
386
- import {BusinessSearchSelect} from '../../../index.ts';
387
-
388
- const { TabPane } = Tabs;
389
-
390
- export default () => {
391
- const selectProps = {
392
- // mode: 'multiple',
393
- // maxTagCount: 1,
394
- // disabled: true
395
- }
396
- const selectPropsMultiple = {
397
- mode: 'multiple',
398
- maxTagCount: 1,
399
- }
400
-
401
- const [ tabKey, setTabKey ] = useState('single')
402
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
403
-
404
- useEffect(() => {
405
- if(tabKey === 'multiple') {
406
- setValue(['1540295745870573570', '1540173160826613762'])
407
- }
408
- },[tabKey])
409
-
410
- const props = {
411
- value,
412
- onChange: (value: any) => {
413
- console.log(value)
414
- setValue(value)
415
- },
416
- requestConfig: {
417
- // mappingValueField: 'physicalWarehouseCode',
418
- // sourceName: 'physicalWarehouseCode',
419
- filterInit: 'qp-id-in'
420
- },
421
- // modalTableProps: {
422
- // modalTableTitle: '选择物理仓-更改title测试',
423
- // needModalTable: false
424
- // },
425
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
426
- selectProps,
427
- // labelInValue: true,
428
- selectBusinessType: 'physicalWarehouse',
429
- };
430
-
431
- const onTabChange = (key) => {
432
- setTabKey(key)
433
- setValue(key === 'single' ? null: [])
434
- }
435
-
436
- return (
437
- <div>
438
- <Tabs onChange={onTabChange} activeKey={tabKey}>
439
- <TabPane tab='单选' key='single'>
440
- {tabKey === 'single' && (
441
- <BusinessSearchSelect {...props} />
442
- )}
443
- </TabPane>
444
- <TabPane tab='多选' key='multiple'>
445
- {tabKey === 'multiple' && (
446
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
447
- )}
448
- </TabPane>
449
- </Tabs>
450
- </div>
451
- );
452
- };
453
- ```
454
-
455
- ## 仓库选择器(逻辑仓) Select-Warehouse-002
456
-
457
- ```tsx
458
- import React, { useState } from 'react';
459
- import { Tabs } from 'antd';
460
- import {BusinessSearchSelect} from '../../../index.ts';
461
-
462
- const { TabPane } = Tabs;
463
-
464
- export default () => {
465
- const selectProps = {
466
- // mode: 'multiple',
467
- // maxTagCount: 1,
468
- // disabled: true
469
- }
470
- const selectPropsMultiple = {
471
- mode: 'multiple',
472
- maxTagCount: 1,
473
- }
474
-
475
- const [ tabKey, setTabKey ] = useState('single')
476
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
477
-
478
- const props = {
479
- value,
480
- onChange: (value: any) => {
481
- console.log(value)
482
- setValue(value)
483
- },
484
- // requestConfig: {
485
- // url: `/bop/api/realWarehouse`,
486
- // filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
487
- // mappingTextField: 'realWarehouseName',
488
- // mappingValueField: 'realWarehouseCode',
489
- // otherParams: {
490
- // sorter: 'desc-id'
491
- // }, // 默认参数
492
- // sourceName: 'warehouseIds',
493
- // },
494
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
495
- selectProps,
496
- selectBusinessType: 'realWarehouse',
497
- };
498
-
499
- const onTabChange = (key) => {
500
- setTabKey(key)
501
- setValue(key === 'single' ? null: [])
502
- }
503
-
504
- return (
505
- <div>
506
- <Tabs onChange={onTabChange} activeKey={tabKey}>
507
- <TabPane tab='单选' key='single'>
508
- {tabKey === 'single' && (
509
- <BusinessSearchSelect {...props} />
510
- )}
511
- </TabPane>
512
- <TabPane tab='多选' key='multiple'>
513
- {tabKey === 'multiple' && (
514
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
515
- )}
516
- </TabPane>
517
- </Tabs>
518
- </div>
519
- );
520
- };
521
- ```
522
-
523
- ## 仓库选择器(运营仓) Select-Warehouse-005
524
-
525
- ```tsx
526
- import React, { useState } from 'react';
527
- import { Tabs } from 'antd';
528
- import {BusinessSearchSelect} from '../../../index.ts';
529
-
530
- const { TabPane } = Tabs;
531
-
532
- export default () => {
533
- const selectProps = {
534
- // mode: 'multiple',
535
- // maxTagCount: 1,
536
- // disabled: true
537
- }
538
- const selectPropsMultiple = {
539
- mode: 'multiple',
540
- maxTagCount: 1,
541
- }
542
-
543
- const [ tabKey, setTabKey ] = useState('single')
544
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
545
-
546
- const props = {
547
- value,
548
- onChange: (value: any) => {
549
- console.log(value)
550
- setValue(value)
551
- },
552
- selectProps,
553
- selectBusinessType: 'ownerWarehouse',
554
- };
555
-
556
- const onTabChange = (key) => {
557
- setTabKey(key)
558
- setValue(key === 'single' ? null: [])
559
- }
560
-
561
- return (
562
- <div>
563
- <Tabs onChange={onTabChange} activeKey={tabKey}>
564
- <TabPane tab='单选' key='single'>
565
- {tabKey === 'single' && (
566
- <BusinessSearchSelect {...props} />
567
- )}
568
- </TabPane>
569
- <TabPane tab='多选' key='multiple'>
570
- {tabKey === 'multiple' && (
571
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
572
- )}
573
- </TabPane>
574
- </Tabs>
575
- </div>
576
- );
577
- };
578
- ```
579
-
580
- ## 仓库选择器(虚拟仓) Select-Warehouse-003
581
-
582
- ```tsx
583
- import React, { useState } from 'react';
584
- import { Tabs } from 'antd';
585
- import {BusinessSearchSelect} from '../../../index.ts';
586
-
587
- const { TabPane } = Tabs;
588
-
589
- export default () => {
590
- const selectProps = {
591
- // mode: 'multiple',
592
- // maxTagCount: 1,
593
- // disabled: true
594
- }
595
- const selectPropsMultiple = {
596
- mode: 'multiple',
597
- maxTagCount: 1,
598
- }
599
-
600
- const [ tabKey, setTabKey ] = useState('single')
601
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
602
-
603
- const props = {
604
- value,
605
- onChange: (value: any) => {
606
- console.log(value)
607
- setValue(value)
608
- },
609
- // requestConfig: {
610
- // url: `/bop/api/virtualWarehouse`,
611
- // filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
612
- // mappingTextField: 'virtualWarehouseName',
613
- // mappingValueField: 'virtualWarehouseCode',
614
- // otherParams: {
615
- // sorter: 'desc-id'
616
- // }, // 默认参数
617
- // sourceName: 'warehouseIds',
618
- // },
619
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
620
- selectProps,
621
- selectBusinessType: 'virtualWarehouse',
622
- };
623
-
624
- const onTabChange = (key) => {
625
- setTabKey(key)
626
- setValue(key === 'single' ? null: [])
627
- }
628
-
629
- return (
630
- <div>
631
- <Tabs onChange={onTabChange} activeKey={tabKey}>
632
- <TabPane tab='单选' key='single'>
633
- {tabKey === 'single' && (
634
- <BusinessSearchSelect {...props} />
635
- )}
636
- </TabPane>
637
- <TabPane tab='多选' key='multiple'>
638
- {tabKey === 'multiple' && (
639
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
640
- )}
641
- </TabPane>
642
- </Tabs>
643
- </div>
644
- );
645
- };
646
- ```
647
-
648
- ## 仓库选择器(渠道仓) Select-Warehouse-004
649
-
650
- ```tsx
651
- import React, { useState } from 'react';
652
- import { Tabs } from 'antd';
653
- import {BusinessSearchSelect} from '../../../index.ts';
654
-
655
- const { TabPane } = Tabs;
656
-
657
- export default () => {
658
- const selectProps = {
659
- // mode: 'multiple',
660
- // maxTagCount: 1,
661
- // disabled: true
662
- }
663
- const selectPropsMultiple = {
664
- mode: 'multiple',
665
- maxTagCount: 1,
666
- }
667
-
668
- const [ tabKey, setTabKey ] = useState('single')
669
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
670
-
671
- const props = {
672
- value,
673
- onChange: (value: any) => {
674
- console.log(value)
675
- setValue(value)
676
- },
677
- // requestConfig: {
678
- // url: `/bop/api/channelWarehouse`,
679
- // filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
680
- // mappingTextField: 'channelWarehouseName',
681
- // mappingValueField: 'channelWarehouseCode',
682
- // otherParams: {
683
- // sorter: 'desc-id'
684
- // }, // 默认参数
685
- // sourceName: 'warehouseIds',
686
- // },
687
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
688
- selectProps,
689
- selectBusinessType: 'channelWarehouse',
690
- };
691
-
692
- const onTabChange = (key) => {
693
- setTabKey(key)
694
- setValue(key === 'single' ? null: [])
695
- }
696
-
697
- return (
698
- <div>
699
- <Tabs onChange={onTabChange} activeKey={tabKey}>
700
- <TabPane tab='单选' key='single'>
701
- {tabKey === 'single' && (
702
- <BusinessSearchSelect {...props} />
703
- )}
704
- </TabPane>
705
- <TabPane tab='多选' key='multiple'>
706
- {tabKey === 'multiple' && (
707
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
708
- )}
709
- </TabPane>
710
- </Tabs>
711
- </div>
712
- );
713
- };
714
- ```
715
-
716
-
717
- ## 客户选择器 Select-KH-001
718
-
719
- ```tsx
720
- import React, { useState } from 'react';
721
- import { Tabs } from 'antd';
722
- import {BusinessSearchSelect} from '../../../index.ts';
723
-
724
- const { TabPane } = Tabs;
725
-
726
- export default () => {
727
- const selectProps = {
728
- // mode: 'multiple',
729
- // maxTagCount: 1,
730
- // disabled: true
731
- }
732
- const selectPropsMultiple = {
733
- mode: 'multiple',
734
- maxTagCount: 1,
735
- }
736
-
737
- const [ tabKey, setTabKey ] = useState('single')
738
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
739
-
740
- const props = {
741
- value,
742
- onChange: (value: any) => {
743
- console.log(value)
744
- setValue(value)
745
- },
746
- // requestConfig: {
747
- // url: `/bop/api/customer`,
748
- // filter: 'qp-name,code-orGroup,like', // 过滤参数
749
- // mappingTextField: 'name',
750
- // mappingValueField: 'code',
751
- // otherParams: {
752
- // sorter: 'desc-id'
753
- // }, // 默认参数
754
- // sourceName: 'customerCode',
755
- // },
756
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
757
- selectProps,
758
- selectBusinessType: 'customer',
759
- };
760
-
761
- const props2 = {
762
- ...props,
763
- // prefixUrl: { selectPrefix: '/channel-manage/', formSelectFix: '/channel-manage/' },
764
- selectBusinessType: 'customer2',
765
- }
766
-
767
- const onTabChange = (key) => {
768
- setTabKey(key)
769
- setValue(key === 'single' ? null: [])
770
- }
771
-
772
- return (
773
- <div>
774
- <Tabs onChange={onTabChange} activeKey={tabKey}>
775
- <TabPane tab='单选' key='single'>
776
- {tabKey === 'single' && (
777
- <>
778
- <span>版本1:支持英伦项目...</span>
779
- <BusinessSearchSelect {...props} />
780
- <span>版本2:支持麦克英孚项目...</span>
781
- <BusinessSearchSelect {...props2} />
782
- </>
783
- )}
784
- </TabPane>
785
- <TabPane tab='多选' key='multiple'>
786
- {tabKey === 'multiple' && (
787
- <>
788
- <span>版本1:支持英伦项目...</span>
789
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
790
- <span>版本2:支持麦克英孚项目...</span>
791
- <BusinessSearchSelect {...props2} selectProps={selectPropsMultiple} />
792
- </>
793
- )}
794
- </TabPane>
795
- </Tabs>
796
- </div>
797
- );
798
- };
799
- ```
800
-
801
-
802
- ## 店铺选择器 Select-DP-001
803
-
804
- ```tsx
805
- import React, { useState } from 'react';
806
- import { Tabs } from 'antd';
807
- import {BusinessSearchSelect} from '../../../index.ts';
808
-
809
- const { TabPane } = Tabs;
810
-
811
- export default () => {
812
- const selectProps = {
813
- // mode: 'multiple',
814
- // maxTagCount: 1,
815
- // disabled: true
816
- }
817
- const selectPropsMultiple = {
818
- mode: 'multiple',
819
- maxTagCount: 1,
820
- }
821
-
822
- const [ tabKey, setTabKey ] = useState('single')
823
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
824
-
825
- const props = {
826
- value,
827
- onChange: (value: any) => {
828
- console.log(value)
829
- setValue(value)
830
- },
831
- // requestConfig: {
832
- // url: `/bop/api/store`,
833
- // filter: 'qp-name,code-orGroup,like',,
834
- // mappingTextField: 'name',
835
- // mappingValueField: 'code',
836
- // otherParams: {
837
- // sorter: 'desc-id'
838
- // }, // 默认参数
839
- // sourceName: 'code',
840
- // },
841
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
842
- selectProps,
843
- selectBusinessType: 'shopFile',
844
- };
845
-
846
- const props2 = {
847
- ...props,
848
- // prefixUrl: { selectPrefix: '/channel-manage/', formSelectFix: '/channel-manage/' },
849
- selectBusinessType: 'shopFile2',
850
- }
851
-
852
- const onTabChange = (key) => {
853
- setTabKey(key)
854
- setValue(key === 'single' ? null: [])
855
- }
856
-
857
- return (
858
- <div>
859
- <Tabs onChange={onTabChange} activeKey={tabKey}>
860
- <TabPane tab='单选' key='single'>
861
- {tabKey === 'single' && (
862
- <>
863
- <span>版本1:支持英伦项目...</span>
864
- <BusinessSearchSelect {...props} />
865
- <span>版本2:支持麦克英孚项目...</span>
866
- <BusinessSearchSelect {...props2} />
867
- </>
868
- )}
869
- </TabPane>
870
- <TabPane tab='多选' key='multiple'>
871
- {tabKey === 'multiple' && (
872
- <>
873
- <span>版本1:支持英伦项目...</span>
874
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
875
- <span>版本2:支持麦克英孚项目...</span>
876
- <BusinessSearchSelect {...props2} selectProps={selectPropsMultiple} />
877
- </>
878
- )}
879
- </TabPane>
880
- </Tabs>
881
- </div>
882
- );
883
- };
884
- ```
885
-
886
-
887
- ## 核算主体选择器 Select-HSZT-001
888
-
889
- ```tsx
890
- import React, { useState } from 'react';
891
- import { Tabs } from 'antd';
892
- import {BusinessSearchSelect} from '../../../index.ts';
893
-
894
- const { TabPane } = Tabs;
895
-
896
- export default () => {
897
- const selectProps = {
898
- // mode: 'multiple',
899
- // maxTagCount: 1,
900
- // disabled: true
901
- }
902
- const selectPropsMultiple = {
903
- mode: 'multiple',
904
- maxTagCount: 1,
905
- }
906
-
907
- const [ tabKey, setTabKey ] = useState('single')
908
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
909
-
910
- const props = {
911
- value,
912
- onChange: (value: any) => {
913
- console.log(value)
914
- setValue(value)
915
- },
916
- // requestConfig: {
917
- // url: `/bop/api/accountingSubject`,
918
- // filter: 'qp-name,code-orGroup,like',
919
- // mappingTextField: 'name',
920
- // mappingValueField: 'code',
921
- // otherParams: {
922
- // sorter: 'desc-id'
923
- // }, // 默认参数
924
- // sourceName: 'accountingCode',
925
- // },
926
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
927
- selectProps,
928
- selectBusinessType: 'accountingSubject',
929
- };
930
-
931
- const onTabChange = (key) => {
932
- setTabKey(key)
933
- setValue(key === 'single' ? null: [])
934
- }
935
-
936
- return (
937
- <div>
938
- <Tabs onChange={onTabChange} activeKey={tabKey}>
939
- <TabPane tab='单选' key='single'>
940
- {tabKey === 'single' && (
941
- <BusinessSearchSelect {...props} />
942
- )}
943
- </TabPane>
944
- <TabPane tab='多选' key='multiple'>
945
- {tabKey === 'multiple' && (
946
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
947
- )}
948
- </TabPane>
949
- </Tabs>
950
- </div>
951
- );
952
- };
953
- ```
954
-
955
-
956
- ## 库存组织选择器 Select-KCZZ-001
957
-
958
- ```tsx
959
- import React, { useState } from 'react';
960
- import { Tabs } from 'antd';
961
- import {BusinessSearchSelect} from '../../../index.ts';
962
-
963
- const { TabPane } = Tabs;
964
-
965
- export default () => {
966
- const selectProps = {
967
- // mode: 'multiple',
968
- // maxTagCount: 1,
969
- // disabled: true
970
- }
971
- const selectPropsMultiple = {
972
- mode: 'multiple',
973
- maxTagCount: 1,
974
- }
975
-
976
- const [ tabKey, setTabKey ] = useState('single')
977
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
978
-
979
- const props = {
980
- value,
981
- onChange: (value: any) => {
982
- console.log(value)
983
- setValue(value)
984
- },
985
- // requestConfig: {
986
- // url: `/bop/api/inventoryOrg`,
987
- // filter: 'qp-name,code-orGroup,like',
988
- // mappingTextField: 'name',
989
- // mappingValueField: 'code',
990
- // otherParams: {
991
- // sorter: 'desc-id'
992
- // }, // 默认参数
993
- // sourceName: 'inventoryOrgCode',
994
- // },
995
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
996
- selectProps,
997
- selectBusinessType: 'inventoryOrg',
998
- };
999
-
1000
- const props2 = {
1001
- ...props,
1002
- selectBusinessType: 'inventoryOrg2',
1003
- }
1004
-
1005
- const onTabChange = (key) => {
1006
- setTabKey(key)
1007
- setValue(key === 'single' ? null: [])
1008
- }
1009
-
1010
- return (
1011
-
1012
- <div>
1013
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1014
- <TabPane tab='单选' key='single'>
1015
- {tabKey === 'single' && <BusinessSearchSelect {...props} />}
1016
- </TabPane>
1017
- <TabPane tab='多选' key='multiple'>
1018
- {tabKey === 'multiple' && <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />}
1019
- </TabPane>
1020
- </Tabs>
1021
- </div>
1022
- );
1023
- };
1024
- ```
1025
-
1026
-
1027
- ## 法人公司选择器 Select-FRGS-001
1028
-
1029
- ```tsx
1030
- import React, { useState } from 'react';
1031
- import { Tabs } from 'antd';
1032
- import {BusinessSearchSelect} from '../../../index.ts';
1033
-
1034
- const { TabPane } = Tabs;
1035
-
1036
- export default () => {
1037
- const selectProps = {
1038
- // mode: 'multiple',
1039
- // maxTagCount: 1,
1040
- // disabled: true
1041
- }
1042
- const selectPropsMultiple = {
1043
- mode: 'multiple',
1044
- maxTagCount: 1,
1045
- }
1046
-
1047
- const [ tabKey, setTabKey ] = useState('single')
1048
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
1049
-
1050
- const props = {
1051
- value,
1052
- onChange: (value: any) => {
1053
- console.log(value)
1054
- setValue(value)
1055
- },
1056
- // requestConfig: {
1057
- // url: `/bop/api/company`,
1058
- // filter: 'qp-name,code-orGroup,like',
1059
- // mappingTextField: 'name',
1060
- // mappingValueField: 'code',
1061
- // otherParams: {
1062
- // 'qp-companyType-eq': '20',
1063
- // sorter: 'desc-id'
1064
- // }, // 默认参数
1065
- // sourceName: 'companyCode',
1066
- // },
1067
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
1068
- selectProps,
1069
- selectBusinessType: 'corporationCompany',
1070
- };
1071
-
1072
- const onTabChange = (key) => {
1073
- setTabKey(key)
1074
- setValue(key === 'single' ? null: [])
1075
- }
1076
-
1077
- return (
1078
- <div>
1079
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1080
- <TabPane tab='单选' key='single'>
1081
- {tabKey === 'single' && (
1082
- <BusinessSearchSelect {...props} />
1083
- )}
1084
- </TabPane>
1085
- <TabPane tab='多选' key='multiple'>
1086
- {tabKey === 'multiple' && (
1087
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1088
- )}
1089
- </TabPane>
1090
- </Tabs>
1091
- </div>
1092
- );
1093
- };
1094
- ```
1095
-
1096
-
1097
- ## 员工选择器 Select-YG-001
1098
-
1099
- ```tsx
1100
- import React, { useState } from 'react';
1101
- import { Tabs } from 'antd';
1102
- import {BusinessSearchSelect} from '../../../index.ts';
1103
-
1104
- const { TabPane } = Tabs;
1105
-
1106
- export default () => {
1107
- const selectProps = {
1108
- // mode: 'multiple',
1109
- // maxTagCount: 1,
1110
- // disabled: true
1111
- }
1112
- const selectPropsMultiple = {
1113
- mode: 'multiple',
1114
- maxTagCount: 1,
1115
- }
1116
-
1117
- const [ tabKey, setTabKey ] = useState('single')
1118
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
1119
-
1120
- const props = {
1121
- value,
1122
- onChange: (value: any) => {
1123
- console.log(value)
1124
- setValue(value)
1125
- },
1126
- // requestConfig: {
1127
- // url: `/bop/api/employee`,
1128
- // filter: 'qp-name,code-orGroup,like',
1129
- // mappingTextField: 'name',
1130
- // mappingValueField: 'code',
1131
- // otherParams: {
1132
- // sorter: 'desc-id'
1133
- // }, // 默认参数
1134
- // sourceName: 'code',
1135
- // },
1136
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
1137
- selectProps,
1138
- selectBusinessType: 'employee',
1139
- };
1140
-
1141
- const props2 = {
1142
- ...props,
1143
- // prefixUrl: { selectPrefix: '/user/api', formSelectFix: '/user/api' },
1144
- selectBusinessType: 'employee2',
1145
- }
1146
-
1147
- const onTabChange = (key) => {
1148
- setTabKey(key)
1149
- setValue(key === 'single' ? null: [])
1150
- }
1151
-
1152
- return (
1153
- <div>
1154
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1155
- <TabPane tab='单选' key='single'>
1156
- {tabKey === 'single' && (
1157
- <>
1158
- <span>版本1:支持英伦项目...</span>
1159
- <BusinessSearchSelect {...props} />
1160
- <span>版本2:支持麦克英孚项目...</span>
1161
- <BusinessSearchSelect {...props2} />
1162
- </>
1163
- )}
1164
- </TabPane>
1165
- <TabPane tab='多选' key='multiple'>
1166
- {tabKey === 'multiple' && (
1167
- <>
1168
- <span>版本1:支持英伦项目...</span>
1169
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1170
- <span>版本2:支持麦克英孚项目...</span>
1171
- <BusinessSearchSelect {...props2} selectProps={selectPropsMultiple} />
1172
- </>
1173
- )}
1174
- </TabPane>
1175
- </Tabs>
1176
- </div>
1177
- );
1178
- };
1179
- ```
1180
-
1181
-
1182
- ## 配送方式选择器 Select-PSFS-001
1183
-
1184
- ```tsx
1185
- import React, { useState } from 'react';
1186
- import { Tabs } from 'antd';
1187
- import {BusinessSearchSelect} from '../../../index.ts';
1188
-
1189
- const { TabPane } = Tabs;
1190
-
1191
- export default () => {
1192
- const selectProps = {
1193
- // mode: 'multiple',
1194
- // maxTagCount: 1,
1195
- // disabled: true
1196
- }
1197
- const selectPropsMultiple = {
1198
- mode: 'multiple',
1199
- maxTagCount: 1,
1200
- }
1201
-
1202
- const [ tabKey, setTabKey ] = useState('single')
1203
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
1204
-
1205
- const props = {
1206
- value,
1207
- onChange: (value: any) => {
1208
- console.log(value)
1209
- setValue(value)
1210
- },
1211
- // requestConfig: {
1212
- // url: `/bop/api/getDeliveryModeCodeNameMap`,
1213
- // filter: 'qp-name,code-orGroup,like',
1214
- // mappingTextField: 'name',
1215
- // mappingValueField: 'code',
1216
- // otherParams: {
1217
- // sorter: 'desc-id'
1218
- // }, // 默认参数
1219
- // sourceName: 'deliveryModeCode',
1220
- // },
1221
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
1222
- selectProps,
1223
- selectBusinessType: 'deliveryMode',
1224
- };
1225
-
1226
- const onTabChange = (key) => {
1227
- setTabKey(key)
1228
- setValue(key === 'single' ? null: [])
1229
- }
1230
-
1231
- return (
1232
- <div>
1233
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1234
- <TabPane tab='单选' key='single'>
1235
- {tabKey === 'single' && (
1236
- <BusinessSearchSelect {...props} />
1237
- )}
1238
- </TabPane>
1239
- <TabPane tab='多选' key='multiple'>
1240
- {tabKey === 'multiple' && (
1241
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1242
- )}
1243
- </TabPane>
1244
- </Tabs>
1245
- </div>
1246
- );
1247
- };
1248
- ```
1249
-
1250
- More skills for writing demo: https://d.umijs.org/guide/demo-principle
1251
-
1252
-
1253
- ## 规则场景选择器 Select-GZCJ-001
1254
-
1255
- ```tsx
1256
- import React, { useState } from 'react';
1257
- import { Tabs } from 'antd';
1258
- import {BusinessSearchSelect} from '../../../index.ts';
1259
-
1260
- const { TabPane } = Tabs;
1261
-
1262
- export default () => {
1263
- const selectProps = {
1264
- // mode: 'multiple',
1265
- // maxTagCount: 1,
1266
- // disabled: true
1267
- }
1268
- const selectPropsMultiple = {
1269
- mode: 'multiple',
1270
- maxTagCount: 1,
1271
- }
1272
-
1273
- const [ tabKey, setTabKey ] = useState('single')
1274
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
1275
-
1276
- const props = {
1277
- value,
1278
- onChange: (value: any) => {
1279
- console.log(value)
1280
- setValue(value)
1281
- },
1282
- selectProps,
1283
- selectBusinessType: 'ruleTemplate',
1284
- };
1285
-
1286
- const onTabChange = (key) => {
1287
- setTabKey(key)
1288
- setValue(key === 'single' ? null: [])
1289
- }
1290
-
1291
- return (
1292
- <div>
1293
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1294
- <TabPane tab='单选' key='single'>
1295
- {tabKey === 'single' && (
1296
- <BusinessSearchSelect {...props} />
1297
- )}
1298
- </TabPane>
1299
- <TabPane tab='多选' key='multiple'>
1300
- {tabKey === 'multiple' && (
1301
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1302
- )}
1303
- </TabPane>
1304
- </Tabs>
1305
- </div>
1306
- );
1307
- };
1308
- ```
1309
-
1310
- 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
+ ## 商品SKC选择器 Select-SKC-001
325
+
326
+ ```tsx
327
+ import React, { useState } from 'react';
328
+ import { Tabs } from 'antd';
329
+ import {BusinessSearchSelect} from '../../../index.ts';
330
+
331
+ const { TabPane } = Tabs;
332
+ export default () => {
333
+ const selectProps = {
334
+ // mode: 'multiple',
335
+ // maxTagCount: 1,
336
+ // disabled: true
337
+ }
338
+ const selectPropsMultiple = {
339
+ mode: 'multiple',
340
+ maxTagCount: 6,
341
+ }
342
+
343
+ const [ tabKey, setTabKey ] = useState('single')
344
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
345
+
346
+ const props = {
347
+ value,
348
+ onChange: (value: any) => {
349
+ console.log(value)
350
+ setValue(value)
351
+ },
352
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
353
+ selectProps,
354
+ selectBusinessType: 'skcCommodity',
355
+ };
356
+
357
+ const onTabChange = (key) => {
358
+ setTabKey(key)
359
+ setValue(key === 'single' ? null: [])
360
+ }
361
+
362
+ return (
363
+ <div>
364
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
365
+ <TabPane tab='单选' key='single'>
366
+ {tabKey === 'single' && (
367
+ <BusinessSearchSelect {...props} />
368
+ )}
369
+ </TabPane>
370
+ <TabPane tab='多选' key='multiple'>
371
+ {tabKey === 'multiple' && (
372
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
373
+ )}
374
+ </TabPane>
375
+ </Tabs>
376
+ </div>
377
+ );
378
+ };
379
+ ```
380
+
381
+ ## 仓库选择器(物理仓) Select-Warehouse-001
382
+
383
+ ```tsx
384
+ import React, { useState, useEffect } from 'react';
385
+ import { Tabs } from 'antd';
386
+ import {BusinessSearchSelect} from '../../../index.ts';
387
+
388
+ const { TabPane } = Tabs;
389
+
390
+ export default () => {
391
+ const selectProps = {
392
+ // mode: 'multiple',
393
+ // maxTagCount: 1,
394
+ // disabled: true
395
+ }
396
+ const selectPropsMultiple = {
397
+ mode: 'multiple',
398
+ maxTagCount: 1,
399
+ }
400
+
401
+ const [ tabKey, setTabKey ] = useState('single')
402
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
403
+
404
+ useEffect(() => {
405
+ if(tabKey === 'multiple') {
406
+ setValue(['1540295745870573570', '1540173160826613762'])
407
+ }
408
+ },[tabKey])
409
+
410
+ const props = {
411
+ value,
412
+ onChange: (value: any) => {
413
+ console.log(value)
414
+ setValue(value)
415
+ },
416
+ requestConfig: {
417
+ // mappingValueField: 'physicalWarehouseCode',
418
+ // sourceName: 'physicalWarehouseCode',
419
+ filterInit: 'qp-id-in'
420
+ },
421
+ // modalTableProps: {
422
+ // modalTableTitle: '选择物理仓-更改title测试',
423
+ // needModalTable: false
424
+ // },
425
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
426
+ selectProps,
427
+ // labelInValue: true,
428
+ selectBusinessType: 'physicalWarehouse',
429
+ };
430
+
431
+ const onTabChange = (key) => {
432
+ setTabKey(key)
433
+ setValue(key === 'single' ? null: [])
434
+ }
435
+
436
+ return (
437
+ <div>
438
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
439
+ <TabPane tab='单选' key='single'>
440
+ {tabKey === 'single' && (
441
+ <BusinessSearchSelect {...props} />
442
+ )}
443
+ </TabPane>
444
+ <TabPane tab='多选' key='multiple'>
445
+ {tabKey === 'multiple' && (
446
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
447
+ )}
448
+ </TabPane>
449
+ </Tabs>
450
+ </div>
451
+ );
452
+ };
453
+ ```
454
+
455
+ ## 仓库选择器(逻辑仓) Select-Warehouse-002
456
+
457
+ ```tsx
458
+ import React, { useState } from 'react';
459
+ import { Tabs } from 'antd';
460
+ import {BusinessSearchSelect} from '../../../index.ts';
461
+
462
+ const { TabPane } = Tabs;
463
+
464
+ export default () => {
465
+ const selectProps = {
466
+ // mode: 'multiple',
467
+ // maxTagCount: 1,
468
+ // disabled: true
469
+ }
470
+ const selectPropsMultiple = {
471
+ mode: 'multiple',
472
+ maxTagCount: 1,
473
+ }
474
+
475
+ const [ tabKey, setTabKey ] = useState('single')
476
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
477
+
478
+ const props = {
479
+ value,
480
+ onChange: (value: any) => {
481
+ console.log(value)
482
+ setValue(value)
483
+ },
484
+ // requestConfig: {
485
+ // url: `/bop/api/realWarehouse`,
486
+ // filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
487
+ // mappingTextField: 'realWarehouseName',
488
+ // mappingValueField: 'realWarehouseCode',
489
+ // otherParams: {
490
+ // sorter: 'desc-id'
491
+ // }, // 默认参数
492
+ // sourceName: 'warehouseIds',
493
+ // },
494
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
495
+ selectProps,
496
+ selectBusinessType: 'realWarehouse',
497
+ };
498
+
499
+ const onTabChange = (key) => {
500
+ setTabKey(key)
501
+ setValue(key === 'single' ? null: [])
502
+ }
503
+
504
+ return (
505
+ <div>
506
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
507
+ <TabPane tab='单选' key='single'>
508
+ {tabKey === 'single' && (
509
+ <BusinessSearchSelect {...props} />
510
+ )}
511
+ </TabPane>
512
+ <TabPane tab='多选' key='multiple'>
513
+ {tabKey === 'multiple' && (
514
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
515
+ )}
516
+ </TabPane>
517
+ </Tabs>
518
+ </div>
519
+ );
520
+ };
521
+ ```
522
+
523
+ ## 仓库选择器(运营仓) Select-Warehouse-005
524
+
525
+ ```tsx
526
+ import React, { useState } from 'react';
527
+ import { Tabs } from 'antd';
528
+ import {BusinessSearchSelect} from '../../../index.ts';
529
+
530
+ const { TabPane } = Tabs;
531
+
532
+ export default () => {
533
+ const selectProps = {
534
+ // mode: 'multiple',
535
+ // maxTagCount: 1,
536
+ // disabled: true
537
+ }
538
+ const selectPropsMultiple = {
539
+ mode: 'multiple',
540
+ maxTagCount: 1,
541
+ }
542
+
543
+ const [ tabKey, setTabKey ] = useState('single')
544
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
545
+
546
+ const props = {
547
+ value,
548
+ onChange: (value: any) => {
549
+ console.log(value)
550
+ setValue(value)
551
+ },
552
+ selectProps,
553
+ selectBusinessType: 'ownerWarehouse',
554
+ };
555
+
556
+ const onTabChange = (key) => {
557
+ setTabKey(key)
558
+ setValue(key === 'single' ? null: [])
559
+ }
560
+
561
+ return (
562
+ <div>
563
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
564
+ <TabPane tab='单选' key='single'>
565
+ {tabKey === 'single' && (
566
+ <BusinessSearchSelect {...props} />
567
+ )}
568
+ </TabPane>
569
+ <TabPane tab='多选' key='multiple'>
570
+ {tabKey === 'multiple' && (
571
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
572
+ )}
573
+ </TabPane>
574
+ </Tabs>
575
+ </div>
576
+ );
577
+ };
578
+ ```
579
+
580
+ ## 仓库选择器(虚拟仓) Select-Warehouse-003
581
+
582
+ ```tsx
583
+ import React, { useState } from 'react';
584
+ import { Tabs } from 'antd';
585
+ import {BusinessSearchSelect} from '../../../index.ts';
586
+
587
+ const { TabPane } = Tabs;
588
+
589
+ export default () => {
590
+ const selectProps = {
591
+ // mode: 'multiple',
592
+ // maxTagCount: 1,
593
+ // disabled: true
594
+ }
595
+ const selectPropsMultiple = {
596
+ mode: 'multiple',
597
+ maxTagCount: 1,
598
+ }
599
+
600
+ const [ tabKey, setTabKey ] = useState('single')
601
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
602
+
603
+ const props = {
604
+ value,
605
+ onChange: (value: any) => {
606
+ console.log(value)
607
+ setValue(value)
608
+ },
609
+ // requestConfig: {
610
+ // url: `/bop/api/virtualWarehouse`,
611
+ // filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
612
+ // mappingTextField: 'virtualWarehouseName',
613
+ // mappingValueField: 'virtualWarehouseCode',
614
+ // otherParams: {
615
+ // sorter: 'desc-id'
616
+ // }, // 默认参数
617
+ // sourceName: 'warehouseIds',
618
+ // },
619
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
620
+ selectProps,
621
+ selectBusinessType: 'virtualWarehouse',
622
+ };
623
+
624
+ const onTabChange = (key) => {
625
+ setTabKey(key)
626
+ setValue(key === 'single' ? null: [])
627
+ }
628
+
629
+ return (
630
+ <div>
631
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
632
+ <TabPane tab='单选' key='single'>
633
+ {tabKey === 'single' && (
634
+ <BusinessSearchSelect {...props} />
635
+ )}
636
+ </TabPane>
637
+ <TabPane tab='多选' key='multiple'>
638
+ {tabKey === 'multiple' && (
639
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
640
+ )}
641
+ </TabPane>
642
+ </Tabs>
643
+ </div>
644
+ );
645
+ };
646
+ ```
647
+
648
+ ## 仓库选择器(渠道仓) Select-Warehouse-004
649
+
650
+ ```tsx
651
+ import React, { useState } from 'react';
652
+ import { Tabs } from 'antd';
653
+ import {BusinessSearchSelect} from '../../../index.ts';
654
+
655
+ const { TabPane } = Tabs;
656
+
657
+ export default () => {
658
+ const selectProps = {
659
+ // mode: 'multiple',
660
+ // maxTagCount: 1,
661
+ // disabled: true
662
+ }
663
+ const selectPropsMultiple = {
664
+ mode: 'multiple',
665
+ maxTagCount: 1,
666
+ }
667
+
668
+ const [ tabKey, setTabKey ] = useState('single')
669
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
670
+
671
+ const props = {
672
+ value,
673
+ onChange: (value: any) => {
674
+ console.log(value)
675
+ setValue(value)
676
+ },
677
+ // requestConfig: {
678
+ // url: `/bop/api/channelWarehouse`,
679
+ // filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
680
+ // mappingTextField: 'channelWarehouseName',
681
+ // mappingValueField: 'channelWarehouseCode',
682
+ // otherParams: {
683
+ // sorter: 'desc-id'
684
+ // }, // 默认参数
685
+ // sourceName: 'warehouseIds',
686
+ // },
687
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
688
+ selectProps,
689
+ selectBusinessType: 'channelWarehouse',
690
+ };
691
+
692
+ const onTabChange = (key) => {
693
+ setTabKey(key)
694
+ setValue(key === 'single' ? null: [])
695
+ }
696
+
697
+ return (
698
+ <div>
699
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
700
+ <TabPane tab='单选' key='single'>
701
+ {tabKey === 'single' && (
702
+ <BusinessSearchSelect {...props} />
703
+ )}
704
+ </TabPane>
705
+ <TabPane tab='多选' key='multiple'>
706
+ {tabKey === 'multiple' && (
707
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
708
+ )}
709
+ </TabPane>
710
+ </Tabs>
711
+ </div>
712
+ );
713
+ };
714
+ ```
715
+
716
+
717
+ ## 客户选择器 Select-KH-001
718
+
719
+ ```tsx
720
+ import React, { useState } from 'react';
721
+ import { Tabs } from 'antd';
722
+ import {BusinessSearchSelect} from '../../../index.ts';
723
+
724
+ const { TabPane } = Tabs;
725
+
726
+ export default () => {
727
+ const selectProps = {
728
+ // mode: 'multiple',
729
+ // maxTagCount: 1,
730
+ // disabled: true
731
+ }
732
+ const selectPropsMultiple = {
733
+ mode: 'multiple',
734
+ maxTagCount: 1,
735
+ }
736
+
737
+ const [ tabKey, setTabKey ] = useState('single')
738
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
739
+
740
+ const props = {
741
+ value,
742
+ onChange: (value: any) => {
743
+ console.log(value)
744
+ setValue(value)
745
+ },
746
+ // requestConfig: {
747
+ // url: `/bop/api/customer`,
748
+ // filter: 'qp-name,code-orGroup,like', // 过滤参数
749
+ // mappingTextField: 'name',
750
+ // mappingValueField: 'code',
751
+ // otherParams: {
752
+ // sorter: 'desc-id'
753
+ // }, // 默认参数
754
+ // sourceName: 'customerCode',
755
+ // },
756
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
757
+ selectProps,
758
+ selectBusinessType: 'customer',
759
+ };
760
+
761
+ const props2 = {
762
+ ...props,
763
+ // prefixUrl: { selectPrefix: '/channel-manage/', formSelectFix: '/channel-manage/' },
764
+ selectBusinessType: 'customer2',
765
+ }
766
+
767
+ const onTabChange = (key) => {
768
+ setTabKey(key)
769
+ setValue(key === 'single' ? null: [])
770
+ }
771
+
772
+ return (
773
+ <div>
774
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
775
+ <TabPane tab='单选' key='single'>
776
+ {tabKey === 'single' && (
777
+ <>
778
+ <span>版本1:支持英伦项目...</span>
779
+ <BusinessSearchSelect {...props} />
780
+ <span>版本2:支持麦克英孚项目...</span>
781
+ <BusinessSearchSelect {...props2} />
782
+ </>
783
+ )}
784
+ </TabPane>
785
+ <TabPane tab='多选' key='multiple'>
786
+ {tabKey === 'multiple' && (
787
+ <>
788
+ <span>版本1:支持英伦项目...</span>
789
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
790
+ <span>版本2:支持麦克英孚项目...</span>
791
+ <BusinessSearchSelect {...props2} selectProps={selectPropsMultiple} />
792
+ </>
793
+ )}
794
+ </TabPane>
795
+ </Tabs>
796
+ </div>
797
+ );
798
+ };
799
+ ```
800
+
801
+
802
+ ## 店铺选择器 Select-DP-001
803
+
804
+ ```tsx
805
+ import React, { useState } from 'react';
806
+ import { Tabs } from 'antd';
807
+ import {BusinessSearchSelect} from '../../../index.ts';
808
+
809
+ const { TabPane } = Tabs;
810
+
811
+ export default () => {
812
+ const selectProps = {
813
+ // mode: 'multiple',
814
+ // maxTagCount: 1,
815
+ // disabled: true
816
+ }
817
+ const selectPropsMultiple = {
818
+ mode: 'multiple',
819
+ maxTagCount: 1,
820
+ }
821
+
822
+ const [ tabKey, setTabKey ] = useState('single')
823
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
824
+
825
+ const props = {
826
+ value,
827
+ onChange: (value: any) => {
828
+ console.log(value)
829
+ setValue(value)
830
+ },
831
+ // requestConfig: {
832
+ // url: `/bop/api/store`,
833
+ // filter: 'qp-name,code-orGroup,like',,
834
+ // mappingTextField: 'name',
835
+ // mappingValueField: 'code',
836
+ // otherParams: {
837
+ // sorter: 'desc-id'
838
+ // }, // 默认参数
839
+ // sourceName: 'code',
840
+ // },
841
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
842
+ selectProps,
843
+ selectBusinessType: 'shopFile',
844
+ };
845
+
846
+ const props2 = {
847
+ ...props,
848
+ // prefixUrl: { selectPrefix: '/channel-manage/', formSelectFix: '/channel-manage/' },
849
+ selectBusinessType: 'shopFile2',
850
+ }
851
+
852
+ const onTabChange = (key) => {
853
+ setTabKey(key)
854
+ setValue(key === 'single' ? null: [])
855
+ }
856
+
857
+ return (
858
+ <div>
859
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
860
+ <TabPane tab='单选' key='single'>
861
+ {tabKey === 'single' && (
862
+ <>
863
+ <span>版本1:支持英伦项目...</span>
864
+ <BusinessSearchSelect {...props} />
865
+ <span>版本2:支持麦克英孚项目...</span>
866
+ <BusinessSearchSelect {...props2} />
867
+ </>
868
+ )}
869
+ </TabPane>
870
+ <TabPane tab='多选' key='multiple'>
871
+ {tabKey === 'multiple' && (
872
+ <>
873
+ <span>版本1:支持英伦项目...</span>
874
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
875
+ <span>版本2:支持麦克英孚项目...</span>
876
+ <BusinessSearchSelect {...props2} selectProps={selectPropsMultiple} />
877
+ </>
878
+ )}
879
+ </TabPane>
880
+ </Tabs>
881
+ </div>
882
+ );
883
+ };
884
+ ```
885
+
886
+
887
+ ## 核算主体选择器 Select-HSZT-001
888
+
889
+ ```tsx
890
+ import React, { useState } from 'react';
891
+ import { Tabs } from 'antd';
892
+ import {BusinessSearchSelect} from '../../../index.ts';
893
+
894
+ const { TabPane } = Tabs;
895
+
896
+ export default () => {
897
+ const selectProps = {
898
+ // mode: 'multiple',
899
+ // maxTagCount: 1,
900
+ // disabled: true
901
+ }
902
+ const selectPropsMultiple = {
903
+ mode: 'multiple',
904
+ maxTagCount: 1,
905
+ }
906
+
907
+ const [ tabKey, setTabKey ] = useState('single')
908
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
909
+
910
+ const props = {
911
+ value,
912
+ onChange: (value: any) => {
913
+ console.log(value)
914
+ setValue(value)
915
+ },
916
+ // requestConfig: {
917
+ // url: `/bop/api/accountingSubject`,
918
+ // filter: 'qp-name,code-orGroup,like',
919
+ // mappingTextField: 'name',
920
+ // mappingValueField: 'code',
921
+ // otherParams: {
922
+ // sorter: 'desc-id'
923
+ // }, // 默认参数
924
+ // sourceName: 'accountingCode',
925
+ // },
926
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
927
+ selectProps,
928
+ selectBusinessType: 'accountingSubject',
929
+ };
930
+
931
+ const onTabChange = (key) => {
932
+ setTabKey(key)
933
+ setValue(key === 'single' ? null: [])
934
+ }
935
+
936
+ return (
937
+ <div>
938
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
939
+ <TabPane tab='单选' key='single'>
940
+ {tabKey === 'single' && (
941
+ <BusinessSearchSelect {...props} />
942
+ )}
943
+ </TabPane>
944
+ <TabPane tab='多选' key='multiple'>
945
+ {tabKey === 'multiple' && (
946
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
947
+ )}
948
+ </TabPane>
949
+ </Tabs>
950
+ </div>
951
+ );
952
+ };
953
+ ```
954
+
955
+
956
+ ## 库存组织选择器 Select-KCZZ-001
957
+
958
+ ```tsx
959
+ import React, { useState } from 'react';
960
+ import { Tabs } from 'antd';
961
+ import {BusinessSearchSelect} from '../../../index.ts';
962
+
963
+ const { TabPane } = Tabs;
964
+
965
+ export default () => {
966
+ const selectProps = {
967
+ // mode: 'multiple',
968
+ // maxTagCount: 1,
969
+ // disabled: true
970
+ }
971
+ const selectPropsMultiple = {
972
+ mode: 'multiple',
973
+ maxTagCount: 1,
974
+ }
975
+
976
+ const [ tabKey, setTabKey ] = useState('single')
977
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
978
+
979
+ const props = {
980
+ value,
981
+ onChange: (value: any) => {
982
+ console.log(value)
983
+ setValue(value)
984
+ },
985
+ // requestConfig: {
986
+ // url: `/bop/api/inventoryOrg`,
987
+ // filter: 'qp-name,code-orGroup,like',
988
+ // mappingTextField: 'name',
989
+ // mappingValueField: 'code',
990
+ // otherParams: {
991
+ // sorter: 'desc-id'
992
+ // }, // 默认参数
993
+ // sourceName: 'inventoryOrgCode',
994
+ // },
995
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
996
+ selectProps,
997
+ selectBusinessType: 'inventoryOrg',
998
+ };
999
+
1000
+ const props2 = {
1001
+ ...props,
1002
+ selectBusinessType: 'inventoryOrg2',
1003
+ }
1004
+
1005
+ const onTabChange = (key) => {
1006
+ setTabKey(key)
1007
+ setValue(key === 'single' ? null: [])
1008
+ }
1009
+
1010
+ return (
1011
+
1012
+ <div>
1013
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1014
+ <TabPane tab='单选' key='single'>
1015
+ {tabKey === 'single' && <BusinessSearchSelect {...props} />}
1016
+ </TabPane>
1017
+ <TabPane tab='多选' key='multiple'>
1018
+ {tabKey === 'multiple' && <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />}
1019
+ </TabPane>
1020
+ </Tabs>
1021
+ </div>
1022
+ );
1023
+ };
1024
+ ```
1025
+
1026
+
1027
+ ## 法人公司选择器 Select-FRGS-001
1028
+
1029
+ ```tsx
1030
+ import React, { useState } from 'react';
1031
+ import { Tabs } from 'antd';
1032
+ import {BusinessSearchSelect} from '../../../index.ts';
1033
+
1034
+ const { TabPane } = Tabs;
1035
+
1036
+ export default () => {
1037
+ const selectProps = {
1038
+ // mode: 'multiple',
1039
+ // maxTagCount: 1,
1040
+ // disabled: true
1041
+ }
1042
+ const selectPropsMultiple = {
1043
+ mode: 'multiple',
1044
+ maxTagCount: 1,
1045
+ }
1046
+
1047
+ const [ tabKey, setTabKey ] = useState('single')
1048
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1049
+
1050
+ const props = {
1051
+ value,
1052
+ onChange: (value: any) => {
1053
+ console.log(value)
1054
+ setValue(value)
1055
+ },
1056
+ // requestConfig: {
1057
+ // url: `/bop/api/company`,
1058
+ // filter: 'qp-name,code-orGroup,like',
1059
+ // mappingTextField: 'name',
1060
+ // mappingValueField: 'code',
1061
+ // otherParams: {
1062
+ // 'qp-companyType-eq': '20',
1063
+ // sorter: 'desc-id'
1064
+ // }, // 默认参数
1065
+ // sourceName: 'companyCode',
1066
+ // },
1067
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
1068
+ selectProps,
1069
+ selectBusinessType: 'corporationCompany',
1070
+ };
1071
+
1072
+ const onTabChange = (key) => {
1073
+ setTabKey(key)
1074
+ setValue(key === 'single' ? null: [])
1075
+ }
1076
+
1077
+ return (
1078
+ <div>
1079
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1080
+ <TabPane tab='单选' key='single'>
1081
+ {tabKey === 'single' && (
1082
+ <BusinessSearchSelect {...props} />
1083
+ )}
1084
+ </TabPane>
1085
+ <TabPane tab='多选' key='multiple'>
1086
+ {tabKey === 'multiple' && (
1087
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1088
+ )}
1089
+ </TabPane>
1090
+ </Tabs>
1091
+ </div>
1092
+ );
1093
+ };
1094
+ ```
1095
+
1096
+
1097
+ ## 员工选择器 Select-YG-001
1098
+
1099
+ ```tsx
1100
+ import React, { useState } from 'react';
1101
+ import { Tabs } from 'antd';
1102
+ import {BusinessSearchSelect} from '../../../index.ts';
1103
+
1104
+ const { TabPane } = Tabs;
1105
+
1106
+ export default () => {
1107
+ const selectProps = {
1108
+ // mode: 'multiple',
1109
+ // maxTagCount: 1,
1110
+ // disabled: true
1111
+ }
1112
+ const selectPropsMultiple = {
1113
+ mode: 'multiple',
1114
+ maxTagCount: 1,
1115
+ }
1116
+
1117
+ const [ tabKey, setTabKey ] = useState('single')
1118
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1119
+
1120
+ const props = {
1121
+ value,
1122
+ onChange: (value: any) => {
1123
+ console.log(value)
1124
+ setValue(value)
1125
+ },
1126
+ // requestConfig: {
1127
+ // url: `/bop/api/employee`,
1128
+ // filter: 'qp-name,code-orGroup,like',
1129
+ // mappingTextField: 'name',
1130
+ // mappingValueField: 'code',
1131
+ // otherParams: {
1132
+ // sorter: 'desc-id'
1133
+ // }, // 默认参数
1134
+ // sourceName: 'code',
1135
+ // },
1136
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
1137
+ selectProps,
1138
+ selectBusinessType: 'employee',
1139
+ };
1140
+
1141
+ const props2 = {
1142
+ ...props,
1143
+ // prefixUrl: { selectPrefix: '/user/api', formSelectFix: '/user/api' },
1144
+ selectBusinessType: 'employee2',
1145
+ }
1146
+
1147
+ const onTabChange = (key) => {
1148
+ setTabKey(key)
1149
+ setValue(key === 'single' ? null: [])
1150
+ }
1151
+
1152
+ return (
1153
+ <div>
1154
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1155
+ <TabPane tab='单选' key='single'>
1156
+ {tabKey === 'single' && (
1157
+ <>
1158
+ <span>版本1:支持英伦项目...</span>
1159
+ <BusinessSearchSelect {...props} />
1160
+ <span>版本2:支持麦克英孚项目...</span>
1161
+ <BusinessSearchSelect {...props2} />
1162
+ </>
1163
+ )}
1164
+ </TabPane>
1165
+ <TabPane tab='多选' key='multiple'>
1166
+ {tabKey === 'multiple' && (
1167
+ <>
1168
+ <span>版本1:支持英伦项目...</span>
1169
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1170
+ <span>版本2:支持麦克英孚项目...</span>
1171
+ <BusinessSearchSelect {...props2} selectProps={selectPropsMultiple} />
1172
+ </>
1173
+ )}
1174
+ </TabPane>
1175
+ </Tabs>
1176
+ </div>
1177
+ );
1178
+ };
1179
+ ```
1180
+
1181
+
1182
+ ## 配送方式选择器 Select-PSFS-001
1183
+
1184
+ ```tsx
1185
+ import React, { useState } from 'react';
1186
+ import { Tabs } from 'antd';
1187
+ import {BusinessSearchSelect} from '../../../index.ts';
1188
+
1189
+ const { TabPane } = Tabs;
1190
+
1191
+ export default () => {
1192
+ const selectProps = {
1193
+ // mode: 'multiple',
1194
+ // maxTagCount: 1,
1195
+ // disabled: true
1196
+ }
1197
+ const selectPropsMultiple = {
1198
+ mode: 'multiple',
1199
+ maxTagCount: 1,
1200
+ }
1201
+
1202
+ const [ tabKey, setTabKey ] = useState('single')
1203
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1204
+
1205
+ const props = {
1206
+ value,
1207
+ onChange: (value: any) => {
1208
+ console.log(value)
1209
+ setValue(value)
1210
+ },
1211
+ // requestConfig: {
1212
+ // url: `/bop/api/getDeliveryModeCodeNameMap`,
1213
+ // filter: 'qp-name,code-orGroup,like',
1214
+ // mappingTextField: 'name',
1215
+ // mappingValueField: 'code',
1216
+ // otherParams: {
1217
+ // sorter: 'desc-id'
1218
+ // }, // 默认参数
1219
+ // sourceName: 'deliveryModeCode',
1220
+ // },
1221
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
1222
+ selectProps,
1223
+ selectBusinessType: 'deliveryMode',
1224
+ };
1225
+
1226
+ const onTabChange = (key) => {
1227
+ setTabKey(key)
1228
+ setValue(key === 'single' ? null: [])
1229
+ }
1230
+
1231
+ return (
1232
+ <div>
1233
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1234
+ <TabPane tab='单选' key='single'>
1235
+ {tabKey === 'single' && (
1236
+ <BusinessSearchSelect {...props} />
1237
+ )}
1238
+ </TabPane>
1239
+ <TabPane tab='多选' key='multiple'>
1240
+ {tabKey === 'multiple' && (
1241
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1242
+ )}
1243
+ </TabPane>
1244
+ </Tabs>
1245
+ </div>
1246
+ );
1247
+ };
1248
+ ```
1249
+
1250
+ More skills for writing demo: https://d.umijs.org/guide/demo-principle
1251
+
1252
+
1253
+ ## 规则场景选择器 Select-GZCJ-001
1254
+
1255
+ ```tsx
1256
+ import React, { useState } from 'react';
1257
+ import { Tabs } from 'antd';
1258
+ import {BusinessSearchSelect} from '../../../index.ts';
1259
+
1260
+ const { TabPane } = Tabs;
1261
+
1262
+ export default () => {
1263
+ const selectProps = {
1264
+ // mode: 'multiple',
1265
+ // maxTagCount: 1,
1266
+ // disabled: true
1267
+ }
1268
+ const selectPropsMultiple = {
1269
+ mode: 'multiple',
1270
+ maxTagCount: 1,
1271
+ }
1272
+
1273
+ const [ tabKey, setTabKey ] = useState('single')
1274
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1275
+
1276
+ const props = {
1277
+ value,
1278
+ onChange: (value: any) => {
1279
+ console.log(value)
1280
+ setValue(value)
1281
+ },
1282
+ selectProps,
1283
+ selectBusinessType: 'ruleTemplate',
1284
+ };
1285
+
1286
+ const onTabChange = (key) => {
1287
+ setTabKey(key)
1288
+ setValue(key === 'single' ? null: [])
1289
+ }
1290
+
1291
+ return (
1292
+ <div>
1293
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1294
+ <TabPane tab='单选' key='single'>
1295
+ {tabKey === 'single' && (
1296
+ <BusinessSearchSelect {...props} />
1297
+ )}
1298
+ </TabPane>
1299
+ <TabPane tab='多选' key='multiple'>
1300
+ {tabKey === 'multiple' && (
1301
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1302
+ )}
1303
+ </TabPane>
1304
+ </Tabs>
1305
+ </div>
1306
+ );
1307
+ };
1308
+ ```
1309
+
1310
+ More skills for writing demo: https://d.umijs.org/guide/demo-principle