feat(leftConfig)footerConfig && menuStyle
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
|||||||
Control,
|
Control,
|
||||||
} from 'dooringx-lib';
|
} from 'dooringx-lib';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { InsertRowBelowOutlined } from '@ant-design/icons';
|
import { InsertRowBelowOutlined, CalendarOutlined } from '@ant-design/icons';
|
||||||
import { useContext } from 'react';
|
import { useContext } from 'react';
|
||||||
import { configContext } from '@/layouts';
|
import { configContext } from '@/layouts';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
@@ -25,8 +25,8 @@ export const HeaderHeight = '40px';
|
|||||||
const footerConfig = function () {
|
const footerConfig = function () {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Popover content={'快捷键'} title={null} trigger="hover">
|
<Popover content={'日历'} title={null} trigger="hover">
|
||||||
<Button type="text" icon={<InsertRowBelowOutlined />}></Button>
|
<Button type="text" icon={<CalendarOutlined />}></Button>
|
||||||
</Popover>
|
</Popover>
|
||||||
<Popover content={'快捷键'} title={null} trigger="hover">
|
<Popover content={'快捷键'} title={null} trigger="hover">
|
||||||
<Button type="text" icon={<InsertRowBelowOutlined />}></Button>
|
<Button type="text" icon={<InsertRowBelowOutlined />}></Button>
|
||||||
@@ -74,7 +74,7 @@ export default function IndexPage() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ height: '100%' }}>
|
<div style={{ height: '100%' }}>
|
||||||
<LeftConfig footerConfig={footerConfig()} config={config}></LeftConfig>
|
<LeftConfig mode="vertical" footerConfig={footerConfig()} config={config}></LeftConfig>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ContainerWrapper config={config}>
|
<ContainerWrapper config={config}>
|
||||||
|
@@ -13,16 +13,18 @@ import { DoubleLeftOutlined, DoubleRightOutlined, SearchOutlined } from '@ant-de
|
|||||||
|
|
||||||
import styles from '../index.less';
|
import styles from '../index.less';
|
||||||
|
|
||||||
|
declare type modeType = 'horizontal' | 'vertical';
|
||||||
interface LeftConfigProps {
|
interface LeftConfigProps {
|
||||||
config: UserConfig;
|
config: UserConfig;
|
||||||
footerConfig?: ReactNode;
|
footerConfig?: ReactNode;
|
||||||
|
mode?: modeType | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* 注册加载左侧组件方法,由于异步拉取,所以要异步加载
|
* 注册加载左侧组件方法,由于异步拉取,所以要异步加载
|
||||||
* 不同tab页可以使用不同type区分
|
* 不同tab页可以使用不同type区分
|
||||||
* @param {*} props
|
* @param {*} props -LeftConfigProps options可选项: mode:'horizontal' | 'vertical' icon与文案展示方向 ;footerConfig:底部功能配置ReactNode类型;
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
function LeftConfig(props: LeftConfigProps) {
|
function LeftConfig(props: LeftConfigProps) {
|
||||||
@@ -158,7 +160,7 @@ function LeftConfig(props: LeftConfigProps) {
|
|||||||
key={i}
|
key={i}
|
||||||
onClick={() => setMenuSelect(i + '')}
|
onClick={() => setMenuSelect(i + '')}
|
||||||
icon={v.icon}
|
icon={v.icon}
|
||||||
className={`${styles.menuStyle}`}
|
className={props.mode === 'vertical' ? `${styles.menuStyle}` : ''}
|
||||||
>
|
>
|
||||||
{v.displayName}
|
{v.displayName}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
@@ -168,6 +168,7 @@
|
|||||||
flex-direction: column !important;
|
flex-direction: column !important;
|
||||||
justify-content: center !important;
|
justify-content: center !important;
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
|
padding-top: 8px !important;
|
||||||
}
|
}
|
||||||
.menu_footer {
|
.menu_footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
Reference in New Issue
Block a user