@bit-sun/business-component 2.0.1 → 2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -0,0 +1,275 @@
1
+ .add_select {
2
+ &_show {
3
+ display: flex;
4
+ }
5
+
6
+ &_expand_button {
7
+ position: relative;
8
+ width: 30px;
9
+ color: #ffffff;
10
+ cursor: pointer;
11
+
12
+ span {
13
+ position: absolute;
14
+ height: 20px;
15
+ line-height: 14px;
16
+ left: 50%;
17
+ top: 50%;
18
+ transform: translate(-50%, -50%);
19
+ }
20
+ }
21
+
22
+ &_header {
23
+ border-bottom: 1px solid #D9D9D9;
24
+ height: 24px;
25
+ height: 40px;
26
+ font-family: PingFangSC-Medium;
27
+ font-weight: 500;
28
+ font-size: 18px;
29
+ color: #000000;
30
+ letter-spacing: 0;
31
+ line-height: 40px;
32
+ margin-bottom: 10px;
33
+ padding-left: 10px;
34
+
35
+ & > span {
36
+ margin-left: 20px;
37
+ font-weight: 400;
38
+ font-size: 12px;
39
+ color: #666666;
40
+ letter-spacing: 0;
41
+ line-height: 40px;
42
+
43
+ & > span {
44
+ color: #ff0000;
45
+ }
46
+ }
47
+
48
+ &_close {
49
+ span {
50
+ position: absolute;
51
+ color: black !important;
52
+ right: 10px;
53
+ top: 10px;
54
+ }
55
+ }
56
+ }
57
+
58
+ &_wrapper {
59
+ position: relative;
60
+ display: flex;
61
+ // min-height: 60vh;
62
+ max-height: 60vh;
63
+ overflow: hidden;
64
+ font-size: 14px;
65
+ margin: 5px 10px;
66
+
67
+
68
+ .ant-table-pagination.ant-pagination {
69
+ margin: 5px;
70
+ padding-right: 5px;
71
+ }
72
+
73
+ .ant-checkbox-wrapper {
74
+ justify-content: center;
75
+ }
76
+
77
+ .ant-table-thead {
78
+ th {
79
+ height: 20px !important;
80
+ padding: 0px 8px !important;
81
+ font-size: 12px !important;
82
+ font-weight: 600 !important;
83
+ line-height: 20px !important;
84
+ }
85
+ }
86
+
87
+ .ant-modal-body {
88
+ padding: 10px;
89
+ }
90
+
91
+ .ant-table-wrapper {
92
+ padding: 0px !important;
93
+ }
94
+
95
+ .row-class {
96
+ height: 24px;
97
+
98
+ td {
99
+ font-size: 12px !important;
100
+ height: 24px !important;
101
+ padding: 0px 8px !important;
102
+ line-height: 20px !important;
103
+ }
104
+ }
105
+
106
+ .ant-table-body {
107
+ height: 240px;
108
+ overflow-y: auto !important;
109
+ }
110
+
111
+ .ant-row.ant-form-item {
112
+ margin-bottom: 10px;
113
+ }
114
+
115
+ &_click_flag {
116
+ position: absolute;
117
+ z-index: 10;
118
+ &_arrow {
119
+ transform: rotate(0deg);
120
+ transition: transform 0.5s;
121
+ }
122
+ &_arrow_1 {
123
+ transform: rotate(-180deg);
124
+ transition: transform 0.5s;
125
+ }
126
+ }
127
+
128
+ &_left {
129
+ flex-basis: 298px;
130
+ width: 298px;
131
+ overflow-y: hidden;
132
+ //background-color: yellow;
133
+ transition: all 0.3s;
134
+ margin-right: 10px;
135
+ border: 1px solid #D9D9D9;
136
+ border-radius: 5px;
137
+ }
138
+
139
+ &_left1 {
140
+ width: 0;
141
+ height: 0;
142
+ transition: all 0.3s;
143
+ display: none;
144
+ }
145
+
146
+ &_right {
147
+ width: 872px;
148
+ //background-color: pink;
149
+ border: 1px solid #D9D9D9;
150
+ border-radius: 5px;
151
+ }
152
+
153
+ &_right1 {
154
+ width: 100%;
155
+ margin-left: 10px;
156
+ //background-color: green;
157
+ }
158
+
159
+ &_right, &_right1 {
160
+ overflow-x: auto;
161
+ }
162
+
163
+ .select_list_columns {
164
+ height: 272px;
165
+ overflow-y: auto;
166
+ border-bottom: 1px solid #D9D9D9;
167
+
168
+ &_tips {
169
+ background: #eee;
170
+ padding: 6px 20px;
171
+ margin-bottom: 10px;
172
+ }
173
+ &_formItems {
174
+ padding: 10px;
175
+ }
176
+ }
177
+ .select_list_searchButton {
178
+ display: flex;
179
+ margin: 10px;
180
+ justify-content: flex-end;
181
+ }
182
+
183
+ .select_list_button_space {
184
+ margin-right: 10px;
185
+ }
186
+
187
+ .select_list_selectTips {
188
+ display: flex;
189
+ justify-content: space-between;
190
+ height: 24px;
191
+ font-size: 12px;
192
+ line-height: 24px;
193
+ background: #F7F8FB;
194
+ padding: 0 5px;
195
+ border-bottom: 1px solid #D9D9D9;
196
+ }
197
+
198
+ .select_list_selectAll {
199
+ position: relative;
200
+ top: -40px;
201
+ left: 20px;
202
+ width: 160px;
203
+ }
204
+ }
205
+
206
+ &_wrapper_select {
207
+ margin-top: 4px;
208
+ border: 1px solid #D9D9D9;
209
+ border-radius: 5px;
210
+ margin: 5px 10px;
211
+
212
+
213
+ .ant-table-pagination.ant-pagination {
214
+ margin: 9px;
215
+ padding-right: 5px;
216
+ }
217
+
218
+ .ant-modal-body {
219
+ padding: 10px;
220
+ }
221
+
222
+ .ant-table-wrapper {
223
+ padding: 0px !important;
224
+ }
225
+
226
+ .ant-table-thead {
227
+ th {
228
+ height: 23px !important;
229
+ padding: 0px 8px !important;
230
+ font-size: 12px !important;
231
+ font-weight: 600 !important;
232
+ line-height: 23px !important;
233
+ }
234
+ }
235
+
236
+ .ant-modal-close-x {
237
+ height: 30px;
238
+ }
239
+
240
+ .row-class {
241
+ height: 30px;
242
+
243
+ td {
244
+ font-size: 12px !important;
245
+ height: 30px !important;
246
+ padding: 4px 8px !important;
247
+ }
248
+ }
249
+
250
+ .ant-table-body {
251
+ height: 200px;
252
+ overflow-y: auto !important;
253
+ }
254
+
255
+ .ant-row.ant-form-item {
256
+ margin-bottom: 10px;
257
+ }
258
+
259
+ .ant-input-number-input {
260
+ height: auto;
261
+ }
262
+
263
+ .select_list_selectTips {
264
+ display: flex;
265
+ justify-content: space-between;
266
+ height: 24px;
267
+ font-size: 12px;
268
+ line-height: 24px;
269
+ background: #F7F8FB;
270
+ padding: 0 3px;
271
+
272
+ border-bottom: 1px solid #D9D9D9;
273
+ }
274
+ }
275
+ }
@@ -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