From 93fc01349aa48a086c71123a2317765a925c0897 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 06 一月 2025 10:22:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
 screen/src/views/EnergyConsum.vue |   67 ++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 19 deletions(-)
diff --git a/screen/src/views/EnergyConsum.vue b/screen/src/views/EnergyConsum.vue
index 3ad40c9..6a4ec2a 100644
--- a/screen/src/views/EnergyConsum.vue
+++ b/screen/src/views/EnergyConsum.vue
@@ -252,18 +252,17 @@
               <div class="tabs">娌硅�楋細L</div>
               <img src="@/assets/images/title@2x.png" class="bg" alt="" />
             </div>
-            <div v-if="data3 && data3.length > 0" class="list">
-              <template v-for="item, i in data3">
-                <div v-if="i < 6" class="line">
-                  <div class="top"><span v-if="i < 3">top</span>{{ i + 1 }}</div>
+            <div v-if="data3 && data3.length > 0" class="list one-swiper">
+              <div class="swiper-wrapper">
+                <div class="line one-swiper-slide swiper-slide" v-for="item, i in data3">
+                  <div class="top" :class="{ top3: i < 3 }"><span v-if="i < 3">top</span>{{ i + 1 }}</div>
                   <div class="id_card">{{ item.carNo }}</div>
                   <div class="wrap">
                     <ChargeRate :rate="item.rate" :color="i > 2 ? 'cyan' : '#e3a83a'" />
                   </div>
                   <div class="num">{{ item.quantity }}</div>
                 </div>
-              </template>
-
+              </div>
             </div>
             <div v-if="data3.length == 0" class="empty_wrap list">
               <img src="@/assets/images/default_empty.png" alt="">
@@ -293,6 +292,8 @@
 import ChargeRate from '@/components/ChargeRate.vue'
 import * as echarts from 'echarts'
 import VScaleScreen from 'v-scale-screen'
+import 'swiper/css/swiper.min.css'
+import Swiper from 'swiper'
 import {
   zxcenterData,
   zxenergyDataList,
@@ -345,7 +346,7 @@
       type: 'category',
       boundaryGap: false,
       axisLabel: {
-        color: '#D2E0FF' 
+        color: '#D2E0FF'
       },
       data: data5.value.map(i => dayjs(i.timeData).format('M'))
     },
@@ -359,7 +360,7 @@
       type: 'value',
       name: '鍗曚綅锛歀',
       axisLabel: {
-        color: '#D2E0FF' 
+        color: '#D2E0FF'
       },
       nameTextStyle: {
         color: '#D2E0FF',
@@ -469,7 +470,7 @@
       type: 'category',
       boundaryGap: false,
       axisLabel: {
-        color: '#D2E0FF' 
+        color: '#D2E0FF'
       },
       data: data4.value.map(i => i.timeData)
     },
@@ -490,7 +491,7 @@
         splitNumber: 4
       },
       axisLabel: {
-        color: '#D2E0FF' 
+        color: '#D2E0FF'
       }
     },
     grid: {
@@ -557,7 +558,7 @@
 const data1 = ref({})
 const getData1 = () => {
   zxcenterData().then(res => {
-    const result = res.data
+    const result = res.data || {}
     data1.value = result
   })
 }
@@ -569,7 +570,7 @@
 }
 const getData6 = () => {
   regionDataRanking({ type: activeDays.value }).then(res => {
-    const result = res.data
+    const result = res.data || {}
     data6.value = result
   })
 }
@@ -603,7 +604,7 @@
     xAxis: {
       type: 'category',
       axisLabel: {
-        color: '#D2E0FF' 
+        color: '#D2E0FF'
       },
       data: data2.value.map(i => dayjs(i.timeData).format('M'))
     },
@@ -611,7 +612,7 @@
       type: 'value',
       name: unit,
       axisLabel: {
-        color: '#D2E0FF' 
+        color: '#D2E0FF'
       },
       nameTextStyle: {
         color: '#D2E0FF',
@@ -673,7 +674,7 @@
 const data4 = ref([])
 const getData4 = () => {
   zxloadCurve().then(res => {
-    const result = res.data
+    const result = res.data || []
     data4.value = result
     if (data4.value && data4.value.length > 0) {
       initLoadReal()
@@ -684,9 +685,26 @@
 const data5 = ref([])
 const getData5 = () => {
   zxenergyDataList({ type: 2 }).then(res => {
-    const result = res.data
+    const result = res.data || []
     data5.value = result
     initOperation()
+  })
+}
+
+const autoplayFlag = (list = [], leng = 4, time = 2000) => {
+  if (list.length > leng) {
+    return { delay: time, disableOnInteraction: false }
+  } else {
+    return false
+  }
+}
+const loopFn1 = () => {
+  var newSwiper1 = new Swiper('.one-swiper', {
+    initialSlide: 0,
+    direction: 'vertical', //绔栫洿鏂瑰悜
+    slidesPerView: 6,
+    autoplay: autoplayFlag(data3.value, 6, 4000),
+    observer: true, //淇敼swiper鑷繁鎴栧瓙鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper
   })
 }
 
@@ -707,6 +725,10 @@
     getData5()
     getData6()
   }, 1000 * 60 * 60)
+
+  setTimeout(() => {
+    loopFn1()
+  }, 12000)
 
 })
 
@@ -994,13 +1016,16 @@
       margin-bottom: 20px;
 
       .list {
-        padding: 20px 24px 4px;
-        height: 250px;
+        padding: 0px 24px;
+        height: 228px;
+        margin: 20px 0 0;
+        overflow: auto;
 
         .line {
           display: flex;
           align-items: center;
-          margin-bottom: 16px;
+          /* margin-bottom: 16px; */
+          height: 38px !important;
 
           .top {
             font-weight: 500;
@@ -1014,6 +1039,10 @@
             margin-right: 10px;
           }
 
+          .top3 {
+            box-shadow: inset 0px 0px 3px 0px #FEAF01;
+          }
+
           .id_card {
             color: #DBEAEA;
             font-weight: 500;
--
Gitblit v1.9.3