From 8dd7af51db4cf768fbf92002b5b62f7fb9d1c929 Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期二, 06 五月 2025 15:04:59 +0800
Subject: [PATCH] refactor(zhitan):调整模型代码和优化能源统计功能

---
 zhitan-vue/src/views/realtimemonitor/realtimemonitor/realtimemonitor.vue |   65 ++++++++++++++++++++++++--------
 1 files changed, 49 insertions(+), 16 deletions(-)

diff --git a/zhitan-vue/src/views/realtimemonitor/realtimemonitor/realtimemonitor.vue b/zhitan-vue/src/views/realtimemonitor/realtimemonitor/realtimemonitor.vue
index 23b7d46..fc83e4f 100644
--- a/zhitan-vue/src/views/realtimemonitor/realtimemonitor/realtimemonitor.vue
+++ b/zhitan-vue/src/views/realtimemonitor/realtimemonitor/realtimemonitor.vue
@@ -2,7 +2,7 @@
   <div class="page">
     <div class="page-container">
       <div class="page-container-left">
-        <LeftTree ref="leftTreeRef" @handleNodeClick="handleNodeClick" />
+        <LeftTree ref="leftTreeRef" @handleNodeClick="handleNodeClick" ParentModelCode="LBJT" />
       </div>
       <div class="page-container-right">
         <div class="form-card">
@@ -128,6 +128,7 @@
 const energyTypeList = ref(undefined)
 let energyRealTimeMonitorList = ref([])
 const loading = ref(false)
+const tabIndex = ref(0)
 const data = reactive({
   queryParams: {
     nodeId: null,
@@ -137,6 +138,39 @@
   query: { ...useRoute().query },
 })
 const { queryParams, query } = toRefs(data)
+
+const refresher = () => {
+  console.log("refresher")
+  listEnergyRealTimeMonitor(
+      proxy.addDateRange({
+        ...queryParams.value,
+        ...query.value,
+      })
+  ).then((res) => {
+    if (!!res.code && res.code == 200) {
+      res.data.map((item) => {
+        item.activeIndex = tabIndex.value
+      })
+      energyRealTimeMonitorList.value = res.data
+    }
+  })
+}
+
+// 娣诲姞瀹氭椂鍣�
+let refreshTimer = null
+
+onMounted(() => {
+  refreshTimer = setInterval(() => {
+    refresher()
+  }, 30000)
+})
+
+onBeforeUnmount(() => {
+  if (refreshTimer) {
+    clearInterval(refreshTimer)
+  }
+})
+
 /** 鑺傜偣鍗曞嚮浜嬩欢 */
 function handleNodeClick(data) {
   queryParams.value.nodeId = data.id
@@ -149,6 +183,7 @@
 }
 function handleClick(item, index) {
   item.activeIndex = index
+  tabIndex.value = index
 }
 // 鑳芥簮瀹炴椂鐩戞帶-鑳芥簮瀹炴椂鐩戞帶-鍒楄〃
 function getList() {
@@ -207,8 +242,8 @@
       text-align: left;
       font-weight: bold;
       font-family: OPPOSans, OPPOSans;
-      font-weight: 500;
-      font-size: 16px;
+     
+      font-size: 14px;
       font-style: normal;
       text-transform: none;
     }
@@ -231,11 +266,10 @@
       padding: 0 10px;
 
       .title {
-        font-size: 14px;
         color: rgba(255, 255, 255, 0.8);
         font-family: OPPOSans, OPPOSans;
-        font-weight: 500;
-        font-size: 16px;
+       
+        font-size: 14px;
         line-height: 19px;
         text-align: left;
         font-style: normal;
@@ -243,7 +277,7 @@
       }
 
       .num {
-        font-size: 24px;
+        font-size: 26px;
         color: #36d3ff;
         font-family: OPPOSans, OPPOSans;
         font-weight: 800;
@@ -293,7 +327,7 @@
       text-align: center;
       margin: 5px 8px;
       border-radius: 8px;
-      padding: 7px 10px;
+      padding: 2px 6px;
       font-family: OPPOSans, OPPOSans;
       font-weight: 500;
       font-size: 16px;
@@ -327,9 +361,9 @@
     }
 
     &-li {
-      width: 240px;
-      margin-right: 10px;
-      margin-top: 16px;
+      width: 18%;
+      min-width: 190px;
+      margin: 1%;
       border-radius: 5px;
       border: 1px solid #ebebeb;
       margin-bottom: 5px;
@@ -339,7 +373,6 @@
       padding: 0 10px;
 
       .title {
-        font-size: 14px;
         color: #676767;
         font-family: OPPOSans, OPPOSans;
         font-weight: 500;
@@ -351,11 +384,10 @@
       }
 
       .num {
-        font-size: 22px;
+        font-size: 26px;
         color: #3271eb;
         font-family: OPPOSans, OPPOSans;
         font-weight: 800;
-        font-size: 32px;
         text-align: left;
         font-style: normal;
         text-transform: none;
@@ -368,6 +400,7 @@
         text-align: left;
         font-style: normal;
         text-transform: none;
+        font-size: 14px;
       }
     }
 
@@ -401,7 +434,7 @@
       text-align: center;
       margin: 5px 8px;
       border-radius: 8px;
-      padding: 7px 3px;
+      padding: 2px 6px;
       font-family: OPPOSans, OPPOSans;
       font-weight: 500;
       font-size: 16px;
@@ -433,7 +466,7 @@
   text-align: center;
   margin: 2px 6px;
   border-radius: 8px;
-  padding: 5px 10px;
+  padding: 2px 6px;
   font-family: OPPOSans, OPPOSans;
   font-weight: 500;
   font-size: 14px;

--
Gitblit v1.9.3