|
|
@ -10,7 +10,7 @@ import {
|
|
|
|
DollarOutlined,
|
|
|
|
DollarOutlined,
|
|
|
|
AreaChartOutlined,
|
|
|
|
AreaChartOutlined,
|
|
|
|
WechatOutlined,
|
|
|
|
WechatOutlined,
|
|
|
|
UserOutlined, FlagOutlined, PieChartOutlined, BarChartOutlined
|
|
|
|
UserOutlined, FlagOutlined, PieChartOutlined, BarChartOutlined, CoffeeOutlined,
|
|
|
|
} from '@ant-design/icons';
|
|
|
|
} from '@ant-design/icons';
|
|
|
|
import { Layout, Menu, Image, Badge } from 'antd';
|
|
|
|
import { Layout, Menu, Image, Badge } from 'antd';
|
|
|
|
import { BrowserRouter, Route, Routes, NavLink } from 'react-router-dom';
|
|
|
|
import { BrowserRouter, Route, Routes, NavLink } from 'react-router-dom';
|
|
|
@ -39,13 +39,15 @@ import ExchangeRate from './charts/ExchangeRate';
|
|
|
|
import KPI from './views/KPI';
|
|
|
|
import KPI from './views/KPI';
|
|
|
|
import Distribution from './views/Distribution';
|
|
|
|
import Distribution from './views/Distribution';
|
|
|
|
import Detail from './views/Detail';
|
|
|
|
import Detail from './views/Detail';
|
|
|
|
|
|
|
|
import Welcome from './views/Welcome';
|
|
|
|
|
|
|
|
|
|
|
|
const App = () => {
|
|
|
|
const App = () => {
|
|
|
|
const { Content, Footer, Sider } = Layout;
|
|
|
|
const { Content, Footer, Sider } = Layout;
|
|
|
|
const { auth_store } = useContext(stores_Context);
|
|
|
|
const { auth_store } = useContext(stores_Context);
|
|
|
|
|
|
|
|
|
|
|
|
const menu_items = [
|
|
|
|
const menu_items = [
|
|
|
|
{ key: 1, label: <NavLink to="/">主页</NavLink>, icon: <HomeOutlined /> },
|
|
|
|
{ key: 1, label: <NavLink to="/">欢迎</NavLink>, icon: <CoffeeOutlined /> },
|
|
|
|
|
|
|
|
{ key: 'annual', label: <NavLink to="/annual">综合看板</NavLink>, icon: <BarChartOutlined /> },
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: 2,
|
|
|
|
key: 2,
|
|
|
|
label: '市场',
|
|
|
|
label: '市场',
|
|
|
@ -176,8 +178,12 @@ const App = () => {
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Routes>
|
|
|
|
<Routes>
|
|
|
|
<Route path="/" element={<Home />} />
|
|
|
|
<Route path="/" element={<Welcome />} />
|
|
|
|
<Route path="/detail" element={<Detail />} />
|
|
|
|
<Route path="/detail" element={<Detail />} />
|
|
|
|
|
|
|
|
<Route element={<ProtectedRoute auth={['admin', 'director_bu']} />}>
|
|
|
|
|
|
|
|
<Route path="/annual" element={<Home />} />
|
|
|
|
|
|
|
|
<Route path="/kpi" element={<KPI />} />
|
|
|
|
|
|
|
|
</Route>
|
|
|
|
<Route element={<ProtectedRoute auth={['admin', 'director_bu', 'marketing']} />}>
|
|
|
|
<Route element={<ProtectedRoute auth={['admin', 'director_bu', 'marketing']} />}>
|
|
|
|
<Route path="/orders" element={<Orders />} />
|
|
|
|
<Route path="/orders" element={<Orders />} />
|
|
|
|
<Route path="/orders_sub/:ordertype/:ordertype_sub/:ordertype_title" element={<Orders_sub />} />
|
|
|
|
<Route path="/orders_sub/:ordertype/:ordertype_sub/:ordertype_title" element={<Orders_sub />} />
|
|
|
@ -198,9 +204,6 @@ const App = () => {
|
|
|
|
<Route path="/credit_card_bill" element={<Credit_card_bill />} />
|
|
|
|
<Route path="/credit_card_bill" element={<Credit_card_bill />} />
|
|
|
|
<Route path="/exchange_rate" element={<ExchangeRate />} />
|
|
|
|
<Route path="/exchange_rate" element={<ExchangeRate />} />
|
|
|
|
</Route>
|
|
|
|
</Route>
|
|
|
|
<Route element={<ProtectedRoute auth={['admin', 'director_bu']} />}>
|
|
|
|
|
|
|
|
<Route path="/kpi" element={<KPI />} />
|
|
|
|
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
<Route element={<ProtectedRoute auth={['admin', 'director_bu', 'sale']} />}>
|
|
|
|
<Route element={<ProtectedRoute auth={['admin', 'director_bu', 'sale']} />}>
|
|
|
|
<Route path="/sale" element={<Sale />} />
|
|
|
|
<Route path="/sale" element={<Sale />} />
|
|
|
|
<Route path="/sale_sub/:type_sub" element={<Sale_sub />} />
|
|
|
|
<Route path="/sale_sub/:type_sub" element={<Sale_sub />} />
|
|
|
|