cfel-base-components 2.5.52 → 2.5.54
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/demo/src/index.jsx +86 -15
- package/demo/src/index.module.less +23 -3
- package/package.json +1 -1
- package/src/.umi/core/helmet.ts +1 -1
- package/src/components/layout/index.scss +68 -78
- package/src/components/layout/index.tsx +32 -4
- package/src/components/layout-console/index-console.scss +90 -46
- package/src/components/layout-console/index.tsx +134 -165
- package/src/global.d.ts +0 -2
- package/demo/src/index.scss +0 -0
- package/src/components/layout-copy/index.scss +0 -169
- package/src/components/layout-copy/index.tsx +0 -218
- package/src/components/layout-copy/user-card/index.scss +0 -180
- package/src/components/layout-copy/user-card/index.tsx +0 -162
package/demo/src/index.jsx
CHANGED
|
@@ -3,9 +3,9 @@ import { createRoot } from 'react-dom/client'
|
|
|
3
3
|
import style from './index.module.less'
|
|
4
4
|
import { SwapOutlined, QqOutlined, WeiboOutlined } from '@ant-design/icons'
|
|
5
5
|
import { ConfigProvider } from 'antd'
|
|
6
|
-
import './index.scss'
|
|
7
6
|
import Layout from '../../src/components/layout'
|
|
8
|
-
import
|
|
7
|
+
// import Layout from '../../src/components/layout-console'
|
|
8
|
+
import { QuestionCircleTwoTone } from '@ant-design/icons'
|
|
9
9
|
// import Account from '../../src/components/universal-pages/account';
|
|
10
10
|
// import AccountInfo from '../../src/components/universal-pages/accountInfo';
|
|
11
11
|
import CpcRole from '../../src/components/universal-pages/cpcRole'
|
|
@@ -13,27 +13,53 @@ import CpcRoleInfo from '../../src/components/universal-pages/cpcRoleInfo'
|
|
|
13
13
|
import ProTable from '../../src/components/base-component/ProTable'
|
|
14
14
|
import PageContainer from '../../src/components/base-component/PageContainer'
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const menuList = [
|
|
17
17
|
{
|
|
18
18
|
label: '云厂商',
|
|
19
|
-
icon: <
|
|
19
|
+
icon: <SwapOutlined />,
|
|
20
20
|
key: 'cloud-list',
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
label: '产品模型',
|
|
24
|
-
icon: <
|
|
24
|
+
icon: <SwapOutlined />,
|
|
25
25
|
key: 'catalog',
|
|
26
26
|
children: [
|
|
27
27
|
{
|
|
28
28
|
label: '产品模型',
|
|
29
|
-
key: 'product-
|
|
29
|
+
key: 'product-list1',
|
|
30
|
+
children: [
|
|
31
|
+
{
|
|
32
|
+
label: '产品模型',
|
|
33
|
+
key: 'product-list2',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: '产品模型',
|
|
37
|
+
key: 'product-list3',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: '产品模型',
|
|
41
|
+
key: 'product-list4',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
30
44
|
},
|
|
31
45
|
{
|
|
32
46
|
label: '商品模型',
|
|
33
47
|
key: 'commodity-list',
|
|
48
|
+
children: [
|
|
49
|
+
{
|
|
50
|
+
label: <>
|
|
51
|
+
<span>配额列表</span>
|
|
52
|
+
<span className={style.quotaCount}>12</span>
|
|
53
|
+
</>,
|
|
54
|
+
key: 'product-list3',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
34
57
|
},
|
|
35
58
|
{
|
|
36
|
-
label
|
|
59
|
+
label:<>
|
|
60
|
+
<span>配额列表</span>
|
|
61
|
+
<span className={style.quotaCount}>12</span>
|
|
62
|
+
</>,
|
|
37
63
|
key: 'entity-list',
|
|
38
64
|
},
|
|
39
65
|
{
|
|
@@ -44,12 +70,56 @@ const menu = [
|
|
|
44
70
|
},
|
|
45
71
|
{
|
|
46
72
|
label: '数据字典',
|
|
47
|
-
icon: <
|
|
73
|
+
icon: <SwapOutlined />,
|
|
48
74
|
key: 'dictionary-list',
|
|
75
|
+
children: [
|
|
76
|
+
{
|
|
77
|
+
label: '产品模型',
|
|
78
|
+
key: 'product-lis1',
|
|
79
|
+
children: [
|
|
80
|
+
{
|
|
81
|
+
label: '产品模型',
|
|
82
|
+
key: 'product-lit2',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: '产品模型',
|
|
86
|
+
key: 'product-lit3',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: '产品模型',
|
|
90
|
+
key: 'product-lit4',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: '商品模型',
|
|
96
|
+
key: 'commodity-li1st',
|
|
97
|
+
children: [
|
|
98
|
+
{
|
|
99
|
+
label: <>
|
|
100
|
+
<span>配额列表</span>
|
|
101
|
+
<span className={style.quotaCount}>12</span>
|
|
102
|
+
</>,
|
|
103
|
+
key: 'product-list3',
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
label:<>
|
|
109
|
+
<span>配额列表</span>
|
|
110
|
+
<span className={style.quotaCount}>12</span>
|
|
111
|
+
</>,
|
|
112
|
+
key: 'entity-list',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: '资源类型管理',
|
|
116
|
+
key: 'rsourceType-listawsd',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
49
119
|
},
|
|
50
120
|
{
|
|
51
121
|
label: '实例管理',
|
|
52
|
-
icon: <
|
|
122
|
+
icon: <SwapOutlined />,
|
|
53
123
|
children: [
|
|
54
124
|
{
|
|
55
125
|
label: '容器镜像服务管理',
|
|
@@ -77,7 +147,7 @@ const menu = [
|
|
|
77
147
|
{
|
|
78
148
|
label: 'API管理',
|
|
79
149
|
key: 'apiAction',
|
|
80
|
-
icon: <
|
|
150
|
+
icon: <SwapOutlined />,
|
|
81
151
|
children: [
|
|
82
152
|
{
|
|
83
153
|
label: 'API 应用管理',
|
|
@@ -96,7 +166,7 @@ const menu = [
|
|
|
96
166
|
{
|
|
97
167
|
label: '消息中心',
|
|
98
168
|
key: 'msgAction',
|
|
99
|
-
icon: <
|
|
169
|
+
icon: <SwapOutlined />,
|
|
100
170
|
children: [
|
|
101
171
|
{
|
|
102
172
|
label: '消息管理',
|
|
@@ -119,7 +189,7 @@ const menu = [
|
|
|
119
189
|
{
|
|
120
190
|
label: '权限资源配置',
|
|
121
191
|
key: 'menuAction',
|
|
122
|
-
icon: <
|
|
192
|
+
icon: <SwapOutlined />,
|
|
123
193
|
children: [
|
|
124
194
|
{
|
|
125
195
|
label: '菜单管理',
|
|
@@ -137,18 +207,18 @@ const menu = [
|
|
|
137
207
|
},
|
|
138
208
|
{
|
|
139
209
|
label: '配额管理',
|
|
140
|
-
icon: <
|
|
210
|
+
icon: <SwapOutlined />,
|
|
141
211
|
key: 'quotaList',
|
|
142
212
|
},
|
|
143
213
|
{
|
|
144
214
|
label: '库存管理',
|
|
145
|
-
icon: <
|
|
215
|
+
icon: <SwapOutlined />,
|
|
146
216
|
key: 'inventoryList',
|
|
147
217
|
},
|
|
148
218
|
{
|
|
149
219
|
label: '权限管理',
|
|
150
220
|
key: 'authority',
|
|
151
|
-
icon: <
|
|
221
|
+
icon: <SwapOutlined />,
|
|
152
222
|
children: [
|
|
153
223
|
{
|
|
154
224
|
label: '账号列表',
|
|
@@ -230,6 +300,7 @@ const App = () => {
|
|
|
230
300
|
tableData: false,
|
|
231
301
|
}}></CpcRoleInfo> */}
|
|
232
302
|
<PageContainer>
|
|
303
|
+
<QuestionCircleTwoTone twoToneColor='orange' />
|
|
233
304
|
<ProTable columns={columns} nameSpace="device" dataSource={[{ name: '1', description: '1', status: '1' }]} />
|
|
234
305
|
</PageContainer>
|
|
235
306
|
</Layout>
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
*,
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
*,
|
|
2
|
+
body {
|
|
3
|
+
padding: 0px;
|
|
4
|
+
margin: 0px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.quotaCount {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
margin-inline-end: 6px;
|
|
12
|
+
width: 28px;
|
|
13
|
+
height: 28px;
|
|
14
|
+
background: rgba(255, 255, 255, 20%);
|
|
15
|
+
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 5%);
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
backdrop-filter: blur(10px);
|
|
18
|
+
color: rgba(0, 0, 0, 60%);
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
line-height: 20px;
|
|
22
|
+
text-align: left;
|
|
23
|
+
font-style: normal;
|
|
4
24
|
}
|
package/package.json
CHANGED
package/src/.umi/core/helmet.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This file is generated by Umi automatically
|
|
3
3
|
// DO NOT CHANGE IT MANUALLY!
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { HelmetProvider } from '/Users/lionaillen/Documents/
|
|
5
|
+
import { HelmetProvider } from '/Users/lionaillen/Documents/work/cfel/base-components/node_modules/.pnpm/@umijs+renderer-react@4.0.72_react-dom@18.1.0_react@18.1.0__react@18.1.0/node_modules/@umijs/renderer-react';
|
|
6
6
|
import { context } from './helmetContext';
|
|
7
7
|
|
|
8
8
|
export const innerProvider = (container) => {
|
|
@@ -7,14 +7,16 @@ ul {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.ant-layout {
|
|
10
|
-
background: linear-gradient(223deg, #
|
|
11
|
-
box-shadow: inset 0px -1px 0px 0px #
|
|
10
|
+
background: linear-gradient( 223deg, #FEF8FF 0%, #ECF3FE 29%, #F9FAFF 100%);
|
|
11
|
+
box-shadow: inset 0px -1px 0px 0px #EDEEFD;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.layout-menu {
|
|
15
15
|
border-radius: 16px;
|
|
16
16
|
height: calc(100% - 109px);
|
|
17
17
|
overflow-y: scroll;
|
|
18
|
+
position: relative;
|
|
19
|
+
z-index: 11;
|
|
18
20
|
|
|
19
21
|
.menu {
|
|
20
22
|
padding: 0;
|
|
@@ -41,7 +43,7 @@ ul {
|
|
|
41
43
|
&::after {
|
|
42
44
|
position: absolute;
|
|
43
45
|
width: 6px;
|
|
44
|
-
height:
|
|
46
|
+
height: 1px;
|
|
45
47
|
scale: 1.25;
|
|
46
48
|
background: #788bb1;
|
|
47
49
|
border-radius: 2px;
|
|
@@ -92,6 +94,20 @@ ul {
|
|
|
92
94
|
|
|
93
95
|
|
|
94
96
|
> li {
|
|
97
|
+
.first-li {
|
|
98
|
+
&:hover {
|
|
99
|
+
.menu-item-icon {
|
|
100
|
+
color: #185dff;
|
|
101
|
+
font-weight: 500;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.menu-item-label {
|
|
105
|
+
color: #185dff;
|
|
106
|
+
font-weight: 500;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
95
111
|
&:hover {
|
|
96
112
|
> .menu-item-content {
|
|
97
113
|
.menu-item-icon,
|
|
@@ -164,10 +180,22 @@ ul {
|
|
|
164
180
|
position: relative;
|
|
165
181
|
z-index: 9;
|
|
166
182
|
|
|
183
|
+
|
|
184
|
+
.menu-item-content {
|
|
185
|
+
width: 100%;
|
|
186
|
+
padding-right: 24px;
|
|
187
|
+
|
|
188
|
+
.menu-item-label {
|
|
189
|
+
width: 100%;
|
|
190
|
+
display: inline-flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
justify-content: space-between;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
167
196
|
&:hover {
|
|
168
197
|
> .menu-item-content {
|
|
169
198
|
.menu-item-icon,
|
|
170
|
-
.iconfont,
|
|
171
199
|
.menu-item-label {
|
|
172
200
|
color: #185dff;
|
|
173
201
|
font-weight: 500;
|
|
@@ -184,14 +212,14 @@ ul {
|
|
|
184
212
|
width: 5px;
|
|
185
213
|
height: 5px;
|
|
186
214
|
background: #b4c4dc;
|
|
187
|
-
border-radius:
|
|
215
|
+
border-radius: 100%;
|
|
188
216
|
z-index: 1;
|
|
189
217
|
}
|
|
190
218
|
|
|
191
219
|
&::after {
|
|
192
220
|
content: '';
|
|
193
221
|
position: absolute;
|
|
194
|
-
left: 32.
|
|
222
|
+
left: 32.9px;
|
|
195
223
|
top: 0 !important;
|
|
196
224
|
width: 1px;
|
|
197
225
|
height: 100%;
|
|
@@ -250,18 +278,32 @@ ul {
|
|
|
250
278
|
}
|
|
251
279
|
|
|
252
280
|
.grand-li {
|
|
253
|
-
background:
|
|
281
|
+
background: rgba(224,235,251);
|
|
254
282
|
position: relative;
|
|
255
283
|
z-index: 9;
|
|
256
284
|
display: flex;
|
|
257
285
|
align-items: center;
|
|
258
286
|
margin-left: 2px;
|
|
259
|
-
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
.menu-item-content {
|
|
290
|
+
width: 100%;
|
|
291
|
+
padding-right: 24px;
|
|
292
|
+
height: 52px;
|
|
293
|
+
display: flex;
|
|
294
|
+
align-items: center;
|
|
295
|
+
|
|
296
|
+
.menu-item-label {
|
|
297
|
+
width: 100%;
|
|
298
|
+
display: inline-flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
justify-content: space-between;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
260
303
|
|
|
261
304
|
&:hover {
|
|
262
305
|
> .menu-item-content {
|
|
263
306
|
.menu-item-icon,
|
|
264
|
-
.iconfont,
|
|
265
307
|
.menu-item-label {
|
|
266
308
|
color: #185dff;
|
|
267
309
|
font-weight: 500;
|
|
@@ -281,7 +323,7 @@ ul {
|
|
|
281
323
|
width: 5px;
|
|
282
324
|
height: 5px;
|
|
283
325
|
background: #b4c4dc;
|
|
284
|
-
border-radius:
|
|
326
|
+
border-radius: 100%;
|
|
285
327
|
transform: translateY(-50%);
|
|
286
328
|
z-index: 1;
|
|
287
329
|
}
|
|
@@ -316,16 +358,7 @@ ul {
|
|
|
316
358
|
}
|
|
317
359
|
|
|
318
360
|
&.rc-menu-item-selected {
|
|
319
|
-
.menu-item-content {
|
|
320
|
-
width: 100%;
|
|
321
|
-
padding-right: 24px;
|
|
322
|
-
height: 52px;
|
|
323
|
-
display: flex;
|
|
324
|
-
align-items: center;
|
|
325
|
-
}
|
|
326
361
|
.menu-item-label {
|
|
327
|
-
display: flex;
|
|
328
|
-
align-items: center;
|
|
329
362
|
padding-left: 12px;
|
|
330
363
|
width: 100%;
|
|
331
364
|
height: 40px;
|
|
@@ -417,6 +450,7 @@ body {
|
|
|
417
450
|
border-radius: 10px;
|
|
418
451
|
backdrop-filter: blur(10px);
|
|
419
452
|
position: relative;
|
|
453
|
+
z-index: 11;
|
|
420
454
|
|
|
421
455
|
.search-bg-mask {
|
|
422
456
|
position: absolute;
|
|
@@ -446,9 +480,6 @@ body {
|
|
|
446
480
|
background: rgba(0, 0, 0, 0.05);
|
|
447
481
|
}
|
|
448
482
|
|
|
449
|
-
box-shadow:
|
|
450
|
-
inset 0px 2px 1px 0px rgba(0, 0, 0, 0.05),
|
|
451
|
-
inset 0px -2px 0px 0px rgba(255, 255, 255, 0.3);
|
|
452
483
|
border-radius: 10px;
|
|
453
484
|
backdrop-filter: blur(10px);
|
|
454
485
|
|
|
@@ -497,6 +528,17 @@ body {
|
|
|
497
528
|
}
|
|
498
529
|
|
|
499
530
|
.layout-side-mask1 {
|
|
531
|
+
background: white;
|
|
532
|
+
position: absolute;
|
|
533
|
+
top: 0;
|
|
534
|
+
left: 0;
|
|
535
|
+
width: 100%;
|
|
536
|
+
height: 100%;
|
|
537
|
+
border-radius: 16px;
|
|
538
|
+
z-index: 9;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.layout-side-mask2 {
|
|
500
542
|
background: radial-gradient(
|
|
501
543
|
152% 131% at 3% 1%,
|
|
502
544
|
#e8e2fa 0%,
|
|
@@ -512,10 +554,10 @@ body {
|
|
|
512
554
|
width: 100%;
|
|
513
555
|
height: 100%;
|
|
514
556
|
border-radius: 16px;
|
|
557
|
+
z-index: 10;
|
|
515
558
|
}
|
|
516
559
|
|
|
517
560
|
.layout-side {
|
|
518
|
-
// background: url('https://cfel-front.oss-cn-hangzhou.aliyuncs.com/logo/base-component/menu-bg-other.png') no-repeat !important;
|
|
519
561
|
background: transparent !important;
|
|
520
562
|
position: relative;
|
|
521
563
|
height: calc(100vh - 24px);
|
|
@@ -531,6 +573,8 @@ body {
|
|
|
531
573
|
justify-content: space-between;
|
|
532
574
|
cursor: pointer;
|
|
533
575
|
height: 30px;
|
|
576
|
+
position: relative;
|
|
577
|
+
z-index: 11;
|
|
534
578
|
|
|
535
579
|
.logo-sub {
|
|
536
580
|
width: 31px;
|
|
@@ -547,7 +591,7 @@ body {
|
|
|
547
591
|
.layout-header {
|
|
548
592
|
z-index: 1;
|
|
549
593
|
height: $header-height;
|
|
550
|
-
background: linear-gradient(223deg, #
|
|
594
|
+
background: linear-gradient( 223deg, #FAF8FF 0%, #ECF2FE 29%, #FFFFFF 100%);
|
|
551
595
|
border-radius: 16px;
|
|
552
596
|
border: 1px solid #ffffff;
|
|
553
597
|
position: relative;
|
|
@@ -748,57 +792,3 @@ body {
|
|
|
748
792
|
}
|
|
749
793
|
}
|
|
750
794
|
|
|
751
|
-
|
|
752
|
-
.#{$menuPrefixCls} {
|
|
753
|
-
&-zoom-enter,
|
|
754
|
-
&-zoom-appear {
|
|
755
|
-
opacity: 0;
|
|
756
|
-
animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
|
|
757
|
-
animation-play-state: paused;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
&-zoom-leave {
|
|
761
|
-
animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
|
|
762
|
-
animation-play-state: paused;
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
&-zoom-enter#{&}-zoom-enter-active,
|
|
766
|
-
&-zoom-appear#{&}-zoom-appear-active {
|
|
767
|
-
animation-name: rcMenuOpenZoomIn;
|
|
768
|
-
animation-play-state: running;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
&-zoom-leave#{&}-zoom-leave-active {
|
|
772
|
-
animation-name: rcMenuOpenZoomOut;
|
|
773
|
-
animation-play-state: running;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
&-zoom-enter,
|
|
777
|
-
&-zoom-appear,
|
|
778
|
-
&-zoom-leave {
|
|
779
|
-
.#{$menuPrefixCls}-submenu-rtl & {
|
|
780
|
-
transform-origin: top right !important;
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
@keyframes rcMenuOpenZoomIn {
|
|
785
|
-
0% {
|
|
786
|
-
opacity: 0;
|
|
787
|
-
transform: scale(0, 0);
|
|
788
|
-
}
|
|
789
|
-
100% {
|
|
790
|
-
opacity: 1;
|
|
791
|
-
transform: scale(1, 1);
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
@keyframes rcMenuOpenZoomOut {
|
|
796
|
-
0% {
|
|
797
|
-
transform: scale(1, 1);
|
|
798
|
-
}
|
|
799
|
-
100% {
|
|
800
|
-
opacity: 0;
|
|
801
|
-
transform: scale(0, 0);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
}
|
|
@@ -106,7 +106,8 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
106
106
|
const { name, avatar } = user || {}
|
|
107
107
|
|
|
108
108
|
// 初始化展开菜单
|
|
109
|
-
const [openKeys, setOpenKeys] = useState<
|
|
109
|
+
const [openKeys, setOpenKeys] = useState<string[]>(defaultOpenKeys || [])
|
|
110
|
+
const [activeThirdLevelMenu, setActiveThirdLevelMenu] = useState<string | null>(null)
|
|
110
111
|
|
|
111
112
|
//处理搜索菜单后自动展开目录
|
|
112
113
|
const findParentMenu = (menuList: any[], pathname: string) => {
|
|
@@ -150,7 +151,25 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
150
151
|
})
|
|
151
152
|
|
|
152
153
|
const onOpenChange: MenuProps['onOpenChange'] = (keys) => {
|
|
153
|
-
|
|
154
|
+
// Find the last opened key
|
|
155
|
+
const latestOpenKey = keys.find((key) => openKeys.indexOf(key) === -1)
|
|
156
|
+
|
|
157
|
+
if (latestOpenKey) {
|
|
158
|
+
// If opening a new key
|
|
159
|
+
const rootSubmenuKeys = menuList.map((item) => item.key)
|
|
160
|
+
|
|
161
|
+
if (rootSubmenuKeys.indexOf(latestOpenKey) === -1) {
|
|
162
|
+
// If it's a third level menu, only keep its parent menu open
|
|
163
|
+
const parentKey = keys.find((key) => rootSubmenuKeys.includes(key))
|
|
164
|
+
setOpenKeys(parentKey ? [parentKey, latestOpenKey] : [latestOpenKey])
|
|
165
|
+
} else {
|
|
166
|
+
// If it's a second level menu, only keep it open
|
|
167
|
+
setOpenKeys([latestOpenKey])
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
// If closing a menu
|
|
171
|
+
setOpenKeys(keys)
|
|
172
|
+
}
|
|
154
173
|
}
|
|
155
174
|
|
|
156
175
|
const copyTextToClipboard = async (text: string, key: string) => {
|
|
@@ -187,6 +206,13 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
187
206
|
motionLeave: true,
|
|
188
207
|
}
|
|
189
208
|
|
|
209
|
+
useEffect(() => {
|
|
210
|
+
return () => {
|
|
211
|
+
setActiveThirdLevelMenu(null)
|
|
212
|
+
setOpenKeys([])
|
|
213
|
+
}
|
|
214
|
+
}, [])
|
|
215
|
+
|
|
190
216
|
return (
|
|
191
217
|
<Layout className="layout-warps">
|
|
192
218
|
{Array.isArray(menuList) && menuList.length > 0 && (
|
|
@@ -205,6 +231,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
205
231
|
}}
|
|
206
232
|
>
|
|
207
233
|
<div className="layout-side-mask1"></div>
|
|
234
|
+
<div className="layout-side-mask2"></div>
|
|
208
235
|
|
|
209
236
|
<div className="header-logo" style={{ justifyContent: collapsed ? 'center' : '', paddingLeft: collapsed ? '0' : '' }}>
|
|
210
237
|
<div
|
|
@@ -234,6 +261,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
234
261
|
<div
|
|
235
262
|
className="close-trigger"
|
|
236
263
|
onClick={() => {
|
|
264
|
+
localStorage.setItem('layout_collapsed', 'false')
|
|
237
265
|
setCollapsed(false)
|
|
238
266
|
}}
|
|
239
267
|
>
|
|
@@ -344,7 +372,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
344
372
|
zIndex: 99,
|
|
345
373
|
}}
|
|
346
374
|
>
|
|
347
|
-
<div>
|
|
375
|
+
<div className="first-li">
|
|
348
376
|
<span className={`menu-item-icon ${isSelected ? 'submenu-selected' : ''}`}>{item.icon}</span>
|
|
349
377
|
{!collapsed && <span className={classNames}>{item.label}</span>}
|
|
350
378
|
</div>
|
|
@@ -423,7 +451,7 @@ function Arrow({ collapsed, type }: { collapsed?: boolean; type?: string }) {
|
|
|
423
451
|
return (
|
|
424
452
|
<svg style={{ transform: !collapsed ? 'rotate(180deg)' : 'rotate(0deg)' }} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20">
|
|
425
453
|
<path
|
|
426
|
-
fill=
|
|
454
|
+
fill="817F9B"
|
|
427
455
|
d="M564.6336 775.168a41.5744 41.5744 0 0 0-13.312-28.672l-230.4-234.4448 229.9904-234.1888a42.0864 42.0864 0 0 0-26.3168-73.0112 42.0864 42.0864 0 0 0-30.6176 11.264L231.0656 481.024a41.984 41.984 0 0 0-2.4576 59.5968l1.9968 2.048 263.7824 265.6256a41.984 41.984 0 0 0 70.2464-33.0752z m254.5152 0a41.472 41.472 0 0 0-13.312-28.672L575.488 512l229.9904-234.1376a41.984 41.984 0 1 0-56.9344-61.7984L485.632 480.9728a42.0864 42.0864 0 0 0-2.4064 59.6992l0.8704 0.9216 0.8704 0.8192 0.4096 0.4096 263.5776 265.4208a41.984 41.984 0 0 0 70.1952-33.0752z"
|
|
428
456
|
></path>
|
|
429
457
|
</svg>
|