123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- import Layout from '@/layouts'
- import EmptyLayout from '@/layouts/EmptyLayout'
- import { publicPath, routerMode } from '@/config'
- Vue.use(VueRouter)
- export const constantRoutes = [
- {
- path: '/login',
- component: () => import('@/views/login/index'),
- hidden: true,
- },
- {
- path: '/register',
- component: () => import('@/views/register/index'),
- hidden: true,
- },
- {
- path: '/401',
- name: '401',
- component: () => import('@/views/401'),
- hidden: true,
- },
- {
- path: '/404',
- name: '404',
- component: () => import('@/views/404'),
- hidden: true,
- },
- ]
- export const asyncRoutes = [
- {
- path: '/',
- component: Layout,
- redirect: '/index',
- children: [
- {
- path: 'index',
- name: 'Index',
- component: () => import('@/views/index/index'),
- meta: {
- title: '计划电量',
- icon: 'home',
- affix: true,
- },
- },
- ],
- },
- {
- path: "/indicators",
- component: Layout,
- redirect: "noRedirect",
- children: [
- {
- path: "indicators",
- name: "indicators",
- component: () => import("@/views/indicators/index"),
- meta: {
- title: "指标录入",
- icon: "marker",
- permissions: ["admin"],
- },
- },
- ],
- },
- {
- path: '/stationConfiguration',
- component: Layout,
- redirect: 'noRedirect',
- name: 'stationConfiguration',
- meta: { title: '场站配置', icon: 'tools', permissions: ['admin'] },
- children: [
- {
- path: 'company',
- name: 'company',
- component: () =>
- import('@/views/stationConfiguration/company/index'),
- meta: { title: '公司管理' },
- },
- {
- path: 'area',
- name: 'area',
- component: () =>
- import('@/views/stationConfiguration/area/index'),
- meta: { title: '区域管理' },
- },
- {
- path: 'station',
- name: 'station',
- component: () =>
- import('@/views/stationConfiguration/station/index'),
- meta: { title: '场站管理' },
- },
- {
- path: 'period',
- name: 'period',
- component: () =>
- import('@/views/stationConfiguration/period/index'),
- meta: { title: '期次管理' },
- },
- {
- path: 'line',
- name: 'line',
- component: () =>
- import('@/views/stationConfiguration/line/index'),
- meta: { title: '线路管理' },
- },
- {
- path: 'windterbin',
- name: 'windterbin',
- component: () =>
- import('@/views/stationConfiguration/windterbin/index'),
- meta: { title: '风机管理' },
- },
- {
- path: 'equipmentmodel',
- name: 'equipmentmodel',
- component: () =>
- import('@/views/stationConfiguration/equipmentmodel/index'),
- meta: { title: '设备型号' },
- },
- ],
- },
- {
- path: "/meterpoint",
- component: Layout,
- redirect: "noRedirect",
- children: [
- {
- path: "meterpoint",
- name: "meterpoint",
- component: () => import("@/views/meterpoint/index"),
- meta: {
- title: "电计量配置",
- icon: "allergies",
- permissions: ["admin"],
- },
- },
- ],
- },
- // {
- // path: "/equipmentAllocation",
- // component: Layout,
- // redirect: "noRedirect",
- // children: [
- // {
- // path: "equipmentAllocation",
- // name: "equipmentAllocation",
- // component: () => import("@/views/pointConfiguration/equipmentAllocation/index"),
- // meta: {
- // title: "设备点表配置",
- // icon: "marker",
- // permissions: ["admin"],
- // },
- // },
- // ],
- // },
- // {
- // path: "/stationAllocation",
- // component: Layout,
- // redirect: "noRedirect",
- // children: [
- // {
- // path: "stationAllocation",
- // name: "stationAllocation",
- // component: () => import("@/views/pointConfiguration/stationAllocation/index"),
- // meta: {
- // title: "场站点表配置",
- // icon: "marker",
- // permissions: ["admin"],
- // },
- // },
- // ],
- // },
- // {
- // path: '/personnelManagement',
- // component: Layout,
- // redirect: 'noRedirect',
- // name: 'PersonnelManagement',
- // meta: { title: '配置', icon: 'users-cog', permissions: ['admin'] },
- // children: [
- // {
- // path: 'userManagement',
- // name: 'UserManagement',
- // component: () =>
- // import('@/views/personnelManagement/userManagement/index'),
- // meta: { title: '用户管理' },
- // },
- // {
- // path: 'roleManagement',
- // name: 'RoleManagement',
- // component: () =>
- // import('@/views/personnelManagement/roleManagement/index'),
- // meta: { title: '角色管理' },
- // },
- // {
- // path: 'menuManagement',
- // name: 'MenuManagement',
- // component: () =>
- // import('@/views/personnelManagement/menuManagement/index'),
- // meta: { title: '菜单管理' },
- // },
- // ],
- // },
- // {
- // path: '/error',
- // component: EmptyLayout,
- // redirect: 'noRedirect',
- // name: 'Error',
- // meta: { title: '错误页', icon: 'bug' },
- // children: [
- // {
- // path: '401',
- // name: 'Error401',
- // component: () => import('@/views/401'),
- // meta: { title: '401' },
- // },
- // {
- // path: '404',
- // name: 'Error404',
- // component: () => import('@/views/404'),
- // meta: { title: '404' },
- // },
- // ],
- // },
- ]
- const router = new VueRouter({
- base: publicPath,
- mode: routerMode,
- scrollBehavior: () => ({
- y: 0,
- }),
- routes: constantRoutes,
- })
- export function resetRouter() {
- location.reload()
- }
- export default router
|