@bit-sun/business-component 2.0.8 → 2.0.11

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 (69) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +4 -4
  3. package/.gitlab-ci.yml +135 -174
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +90 -74
  7. package/Dockerfile +11 -0
  8. package/README.md +27 -27
  9. package/dist/app.d.ts +0 -0
  10. package/dist/components/Business/SearchSelect/index.d.ts +1 -1
  11. package/dist/components/Functional/SearchSelect/index.d.ts +2 -1
  12. package/dist/components/sulaQueryTable/BsSulaQueryTable.d.ts +2 -0
  13. package/dist/components/sulaQueryTable/draggableTable.d.ts +22 -0
  14. package/dist/components/sulaQueryTable/statusComponent.d.ts +2 -0
  15. package/dist/components/sulaQueryTable/utils.d.ts +41 -0
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.esm.js +6590 -6063
  18. package/dist/index.js +6588 -6062
  19. package/dist/utils/requestUtils.d.ts +1 -0
  20. package/docs/index.md +21 -21
  21. package/nginx.conf +43 -0
  22. package/package.json +60 -50
  23. package/src/app.tsx +3 -0
  24. package/src/components/Business/AddSelectBusiness/index.md +41 -41
  25. package/src/components/Business/AddSelectBusiness/index.tsx +300 -299
  26. package/src/components/Business/CommodityEntry/index.md +69 -69
  27. package/src/components/Business/CommodityEntry/index.tsx +78 -78
  28. package/src/components/Business/SearchSelect/BusinessUtils.ts +1445 -1445
  29. package/src/components/Business/SearchSelect/common.ts +53 -53
  30. package/src/components/Business/SearchSelect/index.md +1137 -1137
  31. package/src/components/Business/SearchSelect/index.tsx +49 -44
  32. package/src/components/Business/SearchSelect/utils.ts +99 -99
  33. package/src/components/Business/TreeSearchSelect/index.md +126 -126
  34. package/src/components/Business/TreeSearchSelect/index.tsx +34 -34
  35. package/src/components/Business/TreeSearchSelect/utils.ts +60 -60
  36. package/src/components/Functional/AddSelect/index.less +352 -352
  37. package/src/components/Functional/AddSelect/index.md +120 -120
  38. package/src/components/Functional/AddSelect/index.tsx +896 -896
  39. package/src/components/Functional/BillEntry/index.less +371 -371
  40. package/src/components/Functional/BillEntry/index.md +37 -37
  41. package/src/components/Functional/BillEntry/index.tsx +561 -561
  42. package/src/components/Functional/DataImport/index.less +63 -63
  43. package/src/components/Functional/DataImport/index.md +44 -44
  44. package/src/components/Functional/DataImport/index.tsx +689 -689
  45. package/src/components/Functional/DataValidation/index.less +63 -63
  46. package/src/components/Functional/DataValidation/index.md +38 -38
  47. package/src/components/Functional/DataValidation/index.tsx +680 -680
  48. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  49. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  50. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  51. package/src/components/Functional/SearchSelect/index.less +115 -115
  52. package/src/components/Functional/SearchSelect/index.md +141 -141
  53. package/src/components/Functional/SearchSelect/index.tsx +772 -732
  54. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  55. package/src/components/Functional/TreeSearchSelect/index.tsx +149 -149
  56. package/src/components/sulaQueryTable/BsSulaQueryTable.tsx +368 -0
  57. package/src/components/sulaQueryTable/draggableTable.tsx +111 -0
  58. package/src/components/sulaQueryTable/index.md +271 -0
  59. package/src/components/sulaQueryTable/status-component.less +8 -0
  60. package/src/components/sulaQueryTable/statusComponent.tsx +42 -0
  61. package/src/components/sulaQueryTable/utils.less +48 -0
  62. package/src/components/sulaQueryTable/utils.tsx +336 -0
  63. package/src/global.less +97 -0
  64. package/src/index.ts +22 -32
  65. package/src/utils/CheckOneUser/index.md +39 -39
  66. package/src/utils/CheckOneUser/index.ts +51 -51
  67. package/src/utils/requestUtils.ts +32 -0
  68. package/tsconfig.json +29 -29
  69. package/typings.d.ts +2 -2
@@ -1,299 +1,300 @@
1
- /*
2
- * @Description:
3
- * @Author: rodchen
4
- * @Date: 2022-05-07 15:17:28
5
- * @LastEditTime: 2022-05-08 21:01:21
6
- * @LastEditors: rodchen
7
- */
8
- import React, { useState } from 'react';
9
- import { Tooltip, Select } from 'antd';
10
- import { AddSelect } from '../../../index';
11
-
12
- export const AddSkuSelect = (parProps: any) => {
13
- const selectProps = {
14
- mode: 'multiple',
15
- }
16
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
17
- const props = {
18
- buttonText: parProps.buttonText || '新增',
19
- value,
20
- // labelInValue: true, // 非必填 默认为false
21
- requestConfig: {
22
- url: `/items/sku/pager/v2`,
23
- filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
24
- otherParams: {
25
- 'qp-combination-eq': false,
26
- }, // 默认参数
27
- mappingTextField: 'name',
28
- mappingValueField: 'skuCode',
29
- },
30
- selectProps,
31
- onChange: (value: any) => {
32
- console.log(value)
33
- setValue(value)
34
- },
35
- beforeShowModal: parProps?.beforeShowModal,
36
- onSaveCallback: parProps.onSaveCallback
37
- // onSaveCallback: (rows) => {
38
- // console.log('save call', rows);
39
- // // return Promise.resolve(true);
40
- // // return Promise.reject('FAILE')
41
- // }
42
- };
43
- const modalTableProps = {
44
- modalTableTitle: '选择商品',
45
- tableSearchForm: [
46
- {
47
- name: 'qp-skuCode-like', label: 'SKU编码'
48
- },
49
- { name: 'qp-skuName-like', label: 'SKU名称' },
50
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
51
- type: 'select',
52
- props: {
53
- mode: 'multiple',
54
- notFoundContent: '暂无数据',
55
- allowClear: true,
56
- showSearch: true,
57
- showArrow: true,
58
- maxTagCount: 1,
59
- optionFilterProp: 'children',
60
- filterOption: (input: string, option: { props: { children: string } }) =>
61
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
62
- },
63
- } },
64
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
65
- type: 'treeSelect',
66
- props: {
67
- treeData: [],
68
- treeCheckable: true,
69
- showSearch: true,
70
- allowClear: true,
71
- showArrow: true,
72
- treeNodeFilterProp: 'title',
73
- treeDefaultExpandAll: true,
74
- maxTagCount: 1,
75
- placeholder: '请选择',
76
- style: {
77
- width: '100%',
78
- },
79
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
80
- },
81
- } }
82
- ],
83
- tableColumns: [
84
- {
85
- title: 'SKU编码',
86
- width: 150,
87
- dataIndex: 'skuCode',
88
- },
89
- {
90
- title: 'SKU名称',
91
- width: 200,
92
- ellipsis: {
93
- showTitle: false,
94
- },
95
- render: (text: any) => (
96
- <Tooltip placement="topLeft" title={text}>
97
- {text}
98
- </Tooltip>
99
- ),
100
- dataIndex: 'name',
101
- },
102
- {
103
- title: '国际条码',
104
- width: 100,
105
- ellipsis: {
106
- showTitle: false,
107
- },
108
- dataIndex: 'barCode',
109
- render: (text: any) => (
110
- <Tooltip placement="topLeft" title={text}>
111
- {text}
112
- </Tooltip>
113
- ),
114
- },
115
- {
116
- title: '所属SPU名称',
117
- width: 100,
118
- ellipsis: {
119
- showTitle: false,
120
- },
121
- dataIndex: 'itemName',
122
- render: (text: any) => (
123
- <Tooltip placement="topLeft" title={text}>
124
- {text}
125
- </Tooltip>
126
- ),
127
- },
128
- {
129
- title: '所属SPU编码',
130
- width: 100,
131
- ellipsis: {
132
- showTitle: false,
133
- },
134
- dataIndex: 'itemCode',
135
- render: (text: any) => (
136
- <Tooltip placement="topLeft" title={text}>
137
- {text}
138
- </Tooltip>
139
- ),
140
- },
141
- {
142
- title: '外部编码',
143
- width: 100,
144
- ellipsis: {
145
- showTitle: false,
146
- },
147
- render: (text: any) => (
148
- <Tooltip placement="topLeft" title={text}>
149
- {text}
150
- </Tooltip>
151
- ),
152
- dataIndex: 'externalCode',
153
- },
154
- {
155
- title: '规格',
156
- width: 100,
157
- ellipsis: {
158
- showTitle: false,
159
- },
160
- render: (text: any) => (
161
- <Tooltip placement="topLeft" title={text}>
162
- {text}
163
- </Tooltip>
164
- ),
165
- dataIndex: 'propertyNameAndValue',
166
- },
167
- {
168
- title: '类目',
169
- width: 100,
170
- ellipsis: {
171
- showTitle: false,
172
- },
173
- render: (text: any) => (
174
- <Tooltip placement="topLeft" title={text}>
175
- {text}
176
- </Tooltip>
177
- ),
178
- dataIndex: 'categoryName',
179
- },
180
- {
181
- title: '品类',
182
- width: 100,
183
- ellipsis: {
184
- showTitle: false,
185
- },
186
- render: (text: any) => (
187
- <Tooltip placement="topLeft" title={text}>
188
- {text}
189
- </Tooltip>
190
- ),
191
- dataIndex: 'className',
192
- },
193
- {
194
- title: '品牌',
195
- width: 100,
196
- ellipsis: {
197
- showTitle: false,
198
- },
199
- render: (text: any) => (
200
- <Tooltip placement="topLeft" title={text}>
201
- {text}
202
- </Tooltip>
203
- ),
204
- dataIndex: 'brandName',
205
- },
206
- ],
207
- selectColumn: [
208
- {
209
- title: 'SKU编码',
210
- width: 150,
211
- dataIndex: 'skuCode',
212
- },
213
- {
214
- title: 'SKU名称',
215
- width: 200,
216
- ellipsis: {
217
- showTitle: false,
218
- },
219
- render: (text: any) => (
220
- <Tooltip placement="topLeft" title={text}>
221
- {text}
222
- </Tooltip>
223
- ),
224
- dataIndex: 'name',
225
- },
226
- {
227
- title: '数量',
228
- width: 100,
229
- isInputItem: true,
230
- dataIndex: 'count',
231
- },
232
- {
233
- title: '单位',
234
- dataIndex: 'selectUnitCode',
235
- width: 80,
236
- ellipsis: {
237
- showTitle: false,
238
- },
239
- render: (text: any, record: any) => {
240
- let baseUnitCode = '';
241
- if (record?.packingUnitList) {
242
- let base = record.packingUnitList.filter((item: any) => item.unitCode)
243
- if (base.length) {
244
- baseUnitCode = base[0].unitCode
245
- record.selectUnitCode = base[0].unitCode
246
- record.selectedScale = base[0]?.baseUnitScale || 1
247
- }
248
- }
249
-
250
- if (baseUnitCode) {
251
- return <>
252
- <Select defaultValue={baseUnitCode} onChange={(value) => {record.selectUnitCode = value;record.selectedScale = record?.packingUnitList?.find((item: any) => item.unitCode === value)?.baseUnitScale || 1}} style={{width: '60px'}}>
253
- {record.packingUnitList && record.packingUnitList.map((item: any) => {
254
- return <Select.Option value={item.unitCode}>{item.name}</Select.Option>
255
- })}
256
- </Select>
257
- </>
258
- }
259
- return <></>
260
- },
261
- },
262
- {
263
- title: '所属SPU编码',
264
- width: 150,
265
- ellipsis: {
266
- showTitle: false,
267
- },
268
- dataIndex: 'itemCode',
269
- render: (text: any) => (
270
- <Tooltip placement="topLeft" title={text}>
271
- {text}
272
- </Tooltip>
273
- ),
274
- },
275
- {
276
- title: '规格',
277
- width: 200,
278
- ellipsis: {
279
- showTitle: false,
280
- },
281
- render: (text: any) => (
282
- <Tooltip placement="topLeft" title={text}>
283
- {text}
284
- </Tooltip>
285
- ),
286
- dataIndex: 'propertyNameAndValue',
287
- }
288
- ]
289
- }
290
-
291
- return (
292
- <div>
293
- <AddSelect
294
- {...props}
295
- modalTableProps={modalTableProps}
296
- />
297
- </div>
298
- );
299
- };
1
+ /*
2
+ * @Description:
3
+ * @Author: rodchen
4
+ * @Date: 2022-05-07 15:17:28
5
+ * @LastEditTime: 2022-05-08 21:01:21
6
+ * @LastEditors: rodchen
7
+ */
8
+ import React, { useState } from 'react';
9
+ import { Tooltip, Select } from 'antd';
10
+ import { AddSelect } from '../../../index';
11
+
12
+ export const AddSkuSelect = (parProps: any) => {
13
+ const selectProps = {
14
+ mode: 'multiple',
15
+ }
16
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
17
+ const props = {
18
+ buttonText: parProps.buttonText || '新增',
19
+ value,
20
+ // labelInValue: true, // 非必填 默认为false
21
+ requestConfig: {
22
+ url: `/items/sku/pager/v2`,
23
+ filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
24
+ otherParams: {
25
+ 'qp-combination-eq': false,
26
+ }, // 默认参数
27
+ mappingTextField: 'name',
28
+ mappingValueField: 'skuCode',
29
+ ...parProps.requestConfig
30
+ },
31
+ selectProps,
32
+ onChange: (value: any) => {
33
+ console.log(value)
34
+ setValue(value)
35
+ },
36
+ beforeShowModal: parProps?.beforeShowModal,
37
+ onSaveCallback: parProps.onSaveCallback
38
+ // onSaveCallback: (rows) => {
39
+ // console.log('save call', rows);
40
+ // // return Promise.resolve(true);
41
+ // // return Promise.reject('FAILE')
42
+ // }
43
+ };
44
+ const modalTableProps = {
45
+ modalTableTitle: '选择商品',
46
+ tableSearchForm: [
47
+ {
48
+ name: 'qp-skuCode-like', label: 'SKU编码'
49
+ },
50
+ { name: 'qp-skuName-like', label: 'SKU名称' },
51
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
52
+ type: 'select',
53
+ props: {
54
+ mode: 'multiple',
55
+ notFoundContent: '暂无数据',
56
+ allowClear: true,
57
+ showSearch: true,
58
+ showArrow: true,
59
+ maxTagCount: 1,
60
+ optionFilterProp: 'children',
61
+ filterOption: (input: string, option: { props: { children: string } }) =>
62
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
63
+ },
64
+ } },
65
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
66
+ type: 'treeSelect',
67
+ props: {
68
+ treeData: [],
69
+ treeCheckable: true,
70
+ showSearch: true,
71
+ allowClear: true,
72
+ showArrow: true,
73
+ treeNodeFilterProp: 'title',
74
+ treeDefaultExpandAll: true,
75
+ maxTagCount: 1,
76
+ placeholder: '请选择',
77
+ style: {
78
+ width: '100%',
79
+ },
80
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
81
+ },
82
+ } }
83
+ ],
84
+ tableColumns: [
85
+ {
86
+ title: 'SKU编码',
87
+ width: 150,
88
+ dataIndex: 'skuCode',
89
+ },
90
+ {
91
+ title: 'SKU名称',
92
+ width: 200,
93
+ ellipsis: {
94
+ showTitle: false,
95
+ },
96
+ render: (text: any) => (
97
+ <Tooltip placement="topLeft" title={text}>
98
+ {text}
99
+ </Tooltip>
100
+ ),
101
+ dataIndex: 'name',
102
+ },
103
+ {
104
+ title: '国际条码',
105
+ width: 100,
106
+ ellipsis: {
107
+ showTitle: false,
108
+ },
109
+ dataIndex: 'barCode',
110
+ render: (text: any) => (
111
+ <Tooltip placement="topLeft" title={text}>
112
+ {text}
113
+ </Tooltip>
114
+ ),
115
+ },
116
+ {
117
+ title: '所属SPU名称',
118
+ width: 100,
119
+ ellipsis: {
120
+ showTitle: false,
121
+ },
122
+ dataIndex: 'itemName',
123
+ render: (text: any) => (
124
+ <Tooltip placement="topLeft" title={text}>
125
+ {text}
126
+ </Tooltip>
127
+ ),
128
+ },
129
+ {
130
+ title: '所属SPU编码',
131
+ width: 100,
132
+ ellipsis: {
133
+ showTitle: false,
134
+ },
135
+ dataIndex: 'itemCode',
136
+ render: (text: any) => (
137
+ <Tooltip placement="topLeft" title={text}>
138
+ {text}
139
+ </Tooltip>
140
+ ),
141
+ },
142
+ {
143
+ title: '外部编码',
144
+ width: 100,
145
+ ellipsis: {
146
+ showTitle: false,
147
+ },
148
+ render: (text: any) => (
149
+ <Tooltip placement="topLeft" title={text}>
150
+ {text}
151
+ </Tooltip>
152
+ ),
153
+ dataIndex: 'externalCode',
154
+ },
155
+ {
156
+ title: '规格',
157
+ width: 100,
158
+ ellipsis: {
159
+ showTitle: false,
160
+ },
161
+ render: (text: any) => (
162
+ <Tooltip placement="topLeft" title={text}>
163
+ {text}
164
+ </Tooltip>
165
+ ),
166
+ dataIndex: 'propertyNameAndValue',
167
+ },
168
+ {
169
+ title: '类目',
170
+ width: 100,
171
+ ellipsis: {
172
+ showTitle: false,
173
+ },
174
+ render: (text: any) => (
175
+ <Tooltip placement="topLeft" title={text}>
176
+ {text}
177
+ </Tooltip>
178
+ ),
179
+ dataIndex: 'categoryName',
180
+ },
181
+ {
182
+ title: '品类',
183
+ width: 100,
184
+ ellipsis: {
185
+ showTitle: false,
186
+ },
187
+ render: (text: any) => (
188
+ <Tooltip placement="topLeft" title={text}>
189
+ {text}
190
+ </Tooltip>
191
+ ),
192
+ dataIndex: 'className',
193
+ },
194
+ {
195
+ title: '品牌',
196
+ width: 100,
197
+ ellipsis: {
198
+ showTitle: false,
199
+ },
200
+ render: (text: any) => (
201
+ <Tooltip placement="topLeft" title={text}>
202
+ {text}
203
+ </Tooltip>
204
+ ),
205
+ dataIndex: 'brandName',
206
+ },
207
+ ],
208
+ selectColumn: [
209
+ {
210
+ title: 'SKU编码',
211
+ width: 150,
212
+ dataIndex: 'skuCode',
213
+ },
214
+ {
215
+ title: 'SKU名称',
216
+ width: 200,
217
+ ellipsis: {
218
+ showTitle: false,
219
+ },
220
+ render: (text: any) => (
221
+ <Tooltip placement="topLeft" title={text}>
222
+ {text}
223
+ </Tooltip>
224
+ ),
225
+ dataIndex: 'name',
226
+ },
227
+ {
228
+ title: '数量',
229
+ width: 100,
230
+ isInputItem: true,
231
+ dataIndex: 'count',
232
+ },
233
+ {
234
+ title: '单位',
235
+ dataIndex: 'selectUnitCode',
236
+ width: 80,
237
+ ellipsis: {
238
+ showTitle: false,
239
+ },
240
+ render: (text: any, record: any) => {
241
+ let baseUnitCode = '';
242
+ if (record?.packingUnitList) {
243
+ let base = record.packingUnitList.filter((item: any) => item.unitCode)
244
+ if (base.length) {
245
+ baseUnitCode = base[0].unitCode
246
+ record.selectUnitCode = base[0].unitCode
247
+ record.selectedScale = base[0]?.baseUnitScale || 1
248
+ }
249
+ }
250
+
251
+ if (baseUnitCode) {
252
+ return <>
253
+ <Select defaultValue={baseUnitCode} onChange={(value) => {record.selectUnitCode = value;record.selectedScale = record?.packingUnitList?.find((item: any) => item.unitCode === value)?.baseUnitScale || 1}} style={{width: '60px'}}>
254
+ {record.packingUnitList && record.packingUnitList.map((item: any) => {
255
+ return <Select.Option value={item.unitCode}>{item.name}</Select.Option>
256
+ })}
257
+ </Select>
258
+ </>
259
+ }
260
+ return <></>
261
+ },
262
+ },
263
+ {
264
+ title: '所属SPU编码',
265
+ width: 150,
266
+ ellipsis: {
267
+ showTitle: false,
268
+ },
269
+ dataIndex: 'itemCode',
270
+ render: (text: any) => (
271
+ <Tooltip placement="topLeft" title={text}>
272
+ {text}
273
+ </Tooltip>
274
+ ),
275
+ },
276
+ {
277
+ title: '规格',
278
+ width: 200,
279
+ ellipsis: {
280
+ showTitle: false,
281
+ },
282
+ render: (text: any) => (
283
+ <Tooltip placement="topLeft" title={text}>
284
+ {text}
285
+ </Tooltip>
286
+ ),
287
+ dataIndex: 'propertyNameAndValue',
288
+ }
289
+ ]
290
+ }
291
+
292
+ return (
293
+ <div>
294
+ <AddSelect
295
+ {...props}
296
+ modalTableProps={modalTableProps}
297
+ />
298
+ </div>
299
+ );
300
+ };