@bit-sun/business-component 1.2.4-alpha.1 → 1.2.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.
- package/.fatherrc.ts +0 -1
- package/.umirc.ts +16 -31
- package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +1 -1
- package/dist/components/Business/SearchSelect/common.d.ts +1 -5
- package/dist/components/Business/SearchSelect/index.d.ts +1 -1
- package/dist/components/Business/SearchSelect/utils.d.ts +1 -2
- package/dist/components/Functional/SearchSelect/index.d.ts +1 -2
- package/dist/index.d.ts +0 -15
- package/dist/index.esm.js +4456 -19407
- package/dist/index.js +4443 -19411
- package/package.json +5 -26
- package/src/components/Business/CommodityEntry/index.md +3 -4
- package/src/components/Business/CommodityEntry/index.tsx +2 -7
- package/src/components/Business/SearchSelect/BusinessUtils.ts +14 -107
- package/src/components/Business/SearchSelect/common.ts +1 -20
- package/src/components/Business/SearchSelect/index.md +30 -60
- package/src/components/Business/SearchSelect/index.tsx +12 -21
- package/src/components/Business/SearchSelect/utils.ts +4 -30
- package/src/components/Functional/DataImport/index.tsx +2 -1
- package/src/components/Functional/DataValidation/index.tsx +1 -1
- package/src/components/Functional/SearchSelect/index.tsx +121 -218
- package/src/index.ts +6 -15
- package/typings.d.ts +0 -3
- package/dist/components/Business/AddSelectBusiness/index.d.ts +0 -1
- package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +0 -4
- package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +0 -4
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +0 -4
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +0 -17
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +0 -30
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +0 -3
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +0 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +0 -4
- package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +0 -4
- package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +0 -2
- package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +0 -8
- package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +0 -8
- package/dist/components/Business/BsLayouts/index.d.ts +0 -18
- package/dist/components/Business/BsLayouts/service.d.ts +0 -1
- package/dist/components/Business/BsLayouts/utils.d.ts +0 -13
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +0 -2
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +0 -58
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +0 -98
- package/dist/components/Business/CommonAlert/index.d.ts +0 -3
- package/dist/components/Business/CommonGuideWrapper/index.d.ts +0 -6
- package/dist/components/Business/DetailPageWrapper/index.d.ts +0 -9
- package/dist/components/Business/DetailPageWrapper/utils.d.ts +0 -8
- package/dist/components/Business/HomePageWrapper/index.d.ts +0 -3
- package/dist/components/Business/StateFlow/index.d.ts +0 -3
- package/dist/components/Business/TreeSearchSelect/index.d.ts +0 -3
- package/dist/components/Business/TreeSearchSelect/utils.d.ts +0 -2
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +0 -54
- package/dist/components/Business/columnSettingTable/index.d.ts +0 -16
- package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +0 -17
- package/dist/components/Business/columnSettingTable/utils.d.ts +0 -8
- package/dist/components/Functional/AddSelect/index.d.ts +0 -3
- package/dist/components/Functional/BillEntry/index.d.ts +0 -4
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +0 -12
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +0 -2
- package/dist/utils/enumConfig.d.ts +0 -10
- package/dist/utils/requestUtils.d.ts +0 -1
- package/dist/utils/utils.d.ts +0 -3
- package/lib/assets/arrow_top.png +0 -0
- package/lib/assets/drag.svg +0 -17
- package/lib/assets/exportFail.svg +0 -38
- package/lib/assets/exportProcessing.svg +0 -29
- package/lib/assets/exportSuccess.svg +0 -35
- package/lib/assets/exportlogo.png +0 -0
- package/lib/assets/label_icon_bottom.svg +0 -26
- package/lib/assets/upExport.svg +0 -23
- package/src/assets/32.svg +0 -28
- package/src/assets/addIcon.svg +0 -18
- package/src/assets/allfunc.svg +0 -28
- package/src/assets/arrowRight.svg +0 -25
- package/src/assets/arrow_top.png +0 -0
- package/src/assets/btn-delete.svg +0 -30
- package/src/assets/btn-edit.svg +0 -20
- package/src/assets/btn-more.svg +0 -18
- package/src/assets/btn-submit.svg +0 -20
- package/src/assets/caidan.svg +0 -12
- package/src/assets/close.svg +0 -26
- package/src/assets/closeicon.png +0 -0
- package/src/assets/drag.svg +0 -17
- package/src/assets/exportFail.svg +0 -38
- package/src/assets/exportProcessing.svg +0 -29
- package/src/assets/exportSuccess.svg +0 -35
- package/src/assets/exportlogo.png +0 -0
- package/src/assets/fixed-left-active.svg +0 -12
- package/src/assets/fixed-left.svg +0 -16
- package/src/assets/fixed-right-active.svg +0 -12
- package/src/assets/fixed-right.svg +0 -16
- package/src/assets/guanbi.svg +0 -16
- package/src/assets/icon-quanping.svg +0 -16
- package/src/assets/icon-shezhi.svg +0 -18
- package/src/assets/label_icon_bottom.svg +0 -26
- package/src/assets/list-no-img.svg +0 -22
- package/src/assets/morentouxiang-32.svg +0 -24
- package/src/assets/right.png +0 -0
- package/src/assets/scanning.svg +0 -25
- package/src/assets/upExport.svg +0 -23
- package/src/assets/xinglan-icon-out.png +0 -0
- package/src/components/Business/AddSelectBusiness/index.md +0 -41
- package/src/components/Business/AddSelectBusiness/index.tsx +0 -290
- package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +0 -112
- package/src/components/Business/BsLayouts/Components/AllFunc/index.less +0 -153
- package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +0 -70
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +0 -90
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +0 -38
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +0 -243
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +0 -385
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +0 -286
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +0 -75
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +0 -171
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +0 -65
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +0 -154
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +0 -73
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +0 -158
- package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +0 -85
- package/src/components/Business/BsLayouts/Components/RightContent/home.less +0 -218
- package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +0 -156
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +0 -161
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +0 -76
- package/src/components/Business/BsLayouts/index.less +0 -80
- package/src/components/Business/BsLayouts/index.tsx +0 -1465
- package/src/components/Business/BsLayouts/service.ts +0 -11
- package/src/components/Business/BsLayouts/utils.tsx +0 -211
- package/src/components/Business/BsSulaQueryTable/index.less +0 -220
- package/src/components/Business/BsSulaQueryTable/index.tsx +0 -505
- package/src/components/Business/BsSulaQueryTable/setting.tsx +0 -799
- package/src/components/Business/BsSulaQueryTable/utils.less +0 -65
- package/src/components/Business/BsSulaQueryTable/utils.tsx +0 -688
- package/src/components/Business/CommonAlert/index.less +0 -0
- package/src/components/Business/CommonAlert/index.tsx +0 -23
- package/src/components/Business/CommonGuideWrapper/index.less +0 -112
- package/src/components/Business/CommonGuideWrapper/index.md +0 -39
- package/src/components/Business/CommonGuideWrapper/index.tsx +0 -84
- package/src/components/Business/DetailPageWrapper/index.less +0 -80
- package/src/components/Business/DetailPageWrapper/index.tsx +0 -335
- package/src/components/Business/DetailPageWrapper/utils.tsx +0 -101
- package/src/components/Business/HomePageWrapper/index.less +0 -33
- package/src/components/Business/HomePageWrapper/index.md +0 -45
- package/src/components/Business/HomePageWrapper/index.tsx +0 -162
- package/src/components/Business/StateFlow/index.less +0 -131
- package/src/components/Business/StateFlow/index.md +0 -60
- package/src/components/Business/StateFlow/index.tsx +0 -30
- package/src/components/Business/TreeSearchSelect/index.md +0 -126
- package/src/components/Business/TreeSearchSelect/index.tsx +0 -34
- package/src/components/Business/TreeSearchSelect/utils.ts +0 -60
- package/src/components/Business/columnSettingTable/columnSetting.tsx +0 -764
- package/src/components/Business/columnSettingTable/index.less +0 -247
- package/src/components/Business/columnSettingTable/index.md +0 -358
- package/src/components/Business/columnSettingTable/index.tsx +0 -233
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +0 -241
- package/src/components/Business/columnSettingTable/utils.tsx +0 -69
- package/src/components/Functional/AddSelect/index.less +0 -367
- package/src/components/Functional/AddSelect/index.md +0 -122
- package/src/components/Functional/AddSelect/index.tsx +0 -962
- package/src/components/Functional/BillEntry/index.less +0 -371
- package/src/components/Functional/BillEntry/index.md +0 -39
- package/src/components/Functional/BillEntry/index.tsx +0 -613
- package/src/components/Functional/ExportFunctions/ExportIcon/index.md +0 -37
- package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +0 -59
- package/src/components/Functional/TreeSearchSelect/index.md +0 -47
- package/src/components/Functional/TreeSearchSelect/index.tsx +0 -149
- package/src/styles/bsDefault.less +0 -1907
- package/src/utils/enumConfig.ts +0 -10
- package/src/utils/requestUtils.ts +0 -33
- package/src/utils/utils.ts +0 -52
|
@@ -1,112 +0,0 @@
|
|
|
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;
|
|
@@ -1,153 +0,0 @@
|
|
|
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
|
-
|
|
@@ -1,70 +0,0 @@
|
|
|
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;
|
|
@@ -1,90 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useState,
|
|
3
|
-
forwardRef,
|
|
4
|
-
useImperativeHandle
|
|
5
|
-
} from "react";
|
|
6
|
-
import './index.less';
|
|
7
|
-
import LeftTree from "./leftTree";
|
|
8
|
-
import RightTree from "./rightTree";
|
|
9
|
-
|
|
10
|
-
const MenuSetting = forwardRef(({actionRef, originRoutes, itemPath}: any, ref) => {
|
|
11
|
-
|
|
12
|
-
const [customerMenuData, setCustomerMenuData] = useState(
|
|
13
|
-
JSON.parse( localStorage.getItem(`customerMenu_${itemPath}_front`) || '[]')
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
useImperativeHandle(ref, () => ({
|
|
17
|
-
saveMenuData: () => {
|
|
18
|
-
localStorage.setItem(`customerMenu_${itemPath}_front`, JSON.stringify(customerMenuData));
|
|
19
|
-
actionRef.current?.reload();
|
|
20
|
-
},
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div className={'setting_content'}>
|
|
25
|
-
<LeftTree
|
|
26
|
-
originRoutes={originRoutes}
|
|
27
|
-
customerMenuData={customerMenuData}
|
|
28
|
-
setCustomerMenuData={setCustomerMenuData}
|
|
29
|
-
/>
|
|
30
|
-
<RightTree
|
|
31
|
-
customerMenuData={customerMenuData}
|
|
32
|
-
setCustomerMenuData={setCustomerMenuData}
|
|
33
|
-
/>
|
|
34
|
-
</div>
|
|
35
|
-
)
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
export default MenuSetting;
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { Tree, Input, Tooltip, message } from 'antd';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import './index.less';
|
|
5
|
-
import {
|
|
6
|
-
SearchOutlined,
|
|
7
|
-
FolderOutlined,
|
|
8
|
-
} from '@ant-design/icons';
|
|
9
|
-
import arrowRight from '../../../../../../assets/arrowRight.svg';
|
|
10
|
-
import {
|
|
11
|
-
setMenuTreeData,
|
|
12
|
-
} from '../../../utils';
|
|
13
|
-
import { memoizeOneFormatter } from '@/utils/utils';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const { TreeNode } = Tree;
|
|
17
|
-
const { Search } = Input;
|
|
18
|
-
|
|
19
|
-
const dataList: any[] = [];
|
|
20
|
-
const generateList = data => {
|
|
21
|
-
for (let i = 0; i < data.length; i++) {
|
|
22
|
-
const node = data[i];
|
|
23
|
-
const { path, name } = node;
|
|
24
|
-
dataList.push({ path, name });
|
|
25
|
-
if (node.children) {
|
|
26
|
-
generateList(node.children);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const getParentKey = (path, tree) => {
|
|
33
|
-
let parentKey;
|
|
34
|
-
for (let i = 0; i < tree.length; i++) {
|
|
35
|
-
const node = tree[i];
|
|
36
|
-
if (node.children) {
|
|
37
|
-
if (node.children.some(item => item.path === path)) {
|
|
38
|
-
parentKey = node.path;
|
|
39
|
-
} else if (getParentKey(path, node.children)) {
|
|
40
|
-
parentKey = getParentKey(path, node.children);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return parentKey;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
class LeftTree extends React.Component<any> {
|
|
48
|
-
state = {
|
|
49
|
-
treeData: [],
|
|
50
|
-
expandedKeys: [],
|
|
51
|
-
searchValue: '',
|
|
52
|
-
autoExpandParent: true,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
componentDidMount() {
|
|
57
|
-
const {originRoutes = [] } = this.props;
|
|
58
|
-
const showMenu = originRoutes.find(item => item.path === '/')?.routes || [];
|
|
59
|
-
let routesData = JSON.parse(JSON.stringify(memoizeOneFormatter(showMenu, '')));
|
|
60
|
-
setMenuTreeData(routesData);
|
|
61
|
-
generateList(routesData);
|
|
62
|
-
|
|
63
|
-
this.setState({
|
|
64
|
-
treeData: routesData
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
onExpand = expandedKeys => {
|
|
70
|
-
this.setState({
|
|
71
|
-
expandedKeys,
|
|
72
|
-
autoExpandParent: false,
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
onChange = e => {
|
|
77
|
-
const { value } = e.target;
|
|
78
|
-
const { treeData } = this.state;
|
|
79
|
-
const expandedKeys = dataList
|
|
80
|
-
.map(item => {
|
|
81
|
-
if (item.name.indexOf(value) > -1) {
|
|
82
|
-
return getParentKey(item.path, treeData);
|
|
83
|
-
}
|
|
84
|
-
return null;
|
|
85
|
-
})
|
|
86
|
-
.filter((item, i, self) => item && self.indexOf(item) === i);
|
|
87
|
-
this.setState({
|
|
88
|
-
expandedKeys,
|
|
89
|
-
searchValue: value,
|
|
90
|
-
autoExpandParent: true,
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
getPathList = (originData: any): Array<any> => {
|
|
95
|
-
let pathList: Array<any> = [];
|
|
96
|
-
const getList = (data) => {
|
|
97
|
-
if (Array.isArray(data)) {
|
|
98
|
-
data.forEach(item => {
|
|
99
|
-
pathList.push(item.path);
|
|
100
|
-
if (item.children) {
|
|
101
|
-
getList(item.children)
|
|
102
|
-
}
|
|
103
|
-
})
|
|
104
|
-
} else {
|
|
105
|
-
pathList.push(data.path);
|
|
106
|
-
if (data.children) {
|
|
107
|
-
getList(data.children);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
getList(originData);
|
|
112
|
-
return pathList;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
handleAdd2Menu = (path: string) => {
|
|
117
|
-
const { treeData } = this.state;
|
|
118
|
-
const { customerMenuData, setCustomerMenuData } = this.props;
|
|
119
|
-
let filterItem;
|
|
120
|
-
const filterMenuItem = (menuData: Array<any>) => {
|
|
121
|
-
menuData.forEach(item => {
|
|
122
|
-
if (item.path === path) {
|
|
123
|
-
filterItem = { ...item };
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
if (item.children) {
|
|
127
|
-
filterMenuItem(item.children);
|
|
128
|
-
}
|
|
129
|
-
})
|
|
130
|
-
}
|
|
131
|
-
filterMenuItem(treeData);
|
|
132
|
-
let addPathList = this.getPathList(filterItem);
|
|
133
|
-
let oldPathList = this.getPathList(customerMenuData);
|
|
134
|
-
let isRepet = false;
|
|
135
|
-
oldPathList.forEach(oldPath => {
|
|
136
|
-
if (addPathList.find(newPath => newPath === oldPath)) {
|
|
137
|
-
isRepet = true;
|
|
138
|
-
}
|
|
139
|
-
})
|
|
140
|
-
if (isRepet) {
|
|
141
|
-
message.warning('存在已经添加的菜单,请检查!');
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
setCustomerMenuData([
|
|
145
|
-
...customerMenuData,
|
|
146
|
-
filterItem
|
|
147
|
-
])
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
render() {
|
|
152
|
-
const { searchValue, expandedKeys, autoExpandParent, treeData } = this.state;
|
|
153
|
-
const loop = data =>
|
|
154
|
-
data.map(item => {
|
|
155
|
-
const index = item.name.indexOf(searchValue);
|
|
156
|
-
const beforeStr = item.name.substr(0, index);
|
|
157
|
-
const afterStr = item.name.substr(index + searchValue.length);
|
|
158
|
-
const name =
|
|
159
|
-
index > -1 ? (
|
|
160
|
-
<span>
|
|
161
|
-
{beforeStr}
|
|
162
|
-
<span style={{ color: '#f50' }}>{searchValue}</span>
|
|
163
|
-
{afterStr}
|
|
164
|
-
</span>
|
|
165
|
-
) : (
|
|
166
|
-
<span>{item.name}</span>
|
|
167
|
-
);
|
|
168
|
-
if (item.children && item.children.length) {
|
|
169
|
-
return (
|
|
170
|
-
<TreeNode
|
|
171
|
-
path={item.path}
|
|
172
|
-
icon={<FolderOutlined />}
|
|
173
|
-
name={<div className={'node_title_content'}>
|
|
174
|
-
<span>{name}</span>
|
|
175
|
-
<div
|
|
176
|
-
className={'right_arrow'}
|
|
177
|
-
onClick={() => {
|
|
178
|
-
this.handleAdd2Menu(item.path);
|
|
179
|
-
}}
|
|
180
|
-
>
|
|
181
|
-
<Tooltip placement="topRight" title={'单击加入自定义菜单'}>
|
|
182
|
-
<img style={{ marginTop: '-3px' }} width={18} src={arrowRight} />
|
|
183
|
-
</Tooltip>
|
|
184
|
-
</div>
|
|
185
|
-
</div>}
|
|
186
|
-
>
|
|
187
|
-
{loop(item.children)}
|
|
188
|
-
</TreeNode>
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
return <TreeNode
|
|
192
|
-
path={item.path}
|
|
193
|
-
// icon={<FileOutlined />}
|
|
194
|
-
name={<div className={'node_title_content'}>
|
|
195
|
-
<span>{name}</span>
|
|
196
|
-
<div
|
|
197
|
-
className={'right_arrow'}
|
|
198
|
-
onClick={() => {
|
|
199
|
-
this.handleAdd2Menu(item.path);
|
|
200
|
-
}}
|
|
201
|
-
>
|
|
202
|
-
<Tooltip placement="topRight" title={'单击加入自定义菜单'}>
|
|
203
|
-
<img style={{ marginTop: '-3px' }} width={18} src={arrowRight} />
|
|
204
|
-
</Tooltip>
|
|
205
|
-
</div>
|
|
206
|
-
</div>}
|
|
207
|
-
/>;
|
|
208
|
-
});
|
|
209
|
-
return (
|
|
210
|
-
<div className={'left_tree_content'}>
|
|
211
|
-
<div className={'tree_title'}>
|
|
212
|
-
<div>菜单列表(选中菜单,可快速设置)</div>
|
|
213
|
-
<Input
|
|
214
|
-
style={{ marginBottom: 8 }}
|
|
215
|
-
placeholder="请搜索"
|
|
216
|
-
allowClear
|
|
217
|
-
|
|
218
|
-
prefix={<SearchOutlined />}
|
|
219
|
-
onChange={this.onChange}
|
|
220
|
-
/>
|
|
221
|
-
</div>
|
|
222
|
-
<div className={'tree_content'}>
|
|
223
|
-
<Tree
|
|
224
|
-
showIcon
|
|
225
|
-
showLine={true}
|
|
226
|
-
fieldNames={{
|
|
227
|
-
title: 'name',
|
|
228
|
-
key: 'path',
|
|
229
|
-
children: 'children'
|
|
230
|
-
}}
|
|
231
|
-
onExpand={this.onExpand}
|
|
232
|
-
expandedKeys={expandedKeys}
|
|
233
|
-
autoExpandParent={autoExpandParent}
|
|
234
|
-
>
|
|
235
|
-
{loop(treeData)}
|
|
236
|
-
</Tree>
|
|
237
|
-
</div>
|
|
238
|
-
</div>
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export default LeftTree;
|