Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backstage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SVI
svi-templates
backstage
Commits
16bcc222
Commit
16bcc222
authored
Oct 10, 2018
by
zengyilun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复收缩侧边栏
parent
0175021f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
21 deletions
+14
-21
index.js
template/src/api/index.js
+1
-3
Header.vue
template/src/components/Header.vue
+1
-1
SiderBar.vue
template/src/components/SiderBar.vue
+5
-17
index.js
template/src/store/index.js
+7
-0
No files found.
template/src/api/index.js
View file @
16bcc222
import
axios
from
'axios'
import
config
from
'./config'
import
systemSafety
from
'./systemSafety'
{{
#
serviceMonitor
}}
import
serviceMonitor
from
'./serviceMonitor'
{{
/serviceMonitor}
}
...
...
@@ -13,9 +14,6 @@ import systemMonitor from './systemMonitor'
{{
#
serverMonitor
}}
import
serverMonitor
from
'./serverMonitor'
{{
/serverMonitor}
}
{{
#
systemSafety
}}
import
systemSafety
from
'./systemSafety'
{{
/systemSafety}
}
const
CancelToken
=
axios
.
CancelToken
...
...
template/src/components/Header.vue
View file @
16bcc222
...
...
@@ -208,7 +208,7 @@
// 菜单操作
handleMenu
()
{
this
.
isCollapse
=
!
this
.
isCollapse
this
.
$
root
.
eventHub
.
$emit
(
'handleMenu'
,
this
.
isCollapse
)
// Hub触发事件,通过this.root.eventHub获取此对象//调用emit 方法
this
.
$
store
.
dispatch
(
'setCollapse'
,
this
.
isCollapse
)
},
// 重置密码
handleUsercenter
()
{
...
...
template/src/components/SiderBar.vue
View file @
16bcc222
...
...
@@ -18,13 +18,17 @@
export
default
{
name
:
'SiderBar'
,
conputed
:
{
isCollapse
()
{
return
this
.
$store
.
state
.
isCollapse
}
},
data
()
{
return
{
activeIndex
:
''
,
infos
:
[],
curIndex
:
'0'
,
childModuleinfos
:
''
,
// 新增定义
isCollapse
:
false
,
menuUrl
:
[]
// 菜单链接集合
}
},
...
...
@@ -49,22 +53,6 @@
mounted
()
{
this
.
init
()
},
created
()
{
// 切换
this
.
$on
(
'handleTab'
,
(
msg
)
=>
{
// Hub接收事件
for
(
var
i
=
0
;
i
<
this
.
infos
.
length
;
i
++
)
{
if
(
msg
===
this
.
infos
[
i
].
pageurl
)
{
this
.
curIndex
=
i
return
}
}
})
// 收起菜单栏,只剩图标
this
.
$root
.
eventHub
.
$on
(
'handleMenu'
,
(
msg
)
=>
{
// Hub接收事件
// console.log(msg)
this
.
isCollapse
=
msg
})
},
methods
:
{
init
()
{
let
yObj
=
localStorage
.
getItem
(
'gisopUserInfo'
)
...
...
template/src/store/index.js
View file @
16bcc222
...
...
@@ -11,6 +11,7 @@ const store = new Vuex.Store({
gisopUserInfo
:
{
},
isCollapse
:
false
,
sideMenu
:
[],
ruleid
:
''
},
...
...
@@ -21,6 +22,9 @@ const store = new Vuex.Store({
SET_GISOP_USER
(
state
,
payload
)
{
state
.
gisopUserInfo
=
payload
},
SET_Collapse
(
state
,
payload
)
{
state
.
isCollapse
=
payload
},
SET_SIDE_MENU
(
state
,
payload
)
{
state
.
sideMenu
=
payload
},
...
...
@@ -35,6 +39,9 @@ const store = new Vuex.Store({
setGisopUser
({
commit
},
payload
)
{
commit
(
'SET_GISOP_USER'
,
payload
)
},
setCollapse
({
commit
},
payload
)
{
commit
(
'SET_Collapse'
,
payload
)
},
setSideMenu
({
commit
},
payload
)
{
commit
(
'SET_SIDE_MENU'
,
payload
)
},
...
...
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