code init
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
<!--根据部门查询角色信息-->
|
||||
<template>
|
||||
<el-drawer
|
||||
title="选择角色"
|
||||
:visible.sync="visible"
|
||||
:wrapper-closable="false"
|
||||
size="350px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
@close="handleTreeDrawerCancel"
|
||||
>
|
||||
<div class="demo-drawer-content">
|
||||
<laws-tree
|
||||
ref="deptRoleTree"
|
||||
:loading="loading"
|
||||
:zNodes="zNodes"
|
||||
:check-enable="checkEnable"
|
||||
treeDivId="deptRoleTree"
|
||||
:editable="false"
|
||||
expandFirst
|
||||
:onlyChecked="checkEnable"
|
||||
:checkIdList="checkIdList"
|
||||
:chkboxType="{ 'Y': '', 'N': '' }"
|
||||
@treeOnCheck="handleTreeOnCheck"
|
||||
@treeDblClick="handleTreeDblClick"
|
||||
></laws-tree>
|
||||
</div>
|
||||
<div v-if="checkEnable" class="demo-drawer-footer">
|
||||
<el-button
|
||||
round
|
||||
class="common-button-primary"
|
||||
icon="el-icon-check"
|
||||
type="primary"
|
||||
:loading="sumbitLoading"
|
||||
@click="handleTreeDrawerConfirm">确定
|
||||
</el-button>
|
||||
<el-button
|
||||
round
|
||||
class="common-button-default"
|
||||
icon="el-icon-close"
|
||||
@click="handleTreeDrawerCancel">取消</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'DeptRoleTree',
|
||||
props: {
|
||||
isShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 树结构数据
|
||||
zNodes: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 回显数据
|
||||
checkIdList: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 单选多选
|
||||
checkEnable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 确定事件loading
|
||||
sumbitLoading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
checkedListTwo: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTreeOnCheck (checkedList) {
|
||||
this.checkedListTwo = checkedList
|
||||
},
|
||||
// 人员多选确定事件
|
||||
handleTreeDrawerConfirm() {
|
||||
this.$emit('confirm', this.checkedListTwo)
|
||||
this.visible = false
|
||||
},
|
||||
// 单选双击事件
|
||||
handleTreeDblClick (treeId, treeNode) {
|
||||
this.$emit('dblClick', treeNode)
|
||||
this.visible = false
|
||||
},
|
||||
// 抽屉关闭事件
|
||||
handleTreeDrawerCancel () {
|
||||
this.$emit('cancle')
|
||||
this.visible = false
|
||||
this.checkedListTwo = []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isShow (val) {
|
||||
this.visible = val
|
||||
},
|
||||
visible (val) {
|
||||
this.$emit('update:isShow', val)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user