@bit-sun/business-component 3.1.4 → 3.1.6

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 (225) 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/.yarnclean +45 -0
  8. package/README.md +27 -27
  9. package/dist/components/Business/DetailPageWrapper/utils.d.ts +3 -1
  10. package/dist/components/Functional/DataImport/index.d.ts +2 -0
  11. package/dist/components/Functional/DataValidation/index.d.ts +2 -0
  12. package/dist/index.esm.js +403 -43
  13. package/dist/index.js +405 -41
  14. package/dist/utils/LocalstorageUtils.d.ts +1 -0
  15. package/dist/utils/enumConfig.d.ts +1 -0
  16. package/dist/utils/index.d.ts +2 -0
  17. package/dist/utils/xlsxUtil.d.ts +6 -0
  18. package/docs/index.md +21 -21
  19. package/lib/assets/drag.svg +17 -17
  20. package/lib/assets/exportFail.svg +37 -37
  21. package/lib/assets/exportProcessing.svg +28 -28
  22. package/lib/assets/exportSuccess.svg +34 -34
  23. package/lib/assets/label_icon_bottom.svg +25 -25
  24. package/lib/assets/upExport.svg +22 -22
  25. package/package.json +88 -87
  26. package/src/assets/32.svg +27 -27
  27. package/src/assets/addIcon.svg +17 -17
  28. package/src/assets/allfunc.svg +27 -27
  29. package/src/assets/arrowRight.svg +24 -24
  30. package/src/assets/arrow_top.svg +17 -17
  31. package/src/assets/btn-delete.svg +29 -29
  32. package/src/assets/btn-edit.svg +19 -19
  33. package/src/assets/btn-more.svg +17 -17
  34. package/src/assets/btn-submit.svg +19 -19
  35. package/src/assets/caidan.svg +11 -11
  36. package/src/assets/close.svg +26 -26
  37. package/src/assets/drag.svg +17 -17
  38. package/src/assets/exportFail.svg +37 -37
  39. package/src/assets/exportProcessing.svg +28 -28
  40. package/src/assets/exportSuccess.svg +34 -34
  41. package/src/assets/fixed-left-active.svg +11 -11
  42. package/src/assets/fixed-left.svg +15 -15
  43. package/src/assets/fixed-right-active.svg +11 -11
  44. package/src/assets/fixed-right.svg +15 -15
  45. package/src/assets/guanbi.svg +15 -15
  46. package/src/assets/icon-quanping.svg +15 -15
  47. package/src/assets/icon-shezhi.svg +17 -17
  48. package/src/assets/label_icon_bottom.svg +25 -25
  49. package/src/assets/list-no-img.svg +21 -21
  50. package/src/assets/morentouxiang-32.svg +23 -23
  51. package/src/assets/scanning.svg +24 -24
  52. package/src/assets/upExport.svg +22 -22
  53. package/src/common/ENUM.ts +41 -41
  54. package/src/components/Business/AddSelectBusiness/index.md +398 -398
  55. package/src/components/Business/AddSelectBusiness/index.tsx +1116 -1116
  56. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -112
  57. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  58. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  59. package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +193 -193
  60. package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +10 -10
  61. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  62. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  63. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  64. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  65. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  66. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  67. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  68. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  69. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  70. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  71. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +163 -163
  72. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  73. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  74. package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +8 -8
  75. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +172 -172
  76. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  77. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  78. package/src/components/Business/BsLayouts/index.less +79 -79
  79. package/src/components/Business/BsLayouts/index.tsx +1606 -1606
  80. package/src/components/Business/BsLayouts/service.ts +10 -10
  81. package/src/components/Business/BsLayouts/utils.tsx +205 -205
  82. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +566 -566
  83. package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +5 -5
  84. package/src/components/Business/BsSulaQueryTable/index.less +227 -227
  85. package/src/components/Business/BsSulaQueryTable/index.tsx +772 -772
  86. package/src/components/Business/BsSulaQueryTable/setting.tsx +888 -888
  87. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  88. package/src/components/Business/BsSulaQueryTable/utils.tsx +709 -709
  89. package/src/components/Business/CommodityEntry/index.md +84 -84
  90. package/src/components/Business/CommodityEntry/index.tsx +82 -82
  91. package/src/components/Business/CommonAlert/index.tsx +23 -23
  92. package/src/components/Business/CommonGuideWrapper/index.less +121 -121
  93. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  94. package/src/components/Business/CommonGuideWrapper/index.tsx +94 -94
  95. package/src/components/Business/DetailPageWrapper/index.less +87 -87
  96. package/src/components/Business/DetailPageWrapper/index.tsx +327 -326
  97. package/src/components/Business/DetailPageWrapper/utils.tsx +166 -164
  98. package/src/components/Business/HomePageWrapper/index.less +33 -33
  99. package/src/components/Business/HomePageWrapper/index.md +45 -45
  100. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  101. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +823 -823
  102. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +205 -205
  103. package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -205
  104. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  105. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
  106. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
  107. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
  108. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
  109. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
  110. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
  111. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
  112. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
  113. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
  114. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
  115. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
  116. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  117. package/src/components/Business/JsonQueryTable/index.less +16 -16
  118. package/src/components/Business/JsonQueryTable/index.md +328 -328
  119. package/src/components/Business/JsonQueryTable/index.tsx +534 -534
  120. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
  121. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
  122. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
  123. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
  124. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
  125. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
  126. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
  127. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
  128. package/src/components/Business/JsonQueryTable/static.ts +450 -450
  129. package/src/components/Business/SearchSelect/BusinessUtils.tsx +2162 -2160
  130. package/src/components/Business/SearchSelect/common.ts +134 -134
  131. package/src/components/Business/SearchSelect/index.md +1512 -1512
  132. package/src/components/Business/SearchSelect/index.tsx +55 -55
  133. package/src/components/Business/SearchSelect/utils.ts +125 -125
  134. package/src/components/Business/StateFlow/index.less +130 -130
  135. package/src/components/Business/StateFlow/index.md +60 -60
  136. package/src/components/Business/StateFlow/index.tsx +29 -29
  137. package/src/components/Business/TreeSearchSelect/index.md +211 -211
  138. package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
  139. package/src/components/Business/TreeSearchSelect/utils.ts +104 -104
  140. package/src/components/Business/columnSettingTable/columnSetting.tsx +816 -816
  141. package/src/components/Business/columnSettingTable/index.less +253 -253
  142. package/src/components/Business/columnSettingTable/index.md +357 -357
  143. package/src/components/Business/columnSettingTable/index.tsx +226 -226
  144. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +233 -233
  145. package/src/components/Business/columnSettingTable/utils.tsx +87 -87
  146. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -87
  147. package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -21
  148. package/src/components/Business/moreTreeTable/index.less +99 -99
  149. package/src/components/Business/moreTreeTable/index.md +448 -448
  150. package/src/components/Business/moreTreeTable/index.tsx +387 -387
  151. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  152. package/src/components/Functional/AccessWrapper/index.tsx +33 -33
  153. package/src/components/Functional/AddSelect/helps.ts +81 -81
  154. package/src/components/Functional/AddSelect/index.less +367 -367
  155. package/src/components/Functional/AddSelect/index.md +155 -155
  156. package/src/components/Functional/AddSelect/index.tsx +1065 -1065
  157. package/src/components/Functional/AuthButton/index.tsx +15 -15
  158. package/src/components/Functional/BillEntry/index.less +371 -371
  159. package/src/components/Functional/BillEntry/index.md +39 -39
  160. package/src/components/Functional/BillEntry/index.tsx +772 -772
  161. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -62
  162. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -178
  163. package/src/components/Functional/BsAntdSula/index.ts +2 -2
  164. package/src/components/Functional/DataImport/index.less +63 -63
  165. package/src/components/Functional/DataImport/index.md +44 -44
  166. package/src/components/Functional/DataImport/index.tsx +783 -706
  167. package/src/components/Functional/DataValidation/index.less +63 -63
  168. package/src/components/Functional/DataValidation/index.md +52 -52
  169. package/src/components/Functional/DataValidation/index.tsx +788 -708
  170. package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -5
  171. package/src/components/Functional/EllipsisTooltip/index.js +36 -36
  172. package/src/components/Functional/EllipsisTooltip/index.md +30 -30
  173. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  174. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +65 -65
  175. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  176. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  177. package/src/components/Functional/QueryMutipleInput/index.tsx +129 -129
  178. package/src/components/Functional/SearchSelect/index.less +121 -121
  179. package/src/components/Functional/SearchSelect/index.md +141 -141
  180. package/src/components/Functional/SearchSelect/index.tsx +1034 -1034
  181. package/src/components/Functional/SearchSelect/utils.ts +3 -3
  182. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  183. package/src/components/Functional/TreeSearchSelect/index.tsx +224 -224
  184. package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
  185. package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -62
  186. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +670 -670
  187. package/src/components/Solution/RuleComponent/index.d.ts +29 -29
  188. package/src/components/Solution/RuleComponent/index.js +1601 -1601
  189. package/src/components/Solution/RuleComponent/index.less +247 -247
  190. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
  191. package/src/components/Solution/RuleComponent/ruleFiled.js +2293 -2293
  192. package/src/components/Solution/RuleComponent/services.ts +13 -13
  193. package/src/components/Solution/RuleComponent/util.js +143 -143
  194. package/src/components/Solution/RuleSetter/RuleInstance.tsx +6 -6
  195. package/src/components/Solution/RuleSetter/baseRule.tsx +394 -394
  196. package/src/components/Solution/RuleSetter/function.ts +437 -437
  197. package/src/components/Solution/RuleSetter/index.less +221 -221
  198. package/src/components/Solution/RuleSetter/index.tsx +208 -208
  199. package/src/components/Solution/RuleSetter/service.js +276 -276
  200. package/src/index.ts +41 -41
  201. package/src/plugin/TableColumnSetting/index.less +247 -247
  202. package/src/plugin/TableColumnSetting/index.md +50 -50
  203. package/src/plugin/TableColumnSetting/index.tsx +725 -725
  204. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  205. package/src/styles/bsDefault.less +1933 -1933
  206. package/src/utils/CheckOneUser/index.md +39 -39
  207. package/src/utils/CheckOneUser/index.ts +51 -51
  208. package/src/utils/CustomLoginInfo.ts +55 -55
  209. package/src/utils/LocalstorageUtils.ts +134 -128
  210. package/src/utils/TableUtils.less +51 -51
  211. package/src/utils/TableUtils.tsx +691 -691
  212. package/src/utils/auth.ts +38 -38
  213. package/src/utils/businessUtils.ts +434 -434
  214. package/src/utils/checkUtils.ts +39 -39
  215. package/src/utils/constant.ts +38 -38
  216. package/src/utils/enumConfig.ts +17 -16
  217. package/src/utils/getFormMode.js +12 -12
  218. package/src/utils/index.ts +19 -16
  219. package/src/utils/request.ts +53 -53
  220. package/src/utils/requestUtils.ts +193 -193
  221. package/src/utils/serialize.js +7 -7
  222. package/src/utils/utils.ts +238 -238
  223. package/src/utils/xlsxUtil.tsx +146 -0
  224. package/tsconfig.json +29 -29
  225. package/typings.d.ts +4 -4
@@ -1,1512 +1,1512 @@
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, 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