From 6b2ec7bd05459ddb4ea99df00267dbfda49cbdc7 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期日, 03 八月 2025 14:11:12 +0800
Subject: [PATCH] 设备控制增加电量显示

---
 Web/src/views/device/deviceStartStop/index.vue |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/Web/src/views/device/deviceStartStop/index.vue b/Web/src/views/device/deviceStartStop/index.vue
index c924ddd..427378a 100644
--- a/Web/src/views/device/deviceStartStop/index.vue
+++ b/Web/src/views/device/deviceStartStop/index.vue
@@ -5,15 +5,18 @@
                 <el-collapse-item title="浠撳簱涓�灞�" name="1">
                     <el-card class="box-card" shadow="hover">
                         <el-text style="margin-right: 15px;">1鍙风┛姊溅</el-text>
+                        <el-text style="margin-right: 15px;">鐢甸噺锛歿{carDL1}}</el-text>
                         <el-button @click="write('ShuttleCar', '1', '41093', '1')">澶嶄綅</el-button>
                         <el-button @click="write('ShuttleCar', '1', '41096', '1')">姝e悜瀵荤爜</el-button>
                         <el-button @click="write('ShuttleCar', '1', '41096', '2')">鍙嶅悜瀵荤爜</el-button>
+                        
                     </el-card>
                     <el-card class="box-card" shadow="hover">
                         <el-text style="margin-right: 15px;">2鍙风┛姊溅</el-text>
+                        <el-text style="margin-right: 15px;">鐢甸噺锛歿{carDL2}}</el-text>
                         <el-button @click="write('ShuttleCar', '2', '41093', '1')">澶嶄綅</el-button>
                         <el-button @click="write('ShuttleCar', '2', '41096', '1')">姝e悜瀵荤爜</el-button>
-                        <el-button @click="write('ShuttleCar', '2', '41096', '2')">鍙嶅悜瀵荤爜</el-button>
+                        <el-button @click="write('ShuttleCar', '2', '41096', '2')">鍙嶅悜瀵荤爜</el-button>                        
                     </el-card>
                 </el-collapse-item>
             </el-collapse>
@@ -45,12 +48,32 @@
 
 import { ref, reactive, onMounted } from 'vue';
 import { listStatus, listPosition } from '/@/api/wcs/wcsPlc';
-import { WriteStartStop } from '/@/api/wcs/wcsDevice';
+import { WriteStartStop,GetCarDL } from '/@/api/wcs/wcsDevice';
 import { ElMessage } from "element-plus";
 
+const carDL1= ref<any>({});
+carDL1.value="鑾峰彇涓�..";
+const carDL2= ref<any>({});
+carDL2.value="鑾峰彇涓�..";
 const activeNames = ref(['1'])
 const activeNames2 = ref(['2'])
 const state = ref<any>({});
+const handleQuery = async () => {
+	var resCar = await GetCarDL();
+    if (resCar.data.result._dicList && resCar.data.result._dicList.length > 0) {        
+       resCar.data.result._dicList.forEach(car => {
+            const name = Object.keys(car)[0];
+            if(name=="绌挎杞�1"){
+                carDL1.value=car[name]+"%";
+            }
+            if(name=="绌挎杞�2"){
+                carDL2.value=car[name]+"%";
+            }
+        });
+    }
+};
+handleQuery();
+
 
 const write = async (type: string, no: string, layer: string, FuncName: string) => {
 
@@ -60,7 +83,6 @@
         Layer: layer,
         FuncName: FuncName
     };
-
     var res = await WriteStartStop(data);
     console.log(res.data.result);
     // ElMessage.success(res.data.result);

--
Gitblit v1.8.0