@bit-sun/business-component 1.1.31 → 1.1.34

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.
package/dist/index.esm.js CHANGED
@@ -1657,7 +1657,7 @@ var itemsTemp = []; // const mapping = [
1657
1657
  // { "key": "price", "name": "单价", "rule": "price" }
1658
1658
  // ]
1659
1659
 
1660
- var mapping = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号'], ['warehouseCode', '仓库编码'], ['regionCode', '库区'], ['rowNumber', '货位排数'], ['layerNumber', '货位层数'], ['gridNumber', '货位格号']]); // for dnd
1660
+ var mapping = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号'], ['warehouseCode', '仓库编码'], ['regionCode', '库区'], ['locationCode', '货位'], ['rowNumber', '货位排数'], ['layerNumber', '货位层数'], ['gridNumber', '货位格号']]); // for dnd
1661
1661
 
1662
1662
 
1663
1663
  var reorder = function reorder(list, startIndex, endIndex) {
@@ -2665,7 +2665,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
2665
2665
  }]
2666
2666
  }, modalTableBusProps);
2667
2667
 
2668
- var needModalTable = true; // 商品选择器
2668
+ var needModalTable = true; // 商品选择器sku
2669
2669
 
2670
2670
  if (type === 'skuCommodity') {
2671
2671
  requestConfig = _objectSpread2({
@@ -2827,6 +2827,126 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
2827
2827
  dataIndex: 'brandName'
2828
2828
  }]
2829
2829
  }, modalTableBusProps);
2830
+ } // 商品选择器spu
2831
+
2832
+
2833
+ if (type === 'spuCommodity') {
2834
+ requestConfig = _objectSpread2({
2835
+ url: "".concat(prefixUrl.selectPrefix, "/item"),
2836
+ filter: 'qp-itemCode,name-orGroup,like',
2837
+ mappingTextField: 'name',
2838
+ mappingValueField: 'itemCode',
2839
+ otherParams: {
2840
+ 'qp-approveStatus-eq': 1,
2841
+ sorter: 'desc-id'
2842
+ },
2843
+ sourceName: 'itemCode'
2844
+ }, requestConfigProp);
2845
+ tableSearchForm = [{
2846
+ name: 'qp-name-like',
2847
+ label: 'SPU名称'
2848
+ }, {
2849
+ name: 'qp-itemCode-like',
2850
+ label: 'SPU编码'
2851
+ }, {
2852
+ name: 'qp-brandId-in',
2853
+ type: 'select',
2854
+ label: '品牌',
2855
+ field: {
2856
+ type: 'select',
2857
+ props: {
2858
+ mode: 'multiple',
2859
+ notFoundContent: '暂无数据',
2860
+ allowClear: true,
2861
+ showSearch: true,
2862
+ showArrow: true,
2863
+ maxTagCount: 1,
2864
+ optionFilterProp: 'children',
2865
+ filterOption: function filterOption(input, option) {
2866
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
2867
+ }
2868
+ }
2869
+ }
2870
+ }, {
2871
+ name: 'qp-categoryId-in',
2872
+ type: 'treeSelect',
2873
+ label: '类目',
2874
+ field: {
2875
+ type: 'treeSelect',
2876
+ props: {
2877
+ treeData: [],
2878
+ treeCheckable: true,
2879
+ showSearch: true,
2880
+ allowClear: true,
2881
+ showArrow: true,
2882
+ treeNodeFilterProp: 'title',
2883
+ treeDefaultExpandAll: true,
2884
+ maxTagCount: 1,
2885
+ placeholder: '请选择',
2886
+ style: {
2887
+ width: '100%'
2888
+ },
2889
+ dropdownStyle: {
2890
+ maxHeight: 400,
2891
+ maxWidth: 100,
2892
+ overflow: 'auto'
2893
+ }
2894
+ }
2895
+ }
2896
+ }, {
2897
+ name: 'qp-classId-in',
2898
+ type: 'select',
2899
+ label: '品类',
2900
+ field: {
2901
+ type: 'select',
2902
+ props: {
2903
+ mode: 'multiple',
2904
+ notFoundContent: '暂无数据',
2905
+ allowClear: true,
2906
+ showSearch: true,
2907
+ showArrow: true,
2908
+ maxTagCount: 1,
2909
+ optionFilterProp: 'children',
2910
+ filterOption: function filterOption(input, option) {
2911
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
2912
+ }
2913
+ }
2914
+ }
2915
+ }];
2916
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
2917
+ pageSize: 5000,
2918
+ currentPage: 1
2919
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
2920
+ pageSize: 5000,
2921
+ currentPage: 1
2922
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
2923
+ pageSize: 5000,
2924
+ currentPage: 1
2925
+ })]).then(function (x) {
2926
+ formatSource(x, 0, 2, tableSearchForm, ['id', 'name']);
2927
+ formatTreeDataSource(x, 1, 3, tableSearchForm);
2928
+ formatSource(x, 2, 4, tableSearchForm, ['id', 'name']);
2929
+ });
2930
+ modalTableProps = _objectSpread2({
2931
+ modalTableTitle: '选择SPU',
2932
+ tableSearchForm: tableSearchForm,
2933
+ tableColumns: [{
2934
+ title: 'SPU编码',
2935
+ dataIndex: 'itemCode'
2936
+ }, {
2937
+ title: 'SPU名称',
2938
+ dataIndex: 'name'
2939
+ }, {
2940
+ title: '品牌',
2941
+ dataIndex: 'brandName'
2942
+ }, {
2943
+ title: '类目',
2944
+ dataIndex: 'categoryText'
2945
+ }, {
2946
+ title: '品类',
2947
+ dataIndex: 'className'
2948
+ }]
2949
+ }, modalTableBusProps);
2830
2950
  } // 商品规格选择器(无弹窗)
2831
2951
 
2832
2952
 
@@ -4517,7 +4637,7 @@ var itemsTemp$1 = []; // const mapping = [
4517
4637
  // { "key": "price", "name": "单价", "rule": "price" }
4518
4638
  // ]
4519
4639
 
4520
- var mapping$1 = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号'], ['warehouseCode', '仓库编码'], ['regionCode', '库区'], ['rowNumber', '货位排数'], ['layerNumber', '货位层数'], ['gridNumber', '货位格号']]); // for dnd
4640
+ var mapping$1 = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号'], ['warehouseCode', '仓库编码'], ['regionCode', '库区'], ['locationCode', '货位'], ['rowNumber', '货位排数'], ['layerNumber', '货位层数'], ['gridNumber', '货位格号']]); // for dnd
4521
4641
 
4522
4642
 
4523
4643
  var reorder$1 = function reorder(list, startIndex, endIndex) {
package/dist/index.js CHANGED
@@ -1668,7 +1668,7 @@ var itemsTemp = []; // const mapping = [
1668
1668
  // { "key": "price", "name": "单价", "rule": "price" }
1669
1669
  // ]
1670
1670
 
1671
- var mapping = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号'], ['warehouseCode', '仓库编码'], ['regionCode', '库区'], ['rowNumber', '货位排数'], ['layerNumber', '货位层数'], ['gridNumber', '货位格号']]); // for dnd
1671
+ var mapping = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号'], ['warehouseCode', '仓库编码'], ['regionCode', '库区'], ['locationCode', '货位'], ['rowNumber', '货位排数'], ['layerNumber', '货位层数'], ['gridNumber', '货位格号']]); // for dnd
1672
1672
 
1673
1673
 
1674
1674
  var reorder = function reorder(list, startIndex, endIndex) {
@@ -2676,7 +2676,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
2676
2676
  }]
2677
2677
  }, modalTableBusProps);
2678
2678
 
2679
- var needModalTable = true; // 商品选择器
2679
+ var needModalTable = true; // 商品选择器sku
2680
2680
 
2681
2681
  if (type === 'skuCommodity') {
2682
2682
  requestConfig = _objectSpread2({
@@ -2838,6 +2838,126 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
2838
2838
  dataIndex: 'brandName'
2839
2839
  }]
2840
2840
  }, modalTableBusProps);
2841
+ } // 商品选择器spu
2842
+
2843
+
2844
+ if (type === 'spuCommodity') {
2845
+ requestConfig = _objectSpread2({
2846
+ url: "".concat(prefixUrl.selectPrefix, "/item"),
2847
+ filter: 'qp-itemCode,name-orGroup,like',
2848
+ mappingTextField: 'name',
2849
+ mappingValueField: 'itemCode',
2850
+ otherParams: {
2851
+ 'qp-approveStatus-eq': 1,
2852
+ sorter: 'desc-id'
2853
+ },
2854
+ sourceName: 'itemCode'
2855
+ }, requestConfigProp);
2856
+ tableSearchForm = [{
2857
+ name: 'qp-name-like',
2858
+ label: 'SPU名称'
2859
+ }, {
2860
+ name: 'qp-itemCode-like',
2861
+ label: 'SPU编码'
2862
+ }, {
2863
+ name: 'qp-brandId-in',
2864
+ type: 'select',
2865
+ label: '品牌',
2866
+ field: {
2867
+ type: 'select',
2868
+ props: {
2869
+ mode: 'multiple',
2870
+ notFoundContent: '暂无数据',
2871
+ allowClear: true,
2872
+ showSearch: true,
2873
+ showArrow: true,
2874
+ maxTagCount: 1,
2875
+ optionFilterProp: 'children',
2876
+ filterOption: function filterOption(input, option) {
2877
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
2878
+ }
2879
+ }
2880
+ }
2881
+ }, {
2882
+ name: 'qp-categoryId-in',
2883
+ type: 'treeSelect',
2884
+ label: '类目',
2885
+ field: {
2886
+ type: 'treeSelect',
2887
+ props: {
2888
+ treeData: [],
2889
+ treeCheckable: true,
2890
+ showSearch: true,
2891
+ allowClear: true,
2892
+ showArrow: true,
2893
+ treeNodeFilterProp: 'title',
2894
+ treeDefaultExpandAll: true,
2895
+ maxTagCount: 1,
2896
+ placeholder: '请选择',
2897
+ style: {
2898
+ width: '100%'
2899
+ },
2900
+ dropdownStyle: {
2901
+ maxHeight: 400,
2902
+ maxWidth: 100,
2903
+ overflow: 'auto'
2904
+ }
2905
+ }
2906
+ }
2907
+ }, {
2908
+ name: 'qp-classId-in',
2909
+ type: 'select',
2910
+ label: '品类',
2911
+ field: {
2912
+ type: 'select',
2913
+ props: {
2914
+ mode: 'multiple',
2915
+ notFoundContent: '暂无数据',
2916
+ allowClear: true,
2917
+ showSearch: true,
2918
+ showArrow: true,
2919
+ maxTagCount: 1,
2920
+ optionFilterProp: 'children',
2921
+ filterOption: function filterOption(input, option) {
2922
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
2923
+ }
2924
+ }
2925
+ }
2926
+ }];
2927
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
2928
+ pageSize: 5000,
2929
+ currentPage: 1
2930
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
2931
+ pageSize: 5000,
2932
+ currentPage: 1
2933
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
2934
+ pageSize: 5000,
2935
+ currentPage: 1
2936
+ })]).then(function (x) {
2937
+ formatSource(x, 0, 2, tableSearchForm, ['id', 'name']);
2938
+ formatTreeDataSource(x, 1, 3, tableSearchForm);
2939
+ formatSource(x, 2, 4, tableSearchForm, ['id', 'name']);
2940
+ });
2941
+ modalTableProps = _objectSpread2({
2942
+ modalTableTitle: '选择SPU',
2943
+ tableSearchForm: tableSearchForm,
2944
+ tableColumns: [{
2945
+ title: 'SPU编码',
2946
+ dataIndex: 'itemCode'
2947
+ }, {
2948
+ title: 'SPU名称',
2949
+ dataIndex: 'name'
2950
+ }, {
2951
+ title: '品牌',
2952
+ dataIndex: 'brandName'
2953
+ }, {
2954
+ title: '类目',
2955
+ dataIndex: 'categoryText'
2956
+ }, {
2957
+ title: '品类',
2958
+ dataIndex: 'className'
2959
+ }]
2960
+ }, modalTableBusProps);
2841
2961
  } // 商品规格选择器(无弹窗)
2842
2962
 
2843
2963
 
@@ -4528,7 +4648,7 @@ var itemsTemp$1 = []; // const mapping = [
4528
4648
  // { "key": "price", "name": "单价", "rule": "price" }
4529
4649
  // ]
4530
4650
 
4531
- var mapping$1 = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号'], ['warehouseCode', '仓库编码'], ['regionCode', '库区'], ['rowNumber', '货位排数'], ['layerNumber', '货位层数'], ['gridNumber', '货位格号']]); // for dnd
4651
+ var mapping$1 = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号'], ['warehouseCode', '仓库编码'], ['regionCode', '库区'], ['locationCode', '货位'], ['rowNumber', '货位排数'], ['layerNumber', '货位层数'], ['gridNumber', '货位格号']]); // for dnd
4532
4652
 
4533
4653
 
4534
4654
  var reorder$1 = function reorder(list, startIndex, endIndex) {
package/package.json CHANGED
@@ -1,50 +1,50 @@
1
- {
2
- "name": "@bit-sun/business-component",
3
- "version": "1.1.31",
4
- "scripts": {
5
- "start": "dumi dev",
6
- "docs:build": "dumi build",
7
- "docs:deploy": "gh-pages -d docs-dist",
8
- "build": "father-build",
9
- "deploy": "npm run docs:build && npm run docs:deploy",
10
- "release": "npm run build && npm publish",
11
- "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
12
- "test": "umi-test",
13
- "test:coverage": "umi-test --coverage"
14
- },
15
- "main": "dist/index.js",
16
- "module": "dist/index.esm.js",
17
- "typings": "dist/index.d.ts",
18
- "gitHooks": {
19
- "pre-commit": "lint-staged"
20
- },
21
- "lint-staged": {
22
- "*.{js,jsx,less,md,json}": [
23
- "prettier --write"
24
- ],
25
- "*.ts?(x)": [
26
- "prettier --parser=typescript --write"
27
- ]
28
- },
29
- "dependencies": {
30
- "ahooks": "^3.1.2",
31
- "antd": "4.17.2",
32
- "axios": "^0.24.0",
33
- "classnames": "^2.3.1",
34
- "loadsh": "^0.0.4",
35
- "querystring": "^0.2.1",
36
- "react": "^16.12.0",
37
- "react-beautiful-dnd": "10.0.0"
38
- },
39
- "devDependencies": {
40
- "@umijs/test": "^3.0.5",
41
- "dumi": "^1.0.14",
42
- "father-build": "^1.17.2",
43
- "gh-pages": "^3.0.0",
44
- "lint-staged": "^10.0.7",
45
- "prettier": "^2.2.1"
46
- },
47
- "publishConfig": {
48
- "access": "public"
49
- }
50
- }
1
+ {
2
+ "name": "@bit-sun/business-component",
3
+ "version": "1.1.34",
4
+ "scripts": {
5
+ "start": "dumi dev",
6
+ "docs:build": "dumi build",
7
+ "docs:deploy": "gh-pages -d docs-dist",
8
+ "build": "father-build",
9
+ "deploy": "npm run docs:build && npm run docs:deploy",
10
+ "release": "npm run build && npm publish",
11
+ "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
12
+ "test": "umi-test",
13
+ "test:coverage": "umi-test --coverage"
14
+ },
15
+ "main": "dist/index.js",
16
+ "module": "dist/index.esm.js",
17
+ "typings": "dist/index.d.ts",
18
+ "gitHooks": {
19
+ "pre-commit": "lint-staged"
20
+ },
21
+ "lint-staged": {
22
+ "*.{js,jsx,less,md,json}": [
23
+ "prettier --write"
24
+ ],
25
+ "*.ts?(x)": [
26
+ "prettier --parser=typescript --write"
27
+ ]
28
+ },
29
+ "dependencies": {
30
+ "ahooks": "^3.1.2",
31
+ "antd": "4.17.2",
32
+ "axios": "^0.24.0",
33
+ "classnames": "^2.3.1",
34
+ "loadsh": "^0.0.4",
35
+ "querystring": "^0.2.1",
36
+ "react": "^16.12.0",
37
+ "react-beautiful-dnd": "10.0.0"
38
+ },
39
+ "devDependencies": {
40
+ "@umijs/test": "^3.0.5",
41
+ "dumi": "^1.0.14",
42
+ "father-build": "^1.17.2",
43
+ "gh-pages": "^3.0.0",
44
+ "lint-staged": "^10.0.7",
45
+ "prettier": "^2.2.1"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ }
50
+ }
@@ -161,7 +161,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
161
161
  }
162
162
  let needModalTable = true;
163
163
 
164
- // 商品选择器
164
+ // 商品选择器sku
165
165
  if(type === 'skuCommodity') {
166
166
  requestConfig = {
167
167
  url: `${prefixUrl.selectPrefix}/sku/pager/v2`,
@@ -309,6 +309,117 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
309
309
  }
310
310
  }
311
311
 
312
+ // 商品选择器spu
313
+ if(type === 'spuCommodity') {
314
+ requestConfig = {
315
+ url: `${prefixUrl.selectPrefix}/item`,
316
+ filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
317
+ mappingTextField: 'name',
318
+ mappingValueField: 'itemCode',
319
+ otherParams: {
320
+ 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
321
+ sorter: 'desc-id'
322
+ }, // 默认参数
323
+ sourceName: 'itemCode',
324
+ ...requestConfigProp,
325
+ }
326
+ tableSearchForm = [
327
+ { name: 'qp-name-like', label: 'SPU名称' },
328
+ { name: 'qp-itemCode-like', label: 'SPU编码' },
329
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
330
+ type: 'select',
331
+ props: {
332
+ mode: 'multiple',
333
+ notFoundContent: '暂无数据',
334
+ allowClear: true,
335
+ showSearch: true,
336
+ showArrow: true,
337
+ maxTagCount: 1,
338
+ optionFilterProp: 'children',
339
+ filterOption: (input: string, option: { props: { children: string } }) =>
340
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
341
+ },
342
+ } },
343
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
344
+ type: 'treeSelect',
345
+ props: {
346
+ treeData: [],
347
+ treeCheckable: true,
348
+ showSearch: true,
349
+ allowClear: true,
350
+ showArrow: true,
351
+ treeNodeFilterProp: 'title',
352
+ treeDefaultExpandAll: true,
353
+ maxTagCount: 1,
354
+ placeholder: '请选择',
355
+ style: {
356
+ width: '100%',
357
+ },
358
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
359
+ },
360
+ } },
361
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
362
+ type: 'select',
363
+ props: {
364
+ mode: 'multiple',
365
+ notFoundContent: '暂无数据',
366
+ allowClear: true,
367
+ showSearch: true,
368
+ showArrow: true,
369
+ maxTagCount: 1,
370
+ optionFilterProp: 'children',
371
+ filterOption: (input: string, option: { props: { children: string } }) =>
372
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
373
+ },
374
+ } },
375
+ ]
376
+ Promise.all([
377
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
378
+ pageSize: 5000,
379
+ currentPage: 1,
380
+ }),
381
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
382
+ pageSize: 5000,
383
+ currentPage: 1,
384
+ }),
385
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
386
+ pageSize: 5000,
387
+ currentPage: 1,
388
+ }),
389
+ ]).then((x: any)=>{
390
+ formatSource(x,0, 2, tableSearchForm,['id','name']);
391
+ formatTreeDataSource(x,1, 3, tableSearchForm);
392
+ formatSource(x,2, 4, tableSearchForm,['id','name']);
393
+ })
394
+ modalTableProps = {
395
+ modalTableTitle: '选择SPU',
396
+ tableSearchForm,
397
+ tableColumns: [
398
+ {
399
+ title: 'SPU编码',
400
+ dataIndex: 'itemCode',
401
+ },
402
+ {
403
+ title: 'SPU名称',
404
+ dataIndex: 'name',
405
+ },
406
+ {
407
+ title: '品牌',
408
+ dataIndex: 'brandName',
409
+ },
410
+ {
411
+ title: '类目',
412
+ dataIndex: 'categoryText',
413
+ },
414
+ {
415
+ title: '品类',
416
+ dataIndex: 'className',
417
+ },
418
+ ],
419
+ ...modalTableBusProps
420
+ }
421
+ }
422
+
312
423
  // 商品规格选择器(无弹窗)
313
424
  if(type === 'skuPropertyValue') {
314
425
  requestConfig = {
@@ -247,6 +247,63 @@ export default () => {
247
247
 
248
248
  [comment]: <> (```)
249
249
 
250
+ ## 商品SPU选择器 Select-SPU-001
251
+
252
+ ```tsx
253
+ import React, { useState } from 'react';
254
+ import { Tabs } from 'antd';
255
+ import {BusinessSearchSelect} from '../../../index.ts';
256
+
257
+ const { TabPane } = Tabs;
258
+ export default () => {
259
+ const selectProps = {
260
+ // mode: 'multiple',
261
+ // maxTagCount: 1,
262
+ // disabled: true
263
+ }
264
+ const selectPropsMultiple = {
265
+ mode: 'multiple',
266
+ maxTagCount: 6,
267
+ }
268
+
269
+ const [ tabKey, setTabKey ] = useState('single')
270
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
271
+
272
+ const props = {
273
+ value,
274
+ onChange: (value: any) => {
275
+ console.log(value)
276
+ setValue(value)
277
+ },
278
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
279
+ selectProps,
280
+ selectBusinessType: 'spuCommodity',
281
+ };
282
+
283
+ const onTabChange = (key) => {
284
+ setTabKey(key)
285
+ setValue(key === 'single' ? null: [])
286
+ }
287
+
288
+ return (
289
+ <div>
290
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
291
+ <TabPane tab='单选' key='single'>
292
+ {tabKey === 'single' && (
293
+ <BusinessSearchSelect {...props} />
294
+ )}
295
+ </TabPane>
296
+ <TabPane tab='多选' key='multiple'>
297
+ {tabKey === 'multiple' && (
298
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
299
+ )}
300
+ </TabPane>
301
+ </Tabs>
302
+ </div>
303
+ );
304
+ };
305
+ ```
306
+
250
307
 
251
308
  ## 仓库选择器(物理仓) Select-Warehouse-001
252
309