@bit-sun/business-component 2.4.31-alpha.9 → 2.4.32

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