邓洁 : 风压风速接口

This commit is contained in:
邓洁
2023-12-13 09:43:53 +08:00
parent 16e68e8609
commit 944c727cc5
7 changed files with 127 additions and 125 deletions

View File

@@ -11,69 +11,35 @@
import WindPressureItem from "./childComps/WindPressureItem.vue";
const props = defineProps({
list: Array
list: Array,
winData: Array
});
const wpList = ref([
{
max: 120, //最大值
value: 40, //测量值
point: 60, //阈值
},
{
max: 120, //最大值
value: 66, //测量值
point: 60, //阈值
},
{
max: 120, //最大值
value: 70, //测量值
point: 50, //阈值
},
{
max: 120, //最大值
value: 90, //测量值
point: 60, //阈值
},
{
max: 120, //最大值
value: 40, //测量值
point: 30, //阈值
},
{
max: 120, //最大值
value: 30, //测量值
point: 50, //阈值
},
{
max: 120, //最大值
value: 20, //测量值
point: 30, //阈值
},
{
max: 120, //最大值
value: 20, //测量值
point: 30, //阈值
},
{
max: 120, //最大值
value: 120, //测量值
point: 80, //阈值
},
{
max: 120, //最大值
value: 99, //测量值
point: 70, //阈值
},
]);
const wpList = ref([]);
watch(() => props.list, (now, old) => {
console.log('风压', now, old)
now.map(item=>{
item.unit='Pa'
})
wpList.value = now
}, {deep: true});
// setInterval(() => {
// wpList.forEach((item) => {
// item.value = parseInt(Math.random() * 10) * 10;
// });
// }, 2000);
watch(() => props.winData, (now) => {
getScreenInfo(now)
}, {deep: true});
const getScreenInfo = (now) => {
let windPressureObj = {}
let windPressureArr = []
now.windPressureSensorList.map(item => {
windPressureObj = {
max: 120,
value: item.value,
point: item.valueThreshold,
unit: item.unit
}
windPressureArr.push(windPressureObj)
})
wpList.value = windPressureArr
}
</script>
<style lang="scss" scoped>