|
@@ -1,73 +1,73 @@
|
|
|
import "./home.scss";
|
|
import "./home.scss";
|
|
|
-import {Menu, Avatar, Popconfirm} from 'antd';
|
|
|
|
|
-import {useState,useEffect} from "react";
|
|
|
|
|
-import {DesktopOutlined, SettingOutlined, UserOutlined,FileDoneOutlined,AreaChartOutlined} from '@ant-design/icons';
|
|
|
|
|
-import {Outlet, useNavigate,useLocation} from 'react-router-dom';
|
|
|
|
|
|
|
+import {Avatar, Menu, Popconfirm} from 'antd';
|
|
|
|
|
+import {useEffect, useState} from "react";
|
|
|
|
|
+import {AreaChartOutlined, DesktopOutlined, FileDoneOutlined, SettingOutlined, UserOutlined} from '@ant-design/icons';
|
|
|
|
|
+import {Outlet, useLocation, useNavigate} from 'react-router-dom';
|
|
|
import axios from "@/utils/axios.js";
|
|
import axios from "@/utils/axios.js";
|
|
|
-import { useDispatch } from 'react-redux';
|
|
|
|
|
-import { setDictData } from '@/store/reducer.js';
|
|
|
|
|
|
|
+import {useDispatch} from 'react-redux';
|
|
|
|
|
+import {setDictData} from '@/store/reducer.js';
|
|
|
|
|
+
|
|
|
export default function Home() {
|
|
export default function Home() {
|
|
|
const navagate = useNavigate()
|
|
const navagate = useNavigate()
|
|
|
const [current, setCurrent] = useState('mail')
|
|
const [current, setCurrent] = useState('mail')
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 菜单数据
|
|
// 菜单数据
|
|
|
const items = [
|
|
const items = [
|
|
|
{
|
|
{
|
|
|
label: '首页配置',
|
|
label: '首页配置',
|
|
|
key: 'basicInfomation',
|
|
key: 'basicInfomation',
|
|
|
- icon: <DesktopOutlined />,
|
|
|
|
|
- children:[
|
|
|
|
|
|
|
+ icon: <DesktopOutlined/>,
|
|
|
|
|
+ children: [
|
|
|
{
|
|
{
|
|
|
label: '汇总统计数据',
|
|
label: '汇总统计数据',
|
|
|
key: 'statisticsData',
|
|
key: 'statisticsData',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '消费占比',
|
|
label: '消费占比',
|
|
|
key: 'consumptionProportion',
|
|
key: 'consumptionProportion',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '客流排名',
|
|
label: '客流排名',
|
|
|
key: 'flowRanking',
|
|
key: 'flowRanking',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '线路客流排名',
|
|
label: '线路客流排名',
|
|
|
key: 'lineFlowRanking',
|
|
key: 'lineFlowRanking',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '舆情统计数据',
|
|
label: '舆情统计数据',
|
|
|
key: 'publicOpinion',
|
|
key: 'publicOpinion',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '站场设备统计',
|
|
label: '站场设备统计',
|
|
|
key: 'stationEquipment',
|
|
key: 'stationEquipment',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '客运量数据',
|
|
label: '客运量数据',
|
|
|
key: 'passengerVolumeData',
|
|
key: 'passengerVolumeData',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '班次完成率',
|
|
label: '班次完成率',
|
|
|
key: 'classCompletionRate',
|
|
key: 'classCompletionRate',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '班次准点率',
|
|
label: '班次准点率',
|
|
|
key: 'classPunctualitRate',
|
|
key: 'classPunctualitRate',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '发车准点率',
|
|
label: '发车准点率',
|
|
|
key: 'carCompletionRate',
|
|
key: 'carCompletionRate',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
@@ -79,15 +79,106 @@ export default function Home() {
|
|
|
{
|
|
{
|
|
|
label: '线路基本情况',
|
|
label: '线路基本情况',
|
|
|
key: 'basicInfomationOfTheLine',
|
|
key: 'basicInfomationOfTheLine',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '线路发班情况',
|
|
label: '线路发班情况',
|
|
|
key: 'lineDispatch',
|
|
key: 'lineDispatch',
|
|
|
- icon: <AreaChartOutlined />,
|
|
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '乘客类型',
|
|
|
|
|
+ key: 'passengerType',
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '汇总数据',
|
|
|
|
|
+ key: 'summaryData',
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '驾驶员数量',
|
|
|
|
|
+ key: 'numberOfDrivers',
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '车辆数量占比',
|
|
|
|
|
+ key: 'numberOfTransit',
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '车辆监控',
|
|
|
|
|
+ key: 'vehicleMonitoring',
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '车辆状态',
|
|
|
|
|
+ key: 'vehicleStatus',
|
|
|
|
|
+ icon: <AreaChartOutlined/>,
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '客流分析',
|
|
|
|
|
+ key: 'passengerFlowAnalysis',
|
|
|
|
|
+ icon: <SettingOutlined/>,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '底部信息',
|
|
|
|
|
+ key: 'passengerInfomation',
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '区域客流',
|
|
|
|
|
+ key: 'regionalPassengerFlow',
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '通勤时间',
|
|
|
|
|
+ key: 'commutingTime',
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '消费类型',
|
|
|
|
|
+ key: 'consumptionType',
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '乘距分布',
|
|
|
|
|
+ key: 'distribution',
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '换乘次数',
|
|
|
|
|
+ key: 'replacementFrequency',
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '客流线路分布',
|
|
|
|
|
+ key: 'passengerFlowRoutes',
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '客运量排名',
|
|
|
|
|
+ key: 'rankingOfPassengerVolume',
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '维保动态',
|
|
|
|
|
+ key: 'maintenanceDynamics',
|
|
|
|
|
+ icon: <SettingOutlined/>,
|
|
|
|
|
+ children: [{
|
|
|
|
|
+ label: '车辆数量',
|
|
|
|
|
+ key: 'vehiclesTotalNumber',
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
|
|
+ }, {
|
|
|
|
|
+ label: '维修保养统计',
|
|
|
|
|
+ key: 'maintenanceStatistics',
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
|
|
+ },]
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
label: '基础信息配置',
|
|
label: '基础信息配置',
|
|
|
key: 'setting',
|
|
key: 'setting',
|
|
@@ -96,10 +187,10 @@ export default function Home() {
|
|
|
label: '用户管理',
|
|
label: '用户管理',
|
|
|
key: 'user',
|
|
key: 'user',
|
|
|
icon: <UserOutlined/>,
|
|
icon: <UserOutlined/>,
|
|
|
- },{
|
|
|
|
|
|
|
+ }, {
|
|
|
label: '字典管理',
|
|
label: '字典管理',
|
|
|
key: 'dict',
|
|
key: 'dict',
|
|
|
- icon: <FileDoneOutlined />,
|
|
|
|
|
|
|
+ icon: <FileDoneOutlined/>,
|
|
|
}]
|
|
}]
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -112,40 +203,45 @@ export default function Home() {
|
|
|
navagate("/" + e.key)
|
|
navagate("/" + e.key)
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 退出登录
|
|
|
|
|
- * @returns {Promise<void>}
|
|
|
|
|
- */
|
|
|
|
|
- async function logOut(){
|
|
|
|
|
- let {code}= await axios.post('/sys/logout')
|
|
|
|
|
- if(code===200){
|
|
|
|
|
- localStorage.removeItem('user')
|
|
|
|
|
- navagate('/login')
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 退出登录
|
|
|
|
|
+ * @returns {Promise<void>}
|
|
|
|
|
+ */
|
|
|
|
|
+ async function logOut() {
|
|
|
|
|
+ let {code} = await axios.post('/sys/logout')
|
|
|
|
|
+ if (code === 200) {
|
|
|
|
|
+ localStorage.removeItem('user')
|
|
|
|
|
+ navagate('/login')
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// reduce状态
|
|
// reduce状态
|
|
|
const dispatch = useDispatch();
|
|
const dispatch = useDispatch();
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 全局存储字典
|
|
* 全局存储字典
|
|
|
* @returns {Promise<void>}
|
|
* @returns {Promise<void>}
|
|
|
*/
|
|
*/
|
|
|
- async function getDict(){
|
|
|
|
|
- let {data} = await axios.get("/dict/selectKey");
|
|
|
|
|
- dispatch(setDictData(data))
|
|
|
|
|
|
|
+ async function getDict() {
|
|
|
|
|
+ let {data} = await axios.get("/dict/selectKey");
|
|
|
|
|
+ dispatch(setDictData(data))
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
const location = useLocation();
|
|
const location = useLocation();
|
|
|
|
|
+
|
|
|
// 让页面无法跳转
|
|
// 让页面无法跳转
|
|
|
- function jumpToPage(){
|
|
|
|
|
- if(location.pathname==='/'){
|
|
|
|
|
|
|
+ function jumpToPage() {
|
|
|
|
|
+ if (location.pathname === '/') {
|
|
|
navagate('/statisticsData')
|
|
navagate('/statisticsData')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- useEffect(()=>{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ useEffect(() => {
|
|
|
jumpToPage()
|
|
jumpToPage()
|
|
|
getDict()
|
|
getDict()
|
|
|
- },[])
|
|
|
|
|
|
|
+ }, [])
|
|
|
return (
|
|
return (
|
|
|
<div className="home">
|
|
<div className="home">
|
|
|
<div className="head">
|
|
<div className="head">
|