@bit-sun/business-component 2.4.27 → 2.4.28

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/DetailPageWrapper/utils.d.ts +3 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.esm.js +1383 -1219
  11. package/dist/index.js +500 -300
  12. package/dist/utils/LocalstorageUtils.d.ts +1 -0
  13. package/dist/utils/auth.d.ts +2 -0
  14. package/dist/utils/enumConfig.d.ts +4 -0
  15. package/dist/utils/index.d.ts +6 -0
  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 +80 -79
  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 +162 -162
  52. package/src/components/Business/AddSelectBusiness/index.tsx +1062 -1062
  53. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -112
  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 +158 -158
  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 +566 -566
  77. package/src/components/Business/BsSulaQueryTable/index.less +221 -221
  78. package/src/components/Business/BsSulaQueryTable/index.tsx +559 -558
  79. package/src/components/Business/BsSulaQueryTable/setting.tsx +854 -854
  80. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  81. package/src/components/Business/BsSulaQueryTable/utils.tsx +690 -690
  82. package/src/components/Business/CommodityEntry/index.md +70 -70
  83. package/src/components/Business/CommodityEntry/index.tsx +81 -81
  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 +316 -315
  90. package/src/components/Business/DetailPageWrapper/utils.tsx +164 -105
  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 -205
  96. package/src/components/Business/JsonQueryTable/components/Formula.tsx +206 -206
  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 +537 -537
  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 +450 -450
  122. package/src/components/Business/SearchSelect/{BusinessUtils.ts → BusinessUtils.tsx} +2120 -2057
  123. package/src/components/Business/SearchSelect/common.ts +134 -134
  124. package/src/components/Business/SearchSelect/index.md +1503 -1444
  125. package/src/components/Business/SearchSelect/index.tsx +55 -55
  126. package/src/components/Business/SearchSelect/utils.ts +101 -101
  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 +185 -185
  131. package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
  132. package/src/components/Business/TreeSearchSelect/utils.ts +104 -104
  133. package/src/components/Business/columnSettingTable/columnSetting.tsx +766 -766
  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 +235 -235
  137. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +243 -243
  138. package/src/components/Business/columnSettingTable/utils.tsx +71 -71
  139. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -87
  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 +387 -387
  144. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  145. package/src/components/Functional/AddSelect/helps.ts +80 -80
  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 +1171 -1171
  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 +773 -773
  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 +696 -696
  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 +688 -688
  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 +60 -60
  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 +896 -896
  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 +204 -204
  175. package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
  176. package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -62
  177. package/src/components/Solution/RuleComponent/index.d.ts +29 -29
  178. package/src/components/Solution/RuleComponent/index.js +2073 -2073
  179. package/src/components/Solution/RuleComponent/index.less +230 -230
  180. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
  181. package/src/components/Solution/RuleComponent/ruleFiled.js +2281 -2281
  182. package/src/components/Solution/RuleComponent/services.ts +13 -13
  183. package/src/components/Solution/RuleComponent/util.js +143 -143
  184. package/src/index.ts +39 -38
  185. package/src/plugin/TableColumnSetting/index.less +247 -247
  186. package/src/plugin/TableColumnSetting/index.md +50 -50
  187. package/src/plugin/TableColumnSetting/index.tsx +725 -725
  188. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  189. package/src/styles/bsDefault.less +1912 -1912
  190. package/src/utils/CheckOneUser/index.md +39 -39
  191. package/src/utils/CheckOneUser/index.ts +51 -51
  192. package/src/utils/CustomLoginInfo.ts +55 -55
  193. package/src/utils/LocalstorageUtils.ts +111 -95
  194. package/src/utils/TableUtils.tsx +18 -18
  195. package/src/utils/auth.ts +32 -0
  196. package/src/utils/checkUtils.ts +39 -39
  197. package/src/utils/enumConfig.ts +16 -12
  198. package/src/utils/getFormMode.js +12 -12
  199. package/src/utils/index.ts +12 -4
  200. package/src/utils/requestUtils.ts +166 -166
  201. package/src/utils/serialize.js +7 -7
  202. package/src/utils/utils.ts +195 -195
  203. package/tsconfig.json +29 -29
  204. package/typings.d.ts +4 -4
@@ -1,1444 +1,1503 @@
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
- // prefixUrl: { selectPrefix: '/api/user-manage/', formSelectFix: '/api/user-manage/' },
1161
- modalTableProps: {
1162
- needTypeSearch: true
1163
- },
1164
- selectBusinessType: 'employee2',
1165
- }
1166
-
1167
- const onTabChange = (key) => {
1168
- setTabKey(key)
1169
- setValue(key === 'single' ? null: [])
1170
- }
1171
-
1172
- return (
1173
- <div>
1174
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1175
- <TabPane tab='单选' key='single'>
1176
- {tabKey === 'single' && (
1177
- <>
1178
- <span>版本1:支持英伦项目...</span>
1179
- <BusinessSearchSelect {...props} />
1180
- <span>版本2:支持麦克英孚项目...</span>
1181
- <BusinessSearchSelect {...props2} />
1182
- </>
1183
- )}
1184
- </TabPane>
1185
- <TabPane tab='多选' key='multiple'>
1186
- {tabKey === 'multiple' && (
1187
- <>
1188
- <span>版本1:支持英伦项目...</span>
1189
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1190
- <span>版本2:支持麦克英孚项目...</span>
1191
- <BusinessSearchSelect {...props2} selectProps={selectPropsMultiple} />
1192
- </>
1193
- )}
1194
- </TabPane>
1195
- </Tabs>
1196
- </div>
1197
- );
1198
- };
1199
- ```
1200
-
1201
-
1202
- ## 配送方式选择器 Select-PSFS-001
1203
-
1204
- ```tsx
1205
- import React, { useState } from 'react';
1206
- import { Tabs } from 'antd';
1207
- import {BusinessSearchSelect} from '../../../index.ts';
1208
-
1209
- const { TabPane } = Tabs;
1210
-
1211
- export default () => {
1212
- const selectProps = {
1213
- // mode: 'multiple',
1214
- // maxTagCount: 1,
1215
- // disabled: true
1216
- }
1217
- const selectPropsMultiple = {
1218
- mode: 'multiple',
1219
- maxTagCount: 1,
1220
- }
1221
-
1222
- const [ tabKey, setTabKey ] = useState('single')
1223
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
1224
-
1225
- const props = {
1226
- value,
1227
- onChange: (value: any) => {
1228
- console.log(value)
1229
- setValue(value)
1230
- },
1231
- // requestConfig: {
1232
- // url: `/bop/api/getDeliveryModeCodeNameMap`,
1233
- // filter: 'qp-name,code-orGroup,like',
1234
- // mappingTextField: 'name',
1235
- // mappingValueField: 'code',
1236
- // otherParams: {
1237
- // sorter: 'desc-id'
1238
- // }, // 默认参数
1239
- // sourceName: 'deliveryModeCode',
1240
- // },
1241
- // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
1242
- selectProps,
1243
- selectBusinessType: 'deliveryMode',
1244
- };
1245
-
1246
- const onTabChange = (key) => {
1247
- setTabKey(key)
1248
- setValue(key === 'multiple' ? []: null)
1249
- }
1250
-
1251
- return (
1252
- <div>
1253
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1254
- <TabPane tab='单选' key='single'>
1255
- {tabKey === 'single' && (
1256
- <BusinessSearchSelect {...props} />
1257
- )}
1258
- </TabPane>
1259
- <TabPane tab='多选' key='multiple'>
1260
- {tabKey === 'multiple' && (
1261
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1262
- )}
1263
- </TabPane>
1264
- </Tabs>
1265
- </div>
1266
- );
1267
- };
1268
- ```
1269
-
1270
- More skills for writing demo: https://d.umijs.org/guide/demo-principle
1271
-
1272
-
1273
- ## 规则模板选择器 Select-GZCJ-001
1274
-
1275
- ```tsx
1276
- import React, { useState } from 'react';
1277
- import { Tabs } from 'antd';
1278
- import {BusinessSearchSelect} from '../../../index.ts';
1279
-
1280
- const { TabPane } = Tabs;
1281
-
1282
- export default () => {
1283
- const selectProps = {
1284
- // mode: 'multiple',
1285
- // maxTagCount: 1,
1286
- // disabled: true
1287
- }
1288
- const selectPropsMultiple = {
1289
- mode: 'multiple',
1290
- maxTagCount: 1,
1291
- }
1292
-
1293
- const [ tabKey, setTabKey ] = useState('single')
1294
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
1295
-
1296
- const props = {
1297
- value,
1298
- onChange: (value: any) => {
1299
- console.log(value)
1300
- setValue(value)
1301
- },
1302
- selectProps,
1303
- selectBusinessType: 'ruleTemplate',
1304
- };
1305
-
1306
- const onTabChange = (key) => {
1307
- setTabKey(key)
1308
- setValue(key === 'single' ? null: [])
1309
- }
1310
-
1311
- return (
1312
- <div>
1313
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1314
- <TabPane tab='单选' key='single'>
1315
- {tabKey === 'single' && (
1316
- <BusinessSearchSelect {...props} />
1317
- )}
1318
- </TabPane>
1319
- <TabPane tab='多选' key='multiple'>
1320
- {tabKey === 'multiple' && (
1321
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1322
- )}
1323
- </TabPane>
1324
- </Tabs>
1325
- </div>
1326
- );
1327
- };
1328
- ```
1329
-
1330
- ## 角色选择器 Select-ROLE-001
1331
-
1332
- ```tsx
1333
- import React, { useState } from 'react';
1334
- import { Tabs } from 'antd';
1335
- import {BusinessSearchSelect} from '../../../index.ts';
1336
-
1337
- const { TabPane } = Tabs;
1338
-
1339
- export default () => {
1340
- const selectProps = {
1341
- // mode: 'multiple',
1342
- // maxTagCount: 1,
1343
- // disabled: true
1344
- }
1345
- const selectPropsMultiple = {
1346
- mode: 'multiple',
1347
- maxTagCount: 1,
1348
- }
1349
-
1350
- const [ tabKey, setTabKey ] = useState('single')
1351
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
1352
-
1353
- const props = {
1354
- value,
1355
- onChange: (value: any) => {
1356
- console.log(value)
1357
- setValue(value)
1358
- },
1359
- selectProps,
1360
- selectBusinessType: 'role',
1361
- };
1362
-
1363
- const onTabChange = (key) => {
1364
- setTabKey(key)
1365
- setValue(key === 'single' ? null: [])
1366
- }
1367
-
1368
- return (
1369
- <div>
1370
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1371
- <TabPane tab='单选' key='single'>
1372
- {tabKey === 'single' && (
1373
- <BusinessSearchSelect {...props} />
1374
- )}
1375
- </TabPane>
1376
- <TabPane tab='多选' key='multiple'>
1377
- {tabKey === 'multiple' && (
1378
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1379
- )}
1380
- </TabPane>
1381
- </Tabs>
1382
- </div>
1383
- );
1384
- };
1385
- ```
1386
-
1387
- ## 人员选择器 Select-PERSON-001
1388
-
1389
- ```tsx
1390
- import React, { useState } from 'react';
1391
- import { Tabs } from 'antd';
1392
- import {BusinessSearchSelect} from '../../../index.ts';
1393
-
1394
- const { TabPane } = Tabs;
1395
-
1396
- export default () => {
1397
- const selectProps = {
1398
- // mode: 'multiple',
1399
- // maxTagCount: 1,
1400
- // disabled: true
1401
- }
1402
- const selectPropsMultiple = {
1403
- mode: 'multiple',
1404
- maxTagCount: 1,
1405
- }
1406
-
1407
- const [ tabKey, setTabKey ] = useState('single')
1408
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
1409
-
1410
- const props = {
1411
- value,
1412
- onChange: (value: any) => {
1413
- console.log(value)
1414
- setValue(value)
1415
- },
1416
- selectProps,
1417
- selectBusinessType: 'person',
1418
- };
1419
-
1420
- const onTabChange = (key) => {
1421
- setTabKey(key)
1422
- setValue(key === 'single' ? null: [])
1423
- }
1424
-
1425
- return (
1426
- <div>
1427
- <Tabs onChange={onTabChange} activeKey={tabKey}>
1428
- <TabPane tab='单选' key='single'>
1429
- {tabKey === 'single' && (
1430
- <BusinessSearchSelect {...props} />
1431
- )}
1432
- </TabPane>
1433
- <TabPane tab='多选' key='multiple'>
1434
- {tabKey === 'multiple' && (
1435
- <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1436
- )}
1437
- </TabPane>
1438
- </Tabs>
1439
- </div>
1440
- );
1441
- };
1442
- ```
1443
-
1444
- 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
+ // prefixUrl: { selectPrefix: '/api/user-manage/', formSelectFix: '/api/user-manage/' },
1161
+ modalTableProps: {
1162
+ needTypeSearch: true
1163
+ },
1164
+ selectBusinessType: 'employee2',
1165
+ }
1166
+
1167
+ const onTabChange = (key) => {
1168
+ setTabKey(key)
1169
+ setValue(key === 'single' ? null: [])
1170
+ }
1171
+
1172
+ return (
1173
+ <div>
1174
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1175
+ <TabPane tab='单选' key='single'>
1176
+ {tabKey === 'single' && (
1177
+ <>
1178
+ <span>版本1:支持英伦项目...</span>
1179
+ <BusinessSearchSelect {...props} />
1180
+ <span>版本2:支持麦克英孚项目...</span>
1181
+ <BusinessSearchSelect {...props2} />
1182
+ </>
1183
+ )}
1184
+ </TabPane>
1185
+ <TabPane tab='多选' key='multiple'>
1186
+ {tabKey === 'multiple' && (
1187
+ <>
1188
+ <span>版本1:支持英伦项目...</span>
1189
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1190
+ <span>版本2:支持麦克英孚项目...</span>
1191
+ <BusinessSearchSelect {...props2} selectProps={selectPropsMultiple} />
1192
+ </>
1193
+ )}
1194
+ </TabPane>
1195
+ </Tabs>
1196
+ </div>
1197
+ );
1198
+ };
1199
+ ```
1200
+
1201
+
1202
+ ## 配送方式选择器 Select-PSFS-001
1203
+
1204
+ ```tsx
1205
+ import React, { useState } from 'react';
1206
+ import { Tabs } from 'antd';
1207
+ import {BusinessSearchSelect} from '../../../index.ts';
1208
+
1209
+ const { TabPane } = Tabs;
1210
+
1211
+ export default () => {
1212
+ const selectProps = {
1213
+ // mode: 'multiple',
1214
+ // maxTagCount: 1,
1215
+ // disabled: true
1216
+ }
1217
+ const selectPropsMultiple = {
1218
+ mode: 'multiple',
1219
+ maxTagCount: 1,
1220
+ }
1221
+
1222
+ const [ tabKey, setTabKey ] = useState('single')
1223
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1224
+
1225
+ const props = {
1226
+ value,
1227
+ onChange: (value: any) => {
1228
+ console.log(value)
1229
+ setValue(value)
1230
+ },
1231
+ // requestConfig: {
1232
+ // url: `/bop/api/getDeliveryModeCodeNameMap`,
1233
+ // filter: 'qp-name,code-orGroup,like',
1234
+ // mappingTextField: 'name',
1235
+ // mappingValueField: 'code',
1236
+ // otherParams: {
1237
+ // sorter: 'desc-id'
1238
+ // }, // 默认参数
1239
+ // sourceName: 'deliveryModeCode',
1240
+ // },
1241
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
1242
+ selectProps,
1243
+ selectBusinessType: 'deliveryMode',
1244
+ };
1245
+
1246
+ const onTabChange = (key) => {
1247
+ setTabKey(key)
1248
+ setValue(key === 'multiple' ? []: null)
1249
+ }
1250
+
1251
+ return (
1252
+ <div>
1253
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1254
+ <TabPane tab='单选' key='single'>
1255
+ {tabKey === 'single' && (
1256
+ <BusinessSearchSelect {...props} />
1257
+ )}
1258
+ </TabPane>
1259
+ <TabPane tab='多选' key='multiple'>
1260
+ {tabKey === 'multiple' && (
1261
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1262
+ )}
1263
+ </TabPane>
1264
+ </Tabs>
1265
+ </div>
1266
+ );
1267
+ };
1268
+ ```
1269
+
1270
+ More skills for writing demo: https://d.umijs.org/guide/demo-principle
1271
+
1272
+
1273
+ ## 规则模板选择器 Select-GZCJ-001
1274
+
1275
+ ```tsx
1276
+ import React, { useState } from 'react';
1277
+ import { Tabs } from 'antd';
1278
+ import {BusinessSearchSelect} from '../../../index.ts';
1279
+
1280
+ const { TabPane } = Tabs;
1281
+
1282
+ export default () => {
1283
+ const selectProps = {
1284
+ // mode: 'multiple',
1285
+ // maxTagCount: 1,
1286
+ // disabled: true
1287
+ }
1288
+ const selectPropsMultiple = {
1289
+ mode: 'multiple',
1290
+ maxTagCount: 1,
1291
+ }
1292
+
1293
+ const [ tabKey, setTabKey ] = useState('single')
1294
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1295
+
1296
+ const props = {
1297
+ value,
1298
+ onChange: (value: any) => {
1299
+ console.log(value)
1300
+ setValue(value)
1301
+ },
1302
+ selectProps,
1303
+ selectBusinessType: 'ruleTemplate',
1304
+ };
1305
+
1306
+ const onTabChange = (key) => {
1307
+ setTabKey(key)
1308
+ setValue(key === 'single' ? null: [])
1309
+ }
1310
+
1311
+ return (
1312
+ <div>
1313
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1314
+ <TabPane tab='单选' key='single'>
1315
+ {tabKey === 'single' && (
1316
+ <BusinessSearchSelect {...props} />
1317
+ )}
1318
+ </TabPane>
1319
+ <TabPane tab='多选' key='multiple'>
1320
+ {tabKey === 'multiple' && (
1321
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1322
+ )}
1323
+ </TabPane>
1324
+ </Tabs>
1325
+ </div>
1326
+ );
1327
+ };
1328
+ ```
1329
+
1330
+ ## 角色选择器 Select-ROLE-001
1331
+
1332
+ ```tsx
1333
+ import React, { useState } from 'react';
1334
+ import { Tabs } from 'antd';
1335
+ import {BusinessSearchSelect} from '../../../index.ts';
1336
+
1337
+ const { TabPane } = Tabs;
1338
+
1339
+ export default () => {
1340
+ const selectProps = {
1341
+ // mode: 'multiple',
1342
+ // maxTagCount: 1,
1343
+ // disabled: true
1344
+ }
1345
+ const selectPropsMultiple = {
1346
+ mode: 'multiple',
1347
+ maxTagCount: 1,
1348
+ }
1349
+
1350
+ const [ tabKey, setTabKey ] = useState('single')
1351
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1352
+
1353
+ const props = {
1354
+ value,
1355
+ onChange: (value: any) => {
1356
+ console.log(value)
1357
+ setValue(value)
1358
+ },
1359
+ selectProps,
1360
+ selectBusinessType: 'role',
1361
+ };
1362
+
1363
+ const onTabChange = (key) => {
1364
+ setTabKey(key)
1365
+ setValue(key === 'single' ? null: [])
1366
+ }
1367
+
1368
+ return (
1369
+ <div>
1370
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1371
+ <TabPane tab='单选' key='single'>
1372
+ {tabKey === 'single' && (
1373
+ <BusinessSearchSelect {...props} />
1374
+ )}
1375
+ </TabPane>
1376
+ <TabPane tab='多选' key='multiple'>
1377
+ {tabKey === 'multiple' && (
1378
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1379
+ )}
1380
+ </TabPane>
1381
+ </Tabs>
1382
+ </div>
1383
+ );
1384
+ };
1385
+ ```
1386
+
1387
+ ## 人员选择器 Select-PERSON-001
1388
+
1389
+ ```tsx
1390
+ import React, { useState } from 'react';
1391
+ import { Tabs } from 'antd';
1392
+ import {BusinessSearchSelect} from '../../../index.ts';
1393
+
1394
+ const { TabPane } = Tabs;
1395
+
1396
+ export default () => {
1397
+ const selectProps = {
1398
+ // mode: 'multiple',
1399
+ // maxTagCount: 1,
1400
+ // disabled: true
1401
+ }
1402
+ const selectPropsMultiple = {
1403
+ mode: 'multiple',
1404
+ maxTagCount: 1,
1405
+ }
1406
+
1407
+ const [ tabKey, setTabKey ] = useState('single')
1408
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1409
+
1410
+ const props = {
1411
+ value,
1412
+ onChange: (value: any) => {
1413
+ console.log(value)
1414
+ setValue(value)
1415
+ },
1416
+ selectProps,
1417
+ selectBusinessType: 'person',
1418
+ };
1419
+
1420
+ const onTabChange = (key) => {
1421
+ setTabKey(key)
1422
+ setValue(key === 'single' ? null: [])
1423
+ }
1424
+
1425
+ return (
1426
+ <div>
1427
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1428
+ <TabPane tab='单选' key='single'>
1429
+ {tabKey === 'single' && (
1430
+ <BusinessSearchSelect {...props} />
1431
+ )}
1432
+ </TabPane>
1433
+ <TabPane tab='多选' key='multiple'>
1434
+ {tabKey === 'multiple' && (
1435
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1436
+ )}
1437
+ </TabPane>
1438
+ </Tabs>
1439
+ </div>
1440
+ );
1441
+ };
1442
+ ```
1443
+
1444
+
1445
+ ## 品牌选择器 Select-BRAND-001
1446
+
1447
+ ```tsx
1448
+ import React, { useState } from 'react';
1449
+ import { Tabs } from 'antd';
1450
+ import {BusinessSearchSelect} from '../../../index.ts';
1451
+
1452
+ const { TabPane } = Tabs;
1453
+
1454
+ export default () => {
1455
+ const selectProps = {
1456
+ // mode: 'multiple',
1457
+ // maxTagCount: 1,
1458
+ // disabled: true
1459
+ }
1460
+ const selectPropsMultiple = {
1461
+ mode: 'multiple',
1462
+ maxTagCount: 1,
1463
+ }
1464
+
1465
+ const [ tabKey, setTabKey ] = useState('single')
1466
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1467
+
1468
+ const props = {
1469
+ value,
1470
+ onChange: (value: any) => {
1471
+ console.log(value)
1472
+ setValue(value)
1473
+ },
1474
+ selectProps,
1475
+ selectBusinessType: 'brand',
1476
+ };
1477
+
1478
+ const onTabChange = (key) => {
1479
+ setTabKey(key)
1480
+ setValue(key === 'single' ? null: [])
1481
+ }
1482
+
1483
+ return (
1484
+ <div>
1485
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1486
+ <TabPane tab='单选' key='single'>
1487
+ {tabKey === 'single' && (
1488
+ <BusinessSearchSelect {...props} />
1489
+ )}
1490
+ </TabPane>
1491
+ <TabPane tab='多选' key='multiple'>
1492
+ {tabKey === 'multiple' && (
1493
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1494
+ )}
1495
+ </TabPane>
1496
+ </Tabs>
1497
+ </div>
1498
+ );
1499
+ };
1500
+ ```
1501
+
1502
+
1503
+ More skills for writing demo: https://d.umijs.org/guide/demo-principle