style: common component style

This commit is contained in:
jialin
2024-05-27 19:29:03 +08:00
parent 7ff9b44644
commit 3120f5ee3a
26 changed files with 736 additions and 166 deletions
-21
View File
@@ -1,21 +0,0 @@
import { PageContainer } from '@ant-design/pro-components';
import { Access, useAccess } from '@umijs/max';
import { Button } from 'antd';
const Dashboard: React.FC = () => {
const access = useAccess();
return (
<PageContainer
ghost
header={{
title: 'Dashboard',
}}
>
<Access accessible={access.canSeeAdmin}>
<Button type="primary">==================</Button>
</Access>
</PageContainer>
);
};
export default Dashboard;
+17 -9
View File
@@ -93,17 +93,25 @@ export default (props: any) => {
const formatMessage = undefined;
const runtimeConfig = pluginManager.applyPlugins({
key: 'layout',
type: 'modify',
logout: true,
initialValue: {
...initialInfo,
notFound: <div>not found</div>
}
});
// const runtimeConfig = pluginManager.applyPlugins({
// key: 'layout',
// type: 'modify',
// logout: true,
// initialValue: {
// ...initialInfo,
// notFound: <div>not found</div>
// }
// });
const runtimeConfig = {
...initialInfo,
logout: () => {
console.log('logout');
},
notFound: <div>not found</div>
};
console.log(
'clientRoute==========2=',
props,
clientRoutes,
runtimeConfig,
initialInfo
+25 -8
View File
@@ -1,6 +1,5 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import avatarImg from '@/assets/images/avatar.png';
import { LogoutOutlined } from '@ant-design/icons';
import { Avatar, Dropdown, Menu, Spin, version } from 'antd';
@@ -11,6 +10,7 @@ export function getRightRenderContent(opts: {
initialState: any;
setInitialState: any;
}) {
console.log('runtimeConfig==', opts.runtimeConfig, opts);
if (opts.runtimeConfig.rightRender) {
return opts.runtimeConfig.rightRender(
opts.initialState,
@@ -67,6 +67,20 @@ export function getRightRenderContent(opts: {
onClick: () => {
opts?.runtimeConfig?.logout?.(opts.initialState);
}
},
{
key: 'theme',
label: <></>,
onClick: () => {
console.log('theme');
}
},
{
key: 'lang',
label: '语言',
onClick: () => {
console.log('lang');
}
}
]
};
@@ -96,12 +110,15 @@ export function getRightRenderContent(opts: {
return (
<div className="umi-plugin-layout-right anticon">
{opts.runtimeConfig.logout ? (
<Dropdown
{...dropdownProps}
overlayClassName="umi-plugin-layout-container"
>
{avatar}
</Dropdown>
<>
<Dropdown
{...dropdownProps}
overlayClassName="umi-plugin-layout-container"
>
{avatar}
</Dropdown>
<span></span>
</>
) : (
avatar
)}