299dc68d by 杨威

目录树右键菜单功能优化

1 parent 6732529c
......@@ -47,7 +47,7 @@
@changeDzVisible="changeDzVisible"
@changeGzwVisible="changeGzwVisible"
:list="item.children"
:visible="visible"
:visible="zrzVisible"
:size="size"
:islpb="islpb"
:formatData="formatData"
......@@ -55,7 +55,7 @@
</div>
<ul
v-show="visible"
v-show="zrzVisible"
:style="{ left: left + 'px', top: top + 'px' }"
class="contextmenu"
>
......@@ -169,6 +169,8 @@ export default {
currentClickZdGeo:"",
improtDialog:false,
dialogVisible:false,
//控制自然幢右键菜单
zrzVisible:false,
//控制楼盘表
lpbvisible: false,
lpbtop: 0,
......@@ -210,6 +212,13 @@ export default {
document.body.removeEventListener("click", this.closeMenu);
}
},
zrzVisible(value) {
if (value) {
document.body.addEventListener("click", this.closeMenu);
} else {
document.body.removeEventListener("click", this.closeMenu);
}
},
// createVisible(value) {
// if (value) {
......@@ -270,7 +279,10 @@ export default {
},
// 改变菜单数据
changeVisible(data) {
this.visible = data;
this.zrzVisible = data;
this.lpbvisible = false;
this.dzVisible = false;
this.gzwVisible = false;
},
changeZdData(data) {
this.zdData = data;
......@@ -289,6 +301,9 @@ export default {
},
changeLpbVisible(data) {
this.lpbvisible = data;
this.zrzVisible = false;
this.dzVisible = false;
this.gzwVisible = false;
},
changeCreateVisible(data){
this.createVisible = true;
......@@ -296,10 +311,16 @@ export default {
//多幢
changeDzVisible(data){
this.dzVisible = data;
this.zrzVisible = false;
this.lpbvisible = false;
this.gzwVisible = false;
},
//构筑物
changeGzwVisible(data){
this.gzwVisible = data;
this.zrzVisible = false;
this.lpbvisible = false;
this.dzVisible = false;
},
//添加定着物
openCreateDialog(type){
......@@ -397,6 +418,7 @@ export default {
},
//关闭右键菜单
closeMenu(){
this.zrzVisible = false;
this.lpbvisible = false;
this.dzVisible = false;
this.gzwVisible = false;
......