Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
admin-yweb
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yfront
admin-yweb
Commits
d521b43e
Commit
d521b43e
authored
Aug 28, 2018
by
YoMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加后台获取权限列表
parent
20471e6c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
25 deletions
+70
-25
layouts/default.vue
+66
-18
middleware/authenticated.js
+2
-2
middleware/stats.js
+2
-2
pages/index.vue
+0
-3
No files found.
layouts/default.vue
View file @
d521b43e
...
...
@@ -11,17 +11,24 @@
</div>
</div>
<div
class=
"y_default_start"
>
<keep-alive>
<div
class=
"main_left"
:style=
"
{height: clientHeight + 'px'}">
<div
class=
"orderCtg_txt"
>
<p
v-for=
"(item, index) in orderList"
:class=
"$route.path===item.pagePath?'orderCtg_list_now':''"
@
click=
"entriesClick(item)"
>
{{
item
.
name
}}
</p>
</div>
<div
class=
"orderCtg_txt"
>
<p
v-for=
"(item, index) in lapsList"
:class=
"$route.path===item.pagePath?'orderCtg_list_now':''"
@
click=
"entriesClick(item)"
>
{{
item
.
name
}}
</p>
</div>
<div
class=
"orderCtg_txt"
>
<p
v-for=
"(item, index) in financeList"
:class=
"$route.path===item.pagePath?'orderCtg_list_now':''"
@
click=
"entriesClick(item)"
>
{{
item
.
name
}}
</p>
</div>
<el-menu
:default-active=
"item.name"
class=
"el-menu-vertical-demo"
@
open=
"handleOpen"
@
close=
"handleClose"
v-for=
"(item, index) in leftMenuList"
>
<el-submenu
:index=
"item.name"
:default-openeds=
"[]"
>
<template
slot=
"title"
>
<i
class=
"el-icon-location"
></i>
<span>
{{
item
.
name
}}
</span>
</
template
>
<el-menu-item
:index=
"sub.name"
v-for=
"(sub, subIndex) in item.pageList"
>
{{sub.name}}
</el-menu-item>
</el-submenu>
</el-menu>
</div>
</keep-alive>
<!-- 侧边栏结束 -->
<div
class=
"main_right"
>
<div
class=
"crumbs"
>
<span
class=
"crumbs_list"
v-for=
"(item, index) in Array.from(visitedViews)"
>
{{item.name}}
</span>
...
...
@@ -34,17 +41,23 @@
</template>
<
script
>
import
Vue
from
'vue'
import
Menu
from
'element-ui'
import
'element-ui/lib/theme-chalk/index.css'
import
YCookie
from
'../assets/js/yCookie.js'
// import requestApi from '../assets/js/requestApi.js'
import
requestApi
from
'../assets/js/requestApi.js'
Vue
.
use
(
Menu
)
export
default
{
data
()
{
return
{
tab
:
[
'系统管理'
,
'商品管理'
,
'订单管理'
,
'财务管理'
],
tabNow
:
0
,
systemList
:
[],
goodManageList
:
[],
orderList
:
[],
lapsList
:
[],
financeList
:
[],
clientHeight
:
0
clientHeight
:
0
,
leftMenuList
:
[]
}
},
computed
:
{
...
...
@@ -60,6 +73,17 @@ export default {
return
this
.
$store
.
state
.
financalTags
.
fVisitedViews
}
}
// leftMenuList() {
// if (this.tabNow === 0) {
// return this.systemList
// } else if (this.tabNow === 1) {
// return this.goodManageList
// } else if (this.tabNow === 2) {
// return this.orderList
// } else {
// return this.financeList
// }
// }
},
watch
:
{
$route
()
{
...
...
@@ -67,6 +91,23 @@ export default {
}
},
methods
:
{
initMenuList
()
{
console
.
log
(
'11111111'
)
this
.
leftMenuList
=
[]
if
(
this
.
tabNow
===
0
)
{
this
.
leftMenuList
=
this
.
systemList
}
else
if
(
this
.
tabNow
===
1
)
{
this
.
leftMenuList
=
this
.
goodManageList
}
else
if
(
this
.
tabNow
===
2
)
{
this
.
leftMenuList
=
this
.
orderList
}
else
{
this
.
leftMenuList
=
this
.
financeList
}
},
handleOpen
()
{
},
handleClose
()
{
},
generateRoute
()
{
if
(
this
.
$route
.
name
)
{
return
this
.
$route
...
...
@@ -91,14 +132,21 @@ export default {
},
// 获取列表数据
getOrderCtg
:
async
function
()
{
console
.
log
(
'get data ==== '
)
let
obj
=
await
requestApi
.
roleAuthList
(
this
)
if
(
obj
.
code
===
'success'
)
{
this
.
systemList
=
obj
.
data
.
sys
.
pageList
this
.
goodManageList
=
obj
.
data
.
goods
.
pageList
this
.
orderList
=
obj
.
data
.
order
.
pageList
this
.
financeList
=
obj
.
data
.
finance
.
pageList
this
.
initMenuList
()
}
},
switchTab
(
e
)
{
this
.
tabNow
=
e
this
.
initMenuList
()
YCookie
.
setLocalCookie
(
'tabNow'
,
this
.
tabNow
)
this
.
orderList
=
[]
this
.
lapsList
=
[]
this
.
financeList
=
[]
this
.
getOrderCtg
()
// this.getOrderCtg()
this
.
$router
.
push
({
path
:
'/'
})
...
...
@@ -207,11 +255,11 @@ export default {
font-weight
:
bold
;
}
.main_left
{
width
:
1
0
%
;
width
:
1
3
%
;
background
:
#E8E9EE
;
}
.main_right
{
width
:
90
%
;
width
:
87
%
;
position
:
relative
;
}
.crumbs
{
...
...
middleware/authenticated.js
View file @
d521b43e
export
default
function
({
store
,
redirect
})
{
console
.
log
(
'aut userId'
+
store
.
state
.
auth
)
if
(
store
.
state
.
auth
===
undefined
||
store
.
state
.
auth
===
null
||
Object
.
keys
(
store
.
state
.
auth
).
length
===
0
||
store
.
state
.
auth
.
userId
===
0
)
{
console
.
log
(
'aut userId'
+
store
.
state
.
usrAuth
.
auth
)
if
(
store
.
state
.
usrAuth
.
auth
===
undefined
||
store
.
state
.
usrAuth
.
auth
===
null
||
Object
.
keys
(
store
.
state
.
usrAuth
.
auth
).
length
===
0
||
store
.
state
.
usrAuth
.
auth
.
userId
===
0
)
{
redirect
(
'/login/login'
)
}
}
middleware/stats.js
View file @
d521b43e
export
default
function
({
route
,
redirect
,
store
})
{
console
.
log
(
'route.fullPath == '
+
route
.
fullPath
)
if
(
route
.
fullPath
===
'/login'
)
{
store
.
state
.
loginPath
=
store
.
state
.
forePath
store
.
state
.
usrAuth
.
loginPath
=
store
.
state
.
usrAuth
.
forePath
}
store
.
state
.
forePath
=
route
.
fullPath
store
.
state
.
usrAuth
.
forePath
=
route
.
fullPath
}
pages/index.vue
View file @
d521b43e
...
...
@@ -4,9 +4,6 @@
<h1
class=
"title"
>
Universal Vue.js Application Framework
</h1>
<nuxt-link
class=
"button"
to=
"/about"
>
About page
</nuxt-link>
</section>
</
template
>
...
...
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