cfel-base-components 2.0.6 → 2.0.8
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
CHANGED
|
@@ -2,6 +2,7 @@ import React from "react"
|
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import style from './index.module.less';
|
|
4
4
|
import { SwapOutlined, } from '@ant-design/icons';
|
|
5
|
+
import { history } from 'umi';
|
|
5
6
|
|
|
6
7
|
import './index.scss';
|
|
7
8
|
import PageContainer from '../../src/components/base-component/PageContainer';
|
|
@@ -41,7 +42,8 @@ const App = () => {
|
|
|
41
42
|
type:(window)?.g_config?.custom?.type,
|
|
42
43
|
isCompleted:(window)?.g_config?.custom?.isCompleted,
|
|
43
44
|
isAudited:(window)?.g_config?.custom?.isAudited,
|
|
44
|
-
hrefUrl='/web/user-info'
|
|
45
|
+
hrefUrl='/web/user-info',
|
|
46
|
+
historyAction:history
|
|
45
47
|
}}
|
|
46
48
|
logoutUrl={(window)?.g_config?.logoutUrl}
|
|
47
49
|
switchTenantUrl={(window)?.g_config?.switchTenantUrl}
|
package/package.json
CHANGED
|
@@ -222,8 +222,9 @@ body {
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
.lios-tenant {
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
padding: 5px 0px;
|
|
226
|
+
margin: 5px 0px;
|
|
227
|
+
border-top: 1px solid rgba(5, 5, 5, 0.06);
|
|
227
228
|
.tenant-label {
|
|
228
229
|
font-size: 12px;
|
|
229
230
|
color: rgba(0, 0, 0, .5);
|
|
@@ -252,8 +253,8 @@ body {
|
|
|
252
253
|
|
|
253
254
|
}
|
|
254
255
|
.lios-userInfo{
|
|
255
|
-
padding:
|
|
256
|
-
margin:
|
|
256
|
+
padding: 5px 0px;
|
|
257
|
+
margin: 5px 0px;
|
|
257
258
|
border-top: 1px solid rgba(5, 5, 5, 0.06);
|
|
258
259
|
border-bottom: 1px solid rgba(5, 5, 5, 0.06);
|
|
259
260
|
.li-flex{
|
|
@@ -263,6 +264,7 @@ body {
|
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
266
|
.lios-li{
|
|
267
|
+
line-height: 22px;
|
|
266
268
|
.lios-key{
|
|
267
269
|
font-size: 12px;
|
|
268
270
|
color: rgba(0, 0, 0, .5);
|
|
@@ -273,6 +275,9 @@ body {
|
|
|
273
275
|
display: inline-block;
|
|
274
276
|
font-size: 12px;
|
|
275
277
|
color: rgba(0, 0, 0, .85);
|
|
278
|
+
span{
|
|
279
|
+
padding-left: 5px;
|
|
280
|
+
}
|
|
276
281
|
}
|
|
277
282
|
.lios-icon{
|
|
278
283
|
width: 40px;
|
|
@@ -21,7 +21,13 @@ export interface LiosLayoutlProps {
|
|
|
21
21
|
type: string,
|
|
22
22
|
isCompleted: number,
|
|
23
23
|
isAudited: number,
|
|
24
|
-
hrefUrl:string
|
|
24
|
+
hrefUrl:string,
|
|
25
|
+
historyAction?: any;
|
|
26
|
+
}
|
|
27
|
+
myWalletInfo?:{
|
|
28
|
+
availableCashAmount:string,
|
|
29
|
+
availableAmount:string,
|
|
30
|
+
currency:string
|
|
25
31
|
}
|
|
26
32
|
logoutUrl?: string,
|
|
27
33
|
switchTenantUrl?: string,
|
|
@@ -46,7 +52,8 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
46
52
|
switchTenantUrl,
|
|
47
53
|
defaultOpenKeys,
|
|
48
54
|
productList,
|
|
49
|
-
logoData
|
|
55
|
+
logoData,
|
|
56
|
+
myWalletInfo
|
|
50
57
|
} = props
|
|
51
58
|
|
|
52
59
|
const {
|
|
@@ -58,15 +65,26 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
58
65
|
const {
|
|
59
66
|
isCompleted,
|
|
60
67
|
isAudited,
|
|
61
|
-
hrefUrl
|
|
68
|
+
hrefUrl,
|
|
69
|
+
historyAction
|
|
62
70
|
} = custom || {}
|
|
71
|
+
const {
|
|
72
|
+
availableCashAmount,
|
|
73
|
+
availableAmount,
|
|
74
|
+
currency
|
|
75
|
+
} = myWalletInfo || {}
|
|
63
76
|
const [openKeys, setOpenKeys] = useState<any>(defaultOpenKeys || []);
|
|
64
77
|
const [currentProduct, setCurrentProduct] = useState<any>({});
|
|
65
78
|
|
|
66
79
|
const { Sider } = Layout;
|
|
67
80
|
|
|
68
81
|
const [collapsed, setCollapsed] = useState(false);
|
|
69
|
-
|
|
82
|
+
const [currencyList, setCurrencyList] = useState([
|
|
83
|
+
{ value: 'JPY', label: '日元' },
|
|
84
|
+
{ value: 'SAR', label: '沙特币' },
|
|
85
|
+
{ value: 'USD', label: '美元' },
|
|
86
|
+
{ value: 'CNY', label: '人民币' }
|
|
87
|
+
])
|
|
70
88
|
useEffect(() => {
|
|
71
89
|
if (!productList) return
|
|
72
90
|
let cp = productList?.filter((i: any) => i.productCode == productCode)[0]
|
|
@@ -78,7 +96,24 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
78
96
|
};
|
|
79
97
|
const editUserInfo = () => {
|
|
80
98
|
const { origin } = window.location
|
|
81
|
-
|
|
99
|
+
if(historyAction){
|
|
100
|
+
historyAction?.push({
|
|
101
|
+
pathname: hrefUrl
|
|
102
|
+
});
|
|
103
|
+
}else{
|
|
104
|
+
window.location.href = origin + hrefUrl
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
const currencyText = (currencyText:string)=>{
|
|
109
|
+
let text = ''
|
|
110
|
+
currencyList.some((item:any)=>{
|
|
111
|
+
if(item.value == currencyText){
|
|
112
|
+
text = item.label
|
|
113
|
+
return true
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
return text
|
|
82
117
|
}
|
|
83
118
|
const UserCard = () => {
|
|
84
119
|
return <div className='lios-user-card'>
|
|
@@ -97,7 +132,21 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
97
132
|
</div>
|
|
98
133
|
</div>
|
|
99
134
|
</div>
|
|
100
|
-
|
|
135
|
+
|
|
136
|
+
{
|
|
137
|
+
myWalletInfo && <div className='lios-userInfo'>
|
|
138
|
+
<div className='lios-li'>
|
|
139
|
+
<div className='lios-key'>现金余额</div>
|
|
140
|
+
<div className='lios-value'>{availableCashAmount || '加载中...'}
|
|
141
|
+
<span>{currencyText(currency)}</span></div>
|
|
142
|
+
</div>
|
|
143
|
+
<div className='lios-li'>
|
|
144
|
+
<div className='lios-key'>可用额度</div>
|
|
145
|
+
<div className='lios-value'>{availableAmount || '加载中...'}
|
|
146
|
+
<span>{currencyText(currency)}</span></div>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
}
|
|
101
150
|
{
|
|
102
151
|
custom && <div className='lios-userInfo'>
|
|
103
152
|
<div className='lios-li li-flex'>
|