From 130af7df9d8ab5195afa44ebcc4e398cf701df5b Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:13:22 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afix=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E9=87=8D=E6=9E=84=20=E6=B6=88=E8=80=97=E7=94=B5?= =?UTF-8?q?=E9=87=8F=E7=AE=97=E6=B3=95=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B?= =?UTF-8?q?=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91?= =?UTF-8?q?=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- src/views/layout/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue index 2edbd37..2447b53 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/index.vue @@ -58,9 +58,9 @@ export default { } // 计算电量消耗 - const batteryDrop = (flyData.startBattery || 0) - (flyData.endBattery || 0) - const totalCapacity = plane.planeState.battCapacity || 1 - const powerUsed = Math.round((batteryDrop / 100) * totalCapacity) + const batteryDrop = Number(flyData.startBattery) - Number(flyData.endBattery) + const totalCapacity = Number(plane.planeState.battCapacity) + const powerUsed = Math.round(totalCapacity / 100 * batteryDrop) // 构造上传数据 const uploadData = {