Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
html
/
MeteorologicalBureau
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
23f1289d
authored
Feb 28, 2020
by
hanjixin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
路由表搭建
parent
0fb94926
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
146 additions
and
28 deletions
+146
-28
admin/src/layout/index.vue
+8
-8
admin/src/router/index.js
+20
-16
admin/src/router/modules/contents.js
+114
-0
admin/src/settings.js
+3
-3
admin/src/styles/sidebar.scss
+1
-1
No files found.
admin/src/layout/index.vue
View file @
23f1289d
<
template
>
<div
:class=
"classObj"
class=
"app-wrapper"
>
<div
v-if=
"device==='mobile'&&sidebar.opened"
class=
"drawer-bg"
@
click=
"handleClickOutside"
/>
<sidebar
class=
"sidebar-container"
/>
<div
:class=
"
{hasTagsView:needTagsView}" class="main-container">
<div
:class=
"
{'fixed-header':fixedHeader}">
<navbar
/>
<tags-view
v-if=
"needTagsView"
/
>
<!--
<tags-view
v-if=
"needTagsView"
/>
--
>
</div>
<div
v-if=
"device==='mobile'&&sidebar.opened"
class=
"drawer-bg"
@
click=
"handleClickOutside"
/>
<sidebar
class=
"sidebar-container"
/>
<div
:class=
"
{hasTagsView:needTagsView}" class="main-container" :style="fixedHeader ? 'padding-top: 50px;' : ''">
<app-main
/>
<!--
<right-panel
v-if=
"showSettings"
>
<settings
/>
...
...
@@ -16,7 +16,7 @@
</
template
>
<
script
>
import
{
AppMain
,
Navbar
,
Sidebar
,
TagsView
}
from
'./components'
import
{
AppMain
,
Navbar
,
Sidebar
}
from
'./components'
import
ResizeMixin
from
'./mixin/ResizeHandler'
import
{
mapState
}
from
'vuex'
...
...
@@ -26,8 +26,7 @@ export default {
AppMain
,
Navbar
,
// Settings,
Sidebar
,
TagsView
Sidebar
},
mixins
:
[
ResizeMixin
],
computed
:
{
...
...
@@ -84,9 +83,10 @@ export default {
.fixed-header
{
position
:
fixed
;
top
:
0
;
left
:
0
;
right
:
0
;
z-index
:
9
;
width
:
calc
(
100%
-
#{$
sideBarWidth
}
);
//
width
:
calc
(
100%
-
#{$
sideBarWidth
}
);
transition
:
width
0
.28s
;
}
...
...
admin/src/router/index.js
View file @
23f1289d
...
...
@@ -8,10 +8,11 @@ import Layout from '@/layout'
/* Router Modules */
import
tableRouter
from
'./modules/table'
import
DeviceRouter
from
'./modules/device'
import
TempaltesRouter
from
'./modules/templates'
import
CommonRouter
from
'./modules/common'
// import tableRouter from './modules/table'
// import DeviceRouter from './modules/device'
// import TempaltesRouter from './modules/templates'
// import CommonRouter from './modules/common'
import
ContentRouter
from
'./modules/contents'
/**
* 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
...
...
@@ -73,28 +74,30 @@ export const constantRoutes = [
]
},
{
path
:
'/
documentation
'
,
path
:
'/
profile
'
,
component
:
Layout
,
redirect
:
'/profile/index'
,
hidden
:
false
,
children
:
[
{
path
:
'index'
,
component
:
()
=>
import
(
'@/views/
documentation
/index'
),
name
:
'
Documentation
'
,
meta
:
{
title
:
'
Documentation'
,
icon
:
'documentation'
,
affix
:
fals
e
}
component
:
()
=>
import
(
'@/views/
profile
/index'
),
name
:
'
Profile
'
,
meta
:
{
title
:
'
个人中心'
,
icon
:
'user'
,
noCache
:
tru
e
}
}
]
},
{
path
:
'/
profile
'
,
path
:
'/
setting
'
,
component
:
Layout
,
redirect
:
'/
profile
/index'
,
hidden
:
tru
e
,
redirect
:
'/
setting
/index'
,
hidden
:
fals
e
,
children
:
[
{
path
:
'index'
,
component
:
()
=>
import
(
'@/views/profile/index'
),
name
:
'Profile'
,
meta
:
{
title
:
'
Profile
'
,
icon
:
'user'
,
noCache
:
true
}
meta
:
{
title
:
'
设置
'
,
icon
:
'user'
,
noCache
:
true
}
}
]
}
...
...
@@ -119,10 +122,11 @@ export const asyncRoutes = [
},
/** when your routing map is too long, you can split it into small modules **/
DeviceRouter
,
TempaltesRouter
,
tableRouter
,
CommonRouter
,
// DeviceRouter,
// TempaltesRouter,
// tableRouter,
// CommonRouter,
ContentRouter
,
// {
// path: 'external-link',
// component: Layout,
...
...
admin/src/router/modules/contents.js
0 → 100644
View file @
23f1289d
/** 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
admin/src/settings.js
View file @
23f1289d
module
.
exports
=
{
title
:
'
Vmatrix
Admin'
,
title
:
'Admin'
,
/**
* @type {boolean} true | false
...
...
@@ -11,13 +11,13 @@ module.exports = {
* @type {boolean} true | false
* @description Whether need tagsView
*/
tagsView
:
tru
e
,
tagsView
:
fals
e
,
/**
* @type {boolean} true | false
* @description Whether fix the header
*/
fixedHeader
:
fals
e
,
fixedHeader
:
tru
e
,
/**
* @type {boolean} true | false
...
...
admin/src/styles/sidebar.scss
View file @
23f1289d
...
...
@@ -14,7 +14,7 @@
height
:
100%
;
position
:
fixed
;
font-size
:
0px
;
top
:
0
;
top
:
51px
;
bottom
:
0
;
left
:
0
;
z-index
:
1001
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment