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> <template>
<div class="roleTree"> <div class="roleTree">
<el-drawer <el-drawer
:title="isTitle" :title="isTitle"
:visible.sync="isVisible2" :visible.sync="visible"
:wrapperClosable="false" :wrapperClosable="false"
@close="handleTreeDrawerCancel" @close="handleTreeDrawerCancel"
size="460px"> size="460px">
<el-form <el-form
ref="attributeEO" ref="attributeEO"
class="label-input-form" class="label-input-form"
@@ -22,7 +22,7 @@
</el-form> </el-form>
<div class="divTree"> <div class="divTree">
<el-tree <el-tree
v-if="open1 && isVisible2" v-if="open1 && isVisible"
node-key="id" node-key="id"
style="height: 100%; overflow: auto;" style="height: 100%; overflow: auto;"
class="filter-tree tree-line" class="filter-tree tree-line"
@@ -45,7 +45,7 @@
</span> </span>
</el-tree> </el-tree>
<el-tree <el-tree
v-if="!open1 && isVisible2" v-if="!open1 && isVisible"
node-key="id" node-key="id"
style="height: 100%; overflow: auto;" style="height: 100%; overflow: auto;"
class="filter-tree tree-line" class="filter-tree tree-line"
@@ -124,10 +124,10 @@
}, },
data () { data () {
return { return {
visible: false,
nodeList2: [], nodeList2: [],
delList: [], delList: [],
roleList: [], roleList: [],
isVisible2: false,
filterText: '', filterText: '',
defaultProps: { defaultProps: {
children: 'children', children: 'children',
@@ -239,13 +239,14 @@
}, },
handleTreeDrawerCancel () { handleTreeDrawerCancel () {
this.filterText = '' this.filterText = ''
this.isVisible2 = false
this.open1 = true this.open1 = true
this.visible = false
}, },
saveUserInfo () { saveUserInfo () {
if (this.checkBox) { if (this.checkBox) {
this.isVisible2 = false
this.$emit('checkedRole', this.roleList) this.$emit('checkedRole', this.roleList)
this.nodeList2 = []
this.$emit('update:isVisible', false)
} else { } else {
if (this.nodeList2.length > 0 && this.nodeList2[0].length !== 0) { if (this.nodeList2.length > 0 && this.nodeList2[0].length !== 0) {
let ids = '' let ids = ''
@@ -262,12 +263,14 @@
}, { }, {
_this: this _this: this
}, res => { }, res => {
this.isVisible2 = false
this.$emit('checkedRole', res) this.$emit('checkedRole', res)
this.nodeList2 = []
this.$emit('update:isVisible', false)
}) })
} else { } else {
this.isVisible2 = false
this.$emit('checkedRole', this.roleList) this.$emit('checkedRole', this.roleList)
this.nodeList2 = []
this.$emit('update:isVisible', false)
} }
} }
this.open1 = true this.open1 = true
@@ -316,13 +319,13 @@
}, },
watch: { watch: {
isVisible (val) { isVisible (val) {
this.isVisible2 = val this.visible = val
this.nodeList2 = this.nodeList
if (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 = '' let ids = ''
this.nodeList2.forEach(item => { this.nodeList2.forEach(item => {
if (ids.length > 0) { if (ids.length) {
ids += ',' ids += ','
ids += item ids += item
} else { } else {
@@ -343,9 +346,12 @@
this.delList = [] this.delList = []
} }
}, },
isVisible2 (val) { visible(val) {
this.$emit('update:isVisible', val) this.$emit('update:isVisible', val)
}, if (!val) {
this.$emit('onCancel')
}
}
}, },
mounted () { mounted () {
this.getTree() this.getTree()
@@ -2059,9 +2059,9 @@
<Role-tree <Role-tree
:is-title="drawerTitle" :is-title="drawerTitle"
:is-visible.sync="modalShowRoleFlag" :is-visible.sync="modalShowRoleFlag"
@checkedRole="checkedRole2"
:nodeList="nodeList2" :nodeList="nodeList2"
></Role-tree> @checkedRole="checkedRole2"
/>
<Role-tree <Role-tree
is-title="选择人员信息" is-title="选择人员信息"
:is-visible.sync="modalshowflagRole" :is-visible.sync="modalshowflagRole"
@@ -4660,7 +4660,6 @@ export default {
} }
} }
this.configStandList = res.data.list this.configStandList = res.data.list
console.log(this.configStandList);
this.configTotal = res.data.count this.configTotal = res.data.count
this.selectConfigStand = [] this.selectConfigStand = []
}, e => { }, e => {
@@ -5816,9 +5815,20 @@ export default {
this.$set(this.textStatusMap, item.value, item.label) this.$set(this.textStatusMap, item.value, item.label)
}) })
}, },
choiceZRRS(type, title, id) { choiceZRRS(type, title, nameId) {
this.nodeList = [] this.nodeList2 = []
this.nodeList.push(id) if (nameId) {
let nameId1 = nameId.split(',')
let idList = []
nameId1.forEach(item => {
let a, b
a = item.substring(item.indexOf('(') +1)
b = a.substring(0, a.lastIndexOf(')'))
idList.push(b)
})
idList = idList.join(',')
this.nodeList2.push(idList)
}
this.userType = type this.userType = type
this.drawerTitle = title this.drawerTitle = title
this.modalShowRoleFlag = true this.modalShowRoleFlag = true
@@ -5890,7 +5900,6 @@ export default {
} else if (this.drawerTitle === '查询责任部门') { } else if (this.drawerTitle === '查询责任部门') {
this.advanceSearchMapping['ZRBM'] = nameList this.advanceSearchMapping['ZRBM'] = nameList
} }
}, },
}, },
computed: { computed: {