目录树右键菜单功能优化
Showing
1 changed file
with
25 additions
and
3 deletions
| ... | @@ -47,7 +47,7 @@ | ... | @@ -47,7 +47,7 @@ |
| 47 | @changeDzVisible="changeDzVisible" | 47 | @changeDzVisible="changeDzVisible" |
| 48 | @changeGzwVisible="changeGzwVisible" | 48 | @changeGzwVisible="changeGzwVisible" |
| 49 | :list="item.children" | 49 | :list="item.children" |
| 50 | :visible="visible" | 50 | :visible="zrzVisible" |
| 51 | :size="size" | 51 | :size="size" |
| 52 | :islpb="islpb" | 52 | :islpb="islpb" |
| 53 | :formatData="formatData" | 53 | :formatData="formatData" |
| ... | @@ -55,7 +55,7 @@ | ... | @@ -55,7 +55,7 @@ |
| 55 | </div> | 55 | </div> |
| 56 | 56 | ||
| 57 | <ul | 57 | <ul |
| 58 | v-show="visible" | 58 | v-show="zrzVisible" |
| 59 | :style="{ left: left + 'px', top: top + 'px' }" | 59 | :style="{ left: left + 'px', top: top + 'px' }" |
| 60 | class="contextmenu" | 60 | class="contextmenu" |
| 61 | > | 61 | > |
| ... | @@ -169,6 +169,8 @@ export default { | ... | @@ -169,6 +169,8 @@ export default { |
| 169 | currentClickZdGeo:"", | 169 | currentClickZdGeo:"", |
| 170 | improtDialog:false, | 170 | improtDialog:false, |
| 171 | dialogVisible:false, | 171 | dialogVisible:false, |
| 172 | //控制自然幢右键菜单 | ||
| 173 | zrzVisible:false, | ||
| 172 | //控制楼盘表 | 174 | //控制楼盘表 |
| 173 | lpbvisible: false, | 175 | lpbvisible: false, |
| 174 | lpbtop: 0, | 176 | lpbtop: 0, |
| ... | @@ -210,6 +212,13 @@ export default { | ... | @@ -210,6 +212,13 @@ export default { |
| 210 | document.body.removeEventListener("click", this.closeMenu); | 212 | document.body.removeEventListener("click", this.closeMenu); |
| 211 | } | 213 | } |
| 212 | }, | 214 | }, |
| 215 | zrzVisible(value) { | ||
| 216 | if (value) { | ||
| 217 | document.body.addEventListener("click", this.closeMenu); | ||
| 218 | } else { | ||
| 219 | document.body.removeEventListener("click", this.closeMenu); | ||
| 220 | } | ||
| 221 | }, | ||
| 213 | 222 | ||
| 214 | // createVisible(value) { | 223 | // createVisible(value) { |
| 215 | // if (value) { | 224 | // if (value) { |
| ... | @@ -270,7 +279,10 @@ export default { | ... | @@ -270,7 +279,10 @@ export default { |
| 270 | }, | 279 | }, |
| 271 | // 改变菜单数据 | 280 | // 改变菜单数据 |
| 272 | changeVisible(data) { | 281 | changeVisible(data) { |
| 273 | this.visible = data; | 282 | this.zrzVisible = data; |
| 283 | this.lpbvisible = false; | ||
| 284 | this.dzVisible = false; | ||
| 285 | this.gzwVisible = false; | ||
| 274 | }, | 286 | }, |
| 275 | changeZdData(data) { | 287 | changeZdData(data) { |
| 276 | this.zdData = data; | 288 | this.zdData = data; |
| ... | @@ -289,6 +301,9 @@ export default { | ... | @@ -289,6 +301,9 @@ export default { |
| 289 | }, | 301 | }, |
| 290 | changeLpbVisible(data) { | 302 | changeLpbVisible(data) { |
| 291 | this.lpbvisible = data; | 303 | this.lpbvisible = data; |
| 304 | this.zrzVisible = false; | ||
| 305 | this.dzVisible = false; | ||
| 306 | this.gzwVisible = false; | ||
| 292 | }, | 307 | }, |
| 293 | changeCreateVisible(data){ | 308 | changeCreateVisible(data){ |
| 294 | this.createVisible = true; | 309 | this.createVisible = true; |
| ... | @@ -296,10 +311,16 @@ export default { | ... | @@ -296,10 +311,16 @@ export default { |
| 296 | //多幢 | 311 | //多幢 |
| 297 | changeDzVisible(data){ | 312 | changeDzVisible(data){ |
| 298 | this.dzVisible = data; | 313 | this.dzVisible = data; |
| 314 | this.zrzVisible = false; | ||
| 315 | this.lpbvisible = false; | ||
| 316 | this.gzwVisible = false; | ||
| 299 | }, | 317 | }, |
| 300 | //构筑物 | 318 | //构筑物 |
| 301 | changeGzwVisible(data){ | 319 | changeGzwVisible(data){ |
| 302 | this.gzwVisible = data; | 320 | this.gzwVisible = data; |
| 321 | this.zrzVisible = false; | ||
| 322 | this.lpbvisible = false; | ||
| 323 | this.dzVisible = false; | ||
| 303 | }, | 324 | }, |
| 304 | //添加定着物 | 325 | //添加定着物 |
| 305 | openCreateDialog(type){ | 326 | openCreateDialog(type){ |
| ... | @@ -397,6 +418,7 @@ export default { | ... | @@ -397,6 +418,7 @@ export default { |
| 397 | }, | 418 | }, |
| 398 | //关闭右键菜单 | 419 | //关闭右键菜单 |
| 399 | closeMenu(){ | 420 | closeMenu(){ |
| 421 | this.zrzVisible = false; | ||
| 400 | this.lpbvisible = false; | 422 | this.lpbvisible = false; |
| 401 | this.dzVisible = false; | 423 | this.dzVisible = false; |
| 402 | this.gzwVisible = false; | 424 | this.gzwVisible = false; | ... | ... |
-
Please register or sign in to post a comment