This commit is contained in:
zhutianqi
2021-06-30 20:44:12 +08:00
parent 04190a44a0
commit a37f592df3
2 changed files with 126 additions and 57 deletions
@@ -31,6 +31,10 @@
@click="roleAdd"
v-btn-permission="'93e75b6ec0b2b6b0b40d2b11adeba88a'"
size="mini">配置角色资源</el-button>
<el-button type="primary"
class="common-button-primary add-button"
@click="roleAddData"
size="mini">配置数据权限</el-button>
</div>
<div class="content">
<el-table
@@ -102,6 +106,31 @@
<el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="confirmDialog">确定</el-button>
</div>
</el-dialog>
<el-dialog
title="系统菜单"
:visible.sync="modalflag"
:wrapperClosable="false"
@close="closeDialogData"
size="800px">
<div class="myDialog">
<el-tree
v-if="modalflag"
node-key="id"
class="filter-tree"
:data="treeData3"
:props="defaultProps3"
:default-checked-keys="nodeList2"
default-expand-all
show-checkbox
check-strictly
ref="tree3">
</el-tree>
</div>
<div slot="footer">
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="closeDialogData">取消</el-button>
<el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="confirmDialogData">确定</el-button>
</div>
</el-dialog>
</div>
</template>
@@ -110,6 +139,13 @@ export default {
name: 'role-manage',
data () {
return {
treeData3: [],
defaultProps3: {
children: 'children',
label: 'name'
},
nodeList2: [],
modalflag: false,
sideClose: false, // 边栏收展状态
filterText: '',
treeData: [],
@@ -131,6 +167,37 @@ export default {
}
},
methods: {
getTree3 () {
this.$http.get('sarResource/ts-resource', {}, {}, res=> {
if (res.ok) {
this.treeData3 = res.data
}
})
},
confirmDialogData () {
this.$http.postData('sarRole/role/resource', {
resourceIds: this.$refs.tree3.getCheckedKeys().concat(this.$refs.tree3.getHalfCheckedKeys()),
roleId: this.id
}, {}, res=> {
if (res.ok) {
this.$message.success('设置权限成功')
this.modalflag = false
}
})
},
closeDialogData () {
this.modalflag = false
},
roleAddData () {
this.$http.get('sarRole/role/resource', {
roleId: this.id
}, {}, res=> {
if (res.ok) {
this.nodeList2 = res.data
this.modalflag = true
}
})
},
closeDialog () {
this.modalshowflag = false
},
@@ -205,6 +272,7 @@ export default {
mounted () {
this.getTree()
this.getTree2()
this.getTree3()
}
}
</script>