2 Commits 8f454bf968 ... 79d917e016

Author SHA1 Message Date
  xyh 79d917e016 Merge branch 'master' of http://43.143.235.246:9080/fireLHB/firemap 1 year ago
  xyh 2e44c6e628 config 1 year ago
2 changed files with 21 additions and 16 deletions
  1. 14 1
      src/views/simulation/index.vue
  2. 7 15
      vue.config.js

+ 14 - 1
src/views/simulation/index.vue

@@ -673,7 +673,6 @@ export default {
         name: name
       })
       this.id++;
-      console.log('this.viewer3D.entities :>> ', this.viewer3D.entities);
     },
     // 从鼠标点击事件获取坐标
     getCoordinatesFromEvent(event) {
@@ -794,6 +793,13 @@ export default {
       await axios
         .post("/api/pos", {simulation_time: newTimeString+'.000'}).then(res=>{
           console.log('res :>> ', res);
+          let data = res.data[1]
+          //依次更新每个模型位置
+          for(let i=0;i<this.nameIdList.length;i++){
+            if(data[this.nameIdList[i].name]!=null&&data[this.nameIdList[i].name]!=undefined){
+              this.modelEntityMoveByIDAndLocation(this.viewer2D,this.nameIdList[i].id,data[this.nameIdList[i].name].x,id,data[this.nameIdList[i].name].y,id,data[this.nameIdList[i].name].z)
+            }
+          }
           //更新模型位置
           // this.modelEntityMoveByIDAndLocation(this.viewer2D,"1654426964397658112",res.data[1].data.W1.x,res.data[1].data.W1.y,res.data[1].data.W1.z)
         })
@@ -809,6 +815,13 @@ export default {
       await axios
         .post("/api/pos", {simulation_time: newTimeString+'.000'}).then(res=>{
           console.log('res :>> ', res);
+          let data = res.data[1]
+          //依次更新每个模型位置
+          for(let i=0;i<this.nameIdList.length;i++){
+            if(data[this.nameIdList[i].name]!=null&&data[this.nameIdList[i].name]!=undefined){
+              this.modelEntityMoveByIDAndLocation(this.viewer3D,this.nameIdList[i].id,data[this.nameIdList[i].name].x,id,data[this.nameIdList[i].name].y,id,data[this.nameIdList[i].name].z)
+            }
+          }
            //更新模型位置
           //  this.modelEntityMoveByIDAndLocation(this.viewer3D,viewer,"1654426964397658112",res.data[1].data.W1.x,res.data[1].data.W1.y,res.data[1].data.W1.z)  
         })

+ 7 - 15
vue.config.js

@@ -43,21 +43,13 @@ module.exports = {
         amd: {
             toUrlUndefined: true
         },
-        output: {
-            sourcePrefix: ' '
-        }
-    },
-    devServer: {
-        proxy: {
-            '/api': {
-                target: 'http://localhost:80/',
-                ws: true,
-                changeOrigin: true,
-                // pathRewrite:{
-                //   "^/geoserver":""
-                // } 
-            }
-
+        '/api': {
+          target: 'http://localhost:80',
+          ws: true,
+          changeOrigin: true,
+          // pathRewrite:{
+          //   "^/geoserver":""
+          // } 
         }
     },