From d0f07e25103d7c7845c3b9534e8c66b5905447c0 Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期三, 04 六月 2025 23:27:55 +0800
Subject: [PATCH] 动态溯源(待完成)

---
 src/views/sourcetrace/SourceTrace.vue |   29 ++++++++++-------------------
 1 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/src/views/sourcetrace/SourceTrace.vue b/src/views/sourcetrace/SourceTrace.vue
index b0760b3..0ce544e 100644
--- a/src/views/sourcetrace/SourceTrace.vue
+++ b/src/views/sourcetrace/SourceTrace.vue
@@ -74,7 +74,7 @@
                   </el-col>
                 </el-row>
                 <el-row justify="space-between">
-                  <el-link
+                  <!-- <el-link
                     type="primary"
                     underline
                     @click="showMarksAndPolygon(item)"
@@ -85,16 +85,16 @@
                       item.pollutedSource.sceneList.length +
                       '锛�'
                     }}
-                  </el-link>
-                  <!-- <el-link
+                  </el-link> -->
+                  <el-link
                     type="primary"
                     underline
-                    @click="drawPolygon(item.pollutedArea)"
+                    @click="showMarksAndPolygon(item)"
                   >
-                    瀹氫綅寮傚父
-                  </el-link> -->
+                    {{ item.showMore ? '鏀惰捣寮傚父' : '瀹氫綅寮傚父' }}
+                  </el-link>
                 </el-row>
-                <div v-show="item.showMore" style="width: 320px; height: 140px">
+                <div style="width: 320px; height: 140px">
                   <RealTimeLineChart
                     v-for="(item1, index1) in item._chartOptions"
                     :key="index1"
@@ -102,7 +102,6 @@
                   ></RealTimeLineChart>
                 </div>
                 <SceneTable
-                  v-show="item.showMore"
                   :show-marks="item.showMore"
                   :scene-list="item.pollutedSource.sceneList"
                 ></SceneTable>
@@ -179,10 +178,9 @@
 import { map, onMapMounted } from '@/utils/map/index_old';
 import { FactorDatas } from '@/model/FactorDatas';
 import factorDataParser from '@/utils/chart/factor-data-parser';
+import websocketMsgParser from "@/views/sourcetrace/websocketMsgParser.js";
 
-const START_STR = '##';
-const SPLIT_STR = '&&';
-const END_STR = '%%';
+
 
 const props = defineProps({
   factorType: String
@@ -219,9 +217,7 @@
 
 let showFirstClueTask;
 function dealMsg(data) {
-  const [type, content] = data
-    .substring(START_STR.length, data.length - END_STR.length)
-    .split(SPLIT_STR);
+  const {type, content} = websocketMsgParser.parseMsg(data)
 
   // 姹℃煋绾跨储 PollutedClue
   if (type == '1') {
@@ -251,11 +247,6 @@
     showFirstClueTask = setTimeout(() => {
       showMarksAndPolygon(obj);
     }, 1000);
-  }
-  // 姹℃煋鍒嗘瀽缁撴灉 AnalysisResult
-  else if (type == '2') {
-    const obj = JSON.parse(content);
-    console.log('姹℃煋鍒嗘瀽缁撴灉: ', obj);
   }
 }
 

--
Gitblit v1.9.3