| | |
| | | } from '@ant-design/icons'; |
| | | import { |
| | | PageContainer, |
| | | ProCard, |
| | | ProConfigProvider, |
| | | ProLayout, |
| | | SettingDrawer, |
| | | } from '@ant-design/pro-components'; |
| | | import { |
| | | Button, |
| | | ConfigProvider, |
| | | Dropdown, |
| | | Input, |
| | | theme, |
| | | } from 'antd'; |
| | | import React, { useState } from 'react'; |
| | | import React from 'react'; |
| | | import defaultProps from './_defaultProps'; |
| | | import logo from '@/assets/logo.png'; |
| | | import G6 from './G6'; |
| | | import { getMenuList } from '@/api/meun'; |
| | | import Hello from './Hello'; |
| | | import { Router, Routes, Route, useNavigate } from "react-router-dom"; |
| | | |
| | | const SearchInput = () => { |
| | | const { token } = theme.useToken(); |
| | |
| | | }} |
| | | /> |
| | | } |
| | | placeholder="搜索方案" |
| | | placeholder="请输入" |
| | | bordered={false} |
| | | /> |
| | | </div> |
| | | ); |
| | | }; |
| | | |
| | | export default () => { |
| | | const [settings, setSetting] = useState({ |
| | | fixSiderbar: true, |
| | | layout: 'mix', |
| | | splitMenus: true, |
| | | }); |
| | | const route = { |
| | | route: { |
| | | path: '/', |
| | | routes: [ |
| | | { |
| | | name: '列表页', |
| | | path: '/list', |
| | | component: './ListTableList', |
| | | routes: [ |
| | | { |
| | | path: '/list/sub-page', |
| | | name: '列表页面', |
| | | routes: [ |
| | | { |
| | | path: '/list/sub-page/sub-sub-page1', |
| | | name: '一级列表页面', |
| | | component: './G6', |
| | | }, |
| | | { |
| | | path: '/list/sub-page/hello', |
| | | name: '你好世界', |
| | | component: './Hello', |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | name: '列表页', |
| | | path: '/list', |
| | | component: './ListTableList', |
| | | routes: [ |
| | | { |
| | | path: '/list/sub-page', |
| | | name: '列表页面', |
| | | routes: [ |
| | | { |
| | | path: '/list/sub-page/sub-sub-page1', |
| | | name: '一级列表页面', |
| | | component: './G6', |
| | | }, |
| | | { |
| | | path: '/list/sub-page/hello', |
| | | name: '你好世界', |
| | | component: './Hello', |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | ] |
| | | }, |
| | | } |
| | | |
| | | const [pathname, setPathname] = useState('/list/sub-page/sub-sub-page1'); |
| | | const [num, setNum] = useState(40); |
| | | export default () => { |
| | | if (typeof document === 'undefined') { |
| | | return <div />; |
| | | } |
| | | |
| | | const [menu, setMenu] = React.useState([]); |
| | | |
| | | React.useEffect(() => { |
| | | getMenuList().then(res => { |
| | | setMenu(res.data); |
| | | console.log(res); |
| | | }).catch(error => { |
| | | console.error(error); |
| | | }) |
| | | }, []); |
| | | |
| | | |
| | | const [settings, setSetting] = React.useState({ |
| | | fixSiderbar: true, |
| | | layout: 'side', // mix top |
| | | splitMenus: true, |
| | | fixedHeader: true |
| | | }); |
| | | const [pathname, setPathname] = React.useState('/list/sub-page/sub-sub-page1'); |
| | | |
| | | return ( |
| | | <div |
| | | id="pro-layout" style={{ height: '100vh', overflow: 'auto' }} |
| | |
| | | width: '331px', |
| | | }, |
| | | ]} |
| | | {...defaultProps} |
| | | {...route} |
| | | location={{ |
| | | pathname, |
| | | }} |
| | |
| | | colorBgMenuItemSelected: 'rgba(0,0,0,0.04)', |
| | | }, |
| | | }} |
| | | siderMenuType="group" |
| | | siderMenuType="sub" // group |
| | | menu={{ |
| | | collapsedShowGroupTitle: true, |
| | | }} |
| | |
| | | <> |
| | | <a> |
| | | {logo} |
| | | {title} |
| | | WCS |
| | | </a> |
| | | </> |
| | | ); |
| | |
| | | }} |
| | | // menu 菜单的头部点击事件 |
| | | onMenuHeaderClick={(e) => console.log(e)} |
| | | // Header 自定义菜单项的 render 方法 |
| | | // 自定义菜单项的 render 方法 |
| | | menuItemRender={(item, dom) => ( |
| | | <div |
| | | onClick={() => { |
| | | setPathname(item.path || '/welcome'); |
| | | setPathname(item.path); |
| | | }} |
| | | > |
| | | {dom} |
| | |
| | | )} |
| | | {...settings} |
| | | > |
| | | |
| | | <G6></G6> |
| | | {/* <PageContainer |
| | | token={{ |
| | | paddingInlinePageContainerContent: num, |
| | | }} |
| | | extra={[ |
| | | <Button key="3">操作</Button>, |
| | | <Button key="2">操作</Button>, |
| | | <Button |
| | | key="1" |
| | | type="primary" |
| | | onClick={() => { |
| | | setNum(num > 0 ? 0 : 40); |
| | | }} |
| | | > |
| | | 主操作 |
| | | </Button>, |
| | | ]} |
| | | subTitle="简单的描述" |
| | | footer={[ |
| | | <Button key="3">重置</Button>, |
| | | <Button key="2" type="primary"> |
| | | 提交 |
| | | </Button>, |
| | | ]} |
| | | > |
| | | |
| | | <ProCard |
| | | style={{ |
| | | height: '200vh', |
| | | minHeight: 800, |
| | | }} |
| | | > |
| | | <div /> |
| | | </ProCard> |
| | | {/* <PageContainer> |
| | | |
| | | </PageContainer> */} |
| | | |
| | | <Routes> |
| | | <Route path="/list/sub-page/hello" element={<Hello />} /> |
| | | </Routes> |
| | | |
| | | |
| | | <SettingDrawer |
| | | pathname={pathname} |
| | | enableDarkTheme |