|
@@ -2,13 +2,13 @@
|
2
|
2
|
<r-layout>
|
3
|
3
|
<xm-search @submit="search">
|
4
|
4
|
<el-form-item>
|
5
|
|
- <el-input v-model="filterData.name" placeholder="用户名" clearable></el-input>
|
|
5
|
+ <el-input v-model="listQuery.name" placeholder="用户名" clearable></el-input>
|
6
|
6
|
</el-form-item>
|
7
|
7
|
<el-form-item>
|
8
|
|
- <el-input v-model="filterData.phone" placeholder="手机号" clearable></el-input>
|
|
8
|
+ <el-input v-model="listQuery.phone" placeholder="手机号" clearable></el-input>
|
9
|
9
|
</el-form-item>
|
10
|
10
|
<el-form-item>
|
11
|
|
- <el-select v-model="filterData.identity" placeholder="请选择">
|
|
11
|
+ <el-select v-model="listQuery.identity" placeholder="请选择">
|
12
|
12
|
<el-option label="全部"></el-option>
|
13
|
13
|
<el-option
|
14
|
14
|
v-for="item in identityDict"
|
|
@@ -55,10 +55,10 @@
|
55
|
55
|
</el-table-column>
|
56
|
56
|
<el-table-column
|
57
|
57
|
fixed="right"
|
58
|
|
- label="操作"
|
59
|
|
- width="120">
|
|
58
|
+ label="操作">
|
60
|
59
|
<template slot-scope="scope">
|
61
|
60
|
<el-button type="text" @click="handleEdit(scope.row)" size="small">编辑</el-button>
|
|
61
|
+ <el-button type="text" @click="addUserRole(scope.row)" size="small">添加权限</el-button>
|
62
|
62
|
</template>
|
63
|
63
|
</el-table-column>
|
64
|
64
|
</el-table>
|
|
@@ -73,6 +73,28 @@
|
73
|
73
|
@current-change="getList"
|
74
|
74
|
>
|
75
|
75
|
</el-pagination>
|
|
76
|
+
|
|
77
|
+ <el-dialog title="添加权限" :visible.sync="filterData.dialogFormVisible" :show-close="filterData.close">
|
|
78
|
+ <el-form :model="filterData">
|
|
79
|
+ <el-form-item label="角色权限" required>
|
|
80
|
+ <el-select v-model="userRoleId" multiple placeholder="请选择">
|
|
81
|
+ <el-option
|
|
82
|
+ v-for="(item, index) in sysRole"
|
|
83
|
+ :key="index"
|
|
84
|
+ :label="item.roleName"
|
|
85
|
+ :value="item.roleId">
|
|
86
|
+ </el-option>
|
|
87
|
+ </el-select>
|
|
88
|
+ </el-form-item>
|
|
89
|
+
|
|
90
|
+ </el-form>
|
|
91
|
+ <div slot="footer" class="dialog-footer">
|
|
92
|
+ <el-button @click="TransactionReplyOff">取 消</el-button>
|
|
93
|
+ <el-button type="primary" @click="TransactionReplyAdd()">确 定</el-button>
|
|
94
|
+ </div>
|
|
95
|
+ </el-dialog>
|
|
96
|
+
|
|
97
|
+
|
76
|
98
|
</r-layout>
|
77
|
99
|
</template>
|
78
|
100
|
|
|
@@ -89,7 +111,17 @@ export default {
|
89
|
111
|
name: '',
|
90
|
112
|
phone: '',
|
91
|
113
|
identity: undefined,
|
|
114
|
+ dialogFormVisible: false,
|
|
115
|
+ close: false,
|
|
116
|
+ menuArray:[]
|
92
|
117
|
},
|
|
118
|
+ listQuery: {
|
|
119
|
+ name: '',
|
|
120
|
+ phone: '',
|
|
121
|
+ identity: undefined,
|
|
122
|
+ },
|
|
123
|
+ sysRole:[],
|
|
124
|
+ userRoleId:[],
|
93
|
125
|
pageNavi: {
|
94
|
126
|
page: 1,
|
95
|
127
|
size: 10,
|
|
@@ -106,10 +138,20 @@ export default {
|
106
|
138
|
methods: {
|
107
|
139
|
...mapUserActions([
|
108
|
140
|
'getSysUserList',
|
|
141
|
+ 'userRoledetails',
|
|
142
|
+ 'updateUserRolede',
|
109
|
143
|
]),
|
110
|
144
|
handleEdit (row) {
|
111
|
145
|
this.$router.push({ name: 'sysuseredit', query: {id: row.userId} })
|
112
|
146
|
},
|
|
147
|
+ addUserRole (row) {
|
|
148
|
+ this.filterData.userId = row.userId;
|
|
149
|
+ this.userRoledetails(this.filterData).then((data)=>{
|
|
150
|
+ this.sysRole = data.sysRole
|
|
151
|
+ this.userRoleId = data.arrayList
|
|
152
|
+ })
|
|
153
|
+ this.filterData.dialogFormVisible = true
|
|
154
|
+ },
|
113
|
155
|
addUser () {
|
114
|
156
|
this.$router.push({ name: 'sysuseredit' })
|
115
|
157
|
},
|
|
@@ -117,7 +159,7 @@ export default {
|
117
|
159
|
this.getSysUserList({
|
118
|
160
|
pageNum: this.pageNavi.page || 1,
|
119
|
161
|
pageSize: this.pageNavi.size,
|
120
|
|
- ...this.filterData,
|
|
162
|
+ ...this.listQuery,
|
121
|
163
|
}).then((data) => {
|
122
|
164
|
const { current: page, size, total } = data
|
123
|
165
|
this.pageNavi = { page, size, total }
|
|
@@ -139,7 +181,21 @@ export default {
|
139
|
181
|
getIdentityName (val) {
|
140
|
182
|
const identity = (this.identityDict || []).filter(x => x.value == val)[0] || {}
|
141
|
183
|
return identity.label || '-'
|
|
184
|
+ },
|
|
185
|
+ TransactionReplyOff(){
|
|
186
|
+ this.filterData.dialogFormVisible = false
|
|
187
|
+ this.getList()
|
|
188
|
+ },
|
|
189
|
+ TransactionReplyAdd(){
|
|
190
|
+ this.filterData.menuArray = this.userRoleId
|
|
191
|
+ this.updateUserRolede(this.filterData).then((res)=>{
|
|
192
|
+ console.log('测试返回值:', res)
|
|
193
|
+ this.getList()
|
|
194
|
+ })
|
|
195
|
+ this.filterData.dialogFormVisible = false
|
|
196
|
+
|
142
|
197
|
}
|
|
198
|
+
|
143
|
199
|
},
|
144
|
200
|
created () {
|
145
|
201
|
this.init()
|