From d1d307f6ca27a9dc711c412e9daaaad01015ada6 Mon Sep 17 00:00:00 2001
From: wangqi <magical1908@outlook.com>
Date: 星期四, 11 三月 2021 10:00:09 +0800
Subject: [PATCH] 修改完左下图标在ie下不能正常显示

---
 src/components/panel/ToolBoxPanel.vue |   69 +++++++++++++++++++++++++++++-----
 1 files changed, 58 insertions(+), 11 deletions(-)

diff --git a/src/components/panel/ToolBoxPanel.vue b/src/components/panel/ToolBoxPanel.vue
index 5747cc7..0666a93 100644
--- a/src/components/panel/ToolBoxPanel.vue
+++ b/src/components/panel/ToolBoxPanel.vue
@@ -15,7 +15,7 @@
         </transition>
         <el-dropdown-menu>
           <el-dropdown-item v-for="(ite,index) in item.items" :key="index" :command='ite.headings'>
-            <span @click='toggleActive(ite)'>{{ ite.headings }}</span>
+            <span>{{ ite.headings }}</span>
           </el-dropdown-item>
         </el-dropdown-menu>
       </el-dropdown>
@@ -34,7 +34,6 @@
 export default {
   name: 'ToolBoxPanel',
   components: {},
-  props: ['map'],
   data () {
     return {
       isPanelVisible: false,
@@ -103,7 +102,9 @@
         enterprise: ''
       },
       selectGroup: false,
-      selectGroupOne: false
+      drawLayer: null,
+      L: window.L,
+      map: null
     }
   },
   methods: {
@@ -118,13 +119,59 @@
     },
     handleCommand (command) {
       console.log(command)
-      if (command === '鍏ㄥ睆') {
-        this.map.toggleFullscreen()
-      }
-    },
-    toggleActive (k) {
-      if (k === 'fullscreen') {
-        this.map.toggleFullscreen()
+      switch (command) {
+        case '鍏ㄥ睆':
+          // this.map.toggleFullscreen()
+          var printer = this.L.easyPrint({
+            sizeModes: ['Current', 'A4Landscape', 'A4Portrait'],
+            filename: 'map_image',
+            exportOnly: true,
+            hideControlContainer: true
+          }).addTo(this.map)
+          printer.printMap('CurrentSize', 'MyManualPrint')
+          break
+        case 'A4妯悜':
+          var printerX = this.L.easyPrint({
+            sizeModes: ['Current', 'A4Landscape', 'A4Portrait'],
+            filename: 'map_image',
+            exportOnly: true,
+            hideControlContainer: true
+          }).addTo(this.map)
+          printerX.printMap('A4Landscape page', 'MyManualPrint')
+          break
+        case 'A4绾靛悜':
+          var printerY = this.L.easyPrint({
+            sizeModes: ['Current', 'A4Landscape', 'A4Portrait'],
+            filename: 'map_image',
+            exportOnly: true,
+            hideControlContainer: true
+          }).addTo(this.map)
+          printerY.printMap('A4Portrait page', 'MyManualPrint')
+          break
+        case '绾挎爣缁�':
+          this.drawLayer = this.map.editTools.startPolyline()
+          this.drawLayer.on('dblclick').on('dblclick', this.drawLayer.toggleEdit)
+          break
+        case '闈㈡爣缁�':
+          this.drawLayer = this.map.editTools.startPolygon()
+          this.drawLayer.on('dblclick').on('dblclick', this.drawLayer.toggleEdit)
+          break
+        case '绠ご鏍囩粯':
+          this.drawLayer = this.map.editTools.startPolyline()
+          this.drawLayer.on('dblclick').on('dblclick', this.drawLayer.toggleEdit)
+          break
+        case '鐐规爣娉�':
+          this.drawLayer = this.map.editTools.startMarker()
+          this.drawLayer.on('dblclick').on('dblclick', this.drawLayer.toggleEdit)
+          break
+        case '鍥炬爣鏍囨敞':
+          this.drawLayer = this.map.editTools.startIcon()
+          this.drawLayer.on('dblclick').on('dblclick', this.drawLayer.toggleEdit)
+          break
+        case '鏂囧瓧鏍囨敞':
+          this.drawLayer = this.map.editTools.startText()
+          this.drawLayer.on('dblclick').on('dblclick', this.drawLayer.toggleEdit)
+          break
       }
     },
     loadData () {
@@ -153,7 +200,7 @@
     background: #305B62;
     //margin-top: 15px;
     width: 35px;
-    height: 35px;
+    height: 38px;
     border-radius: 50%;
     border: 2px skyblue solid;
     display: flex;

--
Gitblit v1.8.0