cfel-base-components 2.5.53 → 2.5.55

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.
@@ -1,162 +0,0 @@
1
- import React from "react";
2
- import {
3
- SwapOutlined,
4
- FormOutlined,
5
- CopyOutlined,
6
- LogoutOutlined,
7
- } from "@ant-design/icons";
8
- import "./index.scss";
9
-
10
- interface UserType {
11
- name: string;
12
- avatar: string;
13
- roleInfo: any[];
14
- id: string;
15
- account: string;
16
- isMaster: boolean;
17
- }
18
- interface CustomType {
19
- type: string;
20
- isCompleted: number;
21
- isAudited: number;
22
- hrefUrl: string;
23
- historyAction?: any;
24
- }
25
- interface MyWalletInfoType {
26
- availableCashAmount: string;
27
- availableAmount: string;
28
- currency: string;
29
- }
30
- interface MyLoginInfoType {
31
- isAdmin: any;
32
- }
33
- interface AmountInfoType {
34
- residueNum: string;
35
- currencyCode: string;
36
- }
37
-
38
- const renderCurrency = (currency: string) => {
39
- switch (currency) {
40
- case "CNY":
41
- return "¥ ";
42
- case "USD":
43
- return "$ ";
44
- case "JPY":
45
- return "JP¥ ";
46
- default:
47
- return "¥ ";
48
- }
49
- };
50
-
51
- export default function UserCard({
52
- myWalletInfo,
53
- MyLoginInfo,
54
- amountInfo,
55
- customAction,
56
- isCopied,
57
- copyTextToClipboard,
58
- }: any) {
59
- const { user, tenant, custom, switchTenantUrl, logoutUrl } = (window as any)
60
- ?.g_config;
61
-
62
- const { name, avatar, roleInfo, id, account, isMaster }: UserType =
63
- user || {};
64
-
65
- const { isCompleted, isAudited }: CustomType = custom || {};
66
-
67
- const { isAdmin }: MyLoginInfoType = MyLoginInfo || {};
68
-
69
- const { residueNum, currencyCode }: AmountInfoType = amountInfo || {};
70
-
71
- const UserCard = () => {
72
- return (
73
- <div className="layout-user-card">
74
- <div className="user-info">
75
- <div className="user-avatarBox">
76
- <img className="user-avatar" src={avatar}/>
77
- <div className="user-mater">{isAdmin ? "主账号" : "子账号"}</div>
78
- </div>
79
- <div className="user-info-right">
80
- <span className="name">{name}</span>
81
- <div className="role-list">
82
- {roleInfo?.map((i) => (
83
- <span className="role-item" key={i}>
84
- {i}
85
- </span>
86
- ))}
87
- </div>
88
- </div>
89
- </div>
90
- <div className="lios-userInfo">
91
- <div className="lios-li li-flex">
92
- <div className="lios-keyMare">账号ID</div>
93
- <div className="lios-valueMare" title={id}>{id}</div>
94
- <div
95
- className={isCopied?.['id'] ? "lios-iconDone" : "lios-icon"}
96
- onClick={() => {
97
- copyTextToClipboard(id, 'id');
98
- }}
99
- >
100
- {isCopied?.['id'] ? "已复制" : <CopyOutlined/>}
101
- </div>
102
- </div>
103
- <div className="lios-li li-flex">
104
- <div className="lios-keyMare">账号</div>
105
- <div className="lios-valueMare" title={account}>
106
- {account}
107
- </div>
108
- <div
109
- className={isCopied?.['account'] ? "lios-iconDone" : "lios-icon"}
110
- onClick={() => {
111
- copyTextToClipboard(account, 'account');
112
- }}
113
- >
114
- {isCopied?.['account'] ? "已复制" : <CopyOutlined/>}
115
- </div>
116
- </div>
117
-
118
- <div className="lios-li li-flex">
119
- <div className="lios-keyMare">租户ID</div>
120
- <div className="lios-valueMare" title={tenant?.id}>{tenant?.id}</div>
121
- <div
122
- className={isCopied?.['tenantId'] ? "lios-iconDone" : "lios-icon"}
123
- onClick={() => {
124
- copyTextToClipboard(tenant?.id, 'tenantId');
125
- }}
126
- >
127
- {isCopied?.['tenantId'] ? "已复制" : <CopyOutlined/>}
128
- </div>
129
- </div>
130
- <div className="lios-li li-flex">
131
- <div className="lios-keyMare">租户</div>
132
- <div className="lios-valueMare" title={tenant?.name}>{tenant?.name}</div>
133
- </div>
134
- </div>
135
-
136
-
137
- <div className="lios-logoutBox">
138
- <div
139
- className="lios-logout"
140
- onClick={() => {
141
- location.href = switchTenantUrl;
142
- }}
143
- >
144
- <SwapOutlined className="logout-icon"/>
145
- 切换租户
146
- </div>
147
- <div
148
- className="lios-logout"
149
- onClick={() => {
150
- location.href = logoutUrl;
151
- }}
152
- >
153
- <LogoutOutlined className="logout-icon"/>
154
- 退出登录
155
- </div>
156
- </div>
157
- </div>
158
- );
159
- };
160
-
161
- return UserCard();
162
- }