cfel-base-components 2.0.9 → 2.0.11
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,7 +2,6 @@ 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';
|
|
6
5
|
|
|
7
6
|
import './index.scss';
|
|
8
7
|
import PageContainer from '../../src/components/base-component/PageContainer';
|
|
@@ -42,7 +41,7 @@ const App = () => {
|
|
|
42
41
|
type:(window)?.g_config?.custom?.type,
|
|
43
42
|
isCompleted:(window)?.g_config?.custom?.isCompleted,
|
|
44
43
|
isAudited:(window)?.g_config?.custom?.isAudited,
|
|
45
|
-
hrefUrl
|
|
44
|
+
hrefUrl:'/web/user-info',
|
|
46
45
|
historyAction:history
|
|
47
46
|
}}
|
|
48
47
|
logoutUrl={(window)?.g_config?.logoutUrl}
|
package/package.json
CHANGED
|
@@ -21,14 +21,15 @@ export interface LiosLayoutlProps {
|
|
|
21
21
|
type: string,
|
|
22
22
|
isCompleted: number,
|
|
23
23
|
isAudited: number,
|
|
24
|
-
hrefUrl:string,
|
|
24
|
+
hrefUrl: string,
|
|
25
25
|
historyAction?: any;
|
|
26
26
|
}
|
|
27
|
-
myWalletInfo?:{
|
|
28
|
-
availableCashAmount:string,
|
|
29
|
-
availableAmount:string,
|
|
30
|
-
currency:string
|
|
27
|
+
myWalletInfo?: {
|
|
28
|
+
availableCashAmount: string,
|
|
29
|
+
availableAmount: string,
|
|
30
|
+
currency: string
|
|
31
31
|
}
|
|
32
|
+
myWalletInfoAction?: Function,
|
|
32
33
|
logoutUrl?: string,
|
|
33
34
|
switchTenantUrl?: string,
|
|
34
35
|
defaultOpenKeys?: string[],
|
|
@@ -36,7 +37,8 @@ export interface LiosLayoutlProps {
|
|
|
36
37
|
logoData?: {
|
|
37
38
|
type: string,
|
|
38
39
|
content: string
|
|
39
|
-
}
|
|
40
|
+
},
|
|
41
|
+
isHideHeader?:boolean //是否隐藏header
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
export default function LiosLayout(props: LiosLayoutlProps) {
|
|
@@ -53,7 +55,9 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
53
55
|
defaultOpenKeys,
|
|
54
56
|
productList,
|
|
55
57
|
logoData,
|
|
56
|
-
myWalletInfo
|
|
58
|
+
myWalletInfo,
|
|
59
|
+
myWalletInfoAction,
|
|
60
|
+
isHideHeader
|
|
57
61
|
} = props
|
|
58
62
|
|
|
59
63
|
const {
|
|
@@ -80,10 +84,9 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
80
84
|
|
|
81
85
|
const [collapsed, setCollapsed] = useState(false);
|
|
82
86
|
const [currencyList, setCurrencyList] = useState([
|
|
83
|
-
{ value: 'JPY', label: '日元' },
|
|
84
|
-
{ value: '
|
|
85
|
-
{ value: '
|
|
86
|
-
{ value: 'CNY', label: '人民币' }
|
|
87
|
+
{ value: 'JPY', label: '日元', icon: '¥' },
|
|
88
|
+
{ value: 'USD', label: '美元', icon: "$" },
|
|
89
|
+
{ value: 'CNY', label: '人民币', icon: '¥' }
|
|
87
90
|
])
|
|
88
91
|
useEffect(() => {
|
|
89
92
|
if (!productList) return
|
|
@@ -96,20 +99,20 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
96
99
|
};
|
|
97
100
|
const editUserInfo = () => {
|
|
98
101
|
const { origin } = window.location
|
|
99
|
-
if(historyAction){
|
|
102
|
+
if (historyAction) {
|
|
100
103
|
historyAction?.push({
|
|
101
104
|
pathname: hrefUrl
|
|
102
105
|
});
|
|
103
|
-
}else{
|
|
104
|
-
window.location.href = origin +
|
|
106
|
+
} else {
|
|
107
|
+
window.location.href = origin + hrefUrl
|
|
105
108
|
}
|
|
106
|
-
|
|
109
|
+
|
|
107
110
|
}
|
|
108
|
-
const currencyText = (currencyText:string)=>{
|
|
111
|
+
const currencyText = (currencyText: string) => {
|
|
109
112
|
let text = ''
|
|
110
|
-
currencyList.some((item:any)=>{
|
|
111
|
-
if(item.value == currencyText){
|
|
112
|
-
text =
|
|
113
|
+
currencyList.some((item: any) => {
|
|
114
|
+
if (item.value == currencyText) {
|
|
115
|
+
text = item.icon
|
|
113
116
|
return true
|
|
114
117
|
}
|
|
115
118
|
})
|
|
@@ -132,18 +135,21 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
132
135
|
</div>
|
|
133
136
|
</div>
|
|
134
137
|
</div>
|
|
135
|
-
|
|
138
|
+
|
|
136
139
|
{
|
|
137
140
|
myWalletInfo && <div className='lios-userInfo'>
|
|
138
141
|
<div className='lios-li'>
|
|
139
142
|
<div className='lios-key'>现金余额</div>
|
|
140
|
-
<div className='lios-value'>
|
|
141
|
-
|
|
143
|
+
<div className='lios-value'>
|
|
144
|
+
<span>{currencyText(currency)}</span>
|
|
145
|
+
{availableCashAmount || '加载中...'}
|
|
146
|
+
</div>
|
|
142
147
|
</div>
|
|
143
148
|
<div className='lios-li'>
|
|
144
149
|
<div className='lios-key'>可用额度</div>
|
|
145
|
-
<div className='lios-value'>{
|
|
146
|
-
|
|
150
|
+
<div className='lios-value'><span>{currencyText(currency)}</span>
|
|
151
|
+
{availableAmount || '加载中...'}
|
|
152
|
+
</div>
|
|
147
153
|
</div>
|
|
148
154
|
</div>
|
|
149
155
|
}
|
|
@@ -211,6 +217,8 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
211
217
|
}
|
|
212
218
|
return (
|
|
213
219
|
<Layout className="layoutWarp">
|
|
220
|
+
{
|
|
221
|
+
!isHideHeader &&
|
|
214
222
|
<div className="lios-header">
|
|
215
223
|
|
|
216
224
|
<div className="background">
|
|
@@ -258,7 +266,11 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
258
266
|
})}
|
|
259
267
|
</div>
|
|
260
268
|
|
|
261
|
-
<Popover placement="bottom" content={<UserCard />} arrow={false} trigger="click"
|
|
269
|
+
<Popover placement="bottom" content={<UserCard />} arrow={false} trigger="click"
|
|
270
|
+
onOpenChange={((e) => {
|
|
271
|
+
if (!e) return
|
|
272
|
+
myWalletInfoAction()
|
|
273
|
+
})}>
|
|
262
274
|
<div className="lios-header-user">
|
|
263
275
|
<img
|
|
264
276
|
className="author"
|
|
@@ -270,27 +282,30 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
270
282
|
</div>
|
|
271
283
|
</Popover>
|
|
272
284
|
</div>
|
|
273
|
-
|
|
285
|
+
}
|
|
274
286
|
<div className="lios-main">
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
287
|
+
{
|
|
288
|
+
menuList &&
|
|
289
|
+
<Sider
|
|
290
|
+
className="lios-side"
|
|
291
|
+
theme={"light"}
|
|
292
|
+
collapsible
|
|
293
|
+
collapsed={collapsed}
|
|
294
|
+
width={collapsed ? 60 : 256}
|
|
295
|
+
onCollapse={(value) => setCollapsed(value)}>
|
|
296
|
+
<Menu
|
|
297
|
+
mode="inline"
|
|
298
|
+
openKeys={openKeys}
|
|
299
|
+
onOpenChange={onOpenChange}
|
|
300
|
+
items={menuList}
|
|
301
|
+
style={MenuStyle}
|
|
302
|
+
onClick={(item): any => {
|
|
303
|
+
onMenuClick && onMenuClick(item)
|
|
304
|
+
}}
|
|
305
|
+
selectedKeys={selectedKeys}
|
|
306
|
+
/>
|
|
307
|
+
</Sider>
|
|
308
|
+
}
|
|
294
309
|
<div className="lios-content">
|
|
295
310
|
{props.children}
|
|
296
311
|
</div>
|
|
@@ -226,7 +226,14 @@ export default function RoleInfo() {
|
|
|
226
226
|
}}
|
|
227
227
|
/>
|
|
228
228
|
|
|
229
|
-
<Pagination {...pagination}
|
|
229
|
+
<Pagination {...pagination}
|
|
230
|
+
onChange={(innerPageNo: number, innerPageSize: number) => {
|
|
231
|
+
execute({
|
|
232
|
+
innerPageNo,
|
|
233
|
+
innerPageSize,
|
|
234
|
+
"roleCode": roleCode
|
|
235
|
+
})
|
|
236
|
+
}}/>
|
|
230
237
|
<EditAccountDrawer
|
|
231
238
|
open={editAccountOpen} // 状态
|
|
232
239
|
editOpenStatus={setEditAccountOpen} //修改弹框显隐事件
|