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

commit

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