Commit 1dc7c8b2 by 吕海涛

增加业务配置

parent 654b6802
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import Layout from '@/layout' import Layout from '@/layout'
import {routerMode} from '@/config/index' import { routerMode } from '@/config/index'
import store from '@/store/index' import store from '@/store/index'
Vue.use(VueRouter) Vue.use(VueRouter)
...@@ -10,23 +10,24 @@ Vue.use(VueRouter) ...@@ -10,23 +10,24 @@ Vue.use(VueRouter)
* 静态路由 * 静态路由
* @type {({path: string, component: (function(): *), hidden: boolean}|{path: string, component: (function(): *), hidden: boolean, name: string}|{path: string, component: (function(): *), hidden: boolean, name: string})[]} * @type {({path: string, component: (function(): *), hidden: boolean}|{path: string, component: (function(): *), hidden: boolean, name: string}|{path: string, component: (function(): *), hidden: boolean, name: string})[]}
*/ */
export const currencyRoutes = [ export const currencyRoutes = [{
{
path: '/login', path: '/login',
component: () => component: () =>
import(/* webpackChunkName: "login" */ '@/views/login/index.vue'), import ( /* webpackChunkName: "login" */ '@/views/login/index.vue'),
hidden: true hidden: true
}, },
{ {
path: '/401', path: '/401',
name: '401', name: '401',
component: () => import('@/views/401'), component: () =>
import ('@/views/401'),
hidden: true hidden: true
}, },
{ {
path: '/404', path: '/404',
name: '404', name: '404',
component: () => import('@/views/404'), component: () =>
import ('@/views/404'),
hidden: true hidden: true
} }
] ]
...@@ -35,8 +36,7 @@ export const currencyRoutes = [ ...@@ -35,8 +36,7 @@ export const currencyRoutes = [
* 动态路由 * 动态路由
* @type {any} * @type {any}
*/ */
export const routes = [ export const routes = [{
{
path: '/', path: '/',
name: 'Company', name: 'Company',
component: Layout, component: Layout,
...@@ -49,14 +49,52 @@ export const routes = [ ...@@ -49,14 +49,52 @@ export const routes = [
path: '/', path: '/',
name: 'CompanyInformation', name: 'CompanyInformation',
component: () => component: () =>
import('@/views/dashboard/index.vue'), import ('@/views/dashboard/index.vue'),
meta: { meta: {
title: '企业信息', title: '企业信息',
icon: 'el-icon-s-data' icon: 'el-icon-s-data'
} }
}] },
} {
] path: 'department-information',
name: 'DepartmentInformation',
component: () =>
import ('@/views/DepartmentInformation/index.vue'),
meta: { title: '部门管理', icon: 'el-icon-user-solid' }
},
]
}, {
path: '/configure',
name: 'configure',
component: Layout,
redirect: '/configure',
meta: {
icon: 'el-icon-setting',
title: '业务配置'
},
children: [{
path: 'enclosure',
name: 'Enclosure',
component: () =>
import ('@/views/configure/enclosure.vue'),
meta: { title: '围栏管理', icon: 'el-icon-aim' }
},
{
path: 'CarModel',
name: 'CarModel',
component: () =>
import ('@/views/configure/CarModel.vue'),
meta: { title: '车型管理', icon: 'el-icon-s-data' }
},
{
path: 'site',
name: 'Site',
component: () =>
import ('@/views/configure/site.vue'),
meta: { title: '站点管理', icon: 'el-icon-s-home' }
},
]
}]
const router = new VueRouter({ const router = new VueRouter({
base: '', base: '',
...@@ -80,7 +118,7 @@ export function resetRouter() { ...@@ -80,7 +118,7 @@ export function resetRouter() {
} }
// 导航守卫 验证是否登录了 没有登录跳转到登录页面 // 导航守卫 验证是否登录了 没有登录跳转到登录页面
router.beforeEach(async (to, from, next) => { router.beforeEach(async(to, from, next) => {
if (to.path === '/login') { if (to.path === '/login') {
next() next()
} else { } else {
......
<template xmlns="http://www.w3.org/1999/html">
<el-card style="text-align: left;" type="flex" justify="end" align="end">
车型
</el-card>
</template>
<script>
export default {
name: "CarModel",
data() {
return {
info: 'baaaaaaaaaaa'
}
}
}
</script>
<style scoped lang="scss">
div {
}
</style>
<template xmlns="http://www.w3.org/1999/html">
<el-card style="text-align: left;" type="flex" justify="end" align="end">
围栏
</el-card>
</template>
<script>
export default {
name: "enclosure",
data() {
return {
info: 'baaaaaaaaaaa'
}
}
}
</script>
<style scoped lang="scss">
div {
}
</style>
<template xmlns="http://www.w3.org/1999/html">
<el-card style="text-align: left;" type="flex" justify="end" align="end">
站点
</el-card>
</template>
<script>
export default {
name: "site",
data() {
return {
info: 'baaaaaaaaaaa'
}
}
}
</script>
<style scoped lang="scss">
div {
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment