|
@@ -23,6 +23,7 @@
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="接口名称" prop="permissionUrl" :show-overflow-tooltip="true" align="center" />
|
|
|
<el-table-column label="备注" prop="permissionName" :show-overflow-tooltip="true" align="center" />
|
|
|
+ <el-table-column label="来源" prop="menuName" :show-overflow-tooltip="true" align="center" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
@@ -47,7 +48,7 @@
|
|
|
@pagination="getTreeMenuList"
|
|
|
/>
|
|
|
|
|
|
- <el-dialog title="分配菜单" :visible.sync="dialogVisible" width="35%">
|
|
|
+ <el-dialog title="分配菜单" :visible.sync="dialogVisible" width="40%">
|
|
|
<el-row>
|
|
|
<el-col>
|
|
|
<el-button
|
|
@@ -61,8 +62,8 @@
|
|
|
批量分配</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-table :data="addMenuAuthList" row-key="id" @selection-change="handelAddMenuAuth">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table ref="multipleTable" :data="addMenuAuthList" row-key="id" @selection-change="handelAddMenuAuth">
|
|
|
+ <el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
|
|
|
<el-table-column label="接口名称" prop="permissionUrl" :show-overflow-tooltip="true" align="center" />
|
|
|
<el-table-column label="备注" prop="permissionName" :show-overflow-tooltip="true" align="center" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
@@ -152,7 +153,6 @@ export default {
|
|
|
this.authList = data.permissionList
|
|
|
this.total = data.count
|
|
|
this.loading = false
|
|
|
- this.getAllAuthApi()
|
|
|
})
|
|
|
},
|
|
|
/** 查看所有权限接口 */
|
|
@@ -178,20 +178,24 @@ export default {
|
|
|
},
|
|
|
/** 添加菜单权限多选框选中数据 */
|
|
|
handelAddMenuAuth(selection) {
|
|
|
- this.menuAuthObj.permissionList = selection.map(item => {
|
|
|
- return {
|
|
|
- id: item.id
|
|
|
- }
|
|
|
+ selection.forEach(item => {
|
|
|
+ this.menuAuthObj.permissionList.push({ id: item.id })
|
|
|
})
|
|
|
+ this.menuAuthObj.permissionList = this._.uniqBy(this.menuAuthObj.permissionList, 'id')
|
|
|
this.distribution = !selection.length
|
|
|
},
|
|
|
/** 添加菜单权限按钮 */
|
|
|
handelAdd() {
|
|
|
+ this.getAllAuthApi()
|
|
|
+ this.allAuthQuery.page = 1
|
|
|
+ this.menuAuthObj.permissionList = []
|
|
|
this.dialogVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.multipleTable.clearSelection()
|
|
|
+ })
|
|
|
},
|
|
|
/** 分配按钮操作 */
|
|
|
distMenuAuthBtn(row) {
|
|
|
- this.menuAuthObj.permissionList = []
|
|
|
this.$confirm('是否分配接口权限?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
@@ -267,6 +271,7 @@ export default {
|
|
|
},
|
|
|
/** 取消分配菜单权限接口 */
|
|
|
delMenuAuth() {
|
|
|
+ this.queryParams.page = 1
|
|
|
this.delMenuAuthObj.id = this.queryParams.id
|
|
|
delMenuAuth(this.delMenuAuthObj).then(res => {
|
|
|
if (res.code === 200) {
|