|
|
@ -6,6 +6,9 @@
|
|
|
|
<!-- 角色列表 -->
|
|
|
|
<!-- 角色列表 -->
|
|
|
|
<a-col :span="5">
|
|
|
|
<a-col :span="5">
|
|
|
|
<div class="cardTitle">所有角色</div>
|
|
|
|
<div class="cardTitle">所有角色</div>
|
|
|
|
|
|
|
|
<a-button class="add-btn" style="margin: 10px" @click="add.show = true"
|
|
|
|
|
|
|
|
>新增角色</a-button
|
|
|
|
|
|
|
|
>
|
|
|
|
<a-collapse accordion @change="rolechange">
|
|
|
|
<a-collapse accordion @change="rolechange">
|
|
|
|
<a-collapse-panel
|
|
|
|
<a-collapse-panel
|
|
|
|
v-for="(item, index) in roleList"
|
|
|
|
v-for="(item, index) in roleList"
|
|
|
@ -81,7 +84,6 @@
|
|
|
|
@cancel="sendClose"
|
|
|
|
@cancel="sendClose"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
请选择角色:
|
|
|
|
请选择角色:
|
|
|
|
<!-- <a-cascader :options="roleList" mode="multiple" :field-names="{ label: 'name', value: 'id', children: 'childrenList' }" placeholder="请选择" @change="onChange" style="width: 90%"/> -->
|
|
|
|
|
|
|
|
<el-cascader
|
|
|
|
<el-cascader
|
|
|
|
:options="roleList"
|
|
|
|
:options="roleList"
|
|
|
|
:show-all-levels="false"
|
|
|
|
:show-all-levels="false"
|
|
|
@ -90,22 +92,37 @@
|
|
|
|
@change="multiRole"
|
|
|
|
@change="multiRole"
|
|
|
|
></el-cascader>
|
|
|
|
></el-cascader>
|
|
|
|
</a-modal>
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
<add-form
|
|
|
|
|
|
|
|
:show="add.show"
|
|
|
|
|
|
|
|
:title="add.title"
|
|
|
|
|
|
|
|
:list="roleList"
|
|
|
|
|
|
|
|
@close="addClose"
|
|
|
|
|
|
|
|
@success='success'
|
|
|
|
|
|
|
|
:id='add.editId'
|
|
|
|
|
|
|
|
></add-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { columns, pagination, searchForm } from "./depend/config.js";
|
|
|
|
import { columns, pagination, searchForm } from "./depend/config.js";
|
|
|
|
import { rolelist, listByRole, assignRoles} from "@/api/basic/role";
|
|
|
|
import { rolelist, listByRole, assignRoles, roleDel} from "@/api/basic/role";
|
|
|
|
import rolePermissions from "./depend/permissions.vue";
|
|
|
|
import rolePermissions from "./depend/permissions.vue";
|
|
|
|
|
|
|
|
import addForm from "./depend/form.vue";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
rolePermissions,
|
|
|
|
rolePermissions,
|
|
|
|
|
|
|
|
addForm,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
pagination,
|
|
|
|
pagination,
|
|
|
|
columns,
|
|
|
|
columns,
|
|
|
|
searchForm,
|
|
|
|
searchForm,
|
|
|
|
|
|
|
|
add: {
|
|
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
|
|
title: "新增角色",
|
|
|
|
|
|
|
|
editId:null
|
|
|
|
|
|
|
|
},
|
|
|
|
tableChoosed: [],
|
|
|
|
tableChoosed: [],
|
|
|
|
roleList: [],
|
|
|
|
roleList: [],
|
|
|
|
tableData: [], // 数据
|
|
|
|
tableData: [], // 数据
|
|
|
@ -151,7 +168,38 @@ export default {
|
|
|
|
this.tableData = res.data.rows;
|
|
|
|
this.tableData = res.data.rows;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onChange(){},
|
|
|
|
success(){
|
|
|
|
|
|
|
|
this.getData()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
addClose() {
|
|
|
|
|
|
|
|
this.add.show = false;
|
|
|
|
|
|
|
|
this.add.editId = undefined;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 编辑角色
|
|
|
|
|
|
|
|
editRole(id){
|
|
|
|
|
|
|
|
this.add.editId = id
|
|
|
|
|
|
|
|
this.add.title = '修改角色'
|
|
|
|
|
|
|
|
this.add.show= true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 删除角色
|
|
|
|
|
|
|
|
delRole(id) {
|
|
|
|
|
|
|
|
this.$confirm({
|
|
|
|
|
|
|
|
title: "是否删除",
|
|
|
|
|
|
|
|
// okText:'删除',
|
|
|
|
|
|
|
|
// cancelText:'取消',
|
|
|
|
|
|
|
|
icon: "",
|
|
|
|
|
|
|
|
onOk:()=> {
|
|
|
|
|
|
|
|
roleDel({roleId:id}).then(res=>{
|
|
|
|
|
|
|
|
if(res.code === 200){
|
|
|
|
|
|
|
|
this.$message.success(res.msg)
|
|
|
|
|
|
|
|
this.getData()
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
rolechange(data) {
|
|
|
|
rolechange(data) {
|
|
|
|
if (data) {
|
|
|
|
if (data) {
|
|
|
|
this.searchForm.roleId = this.roleList[data].id;
|
|
|
|
this.searchForm.roleId = this.roleList[data].id;
|
|
|
@ -209,23 +257,6 @@ export default {
|
|
|
|
this.form.manageUserId = undefined
|
|
|
|
this.form.manageUserId = undefined
|
|
|
|
this.send.show = false
|
|
|
|
this.send.show = false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 编辑角色
|
|
|
|
|
|
|
|
editRole(id){
|
|
|
|
|
|
|
|
this.add.editId = id
|
|
|
|
|
|
|
|
this.add.show= true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 删除角色
|
|
|
|
|
|
|
|
delRole(data) {
|
|
|
|
|
|
|
|
this.$confirm({
|
|
|
|
|
|
|
|
title: "是否删除",
|
|
|
|
|
|
|
|
// okText:'删除',
|
|
|
|
|
|
|
|
// cancelText:'取消',
|
|
|
|
|
|
|
|
icon: "",
|
|
|
|
|
|
|
|
onOk: function () {
|
|
|
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Actions(data) {
|
|
|
|
Actions(data) {
|
|
|
|
console.log(data);
|
|
|
|
console.log(data);
|
|
|
|
},
|
|
|
|
},
|
|
|
|