Commit 23f1289d by hanjixin

路由表搭建

parent 0fb94926
<template> <template>
<div :class="classObj" class="app-wrapper"> <div :class="classObj" class="app-wrapper">
<div :class="{'fixed-header':fixedHeader}">
<navbar />
<!-- <tags-view v-if="needTagsView" /> -->
</div>
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" /> <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
<sidebar class="sidebar-container" /> <sidebar class="sidebar-container" />
<div :class="{hasTagsView:needTagsView}" class="main-container"> <div :class="{hasTagsView:needTagsView}" class="main-container" :style="fixedHeader ? 'padding-top: 50px;' : ''">
<div :class="{'fixed-header':fixedHeader}">
<navbar />
<tags-view v-if="needTagsView" />
</div>
<app-main /> <app-main />
<!-- <right-panel v-if="showSettings"> <!-- <right-panel v-if="showSettings">
<settings /> <settings />
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</template> </template>
<script> <script>
import { AppMain, Navbar, Sidebar, TagsView } from './components' import { AppMain, Navbar, Sidebar } from './components'
import ResizeMixin from './mixin/ResizeHandler' import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'vuex' import { mapState } from 'vuex'
...@@ -26,8 +26,7 @@ export default { ...@@ -26,8 +26,7 @@ export default {
AppMain, AppMain,
Navbar, Navbar,
// Settings, // Settings,
Sidebar, Sidebar
TagsView
}, },
mixins: [ResizeMixin], mixins: [ResizeMixin],
computed: { computed: {
...@@ -84,9 +83,10 @@ export default { ...@@ -84,9 +83,10 @@ export default {
.fixed-header { .fixed-header {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0;
right: 0; right: 0;
z-index: 9; z-index: 9;
width: calc(100% - #{$sideBarWidth}); // width: calc(100% - #{$sideBarWidth});
transition: width 0.28s; transition: width 0.28s;
} }
......
...@@ -8,10 +8,11 @@ import Layout from '@/layout' ...@@ -8,10 +8,11 @@ import Layout from '@/layout'
/* Router Modules */ /* Router Modules */
import tableRouter from './modules/table' // import tableRouter from './modules/table'
import DeviceRouter from './modules/device' // import DeviceRouter from './modules/device'
import TempaltesRouter from './modules/templates' // import TempaltesRouter from './modules/templates'
import CommonRouter from './modules/common' // import CommonRouter from './modules/common'
import ContentRouter from './modules/contents'
/** /**
* Note: sub-menu only appear when route children.length >= 1 * Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
...@@ -73,28 +74,30 @@ export const constantRoutes = [ ...@@ -73,28 +74,30 @@ export const constantRoutes = [
] ]
}, },
{ {
path: '/documentation', path: '/profile',
component: Layout, component: Layout,
redirect: '/profile/index',
hidden: false,
children: [ children: [
{ {
path: 'index', path: 'index',
component: () => import('@/views/documentation/index'), component: () => import('@/views/profile/index'),
name: 'Documentation', name: 'Profile',
meta: { title: 'Documentation', icon: 'documentation', affix: false } meta: { title: '个人中心', icon: 'user', noCache: true }
} }
] ]
}, },
{ {
path: '/profile', path: '/setting',
component: Layout, component: Layout,
redirect: '/profile/index', redirect: '/setting/index',
hidden: true, hidden: false,
children: [ children: [
{ {
path: 'index', path: 'index',
component: () => import('@/views/profile/index'), component: () => import('@/views/profile/index'),
name: 'Profile', name: 'Profile',
meta: { title: 'Profile', icon: 'user', noCache: true } meta: { title: '设置', icon: 'user', noCache: true }
} }
] ]
} }
...@@ -119,10 +122,11 @@ export const asyncRoutes = [ ...@@ -119,10 +122,11 @@ export const asyncRoutes = [
}, },
/** when your routing map is too long, you can split it into small modules **/ /** when your routing map is too long, you can split it into small modules **/
DeviceRouter, // DeviceRouter,
TempaltesRouter, // TempaltesRouter,
tableRouter, // tableRouter,
CommonRouter, // CommonRouter,
ContentRouter,
// { // {
// path: 'external-link', // path: 'external-link',
// component: Layout, // component: Layout,
......
/** When your routing table is too long, you can split it into small modules **/
import Layout from '@/layout'
const contentsRouter = {
path: '/contents',
component: Layout,
redirect: '/contents/list',
name: 'contents',
meta: {
title: '内容管理',
icon: 'table'
},
children: [
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '系统标题' }
},
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '事件监控' }
},
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '预警介绍' },
children: [
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '国家预警发布系统' }
},
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '大事记' }
},
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '预警发布服务效益' }
}
]
},
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '预警中心' },
children: [
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '联络人' }
},
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '预警中心建设' }
}
]
},
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '信息中心' },
children: [
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '中心介绍' }
},
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '信息服务应用效益' }
},
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '宣传视频' }
},
{
path: 'type',
component: () => import('@/views/template/template-type'),
name: 'TemplateType',
meta: { title: '大事记' }
}
]
},
{
path: 'type/detail',
component: () => import('@/views/template/template-type-detail'),
name: 'TemplateTypeDeatil',
hidden: true,
meta: { title: '模板类型详情', hidden: true }
}
]
}
export default contentsRouter
module.exports = { module.exports = {
title: 'Vmatrix Admin', title: 'Admin',
/** /**
* @type {boolean} true | false * @type {boolean} true | false
...@@ -11,13 +11,13 @@ module.exports = { ...@@ -11,13 +11,13 @@ module.exports = {
* @type {boolean} true | false * @type {boolean} true | false
* @description Whether need tagsView * @description Whether need tagsView
*/ */
tagsView: true, tagsView: false,
/** /**
* @type {boolean} true | false * @type {boolean} true | false
* @description Whether fix the header * @description Whether fix the header
*/ */
fixedHeader: false, fixedHeader: true,
/** /**
* @type {boolean} true | false * @type {boolean} true | false
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
height: 100%; height: 100%;
position: fixed; position: fixed;
font-size: 0px; font-size: 0px;
top: 0; top: 51px;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 1001; z-index: 1001;
......
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 sign in to comment