Browse Source

fix: 气压保留两位小数

master
guoapeng 1 week ago
parent
commit
a3318c3e12
  1. 18
      src/components/seal/DashboardChart.vue

18
src/components/seal/DashboardChart.vue

@ -17,9 +17,11 @@ watchEffect(() => {
}
if (myChart) {
myChart.setOption({
series: [{
data: [{ value: pressure }],
}],
series: [
{
data: [{ value: Number(pressure || 0).toFixed(2) }],
},
],
})
}
})
@ -53,7 +55,7 @@ const initChart = () => {
},
data: [
{
value: realTimePressure.value,
value: Number(realTimePressure.value || 0).toFixed(2),
},
],
},
@ -75,8 +77,8 @@ onUnmounted(() => {
</template>
<style>
canvas{
width: 60vw !important;
height: 70vh !important;
}
canvas {
width: 60vw !important;
height: 70vh !important;
}
</style>
Loading…
Cancel
Save