cfel-base-components 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -68,8 +68,8 @@ body {
|
|
|
68
68
|
.app-list {
|
|
69
69
|
.app-list-current {
|
|
70
70
|
font-size: 12px;
|
|
71
|
-
height:
|
|
72
|
-
line-height:
|
|
71
|
+
height: 32px;
|
|
72
|
+
line-height: 32px;
|
|
73
73
|
padding: 0 12px;
|
|
74
74
|
border-radius: 6px;
|
|
75
75
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
@@ -79,6 +79,11 @@ body {
|
|
|
79
79
|
transition: all 0.3s;
|
|
80
80
|
color: rgba(0, 0, 0, 0.88);
|
|
81
81
|
font-weight: 400;
|
|
82
|
+
display: flex;
|
|
83
|
+
img{
|
|
84
|
+
max-width: 32px;
|
|
85
|
+
margin-right: 4px;
|
|
86
|
+
}
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
.app-list-current:hover {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { Layout, Menu, MenuProps, Popover } from 'antd';
|
|
3
3
|
import { SwapOutlined, } from '@ant-design/icons';
|
|
4
4
|
import "./index.scss"
|
|
5
5
|
|
|
6
6
|
export interface LiosLayoutlProps {
|
|
7
|
-
appName
|
|
7
|
+
appName?: string;
|
|
8
8
|
productCode: string;
|
|
9
9
|
children: any;
|
|
10
10
|
menuList: any;
|
|
@@ -25,7 +25,6 @@ export interface LiosLayoutlProps {
|
|
|
25
25
|
|
|
26
26
|
export default function LiosLayout(props: LiosLayoutlProps) {
|
|
27
27
|
const {
|
|
28
|
-
appName,
|
|
29
28
|
productCode,
|
|
30
29
|
menuList,
|
|
31
30
|
onMenuClick,
|
|
@@ -45,6 +44,13 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
45
44
|
role,
|
|
46
45
|
} = user || {}
|
|
47
46
|
const [openKeys, setOpenKeys] = useState<any>(defaultOpenKeys || []);
|
|
47
|
+
const [currentProduct, setCurrentProduct] = useState<any>({});
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if(!productList)return
|
|
51
|
+
let cp = productList?.filter((i: any) => i.productCode == productCode)[0]
|
|
52
|
+
setCurrentProduct(cp)
|
|
53
|
+
}, [productList])
|
|
48
54
|
|
|
49
55
|
const onOpenChange: MenuProps['onOpenChange'] = (keys) => {
|
|
50
56
|
setOpenKeys(keys);
|
|
@@ -122,17 +128,22 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
122
128
|
<div className="interval" />
|
|
123
129
|
<div className="app-list">
|
|
124
130
|
{
|
|
125
|
-
productList ?
|
|
126
|
-
|
|
131
|
+
productList ?
|
|
132
|
+
<Popover placement="bottom" content={<ProductListFunc />} arrow={false} trigger="click">
|
|
133
|
+
<div className="app-list-current">
|
|
134
|
+
{currentProduct?.logoUrl && <img src={currentProduct?.logoUrl || ""} alt="" />}
|
|
135
|
+
<div>
|
|
136
|
+
{currentProduct?.productName || "请选择应用"}
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</Popover> :
|
|
127
140
|
<div className="app-list-current">
|
|
128
|
-
{
|
|
141
|
+
{currentProduct?.logoUrl && <img src={currentProduct?.logoUrl || ""} alt="" />}
|
|
142
|
+
<div>
|
|
143
|
+
{currentProduct?.productName}
|
|
144
|
+
</div>
|
|
129
145
|
</div>
|
|
130
|
-
</Popover> :
|
|
131
|
-
<div className="app-list-current">
|
|
132
|
-
{appName}
|
|
133
|
-
</div>
|
|
134
146
|
}
|
|
135
|
-
|
|
136
147
|
</div>
|
|
137
148
|
</strong>
|
|
138
149
|
<div className='lios-header-fill' />
|