cfel-base-components 2.5.0 → 2.5.2
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
|
@@ -12,6 +12,7 @@ export interface LiosLayoutlProps {
|
|
|
12
12
|
menuList: any;
|
|
13
13
|
onMenuClick: (item: any) => void;
|
|
14
14
|
selectedKeys: string[];
|
|
15
|
+
customAction: (item: any) => void;
|
|
15
16
|
actions?: any[];
|
|
16
17
|
myWalletInfo?: {
|
|
17
18
|
availableCashAmount: string;
|
|
@@ -36,6 +37,8 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
36
37
|
menuList,
|
|
37
38
|
onMenuClick,
|
|
38
39
|
selectedKeys,
|
|
40
|
+
|
|
41
|
+
customAction,
|
|
39
42
|
actions,
|
|
40
43
|
|
|
41
44
|
defaultOpenKeys,
|
|
@@ -64,14 +67,14 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
64
67
|
<Sider
|
|
65
68
|
className="layout-side"
|
|
66
69
|
style={{
|
|
67
|
-
backgroundSize: collapsed ? "
|
|
70
|
+
backgroundSize: collapsed ? "1800%" : "900%",
|
|
68
71
|
}}
|
|
69
72
|
collapsible
|
|
70
73
|
collapsed={collapsed}
|
|
71
74
|
width={240}
|
|
72
|
-
onCollapse={(value) =>{
|
|
75
|
+
onCollapse={(value) => {
|
|
73
76
|
localStorage.setItem("layout_collapsed", value.toString());
|
|
74
|
-
setCollapsed(value)
|
|
77
|
+
setCollapsed(value);
|
|
75
78
|
}}
|
|
76
79
|
>
|
|
77
80
|
<div className="layout-logo">
|
|
@@ -136,7 +139,11 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
136
139
|
<Popover
|
|
137
140
|
placement="bottom"
|
|
138
141
|
content={
|
|
139
|
-
<UserCard
|
|
142
|
+
<UserCard
|
|
143
|
+
myWalletInfo={myWalletInfo}
|
|
144
|
+
amountInfo={amountInfo}
|
|
145
|
+
customAction={customAction}
|
|
146
|
+
/>
|
|
140
147
|
}
|
|
141
148
|
arrow={false}
|
|
142
149
|
trigger="click"
|
|
@@ -5,8 +5,7 @@ import "./index.scss";
|
|
|
5
5
|
interface UserType {
|
|
6
6
|
name: string;
|
|
7
7
|
avatar: string;
|
|
8
|
-
|
|
9
|
-
role: any[];
|
|
8
|
+
roleInfo: any[];
|
|
10
9
|
}
|
|
11
10
|
interface CustomType {
|
|
12
11
|
type: string;
|
|
@@ -39,30 +38,22 @@ const renderCurrency = (currency: string) => {
|
|
|
39
38
|
}
|
|
40
39
|
};
|
|
41
40
|
|
|
42
|
-
export default function UserCard({
|
|
43
|
-
|
|
41
|
+
export default function UserCard({
|
|
42
|
+
myWalletInfo,
|
|
43
|
+
amountInfo,
|
|
44
|
+
customAction,
|
|
45
|
+
}: any) {
|
|
46
|
+
const { user, tenant, custom, switchTenantUrl, logoutUrl } = (window as any)
|
|
44
47
|
?.g_config;
|
|
45
48
|
|
|
46
|
-
const { name, avatar,
|
|
47
|
-
|
|
48
|
-
const { isCompleted, isAudited
|
|
49
|
-
custom || {};
|
|
49
|
+
const { name, avatar, roleInfo }: UserType = user || {};
|
|
50
|
+
|
|
51
|
+
const { isCompleted, isAudited }: CustomType = custom || {};
|
|
50
52
|
|
|
51
53
|
const { availableCashAmount, availableAmount, currency }: MyWalletInfoType =
|
|
52
54
|
myWalletInfo || {};
|
|
53
55
|
const { residueNum, currencyCode }: AmountInfoType = amountInfo || {};
|
|
54
56
|
|
|
55
|
-
const editUserInfo = () => {
|
|
56
|
-
const { origin } = window.location;
|
|
57
|
-
if (historyAction) {
|
|
58
|
-
historyAction?.push({
|
|
59
|
-
pathname: hrefUrl,
|
|
60
|
-
});
|
|
61
|
-
} else {
|
|
62
|
-
window.location.href = origin + hrefUrl;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
57
|
const UserCard = () => {
|
|
67
58
|
return (
|
|
68
59
|
<div className="layout-user-card">
|
|
@@ -71,7 +62,7 @@ export default function UserCard({ myWalletInfo, amountInfo }) {
|
|
|
71
62
|
<div className="user-info-right">
|
|
72
63
|
<span className="name">{name}</span>
|
|
73
64
|
<div className="role-list">
|
|
74
|
-
{
|
|
65
|
+
{roleInfo?.map((i) => (
|
|
75
66
|
<span className="role-item" key={i}>
|
|
76
67
|
{i}
|
|
77
68
|
</span>
|
|
@@ -116,7 +107,7 @@ export default function UserCard({ myWalletInfo, amountInfo }) {
|
|
|
116
107
|
<div
|
|
117
108
|
className="lios-icon"
|
|
118
109
|
onClick={() => {
|
|
119
|
-
|
|
110
|
+
customAction && customAction();
|
|
120
111
|
}}
|
|
121
112
|
>
|
|
122
113
|
<FormOutlined />
|
|
@@ -133,11 +124,11 @@ export default function UserCard({ myWalletInfo, amountInfo }) {
|
|
|
133
124
|
</div>
|
|
134
125
|
)}
|
|
135
126
|
|
|
136
|
-
{
|
|
127
|
+
{tenant?.name && (
|
|
137
128
|
<div className="lios-tenant">
|
|
138
129
|
<div className="tenant-label">租户</div>
|
|
139
130
|
<div className="tenant-switch">
|
|
140
|
-
<div className="tenant-value">{
|
|
131
|
+
<div className="tenant-value">{tenant?.name}</div>
|
|
141
132
|
{switchTenantUrl && (
|
|
142
133
|
<div
|
|
143
134
|
className="tenant-icon"
|