Commit 47edb76b authored by 李玲燕's avatar 李玲燕

commit

parent 309d21cc
......@@ -66,9 +66,10 @@ app.use(router)
.use(ViewUIPlus)
.use(pinia)
const config_url = process.env.NODE_ENV === 'development' ? '../config.json' : '/config.json'
function getSysConfig() {
return new Promise((resolve, reject) => {
axios.get('/config.json').then((result) => {
axios.get(config_url).then((result) => {
let config = result.data
resolve(config)
}).catch((error) => {
......
......@@ -124,8 +124,8 @@ export const useVehicleStore = defineStore('vehicle', {
}
},
setBasicInfo(data) {
const {oil, tire0, tire1, tire2, tire3, tire4, tire5} = data
this.vehicleBasic = {oil, tire0, tire1, tire2, tire3, tire4, tire5}
const {oil, isOil, tire0, tire1, tire2, tire3, tire4, tire5} = data
this.vehicleBasic = {oil, isOil, tire0, tire1, tire2, tire3, tire4, tire5}
}
}
})
\ No newline at end of file
......@@ -20,7 +20,7 @@
<span class="middle-img" :style="`background-image: url('/image/ic_${item.name}.png')`">
{{basicMid[item.title] || 0}}{{item.unit}}
</span>
<span>{{item.label}}</span>
<span>{{item.title == 'oil' ? basicMid.isOil ? '油量' : '电量' : item.label}}</span>
</li>
</ul>
</div>
......@@ -213,8 +213,9 @@
number.value = loginAckValue.number
}
if (vehicleBasic) {
const {oil} = vehicleBasic
const {oil, isOil} = vehicleBasic
basicMid['oil'] = oil ? oil.toFixed(2) : 0
basicMid['isOil'] = isOil
}
if (currentBasic) {
const {vehicleLoad, vehicleSpeed} = currentBasic
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment