|
|
@ -1,13 +1,11 @@
|
|
|
|
import { Outlet, Link, useHref, useLocation } from "react-router-dom";
|
|
|
|
import { Outlet, Link, useHref, useLocation } from "react-router-dom";
|
|
|
|
import { useEffect } from 'react';
|
|
|
|
import { useEffect } from "react";
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
import { Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col, App as AntApp } from 'antd';
|
|
|
|
import { Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col, Alert, App as AntApp } from "antd";
|
|
|
|
import {
|
|
|
|
import { DownOutlined } from "@ant-design/icons";
|
|
|
|
DownOutlined
|
|
|
|
import "antd/dist/reset.css";
|
|
|
|
} from '@ant-design/icons';
|
|
|
|
import AppLogo from "@/assets/logo-gh.png";
|
|
|
|
import 'antd/dist/reset.css';
|
|
|
|
import { useStore } from "@/stores/StoreContext.js";
|
|
|
|
import AppLogo from '@/assets/logo-gh.png'
|
|
|
|
|
|
|
|
import { useStore } from '@/stores/StoreContext.js';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { Header, Content, Footer } = Layout;
|
|
|
|
const { Header, Content, Footer } = Layout;
|
|
|
|
const items = [
|
|
|
|
const items = [
|
|
|
@ -17,7 +15,7 @@ const items = [
|
|
|
|
Profile
|
|
|
|
Profile
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
key: '0',
|
|
|
|
key: "0",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: (
|
|
|
|
label: (
|
|
|
@ -25,10 +23,10 @@ const items = [
|
|
|
|
Privacy
|
|
|
|
Privacy
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
key: '1',
|
|
|
|
key: "1",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type: 'divider',
|
|
|
|
type: "divider",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: (
|
|
|
|
label: (
|
|
|
@ -36,11 +34,10 @@ const items = [
|
|
|
|
Logout
|
|
|
|
Logout
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
key: '3',
|
|
|
|
key: "3",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
];
|
|
|
|
function App() {
|
|
|
|
function App() {
|
|
|
|
|
|
|
|
|
|
|
|
const { authStore } = useStore();
|
|
|
|
const { authStore } = useStore();
|
|
|
|
|
|
|
|
|
|
|
|
const href = useHref();
|
|
|
|
const href = useHref();
|
|
|
@ -48,7 +45,7 @@ function App() {
|
|
|
|
let location = useLocation();
|
|
|
|
let location = useLocation();
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
// Check location
|
|
|
|
// Check location
|
|
|
|
console.info('location.pathname: ' + location.pathname)
|
|
|
|
console.info("location.pathname: " + location.pathname);
|
|
|
|
}, [location]);
|
|
|
|
}, [location]);
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
const {
|
|
|
@ -59,35 +56,36 @@ function App() {
|
|
|
|
<ConfigProvider
|
|
|
|
<ConfigProvider
|
|
|
|
theme={{
|
|
|
|
theme={{
|
|
|
|
token: {
|
|
|
|
token: {
|
|
|
|
colorPrimary: '#00b96b',
|
|
|
|
colorPrimary: "#00b96b",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
algorithm: theme.defaultAlgorithm,
|
|
|
|
algorithm: theme.defaultAlgorithm,
|
|
|
|
}}
|
|
|
|
}}>
|
|
|
|
>
|
|
|
|
|
|
|
|
<AntApp>
|
|
|
|
<AntApp>
|
|
|
|
<Layout
|
|
|
|
<Layout
|
|
|
|
style={{
|
|
|
|
style={{
|
|
|
|
minHeight: "100vh",
|
|
|
|
minHeight: "100vh",
|
|
|
|
}}>
|
|
|
|
}}>
|
|
|
|
<Header className="header" style={{ position: 'sticky', top: 0, zIndex: 1, width: '100%' }}>
|
|
|
|
<Header className="header" style={{ position: "sticky", top: 0, zIndex: 1, width: "100%" }}>
|
|
|
|
<Row gutter={{ md: 24 }} justify="end">
|
|
|
|
<Row gutter={{ md: 24 }} justify="end">
|
|
|
|
<Col span={20}>
|
|
|
|
<Col span={20}>
|
|
|
|
<img src={AppLogo} className="logo" alt="App logo" />
|
|
|
|
<img src={AppLogo} className="logo" alt="App logo" />
|
|
|
|
<Menu theme="dark" mode="horizontal" defaultSelectedKeys={[href]} items={
|
|
|
|
<Menu
|
|
|
|
[
|
|
|
|
theme="dark"
|
|
|
|
{ key: '/reservation/newest', label: <Link to="/reservation/newest">Reservation</Link> },
|
|
|
|
mode="horizontal"
|
|
|
|
{ key: '/feedback', label: <Link to="/feedback">Feedback</Link> },
|
|
|
|
defaultSelectedKeys={[href]}
|
|
|
|
{ key: '/invoice/list', label: <Link to="/invoice/list">Invoice</Link> }
|
|
|
|
items={[
|
|
|
|
]
|
|
|
|
{ key: "/reservation/newest", label: <Link to="/reservation/newest">Reservation</Link> },
|
|
|
|
} />
|
|
|
|
{ key: "/feedback", label: <Link to="/feedback">Feedback</Link> },
|
|
|
|
|
|
|
|
{ key: "/invoice/list", label: <Link to="/invoice/list">Invoice</Link> },
|
|
|
|
|
|
|
|
]}
|
|
|
|
|
|
|
|
/>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
<Col span={4}>
|
|
|
|
<Col span={4}>
|
|
|
|
<Dropdown
|
|
|
|
<Dropdown
|
|
|
|
menu={{
|
|
|
|
menu={{
|
|
|
|
items
|
|
|
|
items,
|
|
|
|
}}
|
|
|
|
}}>
|
|
|
|
>
|
|
|
|
<a onClick={e => e.preventDefault()}>
|
|
|
|
<a onClick={(e) => e.preventDefault()}>
|
|
|
|
|
|
|
|
<Space>
|
|
|
|
<Space>
|
|
|
|
{authStore.login.username}
|
|
|
|
{authStore.login.username}
|
|
|
|
<DownOutlined />
|
|
|
|
<DownOutlined />
|
|
|
@ -97,6 +95,9 @@ function App() {
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
</Header>
|
|
|
|
</Header>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Alert message="公告 查看后不再显示,或者一直显示,或者放到页面底部" description="" type="info" banner closable />
|
|
|
|
|
|
|
|
|
|
|
|
<Content
|
|
|
|
<Content
|
|
|
|
style={{
|
|
|
|
style={{
|
|
|
|
padding: 24,
|
|
|
|
padding: 24,
|
|
|
@ -106,8 +107,7 @@ function App() {
|
|
|
|
}}>
|
|
|
|
}}>
|
|
|
|
<Outlet />
|
|
|
|
<Outlet />
|
|
|
|
</Content>
|
|
|
|
</Content>
|
|
|
|
<Footer>
|
|
|
|
<Footer></Footer>
|
|
|
|
</Footer>
|
|
|
|
|
|
|
|
</Layout>
|
|
|
|
</Layout>
|
|
|
|
</AntApp>
|
|
|
|
</AntApp>
|
|
|
|
</ConfigProvider>
|
|
|
|
</ConfigProvider>
|
|
|
|