邓洁: 传感器数据监控

This commit is contained in:
邓洁
2023-12-22 23:33:48 +08:00
parent 267ef35001
commit e2b1ef3845
2 changed files with 67 additions and 21 deletions

View File

@@ -60,8 +60,9 @@ let myEcharts = reactive({});
const isVisited = ref(false);
const eleData = ref([])
const electricityConsumptionMonthly = ref()
const monthlySavings = ref(55555)
const valueA = ref(electricityConsumptionMonthly.value);
const monthlySavings = ref(5)
const length = ref(null);
const valueA = ref();
const valueB = ref(monthlySavings.value);
const bgImage = computed(() =>
isVisited.value
@@ -70,6 +71,7 @@ const bgImage = computed(() =>
);
watch(() => props.eleData, (now) => {
getBasicData(now.frequencyChangerList)
// setValue()
}, {deep: true});
watch(() => props.list, (now) => {
eleData.value.forEach(item => {
@@ -84,7 +86,23 @@ watch(() => props.list, (now) => {
}
})
})
// setValue()
}, {deep: true});
onMounted(()=>{
// setValue()
})
const setValue=()=> {
let width = (electricityConsumptionMonthly.value * length.value.offsetHeight) / 10000;
console.log('width',electricityConsumptionMonthly.value,width)
valueA.value.style.height = `${width}px`;
// let flag = (params.wp.point * length.value.offsetWidth) / params.wp.max;
// point.value.style.left = `${flag}px`;
// if (width >= flag) {
// value.value.style.background = "#F53839";
// } else {
// value.value.style.background = "#60DDDE";
// }
}
const getBasicData = (data) => {
let tranObj = {}
let tranArr = []