【类 型】:fix
【原 因】:重构 消耗电量算法 【过 程】: 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
c8da790f64
commit
130af7df9d
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user