import { Connect } from "dob-react" import * as React from "react" import * as ReactDOM from "react-dom"; import Icon from "../../components/icon/src" import { TabPanel, Tabs } from "../../components/tabs/src" import { Tree } from "../../components/tree/src" import PageAction from "./action" import * as Styled from "./index.style" import { Props, State } from "./index.type" import PageStore from "./store" import TreeNode from "./tree-node/tree-node.component" @Connect class Page extends React.Component { public static defaultProps = new Props() public state = new State() public componentWillMount() { this.props.actions.ApplicationAction.RemoveCreatingPage() } public render() { const Pages = this.props.stores.ApplicationStore.rootPageKeys.map(pageKey => { return ( ) }) return (
配置页面
{this.props.stores.ApplicationStore.pages.size > 0 && {Pages} } {this.props.stores.ApplicationStore.pages.size === 1 && 添加新页面 点击右上角按钮,创建文件夹或页面,应用默认拥有首页 }
) } private handleCloseLeftBar = () => { this.props.actions.ApplicationAction.RemoveCreatingPage() this.props.actions.ApplicationAction.setLeftTool(null) this.props.actions.ApplicationAction.setRightTool(null) } private handleAddFolder = () => { this.props.actions.ApplicationAction.RemoveCreatingPage() this.props.actions.ApplicationAction.createNewPage(true) this.props.actions.ApplicationAction.setRightTool("addFolder") } private handleAddPage = () => { this.props.actions.ApplicationAction.RemoveCreatingPage() this.props.actions.ApplicationAction.createNewPage(false) this.props.actions.ApplicationAction.setRightTool("addPage") } } export default { position: "toolContainerLeftPage", class: Page, actions: { PageAction }, stores: { PageStore } }