|
|
|
import { createRouter, createWebHistory } from 'vue-router';
|
|
|
|
// 还有 createWebHashHistory 和 createMemoryHistory
|
|
|
|
|
|
|
|
export const routes = [
|
|
|
|
{
|
|
|
|
path: '/corrosion/overview',
|
|
|
|
name: 'overview',
|
|
|
|
meta: {
|
|
|
|
title: '设备概览',
|
|
|
|
icon: 'el-icon-box',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/overview.vue'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion/devices',
|
|
|
|
name: 'devices',
|
|
|
|
meta: {
|
|
|
|
title: '设备管理',
|
|
|
|
icon: 'el-icon-box',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/device-list.vue'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion/network-config',
|
|
|
|
name: 'network-config',
|
|
|
|
meta: {
|
|
|
|
title: '网络参数配置',
|
|
|
|
icon: 'el-icon-setting',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/network-config.vue'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion/function-config',
|
|
|
|
name: 'function-config',
|
|
|
|
meta: {
|
|
|
|
title: '功能参数配置',
|
|
|
|
icon: 'el-icon-set-up',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/function-config.vue'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion/device-create',
|
|
|
|
name: 'device-create',
|
|
|
|
meta: {
|
|
|
|
title: '设备添加',
|
|
|
|
icon: 'el-icon-first-aid-kit',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/device-create.vue'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion/data-realtime',
|
|
|
|
name: 'data-realtime',
|
|
|
|
meta: {
|
|
|
|
title: '实时数据查看',
|
|
|
|
icon: 'el-icon-odometer',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/data-realtime.vue'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion/statistical-realtime',
|
|
|
|
name: 'statistical-realtime',
|
|
|
|
meta: {
|
|
|
|
title: '实时数据统计',
|
|
|
|
icon: 'el-icon-data-analysis',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/statistical-realtime.vue'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion/data-report',
|
|
|
|
name: 'data-report',
|
|
|
|
meta: {
|
|
|
|
title: '上报数据查看',
|
|
|
|
icon: 'el-icon-stopwatch',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/data-report.vue'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion/statistical-report',
|
|
|
|
name: 'statistical-report',
|
|
|
|
meta: {
|
|
|
|
title: '上报数据统计',
|
|
|
|
icon: 'el-icon-data-line',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/statistical-report.vue'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion/data-history',
|
|
|
|
name: 'data-history',
|
|
|
|
meta: {
|
|
|
|
title: '历史数据查看',
|
|
|
|
icon: 'el-icon-document-copy',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/data-history.vue'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion/commands',
|
|
|
|
name: 'commands',
|
|
|
|
meta: {
|
|
|
|
title: '历史数据指令下发状态',
|
|
|
|
icon: 'el-icon-moon-night',
|
|
|
|
},
|
|
|
|
component: () => import('@/views/commands.vue'),
|
|
|
|
},
|
|
|
|
// {
|
|
|
|
// path: '/corrosion/statistical-history',
|
|
|
|
// name: 'statistical-history',
|
|
|
|
// meta: {
|
|
|
|
// title: '历史数据统计',
|
|
|
|
// icon: 'el-icon-data-line',
|
|
|
|
// },
|
|
|
|
// component: () => import('@/views/statistical-history.vue'),
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// path: '/corrosion/months',
|
|
|
|
// name: 'months',
|
|
|
|
// meta: { title: '月累计数据分析', icon: 'el-icon-data-analysis' },
|
|
|
|
// component: () => import('@/views/month-data.vue'),
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// path: '/corrosion/communication-log',
|
|
|
|
// name: 'communication-log',
|
|
|
|
// meta: { title: '通讯日志', icon: 'el-icon-phone-outline' },
|
|
|
|
// component: () => import('@/views/communication-log.vue'),
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// path: '/corrosion/access-log',
|
|
|
|
// name: 'access-log',
|
|
|
|
// meta: { title: '访问日志', icon: 'el-icon-message' },
|
|
|
|
// component: () => import('@/views/access-log.vue'),
|
|
|
|
// },
|
|
|
|
];
|
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
history: createWebHistory(),
|
|
|
|
routes: [
|
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
redirect: '/corrosion/devices',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/corrosion',
|
|
|
|
redirect: '/corrosion/devices',
|
|
|
|
},
|
|
|
|
].concat(routes),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default router;
|