From f9af1703cf856d8d824255025701fc76d5fc0e83 Mon Sep 17 00:00:00 2001
From: longyvfengyun <496960745@qq.com>
Date: 星期六, 11 十一月 2023 13:20:07 +0800
Subject: [PATCH] 内容提交

---
 src/views/battShow.vue |   75 +++++++++++++++++++++++++++++--------
 1 files changed, 58 insertions(+), 17 deletions(-)

diff --git a/src/views/battShow.vue b/src/views/battShow.vue
index 86c8888..91dcbe0 100644
--- a/src/views/battShow.vue
+++ b/src/views/battShow.vue
@@ -4,28 +4,66 @@
 import HdwChart from "@/components/echarts/hdwChart.vue";
 import getNormalLine from "@/components/echarts/options/normalLine"
 import {onMounted, ref} from "vue";
+import getRadiusBarOption from "@/components/echarts/options/radiusBar";
 
 const carName = ref("");
 const timeRange = ref("");
 
-const tempLine = ref(null);
-const volLine = ref(null);
+const tempBar = ref(null);
+const volBar = ref(null);
 const alarmLine = ref(null);
 const totalVolLine = ref(null);
 
 const resize = ()=>{
-  tempLine.value.resize();
-  volLine.value.resize();
+  tempBar.value.resize();
+  volBar.value.resize();
   alarmLine.value.resize();
   totalVolLine.value.resize();
 }
 
-onMounted(()=>{
-  const tempLineOption = getNormalLine();
-  tempLine.value.setOption(tempLineOption);
+import carInfoModule from "@/views/moudle/battShow/carInfo";
+const {carList, getCarNames} = carInfoModule();
 
-  const volLineOption = getNormalLine();
-  volLine.value.setOption(volLineOption);
+import battHistoryModule from "@/views/moudle/battShow/battHistory";
+
+const {
+	getBattHistory
+} = battHistoryModule();
+
+const searchBattHistory = async ()=> {
+	try {
+		const rs = await getBattHistory(carName.value, timeRange.value);
+		if (rs.code !== 0) {
+			console.log(rs.data);
+		}
+	}catch (e) {
+		console.log(e);
+	}
+}
+
+onMounted(()=>{
+
+	getCarNames();
+
+  const tempBarOption = getRadiusBarOption({
+	  grid: {
+		  top: '15%',
+		  right: '3%',
+		  left: '5%',
+		  bottom: '5%'
+	  }
+  });
+  tempBar.value.setOption(tempBarOption);
+
+  const volBarOption = getRadiusBarOption({
+	  grid: {
+		  top: '15%',
+		  right: '3%',
+		  left: '5%',
+		  bottom: '5%'
+	  }
+  });
+  volBar.value.setOption(volBarOption);
 
   const alarmLineOption = getNormalLine();
   alarmLine.value.setOption(alarmLineOption);
@@ -33,7 +71,7 @@
   const totalVolLineOption = getNormalLine();
   totalVolLine.value.setOption(totalVolLineOption);
 
-  resize();
+	resize();
 });
 </script>
 
@@ -47,9 +85,9 @@
               <div class="input-label">杞﹁締鍚嶇О:</div>
               <div class="input-content">
                 <el-select v-model="carName" filterable>
-                  <el-option value="snr" label="姹借溅1"></el-option>
-                  <el-option value="snr1" label="姹借溅2"></el-option>
-                  <el-option value="snr2" label="姹借溅3"></el-option>
+                  <el-option
+	                  v-for="(item, key) in carList" :key="'key'+key"
+                    :value="item.key" :label="item.label"></el-option>
                 </el-select>
               </div>
             </div>
@@ -69,6 +107,9 @@
               </div>
             </div>
           </div>
+	        <div class="input-item">
+		        <el-button type="primary" @click="searchBattHistory">鏌ヨ</el-button>
+	        </div>
         </div>
       </div>
       <div class="batt-show-body">
@@ -77,7 +118,7 @@
             <flex-box>
               <div class="flex-box-content">
                 <chart-box title="鍗曚綋娓╁害">
-                  <hdw-chart ref="tempLine"></hdw-chart>
+                  <hdw-chart ref="tempBar"></hdw-chart>
                 </chart-box>
               </div>
             </flex-box>
@@ -86,7 +127,7 @@
             <flex-box>
               <div class="flex-box-content">
                 <chart-box title="鍗曚綋鐢靛帇">
-                  <hdw-chart ref="volLine"></hdw-chart>
+                  <hdw-chart ref="volBar"></hdw-chart>
                 </chart-box>
               </div>
             </flex-box>
@@ -167,7 +208,7 @@
 .input-wrapper {
   display: flex;
   .input-content {
-    width: 160px;
+    min-width: 160px;
     vertical-align: middle;
   }
   .input-label {
@@ -179,4 +220,4 @@
     vertical-align: middle;
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.1