From 236e6b13a0959c69afe40ab8e503c0ed01899f30 Mon Sep 17 00:00:00 2001
From: 徐旺旺 <11530253@qq.com>
Date: 星期四, 25 三月 2021 10:34:56 +0800
Subject: [PATCH] 图层控制

---
 src/components/panel/ToolBoxPanel.vue |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/components/panel/ToolBoxPanel.vue b/src/components/panel/ToolBoxPanel.vue
index 92b018e..bcd5466 100644
--- a/src/components/panel/ToolBoxPanel.vue
+++ b/src/components/panel/ToolBoxPanel.vue
@@ -24,7 +24,7 @@
             </el-button>
             <el-button v-for="(itemT,indexT) in item.items" :key="indexT" @click="choiceItem(itemT,indexT)"
                        v-show="item.index!=='2'">
-              <img :src="itemT.iconChoose" :title="itemT.title" v-if="Selecd === indexT"/>
+              <img :src="itemT.iconChoose" :title="itemT.title" v-if="Selecd === indexT && checkedItem"/>
               <img :src="itemT.icon" :title="itemT.title" v-else/>
             </el-button>
             <div class="base-map-inner-panel" v-show="item.index==='2'">
@@ -98,9 +98,11 @@
       drawLayerArray: [],
       map: null,
       active: -1,
-      Selecd: -1,
       checked: false,
       checkbutton: -1,
+      checkedItem: false,
+      Selecd: -1,
+      isSelecd: -1,
       menuList: [
         {
           icon: plot,
@@ -290,6 +292,7 @@
       this.active = index
       if (this.checkbutton === index) {
         this.checked = !this.checked
+        this.Selecd = -1
       } else {
         if (this.checkbutton === -1) {
           this.checked = !this.checked
@@ -301,7 +304,16 @@
     },
     choiceItem (itemT, indexT) {
       this.Selecd = indexT
-      this.active = -1
+      if (this.isSelecd === indexT) {
+        this.checkedItem = !this.checkedItem
+      } else {
+        if (this.isSelecd === -1) {
+          this.checkedItem = !this.checkedItem
+        } else {
+          this.checkedItem = true
+        }
+      }
+      this.isSelecd = indexT
       switch (itemT.label) {
         case '鐐规爣缁�':
           var myIcon = this.L.icon({
@@ -379,6 +391,7 @@
           printerY.printMap('A4Portrait page', '绾靛悜')
           break
       }
+      this.active = -1
     },
     setLogic () {
       this.drawLayer.on('dblclick', this.L.DomEvent.stop).on('dblclick', this.drawLayer.toggleEdit)
@@ -393,7 +406,6 @@
     },
     changeSelectMouse () {
       this.selectGroup = true
-      this.checked = false
     }
   }
 }

--
Gitblit v1.8.0