diff --git a/src/components/content/airInfo/AirInfo.vue b/src/components/content/airInfo/AirInfo.vue index 2a9ad95..5772f7e 100644 --- a/src/components/content/airInfo/AirInfo.vue +++ b/src/components/content/airInfo/AirInfo.vue @@ -38,6 +38,9 @@ import {ref, reactive} from "vue"; import ItemInfo from "./childComps/ItemInfo.vue"; +const props = defineProps({ + list: Array +}); const info = reactive({ windPId: 0, //编号 max: 120, //最大值 @@ -62,12 +65,17 @@ const info3 = reactive({ value: 80, //测量值 point: 88, //阈值 }); -setInterval(() => { - info.value = parseInt(Math.random() * 10) * 10; - info1.value = parseInt(Math.random() * 10) * 10; - info2.value = parseInt(Math.random() * 10) * 10; - info3.value = parseInt(Math.random() * 10) * 10; -}, 2000); +watch(() => props.list, (now, old) => { + console.log('传感器 ', now, old) + // wpList.value=now +}, {deep: true}); +// setInterval(() => { +// info.value = parseInt(Math.random() * 10) * 10; +// info1.value = parseInt(Math.random() * 10) * 10; +// info2.value = parseInt(Math.random() * 10) * 10; +// info3.value = parseInt(Math.random() * 10) * 10; +// }, 2000); + diff --git a/src/components/content/windPressure/childComps/WindPressureItem.vue b/src/components/content/windPressure/childComps/WindPressureItem.vue index afa41a4..e69dc24 100644 --- a/src/components/content/windPressure/childComps/WindPressureItem.vue +++ b/src/components/content/windPressure/childComps/WindPressureItem.vue @@ -1,9 +1,8 @@ - + - {{ index }}号风压 + + {{ index }}号风压 @@ -64,11 +63,24 @@ let isWaring = computed(() => {