From 3344b2dcbd237c34a90227859eb191bfd4aa2e63 Mon Sep 17 00:00:00 2001
From: longyvfengyun <496960745@qq.com>
Date: 星期四, 16 十一月 2023 17:31:18 +0800
Subject: [PATCH] 解决初始数据是100的问题

---
 src/views/battShow.vue |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/views/battShow.vue b/src/views/battShow.vue
index 26b8fe2..3387134 100644
--- a/src/views/battShow.vue
+++ b/src/views/battShow.vue
@@ -3,7 +3,7 @@
 import ChartBox from "@/components/chartBox.vue";
 import HdwChart from "@/components/echarts/hdwChart.vue";
 import getNormalLine from "@/components/echarts/options/normalLine"
-import {onMounted, ref} from "vue";
+import {nextTick, onMounted, ref} from "vue";
 import getRadiusBarOption from "@/components/echarts/options/radiusBar";
 
 const carName = ref("");
@@ -33,7 +33,7 @@
 
 let totalData = [];
 const searchBattHistory = async ()=> {
-	slideVal.value = 100;
+	slideVal.value = 0;
 	try {
 		const rs = await getBattHistory(carName.value, timeRange.value);
 		let data = [];
@@ -41,7 +41,7 @@
 			data = rs.data;
 		}
 		totalData = data;
-
+		slideVal.value = 100;
 		let currentDataIndex = getDataIndex(totalData.length, slideVal.value);
 		console.log(totalData[currentDataIndex]);
 	}catch (e) {

--
Gitblit v1.9.1