@bit-sun/business-component 4.0.0-alpha.3 → 4.0.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 (241) hide show
  1. package/.editorconfig +16 -0
  2. package/.fatherrc.ts +5 -0
  3. package/.gitlab-ci.yml +179 -0
  4. package/.prettierignore +7 -0
  5. package/.prettierrc +11 -0
  6. package/.umirc.ts +74 -0
  7. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +1 -1
  8. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +1 -1
  9. package/dist/components/Business/columnSettingTable/columnSetting.d.ts +1 -1
  10. package/dist/components/Business/columnSettingTable/index.d.ts +1 -0
  11. package/dist/components/Common/ParagraphCopier/index.d.ts +8 -0
  12. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +3 -0
  13. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/helps.d.ts +2 -0
  14. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +3 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.esm.js +1901 -639
  17. package/dist/index.js +1903 -636
  18. package/dist/utils/requestUtils.d.ts +1 -0
  19. package/dist/utils/utils.d.ts +3 -0
  20. package/docs/index.md +21 -0
  21. package/package.json +9 -14
  22. package/src/assets/32.svg +28 -0
  23. package/src/assets/addIcon.svg +18 -0
  24. package/src/assets/allfunc.svg +28 -0
  25. package/src/assets/arrowRight.svg +25 -0
  26. package/src/assets/arrow_top.png +0 -0
  27. package/src/assets/arrow_top.svg +18 -0
  28. package/src/assets/btn-delete.svg +30 -0
  29. package/src/assets/btn-edit.svg +20 -0
  30. package/src/assets/btn-more.svg +18 -0
  31. package/src/assets/btn-submit.svg +20 -0
  32. package/src/assets/caidan.svg +12 -0
  33. package/src/assets/close.svg +26 -0
  34. package/src/assets/closeicon.png +0 -0
  35. package/src/assets/drag.svg +17 -0
  36. package/src/assets/exportFail.svg +38 -0
  37. package/src/assets/exportProcessing.svg +29 -0
  38. package/src/assets/exportSuccess.svg +35 -0
  39. package/src/assets/exportlogo.png +0 -0
  40. package/src/assets/fixed-left-active.svg +12 -0
  41. package/src/assets/fixed-left.svg +16 -0
  42. package/src/assets/fixed-right-active.svg +12 -0
  43. package/src/assets/fixed-right.svg +16 -0
  44. package/src/assets/guanbi.svg +16 -0
  45. package/src/assets/icon-quanping.svg +16 -0
  46. package/src/assets/icon-shezhi.svg +18 -0
  47. package/src/assets/label_icon_bottom.svg +26 -0
  48. package/src/assets/list-no-img.svg +22 -0
  49. package/src/assets/morentouxiang-32.svg +24 -0
  50. package/src/assets/right.png +0 -0
  51. package/src/assets/scanning.svg +25 -0
  52. package/src/assets/upExport.svg +23 -0
  53. package/src/assets/xinglan-icon-out.png +0 -0
  54. package/src/common/ENUM.ts +41 -0
  55. package/src/components/Business/AddSelectBusiness/index.md +398 -0
  56. package/src/components/Business/AddSelectBusiness/index.tsx +1116 -0
  57. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -0
  58. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -0
  59. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -0
  60. package/src/components/Business/BsLayouts/Components/ChooseStore/index.less +0 -0
  61. package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +193 -0
  62. package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +10 -0
  63. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -0
  64. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +38 -0
  65. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +243 -0
  66. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +385 -0
  67. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +286 -0
  68. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +75 -0
  69. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +171 -0
  70. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +65 -0
  71. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +154 -0
  72. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +73 -0
  73. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +163 -0
  74. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -0
  75. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -0
  76. package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +9 -0
  77. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +172 -0
  78. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +161 -0
  79. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +76 -0
  80. package/src/components/Business/BsLayouts/index.less +80 -0
  81. package/src/components/Business/BsLayouts/index.tsx +1602 -0
  82. package/src/components/Business/BsLayouts/service.ts +11 -0
  83. package/src/components/Business/BsLayouts/utils.tsx +205 -0
  84. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +566 -0
  85. package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +5 -0
  86. package/src/components/Business/BsSulaQueryTable/index.less +228 -0
  87. package/src/components/Business/BsSulaQueryTable/index.tsx +817 -0
  88. package/src/components/Business/BsSulaQueryTable/setting.tsx +937 -0
  89. package/src/components/Business/BsSulaQueryTable/utils.less +65 -0
  90. package/src/components/Business/BsSulaQueryTable/utils.tsx +709 -0
  91. package/src/components/Business/CommodityEntry/index.md +84 -0
  92. package/src/components/Business/CommodityEntry/index.tsx +82 -0
  93. package/src/components/Business/CommonAlert/index.less +0 -0
  94. package/src/components/Business/CommonAlert/index.tsx +23 -0
  95. package/src/components/Business/CommonGuideWrapper/index.less +156 -0
  96. package/src/components/Business/CommonGuideWrapper/index.md +61 -0
  97. package/src/components/Business/CommonGuideWrapper/index.tsx +108 -0
  98. package/src/components/Business/DetailPageWrapper/index.less +89 -0
  99. package/src/components/Business/DetailPageWrapper/index.tsx +306 -0
  100. package/src/components/Business/DetailPageWrapper/utils.tsx +166 -0
  101. package/src/components/Business/HomePageWrapper/index.less +36 -0
  102. package/src/components/Business/HomePageWrapper/index.md +45 -0
  103. package/src/components/Business/HomePageWrapper/index.tsx +130 -0
  104. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +823 -0
  105. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +206 -0
  106. package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -0
  107. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -0
  108. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -0
  109. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -0
  110. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -0
  111. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -0
  112. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -0
  113. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -0
  114. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -0
  115. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -0
  116. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -0
  117. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -0
  118. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -0
  119. package/src/components/Business/JsonQueryTable/function.ts +62 -0
  120. package/src/components/Business/JsonQueryTable/index.less +17 -0
  121. package/src/components/Business/JsonQueryTable/index.md +328 -0
  122. package/src/components/Business/JsonQueryTable/index.tsx +534 -0
  123. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -0
  124. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -0
  125. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -0
  126. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -0
  127. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -0
  128. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -0
  129. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -0
  130. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -0
  131. package/src/components/Business/JsonQueryTable/static.ts +450 -0
  132. package/src/components/Business/SearchSelect/BusinessUtils.tsx +2207 -0
  133. package/src/components/Business/SearchSelect/common.ts +134 -0
  134. package/src/components/Business/SearchSelect/index.md +1570 -0
  135. package/src/components/Business/SearchSelect/index.tsx +55 -0
  136. package/src/components/Business/SearchSelect/utils.ts +125 -0
  137. package/src/components/Business/StateFlow/index.less +131 -0
  138. package/src/components/Business/StateFlow/index.md +60 -0
  139. package/src/components/Business/StateFlow/index.tsx +30 -0
  140. package/src/components/Business/TreeSearchSelect/index.md +239 -0
  141. package/src/components/Business/TreeSearchSelect/index.tsx +33 -0
  142. package/src/components/Business/TreeSearchSelect/utils.ts +115 -0
  143. package/src/components/Business/columnSettingTable/columnSetting.tsx +869 -0
  144. package/src/components/Business/columnSettingTable/index.less +253 -0
  145. package/src/components/Business/columnSettingTable/index.md +373 -0
  146. package/src/components/Business/columnSettingTable/index.tsx +235 -0
  147. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +232 -0
  148. package/src/components/Business/columnSettingTable/utils.tsx +88 -0
  149. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -0
  150. package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -0
  151. package/src/components/Business/moreTreeTable/index.less +100 -0
  152. package/src/components/Business/moreTreeTable/index.md +448 -0
  153. package/src/components/Business/moreTreeTable/index.tsx +387 -0
  154. package/src/components/Business/moreTreeTable/utils.ts +127 -0
  155. package/src/components/Common/ExtendedCollapse/ExtendedPanel.tsx +51 -0
  156. package/src/components/Common/ExtendedCollapse/index.less +33 -0
  157. package/src/components/Common/ExtendedCollapse/index.md +136 -0
  158. package/src/components/Common/ExtendedCollapse/index.tsx +25 -0
  159. package/src/components/Common/ParagraphCopier/index.md +81 -0
  160. package/src/components/Common/ParagraphCopier/index.tsx +56 -0
  161. package/src/components/Common/Section/index.md +120 -0
  162. package/src/components/Common/Section/index.module.less +16 -0
  163. package/src/components/Common/Section/index.tsx +70 -0
  164. package/src/components/Functional/AccessWrapper/index.tsx +34 -0
  165. package/src/components/Functional/AddSelect/helps.ts +81 -0
  166. package/src/components/Functional/AddSelect/index.less +367 -0
  167. package/src/components/Functional/AddSelect/index.md +155 -0
  168. package/src/components/Functional/AddSelect/index.tsx +1072 -0
  169. package/src/components/Functional/AuthButton/index.tsx +15 -0
  170. package/src/components/Functional/BillEntry/index.less +371 -0
  171. package/src/components/Functional/BillEntry/index.md +39 -0
  172. package/src/components/Functional/BillEntry/index.tsx +771 -0
  173. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -0
  174. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -0
  175. package/src/components/Functional/BsAntdSula/index.ts +2 -0
  176. package/src/components/Functional/DataImport/index.less +63 -0
  177. package/src/components/Functional/DataImport/index.md +44 -0
  178. package/src/components/Functional/DataImport/index.tsx +782 -0
  179. package/src/components/Functional/DataValidation/index.less +63 -0
  180. package/src/components/Functional/DataValidation/index.md +52 -0
  181. package/src/components/Functional/DataValidation/index.tsx +788 -0
  182. package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -0
  183. package/src/components/Functional/EllipsisTooltip/index.js +36 -0
  184. package/src/components/Functional/EllipsisTooltip/index.md +30 -0
  185. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -0
  186. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +65 -0
  187. package/src/components/Functional/QueryMutipleInput/index.less +37 -0
  188. package/src/components/Functional/QueryMutipleInput/index.md +33 -0
  189. package/src/components/Functional/QueryMutipleInput/index.tsx +129 -0
  190. package/src/components/Functional/SearchSelect/index.less +121 -0
  191. package/src/components/Functional/SearchSelect/index.md +141 -0
  192. package/src/components/Functional/SearchSelect/index.tsx +1041 -0
  193. package/src/components/Functional/SearchSelect/utils.ts +3 -0
  194. package/src/components/Functional/TreeSearchSelect/index.md +47 -0
  195. package/src/components/Functional/TreeSearchSelect/index.tsx +224 -0
  196. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.tsx +358 -0
  197. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/function.js +255 -0
  198. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/helps.tsx +58 -0
  199. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.tsx +129 -0
  200. package/src/components/Solution/RuleComponent/Formula.tsx +335 -0
  201. package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -0
  202. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +743 -0
  203. package/src/components/Solution/RuleComponent/index.d.ts +29 -0
  204. package/src/components/Solution/RuleComponent/index.js +1614 -0
  205. package/src/components/Solution/RuleComponent/index.less +247 -0
  206. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -0
  207. package/src/components/Solution/RuleComponent/ruleFiled.js +2587 -0
  208. package/src/components/Solution/RuleComponent/services.ts +13 -0
  209. package/src/components/Solution/RuleComponent/util.js +143 -0
  210. package/src/components/Solution/RuleSetter/RuleInstance.tsx +6 -0
  211. package/src/components/Solution/RuleSetter/baseRule.tsx +394 -0
  212. package/src/components/Solution/RuleSetter/function.ts +437 -0
  213. package/src/components/Solution/RuleSetter/index.less +221 -0
  214. package/src/components/Solution/RuleSetter/index.tsx +208 -0
  215. package/src/components/Solution/RuleSetter/service.js +276 -0
  216. package/src/index.ts +46 -0
  217. package/src/plugin/TableColumnSetting/index.less +247 -0
  218. package/src/plugin/TableColumnSetting/index.md +50 -0
  219. package/src/plugin/TableColumnSetting/index.tsx +725 -0
  220. package/src/plugin/TableColumnSetting/utils.ts +19 -0
  221. package/src/styles/bsDefault.less +32 -12
  222. package/src/utils/CheckOneUser/index.md +39 -0
  223. package/src/utils/CheckOneUser/index.ts +52 -0
  224. package/src/utils/CustomLoginInfo.ts +55 -0
  225. package/src/utils/LocalstorageUtils.ts +134 -0
  226. package/src/utils/TableUtils.less +52 -0
  227. package/src/utils/TableUtils.tsx +691 -0
  228. package/src/utils/auth.ts +39 -0
  229. package/src/utils/businessUtils.ts +434 -0
  230. package/src/utils/checkUtils.ts +39 -0
  231. package/src/utils/constant.ts +38 -0
  232. package/src/utils/enumConfig.ts +17 -0
  233. package/src/utils/getFormMode.js +12 -0
  234. package/src/utils/index.ts +19 -0
  235. package/src/utils/request.ts +53 -0
  236. package/src/utils/requestUtils.ts +197 -0
  237. package/src/utils/serialize.js +7 -0
  238. package/src/utils/utils.ts +267 -0
  239. package/src/utils/xlsxUtil.tsx +146 -0
  240. package/tsconfig.json +29 -0
  241. package/typings.d.ts +5 -0
@@ -0,0 +1,1570 @@
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
+ ## 价格项选择器 Select-PRCICE_ITEM-001
1513
+
1514
+ ```tsx
1515
+ import React, { useState } from 'react';
1516
+ import { Tabs } from 'antd';
1517
+ import {BusinessSearchSelect} from '../../../index.ts';
1518
+
1519
+ const { TabPane } = Tabs;
1520
+
1521
+ export default () => {
1522
+ const selectProps = {
1523
+ // mode: 'multiple',
1524
+ // maxTagCount: 1,
1525
+ // disabled: true
1526
+ }
1527
+ const selectPropsMultiple = {
1528
+ mode: 'multiple',
1529
+ maxTagCount: 1,
1530
+ }
1531
+
1532
+ const [ tabKey, setTabKey ] = useState('single')
1533
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
1534
+
1535
+ const props = {
1536
+ value,
1537
+ onChange: (value: any) => {
1538
+ console.log(value)
1539
+ setValue(value)
1540
+ },
1541
+ selectProps,
1542
+ selectBusinessType: 'priceItem',
1543
+ };
1544
+
1545
+ const onTabChange = (key) => {
1546
+ setTabKey(key)
1547
+ setValue(key === 'single' ? null: [])
1548
+ }
1549
+
1550
+ return (
1551
+ <div>
1552
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
1553
+ <TabPane tab='单选' key='single'>
1554
+ {tabKey === 'single' && (
1555
+ <BusinessSearchSelect {...props} />
1556
+ )}
1557
+ </TabPane>
1558
+ <TabPane tab='多选' key='multiple'>
1559
+ {tabKey === 'multiple' && (
1560
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
1561
+ )}
1562
+ </TabPane>
1563
+ </Tabs>
1564
+ </div>
1565
+ );
1566
+ };
1567
+ ```
1568
+
1569
+
1570
+ More skills for writing demo: https://d.umijs.org/guide/demo-principle