123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- import { createRouter, createWebHashHistory } from 'vue-router'
- const routes = [
- {
- path: '/',
- redirect: '/home'
- },
- {
- name: 'login',
- path: '/login',
- component: () => import('../views/login'),
- meta: {
- title: '登录',
- },
- },
- {
- name: 'home',
- path: '/home',
- component: () => import('../views/home'),
- meta: {
- title: '首页',
- },
- },
- {
- name: 'userInfo',
- path: '/userInfo',
- component: () => import('../views/userInfo'),
- meta: {
- title: '账号中心',
- },
- },
- {
- name: 'repairOnline',
- path: '/repairOnline',
- component: () => import('../views/repairOnline'),
- meta: {
- title: '线上报修',
- },
- },
- {
- name: 'reviewCheck',
- path: '/reviewCheck',
- component: () => import('../views/reviewCheck'),
- meta: {
- title: '巡检记录',
- },
- },
- {
- name: 'reduceRecord',
- path: '/reduceRecord',
- component: () => import('../views/reduceRecord'),
- meta: {
- title: '扣缴记录',
- },
- },
- {
- name: 'deviceAlarm',
- path: '/deviceAlarm',
- component: () => import('../views/deviceAlarm'),
- meta: {
- title: '设备异常',
- },
- },
- {
- name: 'lackFee',
- path: '/lackFee',
- component: () => import('../views/lackFee'),
- meta: {
- title: '欠费待收',
- },
- },
- {
- name: 'remoteControl',
- path: '/remoteControl',
- component: () => import('../views/remoteControl'),
- meta: {
- title: '远程管控',
- },
- },
- {
- name: 'repairList',
- path: '/repairList',
- component: () => import('../views/repairList'),
- meta: {
- title: '工单待办',
- },
- },
- {
- name: 'repairDetail',
- path: '/repairDetail',
- component: () => import('../views/repairDetail'),
- meta: {
- title: '工单详情',
- },
- },
- {
- name: 'rentBill',
- path: '/rentBill',
- component: () => import('../views/rentBill'),
- meta: {
- title: '租户账单',
- },
- }
- ,
- {
- name: 'rentBillDetail',
- path: '/rentBillDetail',
- component: () => import('../views/rentBillDetail'),
- meta: {
- title: '账单明细',
- },
- }
- ,
- {
- name: 'checkClock',
- path: '/checkClock',
- component: () => import('../views/checkClock'),
- meta: {
- title: '巡检打卡',
- },
- }
- // {
- // path: '/alllist',
- // name: '全部人员列表',
- // component: () => import(/* webpackChunkName: "about" */ '../views/alllist.vue')
- // },
- ]
- const router = createRouter({
- history: createWebHashHistory(),
- routes
- })
- // 全局前置守卫,设置页面标题
- router.beforeEach((to, from, next) => {
- // const title = to.meta && to.meta.title;
- // if (title) {
- // document.title = title;
- // }
- document.title = '双碳感知资产运营管理平台';
- next(); //必须写
- });
- export default router
|