|
@@ -1,6 +1,12 @@
|
|
|
<template>
|
|
|
<!-- 分配菜单 -->
|
|
|
- <el-dialog title="分配菜单" :visible.sync="dialogVisible" width="50%" top="10vh" append-to-body>
|
|
|
+ <el-dialog
|
|
|
+ title="分配菜单"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="50%"
|
|
|
+ top="10vh"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
<el-row>
|
|
|
<el-col>
|
|
|
<el-button
|
|
@@ -14,11 +20,36 @@
|
|
|
批量分配</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-table ref="multipleTable" v-loading="loading" :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">
|
|
|
+ <el-table
|
|
|
+ ref="multipleTable"
|
|
|
+ v-loading="loading"
|
|
|
+ :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"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
type="primary"
|
|
@@ -86,10 +117,12 @@ export default {
|
|
|
},
|
|
|
/** 添加菜单权限多选框选中数据 */
|
|
|
handelAddMenuAuth(selection) {
|
|
|
+ let arr = []
|
|
|
selection.forEach(item => {
|
|
|
- this.menuAuthObj.permissionList.push({ id: item.id })
|
|
|
+ arr.push({ id: item.id })
|
|
|
})
|
|
|
- this.menuAuthObj.permissionList = this._.uniqBy(this.menuAuthObj.permissionList, 'id')
|
|
|
+ arr = this._.uniqBy(arr, 'id')
|
|
|
+ this.menuAuthObj.permissionList = arr
|
|
|
this.distribution = !selection.length
|
|
|
},
|
|
|
/** 分配按钮操作 */
|
|
@@ -99,6 +132,7 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
+ this.menuAuthObj.permissionList = []
|
|
|
this.menuAuthObj.permissionList.push({ id: row.id })
|
|
|
this.distMenuAuth()
|
|
|
}).catch(() => {
|