@bit-sun/business-component 2.3.25 → 2.3.26

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