wuxiang 1 year ago
parent
commit
62d8fb8a97
1 changed files with 23 additions and 6 deletions
  1. 23 6
      src/views/map/index.vue

+ 23 - 6
src/views/map/index.vue

@@ -548,7 +548,7 @@ export default {
     },
     mode: {
       handler: function (val, oldVal) {
-
+        this.xdName = "无"
         this.$data._viewer2D.destroy();
         this.$data._viewer3D.destroy();
         this.cesiumInit();
@@ -557,11 +557,6 @@ export default {
     xdName: {
       handler: function (val, oldVal) {
         this.$store.commit('app/setXDname',val);
-        this.$notify({
-              title: "提示",
-              message: "已选择想定文件:"+val,
-              type: 'success'
-            });
       },
     },
 
@@ -704,6 +699,11 @@ export default {
           redunit = response.data.redunit
           satellite = response.data.satellite
           center = response.data.center
+          this.$notify({
+              title: "提示",
+              message: "已选择想定文件:"+this.xdName,
+              type: 'success'
+            });
           for(let i=0 ;i<blueunit.length;i++){
             this.blueList.push({
               order: i+1,
@@ -767,6 +767,22 @@ export default {
         this.markLine(point1, point2, "red")
       }
     },
+    async saveJson() {
+      if (this.save) {
+        const jsonData = JSON.stringify(this.jsonData);
+        const blob = new Blob([jsonData], { type: 'application/json' });
+        const url = URL.createObjectURL(blob);
+        const link = document.createElement('a');
+        link.href = url;
+        link.download = this.jsonData.xdname + '.json';
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
+      }
+      else {
+        this.$message("请先导入想定文件!!!")
+      }
+    },
     async seeJson(row) {
       //打开窗口
       this.JsonVisible = true
@@ -1108,6 +1124,7 @@ export default {
       this.handler2D = new Cesium.ScreenSpaceEventHandler(this.$data._viewer2D.scene.canvas);
       this.handler3D = new Cesium.ScreenSpaceEventHandler(this.$data._viewer3D.scene.canvas);
       
+
     },
     // //鼠标悬停在模型上的监听事件
     locationViewer(viewer,handler){