cfel-base-components 2.0.10 → 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,15 +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
|
+
myWalletInfoAction?: Function,
|
|
33
33
|
logoutUrl?: string,
|
|
34
34
|
switchTenantUrl?: string,
|
|
35
35
|
defaultOpenKeys?: string[],
|
|
@@ -37,7 +37,8 @@ export interface LiosLayoutlProps {
|
|
|
37
37
|
logoData?: {
|
|
38
38
|
type: string,
|
|
39
39
|
content: string
|
|
40
|
-
}
|
|
40
|
+
},
|
|
41
|
+
isHideHeader?:boolean //是否隐藏header
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
export default function LiosLayout(props: LiosLayoutlProps) {
|
|
@@ -55,7 +56,8 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
55
56
|
productList,
|
|
56
57
|
logoData,
|
|
57
58
|
myWalletInfo,
|
|
58
|
-
myWalletInfoAction
|
|
59
|
+
myWalletInfoAction,
|
|
60
|
+
isHideHeader
|
|
59
61
|
} = props
|
|
60
62
|
|
|
61
63
|
const {
|
|
@@ -82,9 +84,9 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
82
84
|
|
|
83
85
|
const [collapsed, setCollapsed] = useState(false);
|
|
84
86
|
const [currencyList, setCurrencyList] = useState([
|
|
85
|
-
{ value: 'JPY', label: '日元'
|
|
86
|
-
{ value: 'USD', label: '美元',icon:"$" },
|
|
87
|
-
{ value: 'CNY', label: '人民币'
|
|
87
|
+
{ value: 'JPY', label: '日元', icon: '¥' },
|
|
88
|
+
{ value: 'USD', label: '美元', icon: "$" },
|
|
89
|
+
{ value: 'CNY', label: '人民币', icon: '¥' }
|
|
88
90
|
])
|
|
89
91
|
useEffect(() => {
|
|
90
92
|
if (!productList) return
|
|
@@ -97,20 +99,20 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
97
99
|
};
|
|
98
100
|
const editUserInfo = () => {
|
|
99
101
|
const { origin } = window.location
|
|
100
|
-
if(historyAction){
|
|
102
|
+
if (historyAction) {
|
|
101
103
|
historyAction?.push({
|
|
102
104
|
pathname: hrefUrl
|
|
103
105
|
});
|
|
104
|
-
}else{
|
|
105
|
-
window.location.href = origin +
|
|
106
|
+
} else {
|
|
107
|
+
window.location.href = origin + hrefUrl
|
|
106
108
|
}
|
|
107
|
-
|
|
109
|
+
|
|
108
110
|
}
|
|
109
|
-
const currencyText = (currencyText:string)=>{
|
|
111
|
+
const currencyText = (currencyText: string) => {
|
|
110
112
|
let text = ''
|
|
111
|
-
currencyList.some((item:any)=>{
|
|
112
|
-
if(item.value == currencyText){
|
|
113
|
-
text =
|
|
113
|
+
currencyList.some((item: any) => {
|
|
114
|
+
if (item.value == currencyText) {
|
|
115
|
+
text = item.icon
|
|
114
116
|
return true
|
|
115
117
|
}
|
|
116
118
|
})
|
|
@@ -133,20 +135,20 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
133
135
|
</div>
|
|
134
136
|
</div>
|
|
135
137
|
</div>
|
|
136
|
-
|
|
138
|
+
|
|
137
139
|
{
|
|
138
140
|
myWalletInfo && <div className='lios-userInfo'>
|
|
139
141
|
<div className='lios-li'>
|
|
140
142
|
<div className='lios-key'>现金余额</div>
|
|
141
143
|
<div className='lios-value'>
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
<span>{currencyText(currency)}</span>
|
|
145
|
+
{availableCashAmount || '加载中...'}
|
|
144
146
|
</div>
|
|
145
147
|
</div>
|
|
146
148
|
<div className='lios-li'>
|
|
147
149
|
<div className='lios-key'>可用额度</div>
|
|
148
150
|
<div className='lios-value'><span>{currencyText(currency)}</span>
|
|
149
|
-
|
|
151
|
+
{availableAmount || '加载中...'}
|
|
150
152
|
</div>
|
|
151
153
|
</div>
|
|
152
154
|
</div>
|
|
@@ -215,6 +217,8 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
215
217
|
}
|
|
216
218
|
return (
|
|
217
219
|
<Layout className="layoutWarp">
|
|
220
|
+
{
|
|
221
|
+
!isHideHeader &&
|
|
218
222
|
<div className="lios-header">
|
|
219
223
|
|
|
220
224
|
<div className="background">
|
|
@@ -263,10 +267,10 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
263
267
|
</div>
|
|
264
268
|
|
|
265
269
|
<Popover placement="bottom" content={<UserCard />} arrow={false} trigger="click"
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
+
onOpenChange={((e) => {
|
|
271
|
+
if (!e) return
|
|
272
|
+
myWalletInfoAction()
|
|
273
|
+
})}>
|
|
270
274
|
<div className="lios-header-user">
|
|
271
275
|
<img
|
|
272
276
|
className="author"
|
|
@@ -278,27 +282,30 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
278
282
|
</div>
|
|
279
283
|
</Popover>
|
|
280
284
|
</div>
|
|
281
|
-
|
|
285
|
+
}
|
|
282
286
|
<div className="lios-main">
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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
|
+
}
|
|
302
309
|
<div className="lios-content">
|
|
303
310
|
{props.children}
|
|
304
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} //修改弹框显隐事件
|