This commit is contained in:
zhutianqi
2022-03-11 17:23:35 +08:00
parent 1002813d15
commit 7e51ce5fa3
2 changed files with 40 additions and 25 deletions
+24 -18
View File
@@ -1,11 +1,11 @@
<template>
<div class="roleTree">
<el-drawer
:title="isTitle"
:visible.sync="isVisible2"
:wrapperClosable="false"
@close="handleTreeDrawerCancel"
size="460px">
:title="isTitle"
:visible.sync="visible"
:wrapperClosable="false"
@close="handleTreeDrawerCancel"
size="460px">
<el-form
ref="attributeEO"
class="label-input-form"
@@ -22,7 +22,7 @@
</el-form>
<div class="divTree">
<el-tree
v-if="open1 && isVisible2"
v-if="open1 && isVisible"
node-key="id"
style="height: 100%; overflow: auto;"
class="filter-tree tree-line"
@@ -45,7 +45,7 @@
</span>
</el-tree>
<el-tree
v-if="!open1 && isVisible2"
v-if="!open1 && isVisible"
node-key="id"
style="height: 100%; overflow: auto;"
class="filter-tree tree-line"
@@ -124,10 +124,10 @@
},
data () {
return {
visible: false,
nodeList2: [],
delList: [],
roleList: [],
isVisible2: false,
filterText: '',
defaultProps: {
children: 'children',
@@ -239,13 +239,14 @@
},
handleTreeDrawerCancel () {
this.filterText = ''
this.isVisible2 = false
this.open1 = true
this.visible = false
},
saveUserInfo () {
if (this.checkBox) {
this.isVisible2 = false
this.$emit('checkedRole', this.roleList)
this.nodeList2 = []
this.$emit('update:isVisible', false)
} else {
if (this.nodeList2.length > 0 && this.nodeList2[0].length !== 0) {
let ids = ''
@@ -262,12 +263,14 @@
}, {
_this: this
}, res => {
this.isVisible2 = false
this.$emit('checkedRole', res)
this.nodeList2 = []
this.$emit('update:isVisible', false)
})
} else {
this.isVisible2 = false
this.$emit('checkedRole', this.roleList)
this.nodeList2 = []
this.$emit('update:isVisible', false)
}
}
this.open1 = true
@@ -316,13 +319,13 @@
},
watch: {
isVisible (val) {
this.isVisible2 = val
this.nodeList2 = this.nodeList
this.visible = val
if (val) {
if (this.nodeList2.length > 0 && this.nodeList2[0].length !== 0) {
this.nodeList2 = this.nodeList
if (this.nodeList2.length && this.nodeList2[0].length) {
let ids = ''
this.nodeList2.forEach(item => {
if (ids.length > 0) {
if (ids.length) {
ids += ','
ids += item
} else {
@@ -343,9 +346,12 @@
this.delList = []
}
},
isVisible2 (val) {
visible(val) {
this.$emit('update:isVisible', val)
},
if (!val) {
this.$emit('onCancel')
}
}
},
mounted () {
this.getTree()