Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
qa-platform-ui
Commits
376d7a22
Commit
376d7a22
authored
Mar 07, 2022
by
王晓铜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加用户和权限查询
parent
4992a762
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
10 deletions
+50
-10
permission.vue
src/views/user/permission.vue
+19
-5
user.vue
src/views/user/user.vue
+31
-5
No files found.
src/views/user/permission.vue
View file @
376d7a22
...
...
@@ -2,7 +2,12 @@
<div>
<el-card>
<div
class=
"filter"
>
<el-button
type=
"primary"
icon=
"el-icon-circle-plus"
@
click=
"addPermissionDialog=true"
v-permission=
"('role:permission:add')"
>
新增
</el-button>
菜单名称:
<el-input
v-model=
"queryModuleInfo.menuName"
clearable
placeholder=
"请输入菜单名称"
style=
"width: 300px;"
>
</el-input>
<el-button
type=
"primary"
style=
"margin-left:10px"
icon=
"el-icon-search"
@
click=
"queryData"
>
查询
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-circle-plus"
@
click=
"addPermissionDialog=true"
v-permission=
"('role:permission:add')"
>
新增
</el-button>
</div>
<el-table
:data=
"permissionList"
border
style=
"width: 100%;margin-top:20px"
>
<el-table-column
type=
'index'
width=
"50px"
>
...
...
@@ -17,12 +22,16 @@
<el-table-column
prop=
"createTime"
label=
"创建时间"
width=
"200px"
></el-table-column>
<el-table-column
label=
"操作"
>
<slot
slot-scope=
"scope"
>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"openPermissionDialog(scope.row)"
v-permission=
"('role:permission:edit')"
>
编辑
</el-button>
<el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delPermissionFrom(scope.row)"
v-permission=
"('role:permission:del')"
>
删除
</el-button>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"openPermissionDialog(scope.row)"
v-permission=
"('role:permission:edit')"
>
编辑
</el-button>
<el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delPermissionFrom(scope.row)"
v-permission=
"('role:permission:del')"
>
删除
</el-button>
</slot>
</el-table-column>
</el-table>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page.sync=
"queryModuleInfo.pageNum"
:page-size=
"queryModuleInfo.pageSize"
layout=
"total, prev, pager, next"
:total=
"totalNum"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page.sync=
"queryModuleInfo.pageNum"
:page-size=
"queryModuleInfo.pageSize"
layout=
"total, prev, pager, next"
:total=
"totalNum"
>
</el-pagination>
</el-card>
<!-- 添加权限对话框 -->
...
...
@@ -82,7 +91,8 @@ export default {
return
{
queryModuleInfo
:
{
pageNum
:
1
,
pageSize
:
10
pageSize
:
10
,
menuName
:
''
},
permissionList
:
[],
...
...
@@ -138,6 +148,10 @@ export default {
this
.
getPermissionList
()
},
methods
:
{
// 查询方法
queryData
()
{
this
.
getPermissionList
()
},
// 获取权限列表
getPermissionList
()
{
getPermissionListPaging
(
this
.
queryModuleInfo
).
then
((
resp
)
=>
{
...
...
src/views/user/user.vue
View file @
376d7a22
<
template
>
<div>
<el-card>
<el-table
:data=
"userList"
border
style=
"width: 100%;"
>
<div>
用户名称:
<el-input
v-model=
"queryModuleInfo.userName"
clearable
placeholder=
"请输入用户名称"
style=
"width: 300px;"
>
</el-input>
<el-select
v-model=
"queryModuleInfo.roleId"
placeholder=
"请选择角色"
clearable
filterable
style=
"width:310px"
>
<el-option
v-for=
"item in roleList"
:key=
"item.roleId"
:label=
"item.roleName"
:value=
"item.roleId"
>
</el-option>
</el-select>
<el-button
type=
"primary"
style=
"margin-left:10px"
icon=
"el-icon-search"
@
click=
"queryData"
>
查询
</el-button>
</div>
<el-table
:data=
"userList"
border
style=
"width: 100%;margin-top:20px"
>
<el-table-column
type=
'index'
width=
"50px"
>
<template
slot-scope=
"scope"
>
<span>
{{
(
queryModuleInfo
.
pageNum
-
1
)
*
queryModuleInfo
.
pageSize
+
scope
.
$index
+
1
}}
</span>
...
...
@@ -20,11 +30,14 @@
<el-table-column
prop=
"createTime"
label=
"创建时间"
width=
"200px"
></el-table-column>
<el-table-column
label=
"操作"
>
<slot
slot-scope=
"scope"
>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"openEditDialog(scope.row)"
v-permission=
"('user:list:edit')"
>
编辑
</el-button>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"openEditDialog(scope.row)"
v-permission=
"('user:list:edit')"
>
编辑
</el-button>
</slot>
</el-table-column>
</el-table>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page.sync=
"queryModuleInfo.pageNum"
:page-size=
"queryModuleInfo.pageSize"
layout=
"total, prev, pager, next"
:total=
"totalNum"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page.sync=
"queryModuleInfo.pageNum"
:page-size=
"queryModuleInfo.pageSize"
layout=
"total, prev, pager, next"
:total=
"totalNum"
>
</el-pagination>
</el-card>
<!-- 编辑用户 -->
...
...
@@ -35,7 +48,8 @@
</el-form-item>
<el-form-item
label=
"角色名称:"
prop=
"roleId"
style=
"width:400px"
>
<el-select
v-model=
"editUserForm.roleId"
placeholder=
"请选择角色"
clearable
filterable
style=
"width:310px"
>
<el-option
v-for=
"item in roleList"
:key=
"item.roleId"
:label=
"item.roleName"
:value=
"item.roleId"
></el-option>
<el-option
v-for=
"item in roleList"
:key=
"item.roleId"
:label=
"item.roleName"
:value=
"item.roleId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"中文名称:"
style=
"width:400px"
>
...
...
@@ -62,7 +76,9 @@ export default {
return
{
queryModuleInfo
:
{
pageNum
:
1
,
pageSize
:
10
pageSize
:
10
,
userName
:
''
,
roleId
:
''
},
totalNum
:
0
,
userList
:
[],
...
...
@@ -95,8 +111,13 @@ export default {
},
created
()
{
this
.
getUserList
()
this
.
getRoleList
()
},
methods
:
{
// 查询功能
queryData
()
{
this
.
getUserList
()
},
// 获取用户列表
getUserList
()
{
getUserList
(
this
.
queryModuleInfo
).
then
((
resp
)
=>
{
...
...
@@ -162,3 +183,8 @@ export default {
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.el-select {
margin: 0 10px 0 5px;
}
</
style
>
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