|
|
@ -3,7 +3,6 @@ |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<div class="p-title m-b-20">筛选</div> |
|
|
|
<div class="p-title m-b-20">筛选</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex"> |
|
|
|
<div class="flex"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
|
|
|
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
|
|
@ -35,10 +34,10 @@ |
|
|
|
<el-table-column label="操作" width="180"> |
|
|
|
<el-table-column label="操作" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" @click="showRole(scope.row)" v-auth="'system:角色权限:查看'">查看</el-button> |
|
|
|
<el-button type="text" @click="showRole(scope.row)" v-auth="'system:角色权限:查看'">查看</el-button> |
|
|
|
<template v-if="scope.row.id != 1"> |
|
|
|
<!-- <template v-if="scope.row.id != 1"> --> |
|
|
|
<el-button type="text" @click="editRole(scope.row)" v-auth="'system:角色权限:编辑'">编辑</el-button> |
|
|
|
<el-button type="text" @click="editRole(scope.row)" v-auth="'system:角色权限:编辑'">编辑</el-button> |
|
|
|
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'system:角色权限:删除'">删除</el-button> |
|
|
|
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'system:角色权限:删除'">删除</el-button> |
|
|
|
</template> |
|
|
|
<!-- </template> --> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
@ -80,7 +79,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { mapState } from 'vuex'; |
|
|
|
import { mapState } from 'vuex' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'role', |
|
|
|
name: 'role', |
|
|
|
data() { |
|
|
|
data() { |
|
|
@ -105,150 +104,13 @@ export default { |
|
|
|
isAdd: true, |
|
|
|
isAdd: true, |
|
|
|
roleVisible: false, |
|
|
|
roleVisible: false, |
|
|
|
searchTimer: null, |
|
|
|
searchTimer: null, |
|
|
|
permissions: [ |
|
|
|
permissions: [], |
|
|
|
{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: '学校管理', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: '新增客户' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 2, |
|
|
|
|
|
|
|
name: '批量删除' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 3, |
|
|
|
|
|
|
|
name: '查看' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 4, |
|
|
|
|
|
|
|
name: '编辑' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 5, |
|
|
|
|
|
|
|
name: '删除' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 6, |
|
|
|
|
|
|
|
name: '禁用' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: '用户管理', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 7, |
|
|
|
|
|
|
|
name: '新增用户' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 8, |
|
|
|
|
|
|
|
name: '批量导入' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 9, |
|
|
|
|
|
|
|
name: '批量删除' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 10, |
|
|
|
|
|
|
|
name: '查看' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 11, |
|
|
|
|
|
|
|
name: '编辑' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 12, |
|
|
|
|
|
|
|
name: '重置密码' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 13, |
|
|
|
|
|
|
|
name: '删除' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: '题库管理', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 14, |
|
|
|
|
|
|
|
name: '我上传的题库', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 2, |
|
|
|
|
|
|
|
name: '新增' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 4, |
|
|
|
|
|
|
|
name: '批量删除' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 5, |
|
|
|
|
|
|
|
name: '编辑' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 2, |
|
|
|
|
|
|
|
name: '删除' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 15, |
|
|
|
|
|
|
|
name: '公共题库', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 2, |
|
|
|
|
|
|
|
name: '新增' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 4, |
|
|
|
|
|
|
|
name: '批量删除' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 5, |
|
|
|
|
|
|
|
name: '编辑' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 2, |
|
|
|
|
|
|
|
name: '删除' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 16, |
|
|
|
|
|
|
|
name: '系统设置', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 17, |
|
|
|
|
|
|
|
name: '员工管理', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 18, |
|
|
|
|
|
|
|
name: '新增' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 19, |
|
|
|
|
|
|
|
name: '批量删除' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 20, |
|
|
|
|
|
|
|
name: '编辑' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 21, |
|
|
|
|
|
|
|
name: '删除' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: '角色权限', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 22, |
|
|
|
|
|
|
|
name: '新增' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 23, |
|
|
|
|
|
|
|
name: '批量删除' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 24, |
|
|
|
|
|
|
|
name: '编辑' |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
id: 25, |
|
|
|
|
|
|
|
name: '删除' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
checkedIds: [] |
|
|
|
checkedIds: [] |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
...mapState('user', [ |
|
|
|
...mapState('user', [ |
|
|
|
'clientId','clientName' |
|
|
|
'userId','clientId' |
|
|
|
]) |
|
|
|
]) |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
@ -282,8 +144,8 @@ export default { |
|
|
|
remark : '', |
|
|
|
remark : '', |
|
|
|
id: '' |
|
|
|
id: '' |
|
|
|
} |
|
|
|
} |
|
|
|
// this.checkedIds = [] |
|
|
|
this.checkedIds = [] |
|
|
|
// this.permissions = [] |
|
|
|
this.permissions = [] |
|
|
|
}, |
|
|
|
}, |
|
|
|
currentChange(val) { |
|
|
|
currentChange(val) { |
|
|
|
this.pageNo = val; |
|
|
|
this.pageNo = val; |
|
|
@ -293,7 +155,6 @@ export default { |
|
|
|
if(!this.permissions.length){ |
|
|
|
if(!this.permissions.length){ |
|
|
|
this.$get(this.api.queryPermissionMenu).then(res => { |
|
|
|
this.$get(this.api.queryPermissionMenu).then(res => { |
|
|
|
this.permissions = res.data.children[0].children |
|
|
|
this.permissions = res.data.children[0].children |
|
|
|
console.log(11,JSON.stringify(this.permissions)) |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -301,7 +162,7 @@ export default { |
|
|
|
this.isAdd = true |
|
|
|
this.isAdd = true |
|
|
|
this.getPer() |
|
|
|
this.getPer() |
|
|
|
this.checkedIds = [] |
|
|
|
this.checkedIds = [] |
|
|
|
// this.permissions.length && this.$refs.per.setCheckedNodes([]) |
|
|
|
this.permissions.length && this.$refs.per.setCheckedNodes([]) |
|
|
|
this.roleVisible = true |
|
|
|
this.roleVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleRolePer(data,permissions){ |
|
|
|
handleRolePer(data,permissions){ |
|
|
@ -324,7 +185,7 @@ export default { |
|
|
|
let perRes = await this.$get(`${this.api.toAssign}/${row.id}`) |
|
|
|
let perRes = await this.$get(`${this.api.toAssign}/${row.id}`) |
|
|
|
if(perRes.success){ |
|
|
|
if(perRes.success){ |
|
|
|
this.checkedIds = this.handleRolePer(perRes.data.rolePermissions,this.permissions) |
|
|
|
this.checkedIds = this.handleRolePer(perRes.data.rolePermissions,this.permissions) |
|
|
|
// this.$refs.per.setCheckedNodes(this.checkedIds) |
|
|
|
this.$refs.per.setCheckedNodes(this.checkedIds) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|