From 16eb4bd55a4fd61ddd7a171b1a07378c45d1665b Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 05 六月 2025 13:59:28 +0800
Subject: [PATCH] 动态溯源(待完成)

---
 src/views/sourcetrace/SourceTrace.vue |   87 ++++++++++++++++++++++++++++---------------
 1 files changed, 57 insertions(+), 30 deletions(-)

diff --git a/src/views/sourcetrace/SourceTrace.vue b/src/views/sourcetrace/SourceTrace.vue
index 0ce544e..725f2d6 100644
--- a/src/views/sourcetrace/SourceTrace.vue
+++ b/src/views/sourcetrace/SourceTrace.vue
@@ -18,14 +18,17 @@
           <!-- <div>
             <el-text type="primary" size="large" tag="b">鍔ㄦ�佹函婧�</el-text>
           </div> -->
-          <el-scrollbar ref="scrollbarRef" :height="height" class="scrollbar">
-            <el-row ref="scrollContentRef">
-              <div
+          <el-scrollbar ref="scrollbarRef" class="scrollbar">
+            <div
+              ref="scrollContentRef"
+              style="display: flex; width: fit-content"
+            >
+              <el-scrollbar
                 v-for="(item, index) in streams"
                 :key="index"
                 class="clue-card"
               >
-                <el-row>
+                <el-row justify="space-between">
                   <!-- <el-tag v-if="index == 0" type="danger">鏈�鏂�</el-tag> -->
                   <el-text type="primary">{{
                     '绾跨储鏃堕棿锛�' +
@@ -33,6 +36,13 @@
                     ' - ' +
                     item.pollutedData.endTime
                   }}</el-text>
+                  <el-link
+                    type="primary"
+                    :underline="true"
+                    @click="showMarksAndPolygon(item)"
+                  >
+                    {{ item.showMore ? '鏀惰捣寮傚父' : '瀹氫綅寮傚父' }}
+                  </el-link>
                 </el-row>
                 <div>
                   <el-text type="primary">
@@ -46,7 +56,7 @@
                     }}
                   </el-text>
                 </div>
-                <el-row>
+                <el-row style="border-top: 1px solid white">
                   <el-col :span="6">
                     <el-statistic
                       title="绐佸彉鍥犲瓙"
@@ -86,13 +96,6 @@
                       '锛�'
                     }}
                   </el-link> -->
-                  <el-link
-                    type="primary"
-                    underline
-                    @click="showMarksAndPolygon(item)"
-                  >
-                    {{ item.showMore ? '鏀惰捣寮傚父' : '瀹氫綅寮傚父' }}
-                  </el-link>
                 </el-row>
                 <div style="width: 320px; height: 140px">
                   <RealTimeLineChart
@@ -100,6 +103,11 @@
                     :key="index1"
                     :model-value="item1"
                   ></RealTimeLineChart>
+                </div>
+                <div class="border-dashed">
+                  <el-text type="" tag="mark">
+                    {{ item.pollutedSource.conclusion }}
+                  </el-text>
                 </div>
                 <SceneTable
                   :show-marks="item.showMore"
@@ -156,8 +164,8 @@
                   :scene-list="item.relatedSceneList"
                 ></SceneTable>
                 <el-divider /> -->
-              </div>
-            </el-row>
+              </el-scrollbar>
+            </div>
           </el-scrollbar>
         </template>
       </BaseCard>
@@ -178,9 +186,7 @@
 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";
-
-
+import websocketMsgParser from '@/views/sourcetrace/websocketMsgParser.js';
 
 const props = defineProps({
   factorType: String
@@ -188,7 +194,7 @@
 
 const emits = defineEmits(['update:factorType']);
 
-const height = `48vh`;
+const height = `30vh`;
 const width = `60vh`;
 
 const show = ref(false);
@@ -217,7 +223,7 @@
 
 let showFirstClueTask;
 function dealMsg(data) {
-  const {type, content} = websocketMsgParser.parseMsg(data)
+  const { type, content } = websocketMsgParser.parseMsg(data);
 
   // 姹℃煋绾跨储 PollutedClue
   if (type == '1') {
@@ -229,12 +235,13 @@
     if (streams.length == 0) {
       streams.push(obj);
     } else {
-      streams.forEach((s) => {
-        s.showMore = false;
-      });
+      // streams.forEach((s) => {
+      //   showMarksAndPolygon(s);
+      // });
+      hideAll();
       streams.unshift(obj);
-      show.value = true;
     }
+    show.value = true;
 
     // scrollToBottom();
     scrollToTop();
@@ -263,9 +270,20 @@
   // }
 });
 
+function hideAll() {
+  streams.forEach((s) => {
+    if (polygonMap.has(s.guid)) {
+      s.showMore = false;
+      map.remove(polygonMap.get(s.guid));
+    }
+  });
+}
+
 function showMarksAndPolygon(item) {
   item.showMore = !item.showMore;
   if (item.showMore) {
+    hideAll();
+    item.showMore = true;
     drawPolygon(item);
   } else {
     if (polygonMap.has(item.guid)) {
@@ -296,11 +314,11 @@
     });
     polygonMap.set(item.guid, pollutedAreaPolygon);
   }
-  map.setFitView(polygonMap.get(item.guid));
+  // map.setFitView(polygonMap.get(item.guid));
 }
 
 function parseChartData(obj) {
-  console.log('鎶樼嚎鍥撅細start');
+  // console.log('鎶樼嚎鍥撅細start');
   const factorDatas = new FactorDatas();
   factorDatas.setData(obj.pollutedData.dataVoList, 0, () => {
     obj._chartOptions = factorDataParser.parseData(factorDatas, [
@@ -310,7 +328,7 @@
         value: obj.pollutedData.factorId + ''
       }
     ]);
-    console.log('鎶樼嚎鍥撅細', obj._chartOptions);
+    // console.log('鎶樼嚎鍥撅細', obj._chartOptions);
   });
 }
 
@@ -435,7 +453,7 @@
   --el-statistic-content-color: white;
 }
 
-:deep(.el-text) {
+:deep(.el-text.el-text--primary) {
   --el-text-color: white;
 }
 
@@ -446,14 +464,23 @@
 .scrollbar {
   min-width: 300px;
   max-width: 60vw;
+  /* height: 35vh; */
   /* color: #02ffea; */
 }
 
 .clue-card {
   padding: 0 4px;
-  margin-right: 2px;
-  width: 320px;
-  border: 1px solid white;
+  /* margin-right: 2px; */
+  width: 340px;
+  height: 35vh;
+  border-right: 1px solid white;
   border-radius: 2px;
 }
+
+.border-dashed {
+  /* border: 1px dashed white; */
+  border: 1px dashed #ffbc58;
+  padding: 0px 1px;
+  margin-bottom: 4px;
+}
 </style>

--
Gitblit v1.9.3