@bit-sun/business-component 2.3.0 → 2.3.2

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