xyh 2 éve
szülő
commit
907e86e054

+ 4 - 0
src/views/onlineForm/formRender/onlineFormMixins.js

@@ -876,6 +876,7 @@ const OnlineFormMixins = {
                 picture: row.picture
               }
             }
+            data["name"] = row.number
             const jsonData = JSON.stringify(data);
             const blob = new Blob([jsonData], { type: 'application/json' });
             const url = URL.createObjectURL(blob);
@@ -908,6 +909,7 @@ const OnlineFormMixins = {
               url: row.url,
               picture: row.picture
             }
+            data["name"] = row.name
             const jsonData = JSON.stringify(data);
             const blob = new Blob([jsonData], { type: 'application/json' });
             const url = URL.createObjectURL(blob);
@@ -921,6 +923,7 @@ const OnlineFormMixins = {
           } else if (this.formId == 1675056214280507392) {
             let number = row.number
             const data = {};
+            data["name"] = number
             data[number] = {
               name: number,
               type: row.type,
@@ -959,6 +962,7 @@ const OnlineFormMixins = {
             console.log('row :>> ', row);
             let number = row.number
             const data = {};
+            data["name"] = row.number
             data[number] = {
               type: row.type,
               properties: {

+ 53 - 45
src/views/situation/index.vue

@@ -20,14 +20,8 @@
           <div id="3DcesiumContainer" class="map" @click="onMapClick"></div>
         </div>
       </el-col>
-      <el-tabs
-        type="border-card"
-        v-model="activeName"
-        tab-position="left"
-        class="menu"
-        :stretch="true"
-        @tab-click="legendClick"
-      >
+      <el-tabs type="border-card" v-model="activeName" tab-position="left" class="menu" :stretch="true"
+        @tab-click="legendClick">
         <el-tab-pane name="first">
           <el-tooltip placement="right" effect="light" slot="label">
             <span slot="content" class="item">标绘</span>
@@ -79,6 +73,7 @@ import fireController from "../../api/fireController";
 import { getToken } from "@/utils";
 import axios from "axios";
 import Model from "@/views/situation/Model";
+import satelliteModel from '@/assets/model/satelite.glb';
 export default {
   components: {
     Model
@@ -101,7 +96,7 @@ export default {
       unit: [],
       satellite: [],
       center: [],
-      move_data:{},
+      move_data: {},
       viewer2D: null,
       viewer3D: null,
       dimension: 5,
@@ -140,30 +135,30 @@ export default {
 
   },
   methods: {
-    startWebSocket(){
+    startWebSocket() {
       this.websocket = new WebSocket('ws://localhost:8765');
 
-this.websocket.onopen = () => {
-  console.log('WebSocket连接已建立!');
+      this.websocket.onopen = () => {
+        console.log('WebSocket连接已建立!');
 
-};
+      };
 
-this.websocket.onmessage = (event) => {
-  // 处理从WebSocket服务器接收到的消息
-  const data = JSON.parse(event.data);
-  console.log('收到消息:', data);
+      this.websocket.onmessage = (event) => {
+        // 处理从WebSocket服务器接收到的消息
+        const data = JSON.parse(event.data);
+        console.log('收到消息:', data);
 
 
-  // 在这里处理接收到的数据,更新Vue组件的数据等操作
-};
+        // 在这里处理接收到的数据,更新Vue组件的数据等操作
+      };
 
-this.websocket.onerror = (error) => {
-  console.error('WebSocket错误:', error);
-};
+      this.websocket.onerror = (error) => {
+        console.error('WebSocket错误:', error);
+      };
 
-this.websocket.onclose = () => {
-  console.log('WebSocket连接已关闭!');
-};
+      this.websocket.onclose = () => {
+        console.log('WebSocket连接已关闭!');
+      };
     },
     async saveJson(row) {
       // await axios
@@ -177,22 +172,22 @@ this.websocket.onclose = () => {
       //   .then((res) => {
       //     console.log("update successfully ");
       //   });
-  //     const requestData = row
-  //     if(this.websocket && this.websocket.readyState === WebSocket.OPEN){
-  //       this.websocket.send(JSON.stringify(requestData));
-  //     }
-  //     else{
-  //       this.startWebSocket();
-  //       setTimeout(() => {
-  //         this.websocket.send(JSON.stringify(requestData));
-  // }, 2000);
-
-  //     }
-  this.markLocation(120,20)
+      //     const requestData = row
+      //     if(this.websocket && this.websocket.readyState === WebSocket.OPEN){
+      //       this.websocket.send(JSON.stringify(requestData));
+      //     }
+      //     else{
+      //       this.startWebSocket();
+      //       setTimeout(() => {
+      //         this.websocket.send(JSON.stringify(requestData));
+      // }, 2000);
+
+      //     }
+      this.markLocation(120, 20)
 
     },
-    changeItemPosition(data){
-      
+    changeItemPosition(data) {
+
     },
     async getJson(row) {
       let redunit = [];
@@ -640,6 +635,11 @@ this.websocket.onclose = () => {
           pixelSize: 12, // 调整点的大小,可以增大点的像素大小
           color: this.Cesium.Color.fromCssColorString(this.image.color)
         },
+        // model: {
+        //   uri: require('@/assets/model/satelite.glb'), // 替换为你的3D模型文件路径
+        //   scale: 1.0, // 调整3D模型的缩放大小
+        //   minimumPixelSize: 64 // 设置3D模型的最小像素大小,确保在视图中可见
+        // },
         label: {
           text: this.image.name,
           show: true,
@@ -824,12 +824,15 @@ this.websocket.onclose = () => {
 ::v-deep .cesium-infoBox {
   display: none !important;
 }
+
 ::v-deep .cesium-infoBox-bodyless {
   display: none !important;
 }
+
 ::v-deep .cesium-infoBox-visible {
   display: none !important;
 }
+
 .modeltooltip {
   position: absolute;
   padding: 5px;
@@ -838,15 +841,19 @@ this.websocket.onclose = () => {
   pointer-events: none;
   z-index: 999;
 }
+
 .myHeader {
   background-color: #1c222b !important;
   color: #fff;
   height: 100%;
   display: flex;
   flex-direction: row;
-  align-items: center; /*由于flex-direction: column,因此align-items代表的是水平方向*/
-  justify-content: center; /*由于flex-direction: column,因此justify-content代表的是垂直方向*/
+  align-items: center;
+  /*由于flex-direction: column,因此align-items代表的是水平方向*/
+  justify-content: center;
+  /*由于flex-direction: column,因此justify-content代表的是垂直方向*/
 }
+
 .myHeader .el-button {
   width: 100px;
   height: 20px;
@@ -895,11 +902,12 @@ this.websocket.onclose = () => {
   right: 20px;
   top: 20px;
 }
+
 .el-button {
   margin: 5px !important;
 }
 
-::v-deep .el-tabs--border-card > .el-tabs__content {
+::v-deep .el-tabs--border-card>.el-tabs__content {
   width: 300px;
   display: none;
 }
@@ -910,17 +918,17 @@ this.websocket.onclose = () => {
   flex-wrap: wrap;
 }
 
-.model > div {
+.model>div {
   width: 50%;
   height: 120px;
   padding: 5px;
 }
 
-.model > div:hover {
+.model>div:hover {
   border: 2px solid blue;
 }
 
-.model > div:active {
+.model>div:active {
   border: 2px solid red;
 }