@bit-sun/business-component 1.2.3 → 1.2.4-alpha.1
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/.fatherrc.ts +1 -0
- package/.umirc.ts +31 -16
- package/dist/components/Business/AddSelectBusiness/index.d.ts +1 -0
- package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +17 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +30 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +3 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +2 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +2 -0
- package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +8 -0
- package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +8 -0
- package/dist/components/Business/BsLayouts/index.d.ts +18 -0
- package/dist/components/Business/BsLayouts/service.d.ts +1 -0
- package/dist/components/Business/BsLayouts/utils.d.ts +13 -0
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +2 -0
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +58 -0
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +98 -0
- package/dist/components/Business/CommonAlert/index.d.ts +3 -0
- package/dist/components/Business/CommonGuideWrapper/index.d.ts +6 -0
- package/dist/components/Business/DetailPageWrapper/index.d.ts +9 -0
- package/dist/components/Business/DetailPageWrapper/utils.d.ts +8 -0
- package/dist/components/Business/HomePageWrapper/index.d.ts +3 -0
- package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +1 -1
- package/dist/components/Business/SearchSelect/common.d.ts +5 -1
- package/dist/components/Business/SearchSelect/index.d.ts +1 -1
- package/dist/components/Business/SearchSelect/utils.d.ts +2 -1
- package/dist/components/Business/StateFlow/index.d.ts +3 -0
- package/dist/components/Business/TreeSearchSelect/index.d.ts +3 -0
- package/dist/components/Business/TreeSearchSelect/utils.d.ts +2 -0
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +54 -0
- package/dist/components/Business/columnSettingTable/index.d.ts +16 -0
- package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +17 -0
- package/dist/components/Business/columnSettingTable/utils.d.ts +8 -0
- package/dist/components/Functional/AddSelect/index.d.ts +3 -0
- package/dist/components/Functional/BillEntry/index.d.ts +4 -0
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +12 -0
- package/dist/components/Functional/SearchSelect/index.d.ts +2 -1
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +2 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.esm.js +19420 -4457
- package/dist/index.js +19451 -4471
- package/dist/utils/CheckOneUser/index.d.ts +1 -1
- package/dist/utils/enumConfig.d.ts +10 -0
- package/dist/utils/requestUtils.d.ts +1 -0
- package/dist/utils/utils.d.ts +3 -0
- package/lib/assets/arrow_top.png +0 -0
- package/lib/assets/drag.svg +17 -0
- package/lib/assets/exportFail.svg +38 -0
- package/lib/assets/exportProcessing.svg +29 -0
- package/lib/assets/exportSuccess.svg +35 -0
- package/lib/assets/exportlogo.png +0 -0
- package/lib/assets/label_icon_bottom.svg +26 -0
- package/lib/assets/upExport.svg +23 -0
- package/package.json +26 -5
- package/src/assets/32.svg +28 -0
- package/src/assets/addIcon.svg +18 -0
- package/src/assets/allfunc.svg +28 -0
- package/src/assets/arrowRight.svg +25 -0
- package/src/assets/arrow_top.png +0 -0
- package/src/assets/btn-delete.svg +30 -0
- package/src/assets/btn-edit.svg +20 -0
- package/src/assets/btn-more.svg +18 -0
- package/src/assets/btn-submit.svg +20 -0
- package/src/assets/caidan.svg +12 -0
- package/src/assets/close.svg +26 -0
- package/src/assets/closeicon.png +0 -0
- package/src/assets/drag.svg +17 -0
- package/src/assets/exportFail.svg +38 -0
- package/src/assets/exportProcessing.svg +29 -0
- package/src/assets/exportSuccess.svg +35 -0
- package/src/assets/exportlogo.png +0 -0
- package/src/assets/fixed-left-active.svg +12 -0
- package/src/assets/fixed-left.svg +16 -0
- package/src/assets/fixed-right-active.svg +12 -0
- package/src/assets/fixed-right.svg +16 -0
- package/src/assets/guanbi.svg +16 -0
- package/src/assets/icon-quanping.svg +16 -0
- package/src/assets/icon-shezhi.svg +18 -0
- package/src/assets/label_icon_bottom.svg +26 -0
- package/src/assets/list-no-img.svg +22 -0
- package/src/assets/morentouxiang-32.svg +24 -0
- package/src/assets/right.png +0 -0
- package/src/assets/scanning.svg +25 -0
- package/src/assets/upExport.svg +23 -0
- package/src/assets/xinglan-icon-out.png +0 -0
- package/src/components/Business/AddSelectBusiness/index.md +41 -0
- package/src/components/Business/AddSelectBusiness/index.tsx +290 -0
- package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -0
- package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -0
- package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +38 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +243 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +385 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +286 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +75 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +171 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +65 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +154 -0
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +73 -0
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +158 -0
- package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -0
- package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -0
- package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +156 -0
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +161 -0
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +76 -0
- package/src/components/Business/BsLayouts/index.less +80 -0
- package/src/components/Business/BsLayouts/index.tsx +1465 -0
- package/src/components/Business/BsLayouts/service.ts +11 -0
- package/src/components/Business/BsLayouts/utils.tsx +211 -0
- package/src/components/Business/BsSulaQueryTable/index.less +220 -0
- package/src/components/Business/BsSulaQueryTable/index.tsx +505 -0
- package/src/components/Business/BsSulaQueryTable/setting.tsx +799 -0
- package/src/components/Business/BsSulaQueryTable/utils.less +65 -0
- package/src/components/Business/BsSulaQueryTable/utils.tsx +688 -0
- package/src/components/Business/CommodityEntry/index.md +4 -3
- package/src/components/Business/CommodityEntry/index.tsx +7 -2
- package/src/components/Business/CommonAlert/index.less +0 -0
- package/src/components/Business/CommonAlert/index.tsx +23 -0
- package/src/components/Business/CommonGuideWrapper/index.less +112 -0
- package/src/components/Business/CommonGuideWrapper/index.md +39 -0
- package/src/components/Business/CommonGuideWrapper/index.tsx +84 -0
- package/src/components/Business/DetailPageWrapper/index.less +80 -0
- package/src/components/Business/DetailPageWrapper/index.tsx +335 -0
- package/src/components/Business/DetailPageWrapper/utils.tsx +101 -0
- package/src/components/Business/HomePageWrapper/index.less +33 -0
- package/src/components/Business/HomePageWrapper/index.md +45 -0
- package/src/components/Business/HomePageWrapper/index.tsx +162 -0
- package/src/components/Business/SearchSelect/BusinessUtils.ts +107 -14
- package/src/components/Business/SearchSelect/common.ts +20 -1
- package/src/components/Business/SearchSelect/index.md +60 -30
- package/src/components/Business/SearchSelect/index.tsx +21 -12
- package/src/components/Business/SearchSelect/utils.ts +30 -4
- package/src/components/Business/StateFlow/index.less +131 -0
- package/src/components/Business/StateFlow/index.md +60 -0
- package/src/components/Business/StateFlow/index.tsx +30 -0
- package/src/components/Business/TreeSearchSelect/index.md +126 -0
- package/src/components/Business/TreeSearchSelect/index.tsx +34 -0
- package/src/components/Business/TreeSearchSelect/utils.ts +60 -0
- package/src/components/Business/columnSettingTable/columnSetting.tsx +764 -0
- package/src/components/Business/columnSettingTable/index.less +247 -0
- package/src/components/Business/columnSettingTable/index.md +358 -0
- package/src/components/Business/columnSettingTable/index.tsx +233 -0
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +241 -0
- package/src/components/Business/columnSettingTable/utils.tsx +69 -0
- package/src/components/Functional/AddSelect/index.less +367 -0
- package/src/components/Functional/AddSelect/index.md +122 -0
- package/src/components/Functional/AddSelect/index.tsx +962 -0
- package/src/components/Functional/BillEntry/index.less +371 -0
- package/src/components/Functional/BillEntry/index.md +39 -0
- package/src/components/Functional/BillEntry/index.tsx +613 -0
- package/src/components/Functional/DataImport/index.tsx +7 -2
- package/src/components/Functional/DataValidation/index.md +1 -0
- package/src/components/Functional/DataValidation/index.tsx +17 -2
- package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -0
- package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -0
- package/src/components/Functional/SearchSelect/index.tsx +218 -121
- package/src/components/Functional/TreeSearchSelect/index.md +47 -0
- package/src/components/Functional/TreeSearchSelect/index.tsx +149 -0
- package/src/index.ts +15 -6
- package/src/styles/bsDefault.less +1907 -0
- package/src/utils/enumConfig.ts +10 -0
- package/src/utils/requestUtils.ts +33 -0
- package/src/utils/utils.ts +52 -0
- package/typings.d.ts +3 -0
|
@@ -0,0 +1,290 @@
|
|
|
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
|
+
'qp-approveStatus-eq': 1,
|
|
27
|
+
'qp-status-eq': 1,
|
|
28
|
+
}, // 默认参数
|
|
29
|
+
mappingTextField: 'name',
|
|
30
|
+
mappingValueField: 'skuCode',
|
|
31
|
+
...parProps.requestConfig
|
|
32
|
+
},
|
|
33
|
+
selectProps,
|
|
34
|
+
onChange: (value: any) => {
|
|
35
|
+
console.log(value)
|
|
36
|
+
setValue(value)
|
|
37
|
+
},
|
|
38
|
+
beforeShowModal: parProps?.beforeShowModal,
|
|
39
|
+
onSaveCallback: parProps.onSaveCallback
|
|
40
|
+
// onSaveCallback: (rows) => {
|
|
41
|
+
// console.log('save call', rows);
|
|
42
|
+
// // return Promise.resolve(true);
|
|
43
|
+
// // return Promise.reject('FAILE')
|
|
44
|
+
// }
|
|
45
|
+
};
|
|
46
|
+
const modalTableProps = {
|
|
47
|
+
modalTableTitle: '选择商品',
|
|
48
|
+
tableSearchForm: [
|
|
49
|
+
{
|
|
50
|
+
name: 'qp-skuCode-like', label: 'SKU编码'
|
|
51
|
+
},
|
|
52
|
+
{ name: 'qp-skuName-like', label: 'SKU名称' },
|
|
53
|
+
{ name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
|
|
54
|
+
type: 'select',
|
|
55
|
+
props: {
|
|
56
|
+
mode: 'multiple',
|
|
57
|
+
notFoundContent: '暂无数据',
|
|
58
|
+
allowClear: true,
|
|
59
|
+
showSearch: true,
|
|
60
|
+
showArrow: true,
|
|
61
|
+
maxTagCount: 1,
|
|
62
|
+
optionFilterProp: 'children',
|
|
63
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
64
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
65
|
+
},
|
|
66
|
+
} },
|
|
67
|
+
{ name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
|
|
68
|
+
type: 'treeSelect',
|
|
69
|
+
props: {
|
|
70
|
+
treeData: [],
|
|
71
|
+
treeCheckable: true,
|
|
72
|
+
showSearch: true,
|
|
73
|
+
allowClear: true,
|
|
74
|
+
showArrow: true,
|
|
75
|
+
treeNodeFilterProp: 'title',
|
|
76
|
+
treeDefaultExpandAll: true,
|
|
77
|
+
maxTagCount: 1,
|
|
78
|
+
placeholder: '请选择',
|
|
79
|
+
style: {
|
|
80
|
+
width: '100%',
|
|
81
|
+
},
|
|
82
|
+
dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
|
|
83
|
+
},
|
|
84
|
+
} }
|
|
85
|
+
],
|
|
86
|
+
tableColumns: [
|
|
87
|
+
{
|
|
88
|
+
title: 'SKU编码',
|
|
89
|
+
width: 150,
|
|
90
|
+
dataIndex: 'skuCode',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: 'SKU名称',
|
|
94
|
+
width: 200,
|
|
95
|
+
ellipsis: {
|
|
96
|
+
showTitle: false,
|
|
97
|
+
},
|
|
98
|
+
render: (text: any) => (
|
|
99
|
+
<Tooltip placement="topLeft" title={text}>
|
|
100
|
+
{text}
|
|
101
|
+
</Tooltip>
|
|
102
|
+
),
|
|
103
|
+
dataIndex: 'name',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: '国际条码',
|
|
107
|
+
width: 100,
|
|
108
|
+
ellipsis: {
|
|
109
|
+
showTitle: false,
|
|
110
|
+
},
|
|
111
|
+
dataIndex: 'barCode',
|
|
112
|
+
render: (text: any) => (
|
|
113
|
+
<Tooltip placement="topLeft" title={text}>
|
|
114
|
+
{text}
|
|
115
|
+
</Tooltip>
|
|
116
|
+
),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
title: '所属SPU名称',
|
|
120
|
+
width: 100,
|
|
121
|
+
ellipsis: {
|
|
122
|
+
showTitle: false,
|
|
123
|
+
},
|
|
124
|
+
dataIndex: 'itemName',
|
|
125
|
+
render: (text: any) => (
|
|
126
|
+
<Tooltip placement="topLeft" title={text}>
|
|
127
|
+
{text}
|
|
128
|
+
</Tooltip>
|
|
129
|
+
),
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
title: '所属SPU编码',
|
|
133
|
+
width: 100,
|
|
134
|
+
ellipsis: {
|
|
135
|
+
showTitle: false,
|
|
136
|
+
},
|
|
137
|
+
dataIndex: 'itemCode',
|
|
138
|
+
render: (text: any) => (
|
|
139
|
+
<Tooltip placement="topLeft" title={text}>
|
|
140
|
+
{text}
|
|
141
|
+
</Tooltip>
|
|
142
|
+
),
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
title: '外部编码',
|
|
146
|
+
width: 100,
|
|
147
|
+
ellipsis: {
|
|
148
|
+
showTitle: false,
|
|
149
|
+
},
|
|
150
|
+
render: (text: any) => (
|
|
151
|
+
<Tooltip placement="topLeft" title={text}>
|
|
152
|
+
{text}
|
|
153
|
+
</Tooltip>
|
|
154
|
+
),
|
|
155
|
+
dataIndex: 'externalCode',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
title: '规格',
|
|
159
|
+
width: 100,
|
|
160
|
+
ellipsis: {
|
|
161
|
+
showTitle: false,
|
|
162
|
+
},
|
|
163
|
+
render: (text: any) => (
|
|
164
|
+
<Tooltip placement="topLeft" title={text}>
|
|
165
|
+
{text}
|
|
166
|
+
</Tooltip>
|
|
167
|
+
),
|
|
168
|
+
dataIndex: 'propertyNameAndValue',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
title: '类目',
|
|
172
|
+
width: 100,
|
|
173
|
+
ellipsis: {
|
|
174
|
+
showTitle: false,
|
|
175
|
+
},
|
|
176
|
+
render: (text: any) => (
|
|
177
|
+
<Tooltip placement="topLeft" title={text}>
|
|
178
|
+
{text}
|
|
179
|
+
</Tooltip>
|
|
180
|
+
),
|
|
181
|
+
dataIndex: 'categoryName',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
title: '品类',
|
|
185
|
+
width: 100,
|
|
186
|
+
ellipsis: {
|
|
187
|
+
showTitle: false,
|
|
188
|
+
},
|
|
189
|
+
render: (text: any) => (
|
|
190
|
+
<Tooltip placement="topLeft" title={text}>
|
|
191
|
+
{text}
|
|
192
|
+
</Tooltip>
|
|
193
|
+
),
|
|
194
|
+
dataIndex: 'className',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
title: '品牌',
|
|
198
|
+
width: 100,
|
|
199
|
+
ellipsis: {
|
|
200
|
+
showTitle: false,
|
|
201
|
+
},
|
|
202
|
+
render: (text: any) => (
|
|
203
|
+
<Tooltip placement="topLeft" title={text}>
|
|
204
|
+
{text}
|
|
205
|
+
</Tooltip>
|
|
206
|
+
),
|
|
207
|
+
dataIndex: 'brandName',
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
selectColumn: [
|
|
211
|
+
{
|
|
212
|
+
title: 'SKU编码',
|
|
213
|
+
width: 150,
|
|
214
|
+
dataIndex: 'skuCode',
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
title: 'SKU名称',
|
|
218
|
+
width: 200,
|
|
219
|
+
ellipsis: {
|
|
220
|
+
showTitle: false,
|
|
221
|
+
},
|
|
222
|
+
render: (text: any) => (
|
|
223
|
+
<Tooltip placement="topLeft" title={text}>
|
|
224
|
+
{text}
|
|
225
|
+
</Tooltip>
|
|
226
|
+
),
|
|
227
|
+
dataIndex: 'name',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
title: '数量',
|
|
231
|
+
width: 100,
|
|
232
|
+
isInputItem: true,
|
|
233
|
+
dataIndex: 'count',
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
title: '单位',
|
|
237
|
+
dataIndex: 'selectUnitCode',
|
|
238
|
+
width: 80,
|
|
239
|
+
ellipsis: {
|
|
240
|
+
showTitle: false,
|
|
241
|
+
},
|
|
242
|
+
render: (text: any, record: any) => {
|
|
243
|
+
if (record?.packingUnitList?.length) {
|
|
244
|
+
const basePackUnit = record?.packingUnitList[0]
|
|
245
|
+
record.selectUnitCode = basePackUnit.unitCode
|
|
246
|
+
return basePackUnit.name || basePackUnit.unitCode
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
return <></>
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
title: '所属SPU编码',
|
|
255
|
+
width: 150,
|
|
256
|
+
ellipsis: {
|
|
257
|
+
showTitle: false,
|
|
258
|
+
},
|
|
259
|
+
dataIndex: 'itemCode',
|
|
260
|
+
render: (text: any) => (
|
|
261
|
+
<Tooltip placement="topLeft" title={text}>
|
|
262
|
+
{text}
|
|
263
|
+
</Tooltip>
|
|
264
|
+
),
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
title: '规格',
|
|
268
|
+
width: 200,
|
|
269
|
+
ellipsis: {
|
|
270
|
+
showTitle: false,
|
|
271
|
+
},
|
|
272
|
+
render: (text: any) => (
|
|
273
|
+
<Tooltip placement="topLeft" title={text}>
|
|
274
|
+
{text}
|
|
275
|
+
</Tooltip>
|
|
276
|
+
),
|
|
277
|
+
dataIndex: 'propertyNameAndValue',
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return (
|
|
283
|
+
<div>
|
|
284
|
+
<AddSelect
|
|
285
|
+
{...props}
|
|
286
|
+
modalTableProps={modalTableProps}
|
|
287
|
+
/>
|
|
288
|
+
</div>
|
|
289
|
+
);
|
|
290
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { List, Tooltip } from 'antd';
|
|
3
|
+
import React, { useEffect, useState, } from 'react';
|
|
4
|
+
import { Link, formatMessage } from 'umi';
|
|
5
|
+
import './index.less';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import right from '../../../../../assets/right.png';
|
|
8
|
+
import ENUM from '@/utils/enumConfig';
|
|
9
|
+
export type SiderTheme = 'light' | 'dark';
|
|
10
|
+
|
|
11
|
+
const DrawContent = ({onClose, itemPath}: any) => {
|
|
12
|
+
const routes = JSON.parse(localStorage.getItem(`customerMenu_${itemPath}_front`) || '[]');
|
|
13
|
+
const btnAuth = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES) || '[]');
|
|
14
|
+
const [homepageData, sethomepageData]: any = useState([]);
|
|
15
|
+
const [routesData, setroutesData]: any = useState([]);
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const homepageDataList: any[] = []; //不含子集的菜单
|
|
19
|
+
const routesDataList: any[] = []; //含子集的菜单
|
|
20
|
+
routes.forEach(item => {
|
|
21
|
+
if (btnAuth.find((d: any) => d === item.code)) {
|
|
22
|
+
}
|
|
23
|
+
if (item.children) {
|
|
24
|
+
routesDataList.push(item);
|
|
25
|
+
} else {
|
|
26
|
+
homepageDataList.push(item);
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
sethomepageData(homepageDataList)
|
|
30
|
+
setroutesData(routesDataList)
|
|
31
|
+
}, []);
|
|
32
|
+
|
|
33
|
+
const renderChildItem = (child) => {
|
|
34
|
+
if (!child.hideInMenu && child.children) {
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<List.Item style={{color: '#000', fontWeight: 'bold' }}>
|
|
38
|
+
{formatMessage({ id: `${child.locale}` })}
|
|
39
|
+
</List.Item>
|
|
40
|
+
{child.children.map((menuItem: any) => {
|
|
41
|
+
return renderChildItem(menuItem)
|
|
42
|
+
})}
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
} else if (!child.hideInMenu && child.path) {
|
|
46
|
+
return (
|
|
47
|
+
<List.Item style={{ fontSize: '12px' }} className="allFuncOnMouserover">
|
|
48
|
+
<Link to={child.path} onClick={onClose}>
|
|
49
|
+
<Tooltip
|
|
50
|
+
title={formatMessage({ id: `${child.locale}` })}
|
|
51
|
+
>
|
|
52
|
+
{formatMessage({ id: `${child.locale}` }).length > 10
|
|
53
|
+
? `${formatMessage({
|
|
54
|
+
id: `${child.name}`,
|
|
55
|
+
}).slice(0, 10)}...`
|
|
56
|
+
: formatMessage({ id: `${child.locale}` })}
|
|
57
|
+
</Tooltip>
|
|
58
|
+
<img className="allFuncOnMouseroverImg" src={right}></img>
|
|
59
|
+
</Link>
|
|
60
|
+
</List.Item>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div className='allfunc_drawcontent'>
|
|
68
|
+
<p className={'drawerWarp_p'}>您的当前权限可以使用以下功能:</p>
|
|
69
|
+
<div className={'drawerWarp'}>
|
|
70
|
+
{homepageData && homepageData.filter((d) => !d.hideInMenu).length > 0 && (
|
|
71
|
+
<List
|
|
72
|
+
className={classNames('allFunsList', 'allFunsListWarp')}
|
|
73
|
+
dataSource={homepageData}
|
|
74
|
+
renderItem={(child: any) => {
|
|
75
|
+
if (!child.hideInMenu && child.path) {
|
|
76
|
+
return (
|
|
77
|
+
<div className={classNames('allFunsListWarp')}>
|
|
78
|
+
<List.Item
|
|
79
|
+
className={classNames('allFuncOnMouserover')}
|
|
80
|
+
style={{ padding: '12px 24px' }}
|
|
81
|
+
>
|
|
82
|
+
<Link to={child.path} onClick={onClose}>
|
|
83
|
+
{formatMessage({ id: `${child.name}` })}
|
|
84
|
+
<img className="allFuncOnMouseroverImg" src={right}></img>
|
|
85
|
+
</Link>
|
|
86
|
+
</List.Item>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}}
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
93
|
+
{routesData.map((item, index) => {
|
|
94
|
+
return (
|
|
95
|
+
<List
|
|
96
|
+
className={classNames('allFunsList', 'allFunsListWarp')}
|
|
97
|
+
style={{color: '#005CFF'}}
|
|
98
|
+
header={<b>{formatMessage({ id: `${item.name}` })}</b>}
|
|
99
|
+
bordered
|
|
100
|
+
dataSource={item.children}
|
|
101
|
+
renderItem={(child: any) => {
|
|
102
|
+
return renderChildItem(child)
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
})}
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default DrawContent;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
.menu {
|
|
4
|
+
.anticon {
|
|
5
|
+
margin-right: 8px;
|
|
6
|
+
}
|
|
7
|
+
.ant-dropdown-menu-item {
|
|
8
|
+
min-width: 160px;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.right {
|
|
13
|
+
display: flex;
|
|
14
|
+
float: right;
|
|
15
|
+
height: 48px;
|
|
16
|
+
margin-left: auto;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
.action {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
height: 48px;
|
|
22
|
+
padding: 0 12px;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transition: all 0.3s;
|
|
25
|
+
> span {
|
|
26
|
+
vertical-align: middle;
|
|
27
|
+
}
|
|
28
|
+
&:hover {
|
|
29
|
+
background: rgba(0, 0, 0, 0.025);
|
|
30
|
+
}
|
|
31
|
+
.opened {
|
|
32
|
+
background: rgba(0, 0, 0, 0.025);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
.search {
|
|
36
|
+
padding: 0 12px;
|
|
37
|
+
&:hover {
|
|
38
|
+
background: transparent;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.account {
|
|
42
|
+
.avatar {
|
|
43
|
+
margin-right: 8px;
|
|
44
|
+
color: #1890ff;
|
|
45
|
+
vertical-align: top;
|
|
46
|
+
background: rgba(255, 255, 255, 0.85);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dark {
|
|
52
|
+
.action {
|
|
53
|
+
&:hover {
|
|
54
|
+
background: #252a3d;
|
|
55
|
+
}
|
|
56
|
+
.opened {
|
|
57
|
+
background: #252a3d;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.warp_allfunc {
|
|
63
|
+
z-index: 100;
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
.drawerWarp {
|
|
67
|
+
column-count: 4;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.drawer_header_warp {
|
|
71
|
+
.ant-list-header {
|
|
72
|
+
padding: 0 0 0 10px !important;
|
|
73
|
+
line-height: 40px;
|
|
74
|
+
border: 0px !important;
|
|
75
|
+
b {
|
|
76
|
+
width: 100%;
|
|
77
|
+
display: inline-block;
|
|
78
|
+
border-bottom: 1px solid #f0f0f0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
.ant-list-item {
|
|
82
|
+
padding: 0 0 0 10px !important;
|
|
83
|
+
line-height: 30px !important;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ant-drawer-close {
|
|
87
|
+
position: absolute;
|
|
88
|
+
right: 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
.p {
|
|
95
|
+
color: #b1bad4;
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
font-size: 12px;
|
|
98
|
+
margin-bottom: 10px;
|
|
99
|
+
font-family: PingFangSC, PingFangSC-Regular;
|
|
100
|
+
line-height: 16px;
|
|
101
|
+
text-align: left;
|
|
102
|
+
opacity: 0.8;
|
|
103
|
+
user-select: none;
|
|
104
|
+
text-align: center;
|
|
105
|
+
margin-left: 8px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.btn {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
height: 44px;
|
|
112
|
+
color: #b1bad4;
|
|
113
|
+
background: #10234c;
|
|
114
|
+
border-radius: 8px;
|
|
115
|
+
width: 130px;
|
|
116
|
+
user-select: none;
|
|
117
|
+
}
|
|
118
|
+
.btn:hover,
|
|
119
|
+
.btnSpan1:hover,
|
|
120
|
+
.btnSpan2:hover {
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
color: #b1bad4;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.btnSpan1 {
|
|
126
|
+
margin: 0 7px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.allfunc_drawcontent {
|
|
131
|
+
.allFunsList {
|
|
132
|
+
margin-bottom: 10px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.allFunsListWarp {
|
|
136
|
+
width: 200px;
|
|
137
|
+
margin-right: 10px;
|
|
138
|
+
border-radius: 4px;
|
|
139
|
+
|
|
140
|
+
break-inside: avoid;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.drawerWarp_p {
|
|
144
|
+
color: #8c8c8c;
|
|
145
|
+
font-weight: 400;
|
|
146
|
+
font-size: 14px;
|
|
147
|
+
font-family: PingFangSC, PingFangSC-Regular;
|
|
148
|
+
line-height: 20px;
|
|
149
|
+
text-align: left;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { Drawer } from 'antd';
|
|
4
|
+
import React, { useEffect, useState, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import './index.less';
|
|
6
|
+
import allfunc from '../../../../../assets/allfunc.svg';
|
|
7
|
+
import DrawContent from './drawContent';
|
|
8
|
+
export type SiderTheme = 'light' | 'dark';
|
|
9
|
+
|
|
10
|
+
const AllFunc: any = forwardRef(({ isCollapse, handleClose, itemPath }: any, ref) => {
|
|
11
|
+
const [isDrawer, setIsDrawer]: any = useState(false);
|
|
12
|
+
useImperativeHandle(ref, () => ({
|
|
13
|
+
close: () => {
|
|
14
|
+
setIsDrawer(false)
|
|
15
|
+
}
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (isCollapse) {
|
|
20
|
+
setIsDrawer(false);
|
|
21
|
+
}
|
|
22
|
+
}, [isCollapse]);
|
|
23
|
+
const showDrawer = (e) => {
|
|
24
|
+
if (isCollapse) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
handleClose()
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
setIsDrawer(!isDrawer);
|
|
30
|
+
};
|
|
31
|
+
const onClose = () => {
|
|
32
|
+
setIsDrawer(!isDrawer);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div
|
|
38
|
+
className={'warp_allfunc'}
|
|
39
|
+
onClick={(e: any) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
}}
|
|
42
|
+
style={{ opacity: isCollapse ? '0' : '1' }}
|
|
43
|
+
>
|
|
44
|
+
<p className={'p'}>没有找到想要的功能?</p>
|
|
45
|
+
|
|
46
|
+
<p className={'btn'} onClick={showDrawer}>
|
|
47
|
+
<span className={'btnSpan1'}>
|
|
48
|
+
<img style={{marginTop: '-2px'}} width={18} src={allfunc} />
|
|
49
|
+
</span>
|
|
50
|
+
<span className={'btnSpan2'}>查看全部功能</span>
|
|
51
|
+
</p>
|
|
52
|
+
{!isCollapse && (
|
|
53
|
+
<Drawer
|
|
54
|
+
style={{ left: isDrawer ? 140 : 0, top:50 }}
|
|
55
|
+
destroyOnClose
|
|
56
|
+
title={<span style={{ fontWeight: 'bold', fontSize: 18 }}>全部功能</span>}
|
|
57
|
+
zIndex={19}
|
|
58
|
+
width={850}
|
|
59
|
+
className={'drawer_header_warp'}
|
|
60
|
+
placement="left"
|
|
61
|
+
onClose={onClose}
|
|
62
|
+
visible={isDrawer}
|
|
63
|
+
>
|
|
64
|
+
<DrawContent itemPath={itemPath} onClose={onClose} />
|
|
65
|
+
</Drawer>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
export default AllFunc;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
.setting_content>div {
|
|
2
|
+
width: 50%;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
// float: left;
|
|
5
|
+
margin: 0 10px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.setting_content {
|
|
9
|
+
display: flex;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
.tree_title {
|
|
14
|
+
height: 50px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tree_content {
|
|
18
|
+
height: 400px;
|
|
19
|
+
overflow: auto;
|
|
20
|
+
border: 1px solid #d9d9d9;
|
|
21
|
+
padding: 5px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.setting_content::after {
|
|
25
|
+
clear: both;
|
|
26
|
+
display: block;
|
|
27
|
+
content: '';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.choosed_label_color {
|
|
31
|
+
color: #f50;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.left_tree_content {
|
|
35
|
+
.ant-tree .ant-tree-node-content-wrapper {
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
.ant-tree-title {
|
|
38
|
+
width: 100%;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.ant-tree .ant-tree-treenode {
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.right_tree_content, .left_tree_content {
|
|
47
|
+
.ant-tree .ant-tree-node-content-wrapper {
|
|
48
|
+
display: flex;
|
|
49
|
+
margin-left: -3px;
|
|
50
|
+
}
|
|
51
|
+
.ant-tree-checkbox {
|
|
52
|
+
top: auto;
|
|
53
|
+
top: initial;
|
|
54
|
+
// margin: 4px 3px 0 0 !important;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.node_title_content:hover {
|
|
59
|
+
.right_arrow {
|
|
60
|
+
display: block !important;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.right_arrow {
|
|
65
|
+
float: right;
|
|
66
|
+
display: none;
|
|
67
|
+
color: #999999;
|
|
68
|
+
margin-right: 10px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
.right_tree_content {
|
|
74
|
+
.ant-tree-title {
|
|
75
|
+
width: 100%;
|
|
76
|
+
display: inline-block;
|
|
77
|
+
padding-right: 10px;
|
|
78
|
+
}
|
|
79
|
+
.ant-dropdown-trigger {
|
|
80
|
+
color: gray !important;
|
|
81
|
+
}
|
|
82
|
+
.tree_node_title {
|
|
83
|
+
font-size: 20px;
|
|
84
|
+
color: #d9d9d9;
|
|
85
|
+
float: right;
|
|
86
|
+
span {
|
|
87
|
+
margin-right: 5px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|