From c23ac06446a9a1edc41cc13723e5d0b8eabdfd63 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 16 七月 2025 17:30:50 +0800
Subject: [PATCH] 2025.7.16 动态溯源新增合并异常

---
 src/views/sourcetrace/SourceTrace.vue |   79 +++++++++++++++++++++++++++------------
 1 files changed, 54 insertions(+), 25 deletions(-)

diff --git a/src/views/sourcetrace/SourceTrace.vue b/src/views/sourcetrace/SourceTrace.vue
index 19012f9..9cfbd0e 100644
--- a/src/views/sourcetrace/SourceTrace.vue
+++ b/src/views/sourcetrace/SourceTrace.vue
@@ -1,18 +1,32 @@
 <template>
-  <el-row>
-    <el-col v-if="direction == 'right'" span="2" class="flex-col">
-      <el-row justify="end">
+  <el-row
+    :style="
+      direction == 'left'
+        ? 'flex-direction: row;'
+        : 'flex-direction: row-reverse'
+    "
+  >
+    <el-col span="2" class="flex-col">
+      <el-row :justify="direction == 'left' ? 'end' : 'start'">
         <CardButton
-          direction="left"
+          :direction="direction"
           name="鍔ㄦ�佹函婧�"
           @click="handleDisplayChange"
         ></CardButton>
       </el-row>
       <el-row class="flex-col">
+        <PollutedWarnItem
+          :item="selectedWarning"
+          @showMarksAndPolygon="showMarksAndPolygon"
+        ></PollutedWarnItem>
         <PollutedExceptionItem
           :item="selectedException"
           @showMarksAndPolygon="showMarksAndPolygon"
         ></PollutedExceptionItem>
+        <PollutedClueItem
+          v-model="clueDialog"
+          :item="selectedClue"
+        ></PollutedClueItem>
       </el-row>
     </el-col>
     <el-col v-show="show" span="10">
@@ -35,9 +49,9 @@
             <!-- 鏁版嵁鍒囩墖缁熻 -->
             <div style="border-left: 1px solid white" class="p-l-8">
               <el-space direction="vertical">
-                <el-text type="primary">婧簮锛歿{ countMsg1.type1 }}鏉�</el-text>
-                <el-text type="primary">绾跨储锛歿{ countMsg1.type2 }}鏉�</el-text>
-                <el-text type="primary">鎻愰啋锛歿{ countMsg1.type3 }}鏉�</el-text>
+                <el-text type="info">婧簮锛歿{ countMsg1.type1 }}鏉�</el-text>
+                <el-text type="info">绾跨储锛歿{ countMsg1.type2 }}鏉�</el-text>
+                <el-text type="info">鎻愰啋锛歿{ countMsg1.type3 }}鏉�</el-text>
               </el-space>
             </div>
           </el-row>
@@ -57,7 +71,7 @@
         </template>
       </BaseCard>
     </el-col>
-    <el-col v-if="direction == 'left'" span="2" class="flex-col">
+    <!-- <el-col v-if="direction == 'left'" span="2" class="flex-col">
       <el-row justify="start">
         <CardButton
           direction="right"
@@ -70,12 +84,12 @@
           :item="selectedException"
           @showMarksAndPolygon="showMarksAndPolygon"
         ></PollutedExceptionItem>
+        <PollutedClueItem
+          v-model="clueDialog"
+          :item="selectedClue"
+        ></PollutedClueItem>
       </el-row>
-    </el-col>
-    <PollutedClueItem
-      v-model="clueDialog"
-      :item="selectedClue"
-    ></PollutedClueItem>
+    </el-col> -->
   </el-row>
 </template>
 <script setup>
@@ -101,6 +115,7 @@
 import ClueRecordItem from './component/ClueRecordItem.vue';
 import PollutedClueItem from '@/views/sourcetrace/component/PollutedClueItem.vue';
 import SourceTraceFilter from '@/views/sourcetrace/component/SourceTraceFilter.vue';
+import PollutedWarnItem from './component/PollutedWarnItem.vue';
 
 const NO_SCENE = 'no_scene';
 
@@ -110,7 +125,7 @@
 const props = defineProps({
   direction: {
     type: String,
-    default: 'left'
+    default: 'right'
   },
   factorType: String,
   // 妯″紡锛宺ealtime锛氬疄鏃舵ā寮忥紱history锛氬巻鍙叉暟鎹ā寮�
@@ -125,12 +140,14 @@
 const emits = defineEmits(['update:factorType']);
 
 const show = ref(false);
-const clueDialog = ref(false);
 const scrollContentRef = ref();
 const scrollbarRef = ref();
 
+const selectedWarning = ref();
 const selectedException = ref();
 const selectedClue = ref();
+const clueDialog = ref(false);
+
 const selectedMsgTypes = ref(['1', '2', '3']);
 const selectedFactorTypes = ref([]);
 const factorOptions = ref([]);
@@ -281,7 +298,7 @@
         // 鑻ユ病鏈夋壘鍒伴闄╂簮鏃讹紝灏嗚鍒嗙被璁惧畾涓簄ull
         if (sceneOptions.value.findIndex((v) => v.value == NO_SCENE) == -1) {
           sceneOptions.value.push({
-            label: '鏃�',
+            label: '鏈煡',
             value: NO_SCENE
           });
           selectedSceneTypes.value.push(NO_SCENE);
@@ -374,21 +391,33 @@
 );
 
 function handleOpen(item) {
+  // 鍘婚櫎涓婁竴涓�滄函婧愨�濆拰鈥滄彁閱掆�濇秷鎭殑閫変腑鏍囧織
+  if (selectedWarning.value && selectedWarning.value._selected) {
+    selectedWarning.value._selected = false;
+    showMarksAndPolygon(selectedWarning.value);
+  }
+  if (selectedException.value && selectedException.value._selected) {
+    selectedException.value._selected = false;
+    showMarksAndPolygon(selectedException.value);
+  }
+  if (selectedClue.value && selectedClue.value._selected) {
+    selectedClue.value._selected = false;
+    clueDialog.value = false;
+  }
   switch (item._type) {
     case '1':
-    case '3':
-      if (selectedException.value) {
-        selectedException.value._selected = false;
-      }
+      // 鏄剧ず褰撳墠閫変腑鐨勭浉鍏冲湴鍥炬爣璁�
       showMarksAndPolygon(item);
+      // 鏇存柊閫変腑鐨勫璞�
       selectedException.value = item;
       break;
     case '2':
-      if (selectedClue.value) {
-        selectedClue.value._selected = false;
-      }
       selectedClue.value = item;
       clueDialog.value = true;
+      break;
+    case '3':
+      showMarksAndPolygon(item);
+      selectedWarning.value = item;
       break;
   }
   item._selected = true;
@@ -412,7 +441,7 @@
   } else {
     if (polygonMap.has(item.guid)) {
       map.remove(polygonMap.get(item.guid));
-      selectedException.value._selected = false;
+      item._selected = false;
     }
   }
 }
@@ -473,7 +502,7 @@
   --el-statistic-content-color: white;
 }
 
-:deep(.el-text.el-text--primary) {
+:deep(.el-text.el-text--info) {
   --el-text-color: white;
 }
 

--
Gitblit v1.9.3