|
@@ -32,6 +32,17 @@
|
|
|
删除
|
|
删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template v-slot:enable="{ row }">
|
|
|
|
|
+ <el-switch
|
|
|
|
|
+ v-model="row.enable"
|
|
|
|
|
+ active-color="#13ce66"
|
|
|
|
|
+ inactive-color="#ff4949"
|
|
|
|
|
+ :active-value="1"
|
|
|
|
|
+ :inactive-value="0"
|
|
|
|
|
+ @change="changeEnable(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-switch>
|
|
|
|
|
+ </template>
|
|
|
<!-- 操作列 -->
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
<template v-slot:action="{ row }">
|
|
|
<el-link
|
|
<el-link
|
|
@@ -42,14 +53,14 @@
|
|
|
>
|
|
>
|
|
|
修改
|
|
修改
|
|
|
</el-link>
|
|
</el-link>
|
|
|
- <el-link
|
|
|
|
|
|
|
+ <!-- <el-link
|
|
|
type="primary"
|
|
type="primary"
|
|
|
:underline="false"
|
|
:underline="false"
|
|
|
icon="el-icon-finished"
|
|
icon="el-icon-finished"
|
|
|
@click="openAuth(row)"
|
|
@click="openAuth(row)"
|
|
|
>
|
|
>
|
|
|
分配权限
|
|
分配权限
|
|
|
- </el-link>
|
|
|
|
|
|
|
+ </el-link> -->
|
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
|
class="ele-action"
|
|
class="ele-action"
|
|
|
title="确定要删除此角色吗?"
|
|
title="确定要删除此角色吗?"
|
|
@@ -75,7 +86,12 @@
|
|
|
import RoleSearch from './components/role-search.vue';
|
|
import RoleSearch from './components/role-search.vue';
|
|
|
import RoleEdit from './components/role-edit.vue';
|
|
import RoleEdit from './components/role-edit.vue';
|
|
|
import RoleAuth from './components/role-auth.vue';
|
|
import RoleAuth from './components/role-auth.vue';
|
|
|
- import { pageRoles, removeRole, removeRoles } from '@/api/system/role';
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ pageRoles,
|
|
|
|
|
+ removeRole,
|
|
|
|
|
+ removeRoles,
|
|
|
|
|
+ putRoles
|
|
|
|
|
+ } from '@/api/system/role';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'SystemRole',
|
|
name: 'SystemRole',
|
|
@@ -111,17 +127,19 @@
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- prop: 'roleCode',
|
|
|
|
|
- label: '角色标识',
|
|
|
|
|
|
|
+ prop: 'groupId',
|
|
|
|
|
+ label: '组织ID',
|
|
|
sortable: 'custom',
|
|
sortable: 'custom',
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- prop: 'comments',
|
|
|
|
|
- label: '备注',
|
|
|
|
|
|
|
+ prop: 'enable',
|
|
|
|
|
+ label: '启用状态',
|
|
|
sortable: 'custom',
|
|
sortable: 'custom',
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
|
|
+ slot: 'enable',
|
|
|
|
|
+
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -154,18 +172,28 @@
|
|
|
showAuth: false
|
|
showAuth: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- created() {
|
|
|
|
|
- this.getRoles(); //获取角色列表数据。该方法在实例初始化时实现。在实例销毁时
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ created() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
- getRoles() {},
|
|
|
|
|
/* 表格数据源 */
|
|
/* 表格数据源 */
|
|
|
datasource({ page, limit, where, order }) {
|
|
datasource({ page, limit, where, order }) {
|
|
|
- return pageRoles({ ...where, ...order, page, limit });
|
|
|
|
|
|
|
+ console.log(where);
|
|
|
|
|
+ return pageRoles({ pageNum: page, size: limit, ...where });
|
|
|
|
|
+ },
|
|
|
|
|
+ async changeEnable(row) {
|
|
|
|
|
+ const res = await putRoles(row);
|
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '修改成功',
|
|
|
|
|
+ customClass: 'ele-message-border'
|
|
|
|
|
+ });
|
|
|
|
|
+ this.reload();
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
/* 刷新表格 */
|
|
/* 刷新表格 */
|
|
|
reload(where) {
|
|
reload(where) {
|
|
|
- this.$refs.table.reload({ page: 1, where: where });
|
|
|
|
|
|
|
+ console.log(where, '1111');
|
|
|
|
|
+ this.$refs.table.reload({ page: 1, where });
|
|
|
},
|
|
},
|
|
|
/* 显示编辑 */
|
|
/* 显示编辑 */
|
|
|
openEdit(row) {
|
|
openEdit(row) {
|
|
@@ -180,7 +208,7 @@
|
|
|
/* 删除 */
|
|
/* 删除 */
|
|
|
remove(row) {
|
|
remove(row) {
|
|
|
const loading = this.$loading({ lock: true });
|
|
const loading = this.$loading({ lock: true });
|
|
|
- removeRole(row.roleId)
|
|
|
|
|
|
|
+ removeRole(row.id)
|
|
|
.then((msg) => {
|
|
.then((msg) => {
|
|
|
loading.close();
|
|
loading.close();
|
|
|
this.$message.success(msg);
|
|
this.$message.success(msg);
|
|
@@ -202,7 +230,10 @@
|
|
|
})
|
|
})
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
const loading = this.$loading({ lock: true });
|
|
const loading = this.$loading({ lock: true });
|
|
|
- removeRoles(this.selection.map((d) => d.roleId))
|
|
|
|
|
|
|
+ removeRole(
|
|
|
|
|
+ this.selection.map((d) => d.id),
|
|
|
|
|
+ true
|
|
|
|
|
+ )
|
|
|
.then((msg) => {
|
|
.then((msg) => {
|
|
|
loading.close();
|
|
loading.close();
|
|
|
this.$message.success(msg);
|
|
this.$message.success(msg);
|