linqilong 1 lună în urmă
părinte
comite
72754778cd
3 a modificat fișierele cu 14 adăugiri și 76 ștergeri
  1. 2 2
      src/components/UePlayer.vue
  2. 10 72
      src/utils/tdInstruction/operate.ts
  3. 2 2
      src/views/Yuyan.vue

+ 2 - 2
src/components/UePlayer.vue

@@ -16,12 +16,12 @@ onMounted(() => {
     useUrlParams: true,
     initialSettings: {
       // ss: "ws://192.168.0.136:85",
-      // ss: "ws://192.168.0.120:85",
+      ss: "ws://192.168.0.120:85",
       // ss: "ws://192.168.0.121:85",
       // ss: "ws://10.8.33.179:85",
       // ss: "ws://192.168.137.223:85",
       // ss: "ws://192.168.137.132:85",
-      ss: "ws://10.8.11.98:65",
+      // ss: "ws://10.8.11.98:65",
       AutoConnect: true,
       AutoPlayVideo: true,
       StartVideoMuted: true,

+ 10 - 72
src/utils/tdInstruction/operate.ts

@@ -239,83 +239,21 @@ export function setStationData(data: any) {
 
 let strategyMapState = false
 
-export function strategyMap(direction: any) {
-  if (strategyMapState) {
-    updateStrategyMapCoord(direction)
-  } else {
-    addStrategyMap(direction)
-  }
-}
-
-/**
- * 添加太湖湖面图层
- * @param data
- */
-export function addStrategyMap(direction: any) {
-  let descriptor = {
-    "command": "AddStrategyMap",
-    "data": {
-      "id": "strategymap_id",
-      "coord_type": "0",
-      "cad_mapkey": "ea",
-      "coord_z_type": "0",
-      "type": "5",
-      "is_gather": "true",
-      "animation_type": "0",
-      "start_coord": "119.938890, 31.106388",
-      "start_coord_z": "600",
-      "target_data": [
-        {
-          "target_coord": "120.405242, 31.444280",
-          "target_coord_z": "600",
-          "color": "ff0000"
-        }
-      ]
-    }
-  }
-  Bus.emit('emitUIInteraction', descriptor);
-  console.log("-- 添加太湖湖面图层:", JSON.stringify(descriptor));
-  strategyMapState = true
-}
-
 /**
- * 更新太湖湖面图层
- * @param data
+ * 设置太湖湖面图层
+ * @param direction
+ * @param slope
+ * @param show
  */
-export function updateStrategyMapCoord(direction: any) {
+export function strategyMap(direction: string, slope: string, show = true) {
   let descriptor = {
-    "command": "UpdateStrategyMapCoord",
+    "command": "InclinedAngle",
     "data": {
-      "id": "strategymap_id",
-      "coord_type": "0",
-      "cad_mapkey": "ea",
-      "coord_z_type": "0",
-      "start_coord": "120.243630, 30.9273",
-      "start_coord_z": "100",
-      "target_data": [
-        {
-          "target_coord": "120.405242, 31.444280",
-          "target_coord_z": "200"
-        }
-      ]
-    }
-  }
-  Bus.emit('emitUIInteraction', descriptor);
-  console.log("-- 更新太湖湖面图层:", JSON.stringify(descriptor));
-}
-
-/**
- * 删除太湖湖面图层
- */
-export function deleteStrategyMap() {
-  let descriptor = {
-    "command": "DelLevel",
-    "data": {
-      "id": "strategymap_id",
-      "type": "3"
+      "Direction": direction,
+      "Slope": slope,
+      "Diaplay": show ? 'true' : 'false'
     }
   }
   Bus.emit('emitUIInteraction', descriptor);
-  console.log("-- 删除太湖湖面图层:", JSON.stringify(descriptor));
-  strategyMapState = false
+  console.log("-- 太湖湖面图层:", JSON.stringify(descriptor));
 }

+ 2 - 2
src/views/Yuyan.vue

@@ -86,7 +86,7 @@ function handleCurrentChange(row) {
       })
 
       const res = slopeCalculation(data);
-      Operate.strategyMap(res.direction);
+      Operate.strategyMap(res.direction, res.slope);
 
       Point.addPoint(data.map(a => {
         return {'id': a.id, 'name': `${a.value}\n${a.name}`, 'type': a.type, 'x': a.x, 'y': a.y}
@@ -105,7 +105,7 @@ onMounted(() => {
 })
 
 onUnmounted(() => {
-  Operate.deleteStrategyMap()
+  Operate.strategyMap("", "", false)
   timeScrollbarStore.close()
   basinStore.setLabelState2('水文站', false)
 })