|
@@ -128,7 +128,6 @@
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
:disabled="!multiple"
|
|
|
-
|
|
|
@click="handleDelete(scope.row)"
|
|
|
>删除</el-button>
|
|
|
<el-button
|
|
@@ -216,7 +215,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getRoleList, addRoleInfo, updateRoleInfo, delRoleById } from '@/api/system/role'
|
|
|
+import { getRoleList, addRoleInfo, updateRoleInfo, delRolesById } from '@/api/system/role'
|
|
|
|
|
|
export default {
|
|
|
name: 'Index',
|
|
@@ -293,7 +292,7 @@ export default {
|
|
|
},
|
|
|
/** 多选框选中数据 */
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.userId)
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
/** 查询用户列表 */
|
|
@@ -324,14 +323,7 @@ export default {
|
|
|
cancelButtonClass: 'btn_custom_cancel',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- for (const i in roleIdList) {
|
|
|
- const id = roleIdList[i]
|
|
|
- delRoleById({
|
|
|
- 'roleId': id
|
|
|
- }).then(response => {
|
|
|
- this.getRoleList()
|
|
|
- })
|
|
|
- }
|
|
|
+ this.delRolesById(roleIdList)
|
|
|
}).catch(() => {
|
|
|
this.$refs.roleTable.clearSelection()
|
|
|
})
|
|
@@ -343,18 +335,19 @@ export default {
|
|
|
cancelButtonClass: 'btn_custom_cancel',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- delRoleById({
|
|
|
- roleId
|
|
|
- }).then(response => {
|
|
|
- this.$message({
|
|
|
- message: '删除成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.getRoleList()
|
|
|
- })
|
|
|
+ this.delRolesById([roleId])
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
},
|
|
|
+ /** 删除角色请求 */
|
|
|
+ delRolesById(ids) {
|
|
|
+ delRolesById(ids).then(res => {
|
|
|
+ this.$message({
|
|
|
+ message: '批量删除成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset()
|