@bit-sun/business-component 2.2.0 → 2.2.2

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