@bit-sun/business-component 2.0.1 → 2.0.4

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.
@@ -0,0 +1,118 @@
1
+ ---
2
+ nav:
3
+ title: '组件'
4
+ order: 1
5
+ group:
6
+ title: 功能组件
7
+ order: 0
8
+ title: 添加选择器
9
+ order: 3
10
+ ---
11
+
12
+ ## AddSelect
13
+
14
+ Demo:
15
+
16
+ ```tsx
17
+ import React, { useState } from 'react';
18
+ import { AddSelect } from '../../../index';
19
+
20
+ export default () => {
21
+ const selectProps = {
22
+ mode: 'multiple',
23
+ }
24
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
25
+ const props = {
26
+ value,
27
+ // labelInValue: true, // 非必填 默认为false
28
+ requestConfig: {
29
+ url: `/items/sku/pager/v2`,
30
+ filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
31
+ otherParams: {}, // 默认参数
32
+ mappingTextField: 'name',
33
+ mappingValueField: 'skuCode',
34
+ },
35
+ selectProps,
36
+ onChange: (value: any) => {
37
+ console.log(value)
38
+ setValue(value)
39
+ },
40
+ onSaveCallback: (rows) => {
41
+ console.log('save call', rows);
42
+ // return Promise.resolve(true);
43
+ // return Promise.reject('FAILE')
44
+ }
45
+ };
46
+ const DictionaryUC000013 = [{ text: '共享', value: '10' }, { text: '私有', value: '20' }]
47
+ const modalTableProps = {
48
+ modalTableTitle: '选择商品',
49
+ tableSearchForm: [
50
+ { name: 'qp-name-like', label: 'SKU名称' }, // field: { type: 'input', props: { placeholder: '8888'}}
51
+ { name: 'qp-code-like', label: 'SKU编码' },
52
+ ],
53
+ tableColumns: [
54
+ {
55
+ title: '商品编码',
56
+ width: 150,
57
+ dataIndex: 'skuCode',
58
+ },
59
+ {
60
+ title: '商品名称',
61
+ width: 250,
62
+ dataIndex: 'name',
63
+ },
64
+ {
65
+ title: '归属集团',
66
+ width: 150,
67
+ dataIndex: 'conglomerateName',
68
+ },
69
+ {
70
+ title: '归属法人公司',
71
+ width: 150,
72
+ dataIndex: 'legalCompanyName',
73
+ },
74
+ ],
75
+ selectColumn: [
76
+ {
77
+ title: '商品编码',
78
+ width: 150,
79
+ dataIndex: 'skuCode',
80
+ },
81
+ {
82
+ title: '商品名称',
83
+ width: 250,
84
+ dataIndex: 'name',
85
+ },
86
+ {
87
+ title: '数量',
88
+ width: 150,
89
+ isInputItem: true,
90
+ dataIndex: 'count',
91
+ },
92
+ {
93
+ title: '价格',
94
+ width: 150,
95
+ dataIndex: 'price',
96
+ isInputItem: true,
97
+ },
98
+ {
99
+ title: '折扣',
100
+ width: 150,
101
+ dataIndex: 'sales',
102
+ isInputItem: true,
103
+ }
104
+ ]
105
+ }
106
+
107
+ return (
108
+ <div>
109
+ <AddSelect
110
+ {...props}
111
+ modalTableProps={modalTableProps}
112
+ />
113
+ </div>
114
+ );
115
+ };
116
+ ```
117
+
118
+ More skills for writing demo: https://d.umijs.org/guide/demo-principle