Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-operation-4
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
达摩4.0重构
haoban-operation-4
Commits
3cb5e4fa
Commit
3cb5e4fa
authored
Jul 27, 2020
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限项列表
parent
44eaef19
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
131 additions
and
7 deletions
+131
-7
.gitignore
.gitignore
+1
-0
permission.js
src/api/permission.js
+5
-0
layout.vue
src/layout/layout.vue
+23
-5
menu-list.vue
src/views/permission/menu-config/menu-list.vue
+1
-0
permission-list.vue
src/views/permission/permission-list.vue
+101
-2
No files found.
.gitignore
View file @
3cb5e4fa
...
...
@@ -13,6 +13,7 @@ yarn-error.log*
package-lock.json
yarn.lock
index-1.js
todo.md
# Editor directories and files
.idea
...
...
src/api/permission.js
View file @
3cb5e4fa
...
...
@@ -5,6 +5,11 @@ const api = {
addMenu
:
'/menu-add'
,
// 添加菜单、添加子菜单
editMenu
:
'/menu-edit'
,
// 编辑菜单
delMenu
:
'/menu-del'
,
// 删除菜单
addAuthItem
:
'/add-auth-item'
,
// 添加权限项
editAuthItem
:
'/edit-auth-item'
,
// 编辑权限项
delAuthItem
:
'/del-auth-item'
,
// 删除权限项
getAuthItemList
:
'/auth-item-list'
,
// 获取权限项列表
getOperationItemList
:
'/operation-item-list'
,
// 获取操作项列表
}
export
default
getFetch
(
api
,
'/hb-manage-web'
);
src/layout/layout.vue
View file @
3cb5e4fa
<
template
>
<div
class=
"layout"
>
<yw-header
@
updateAsideMenu=
"updateAsideMenu"
></yw-header>
<aside-menu
:menu=
"menu"
></aside-menu>
<div
class=
"main"
>
<aside-menu
:menu=
"menu"
></aside-menu>
<el-breadcrumb
separator-class=
"el-icon-arrow-right"
v-if=
"breadList.length"
>
<el-breadcrumb-item
v-for=
"item in breadList"
:key=
"item"
:to=
"
{ path: item.path }">
{{
item
.
name
}}
</el-breadcrumb-item>
</el-breadcrumb>
<keep-alive>
<router-view
v-if=
"$route.meta.keepAlive"
:key=
"$route.fullPath"
></router-view>
<router-view
v-if=
"$route.meta.keepAlive"
:key=
"$route.fullPath"
@
updateBread=
"updateBread"
></router-view>
</keep-alive>
<router-view
v-if=
"!$route.meta.keepAlive"
:key=
"$route.fullPath"
></router-view>
<router-view
v-if=
"!$route.meta.keepAlive"
:key=
"$route.fullPath"
@
updateBread=
"updateBread"
></router-view>
</div>
</div>
</
template
>
...
...
@@ -19,18 +22,22 @@ export default {
components
:
{
YwHeader
,
AsideMenu
},
data
()
{
return
{
menu
:
[]
menu
:
[],
breadList
:
[]
}
},
methods
:
{
updateAsideMenu
(
menu
)
{
this
.
menu
=
menu
||
[];
},
updateBread
(
val
)
{
this
.
breadList
=
val
||
[];
}
}
}
</
script
>
<
style
scoped
>
<
style
lang=
"less"
scoped
>
.layout
{
padding
:
84px
20px
20px
240px
;
min-width
:
1400px
;
...
...
@@ -42,4 +49,15 @@ export default {
background
:
#fff
;
overflow-y
:
scroll
;
}
.el-breadcrumb
{
width
:
100%
;
padding
:
17px
20px
18px
;
background-color
:
#fff
;
border-bottom
:
1px
solid
@
gray-separator
;
}
/
deep
/
.el-breadcrumb__inner
{
a
:
hover
,
&
.
is-link
:
hover
{
color
:
@
blue
;
}
}
</
style
>
src/views/permission/menu-config/menu-list.vue
View file @
3cb5e4fa
...
...
@@ -187,6 +187,7 @@ export default {
}
},
mounted
()
{
this
.
menuList
=
[];
this
.
getMenuList
();
},
methods
:
{
...
...
src/views/permission/permission-list.vue
View file @
3cb5e4fa
<
template
>
<div>
权限项列表
</div>
<div
style=
"padding: 20px"
>
<div
style=
"text-align: right"
>
<el-button
type=
"primary"
>
新建权限项
</el-button>
</div>
<el-table
style=
"margin-top: 20px"
:data=
"authList"
>
<el-table-column
label=
"权限名称"
prop=
"authItemName"
:formatter=
"(row, col, val) => val || '--'"
></el-table-column>
<el-table-column
label=
"包含操作项"
prop=
"operationItemNames"
:formatter=
"(row, col, val) => val || '--'"
></el-table-column>
<el-table-column
label=
"操作"
>
<el-button
type=
"text"
>
编辑
</el-button>
<el-button
type=
"text"
>
删除
</el-button>
</el-table-column>
</el-table>
<el-dialog
:visible
.
sync=
"editAuth.show"
:title=
"editAuth.authItemId ? '编辑权限项' : '新建权限项'"
width=
"600px"
>
<el-form
:model=
"editAuth"
ref=
"editAuth"
>
<el-form-item
label=
"权限项名称"
>
<el-input
type=
"text"
placeholder=
"请输入权限项名称"
style=
"width: 440px"
maxlength=
"20"
show-limit-word
v-model
.
trim=
"editAuth.authItemName"
></el-input>
</el-form-item>
<el-form-item
label=
"包含操作项"
></el-form-item>
</el-form>
<template
slot=
"footer"
>
<el-button
@
click=
"editAuth.show = false"
>
取消
</el-button>
<el-button
type=
"primary"
:loading=
"editAuth.loading"
>
{{
editAuth
.
authItemId
?
'保存'
:
'新建'
}}
</el-button>
</
template
>
</el-dialog>
</div>
</template>
<
script
>
import
api
from
'@/api/permission.js'
;
// eslint-disable-next-line
const
{
addAuthItem
,
editAuthItem
,
delAuthItem
,
getAuthItemList
,
getOperationItemList
}
=
api
;
export
default
{
name
:
'permission-list'
name
:
'permission-list'
,
data
()
{
return
{
bread
:
[
{
path
:
'/menu-config'
,
name
:
'权限配置'
},
{
name
:
'权限项'
}
],
menuId
:
''
,
// 操作项列表
operationList
:
[],
// 权限项列表
authList
:
[],
// 新建、编辑权限项弹窗相关的数据
editAuth
:
{
show
:
true
,
loading
:
false
,
authItemId
:
''
,
authItemName
:
''
,
operationItemNames
:
''
,
operationItemIds
:
''
}
}
},
created
()
{
const
{
menuId
}
=
this
.
$route
.
query
;
if
(
!
menuId
)
{
return
this
.
$router
.
go
(
-
1
);
}
this
.
menuId
=
menuId
;
this
.
initData
();
this
.
$emit
(
'updateBread'
,
this
.
bread
)
},
methods
:
{
initData
()
{
this
.
getAuthItemList
();
return
;
getOperationItemList
({
menuId
:
this
.
menuId
}).
then
(
res
=>
{
this
.
operationList
=
res
.
result
||
[];
})
this
.
getAuthItemList
();
},
getAuthItemList
()
{
this
.
authList
=
[
{
menuId
:
''
,
authItemId
:
'123'
,
authItemName
:
'权限项名称123'
,
operationItemNames
:
'操作项集合123'
,
operationItemIds
:
''
},
{
menuId
:
''
,
authItemId
:
'456'
,
authItemName
:
'权限项名称456'
,
operationItemNames
:
'操作项集合456'
,
operationItemIds
:
''
},
]
return
;
getAuthItemList
({
menuId
:
this
.
menuId
}).
then
(
res
=>
{
this
.
authList
=
res
.
result
||
[];
})
}
}
}
</
script
>
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