From ce6dc0b882ce5100796760a21b1fb2c07d001cad Mon Sep 17 00:00:00 2001 From: yezhichao <651778286@qq.com> Date: Tue, 23 Nov 2021 07:54:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=B5=B7=E6=8B=94=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E6=95=B0=E6=8D=AE=E7=9A=84=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/render/components/DigitalFlop.vue | 2 +- .../components/DigitalFlopContainer.vue | 25 +++++++------------ src/render/components/WaterLevel.vue | 6 +++-- src/render/page/DataMonitorPage.vue | 2 +- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/render/components/DigitalFlop.vue b/src/render/components/DigitalFlop.vue index 2bf95ea..0b041cc 100644 --- a/src/render/components/DigitalFlop.vue +++ b/src/render/components/DigitalFlop.vue @@ -6,7 +6,7 @@ \ No newline at end of file diff --git a/src/render/components/DigitalFlopContainer.vue b/src/render/components/DigitalFlopContainer.vue index eebc59a..38c07cc 100644 --- a/src/render/components/DigitalFlopContainer.vue +++ b/src/render/components/DigitalFlopContainer.vue @@ -11,7 +11,6 @@ :style="item.style" :ref="item.key + 'Digital'" /> -
{{ item.unit }}
@@ -25,33 +24,27 @@ const digitalFlopData = reactive([ { title: '日  期', value: '', - style: 'color: #4d99fc', - unit : '' + style: 'color: #4d99fc' }, { title: '时  间', value: '', - style: 'color: #f46827', - unit : '' + style: 'color: #f46827' }, { title: '经  度', value: '', - style: 'color: #40faee', - unit : '' + style: 'color: #40faee' }, { title: '纬  度', value: '', - style: 'color: #4d99fc', - unit : '' + style: 'color: #4d99fc' }, { title: '海  拔', - value: null, - style: 'color: #f46827', - unit : '' + value: '', + style: 'color: #f46827' }, { title: '定位卫星数目', - value: 0, - style: 'color: #40faee', - unit : '' + value: '', + style: 'color: #40faee' } ]) @@ -72,7 +65,7 @@ const update = ( // 海拔 digitalFlopData[4].value = `${alt} 米` // 定位卫星数目 - digitalFlopData[5].value = numSat + digitalFlopData[5].value = numSat.toString() } defineExpose({ update }) diff --git a/src/render/components/WaterLevel.vue b/src/render/components/WaterLevel.vue index fbc7575..b15f7ce 100644 --- a/src/render/components/WaterLevel.vue +++ b/src/render/components/WaterLevel.vue @@ -29,13 +29,15 @@ const option = reactive({ }, label: { formatter: function({ value }) { - return value + return parseInt(value) } }, data: [60, 0.5, 0.4, 0.3] }] }) -const update = console.log +const update = (alt: number) => { + option.series[0].data[0] = alt +} defineExpose({ update }) \ No newline at end of file diff --git a/src/render/page/DataMonitorPage.vue b/src/render/page/DataMonitorPage.vue index 599db2b..7813fa6 100644 --- a/src/render/page/DataMonitorPage.vue +++ b/src/render/page/DataMonitorPage.vue @@ -51,7 +51,7 @@ const update = (nmeaStr: string) => { digitalFlopContainer.value.update(dateTime, longitude, latitude, alt, numSat) clock.value.update(dateTime) compass.value.update(variation, variationPole) - // waterLevel.value.update(alt) + waterLevel.value.update(alt) // map.value.update(lon, lonPole, lat, latPole) }