mirror of
https://github.com/MrXujiang/h5-Dooring.git
synced 2026-01-06 19:58:10 +00:00
add: 左边增加收缩切换按钮
This commit is contained in:
parent
cb60dfa9b5
commit
8e8926e3b1
@ -28,6 +28,7 @@ const { TabPane } = Tabs;
|
|||||||
|
|
||||||
const Container = (props: { history?: any; location?: any; pstate?: any; dispatch?: any }) => {
|
const Container = (props: { history?: any; location?: any; pstate?: any; dispatch?: any }) => {
|
||||||
const [scaleNum, setScale] = useState(1);
|
const [scaleNum, setScale] = useState(1);
|
||||||
|
const [collapsed, setCollapsed] = useState(false);
|
||||||
|
|
||||||
const { pstate, dispatch } = props;
|
const { pstate, dispatch } = props;
|
||||||
const pointData = pstate ? pstate.pointData : {};
|
const pointData = pstate ? pstate.pointData : {};
|
||||||
@ -39,6 +40,10 @@ const Container = (props: { history?: any; location?: any; pstate?: any; dispatc
|
|||||||
setScale(1);
|
setScale(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const toggleCollapsed = (checked: boolean) => {
|
||||||
|
setCollapsed(checked);
|
||||||
|
};
|
||||||
|
|
||||||
const CpIcon = {
|
const CpIcon = {
|
||||||
base: <HighlightOutlined />,
|
base: <HighlightOutlined />,
|
||||||
media: <PlayCircleOutlined />,
|
media: <PlayCircleOutlined />,
|
||||||
@ -123,9 +128,10 @@ const Container = (props: { history?: any; location?: any; pstate?: any; dispatc
|
|||||||
pointData={pointData}
|
pointData={pointData}
|
||||||
clearData={clearData}
|
clearData={clearData}
|
||||||
location={props.location}
|
location={props.location}
|
||||||
|
toggleCollapsed={toggleCollapsed}
|
||||||
/>
|
/>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<div className={styles.list}>
|
<div className={!collapsed ? styles.list : styles.collapsed}>
|
||||||
<div className={styles.searchBar}>
|
<div className={styles.searchBar}>
|
||||||
<Alert
|
<Alert
|
||||||
banner
|
banner
|
||||||
@ -195,6 +201,7 @@ const Container = (props: { history?: any; location?: any; pstate?: any; dispatc
|
|||||||
canvasId={canvasId}
|
canvasId={canvasId}
|
||||||
allType={allType}
|
allType={allType}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className={styles.resetBall}>
|
<div className={styles.resetBall}>
|
||||||
<ReloadOutlined onClick={() => setDragState({ x: 0, y: 0 })} />
|
<ReloadOutlined onClick={() => setDragState({ x: 0, y: 0 })} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { useRef, memo } from 'react';
|
import React, { useRef, memo } from 'react';
|
||||||
import { Button, Input, Popover, Modal } from 'antd';
|
import { Button, Input, Popover, Modal, Switch } from 'antd';
|
||||||
import {
|
import {
|
||||||
ArrowLeftOutlined,
|
ArrowLeftOutlined,
|
||||||
MobileOutlined,
|
MobileOutlined,
|
||||||
@ -28,10 +28,11 @@ interface HeaderComponentProps {
|
|||||||
clearData: any;
|
clearData: any;
|
||||||
undohandler: any;
|
undohandler: any;
|
||||||
redohandler: any;
|
redohandler: any;
|
||||||
|
toggleCollapsed: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
const HeaderComponent = memo((props: HeaderComponentProps) => {
|
const HeaderComponent = memo((props: HeaderComponentProps) => {
|
||||||
const { pointData, location, clearData, undohandler, redohandler } = props;
|
const { pointData, location, clearData, undohandler, redohandler, toggleCollapsed } = props;
|
||||||
const iptRef = useRef<Input>(null);
|
const iptRef = useRef<Input>(null);
|
||||||
|
|
||||||
const toPreview = () => {
|
const toPreview = () => {
|
||||||
@ -135,6 +136,7 @@ const HeaderComponent = memo((props: HeaderComponentProps) => {
|
|||||||
<ArrowLeftOutlined />
|
<ArrowLeftOutlined />
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.logo}>Dooring</div>
|
<div className={styles.logo}>Dooring</div>
|
||||||
|
<Switch onChange={toggleCollapsed} style={{ marginLeft: '100px' }} />
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.controlArea}>
|
<div className={styles.controlArea}>
|
||||||
<Button type="primary" style={{ marginRight: '9px' }} onClick={useTemplate}>
|
<Button type="primary" style={{ marginRight: '9px' }} onClick={useTemplate}>
|
||||||
|
|||||||
@ -1,6 +1,17 @@
|
|||||||
.layout {
|
.layout {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
div::-webkit-scrollbar {
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
}
|
||||||
|
div::-webkit-scrollbar-thumb {
|
||||||
|
background: #bfbfbf;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
div::-webkit-scrollbar-thumb:hover {
|
||||||
|
background: #2f54eb;
|
||||||
|
}
|
||||||
.editorWrap {
|
.editorWrap {
|
||||||
background-color: rgba(245, 245, 245, 1);
|
background-color: rgba(245, 245, 245, 1);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@ -194,6 +205,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.collapsed {
|
||||||
|
.list;
|
||||||
|
height: calc(56px);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,11 +3,12 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
.leftArea {
|
.leftArea {
|
||||||
padding: 10px 0 10px 20px;
|
padding: 10px 0 10px 20px;
|
||||||
width: 320px;
|
// width: 320px;
|
||||||
border-right: 1px solid #f0f0f0;
|
border-right: 1px solid #f0f0f0;
|
||||||
}
|
}
|
||||||
.contentArea {
|
.contentArea {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
margin-right: 60px;
|
||||||
.logoTip {
|
.logoTip {
|
||||||
padding-top: 100px;
|
padding-top: 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import {
|
|||||||
ConsoleSqlOutlined,
|
ConsoleSqlOutlined,
|
||||||
GithubOutlined,
|
GithubOutlined,
|
||||||
CodeOutlined,
|
CodeOutlined,
|
||||||
|
IdcardOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
@ -47,6 +48,17 @@ const Home = () => {
|
|||||||
>
|
>
|
||||||
正在开发...
|
正在开发...
|
||||||
</TabPane>
|
</TabPane>
|
||||||
|
<TabPane
|
||||||
|
tab={
|
||||||
|
<span>
|
||||||
|
<IdcardOutlined />
|
||||||
|
我的可视化
|
||||||
|
</span>
|
||||||
|
}
|
||||||
|
key="3"
|
||||||
|
>
|
||||||
|
正在开发...
|
||||||
|
</TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.contentArea}>
|
<div className={styles.contentArea}>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user