角色管理
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="margin: 5px 0 10px 2px">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'sys:role:add'">添加角色</a-button>
|
||||
<a-button @click="handleAddLowerLevel" type="primary" icon="plus" >添加下级</a-button>
|
||||
<a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
@@ -64,6 +65,7 @@ import UserRoleModal from "./modules/UserRoleModal";
|
||||
import JEllipsis from "@comp/jero/JEllipsis";
|
||||
import moment from "moment";
|
||||
|
||||
|
||||
export default {
|
||||
name: "RoleUserList",
|
||||
mixins: [JeroListMixin],
|
||||
@@ -94,6 +96,11 @@ export default {
|
||||
dataIndex: "roleName",
|
||||
scopedSlots: {customRender: 'text'}
|
||||
},
|
||||
{
|
||||
title: "上级角色",
|
||||
align: "center",
|
||||
dataIndex: "",
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
dataIndex: "createTime",
|
||||
@@ -112,7 +119,7 @@ export default {
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/sys/role/page",
|
||||
// list: "/sys/role/page",
|
||||
delete: "/sys/role/delete",
|
||||
deleteBatch: "/sys/role/deleteBatch",
|
||||
list2: "/sys/user/userRoleList",
|
||||
@@ -151,7 +158,22 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*
|
||||
* 添加下级
|
||||
* */
|
||||
handleAddLowerLevel(){
|
||||
if(this.selectedRowKeys.length === 0){
|
||||
this.$message.warning('请选择一条记录')
|
||||
return
|
||||
}
|
||||
if(this.selectedRowKeys.length > 1){
|
||||
this.$message.warning('只能选择一条记录')
|
||||
return
|
||||
}
|
||||
// 将这行的角色id作为新建角色的的父级id
|
||||
this.$refs.modalForm.addLowerRole(this.selectedRowKeys[0]);
|
||||
this.$refs.modalForm.title='添加下级'
|
||||
},
|
||||
handleAddUserRole() {
|
||||
if (this.currentRoleId == "") {
|
||||
this.$message.error("请选择一个角色!");
|
||||
|
||||
Reference in New Issue
Block a user