From 89c137c7b440fbbb068a728dba1d5e19a7256c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Wed, 3 Jan 2024 16:41:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/content/airInfo/AirInfo.vue | 3 + src/components/content/usedEle/UsedEle.vue | 40 +++------ src/views/tunnel-manage/index.vue | 94 ++++------------------ src/views/tunnel/index.vue | 43 +++------- 4 files changed, 40 insertions(+), 140 deletions(-) diff --git a/src/components/content/airInfo/AirInfo.vue b/src/components/content/airInfo/AirInfo.vue index 25090bb..15abe69 100644 --- a/src/components/content/airInfo/AirInfo.vue +++ b/src/components/content/airInfo/AirInfo.vue @@ -106,6 +106,9 @@ watch(() => props.airData, (now) => { } else { getAirInfo(now.sensorList) } + }else { + airList.value = [] + windSpeed.value = 0 } }, {deep: true}); const getChartInfo = (equipmentId) => { diff --git a/src/components/content/usedEle/UsedEle.vue b/src/components/content/usedEle/UsedEle.vue index cf09b65..00de321 100644 --- a/src/components/content/usedEle/UsedEle.vue +++ b/src/components/content/usedEle/UsedEle.vue @@ -63,7 +63,6 @@ const props = defineProps({ let myEcharts = reactive({}); const isVisited = ref(false); const showLoading = ref(false) -const eleData = ref([]) const electricityConsumptionMonthly = ref(0) const monthlySavings = ref(4000) const length = ref(null); @@ -79,18 +78,15 @@ watch(() => props.eleData, (now) => { setValueA() }, {deep: true}); watch(() => props.list, (now) => { - eleData.value.forEach(item => { - now.forEach(newItem => { - if (item.equipmentId === newItem.equipmentId) { - if (newItem.electricityConsumptionDay) { - electricityConsumptionMonthly.value = newItem.electricityConsumptionMonthly - // item.electricityConsumptionDay = newItem.electricityConsumptionDay - // item.electricityConsumptionMonthly = newItem.electricityConsumptionMonthly - // item.electricityConsumptionTotal = newItem.electricityConsumptionTotal - } - } - }) - }) + // props.eleData.forEach(item => { + // now.forEach(newItem => { + // if (item.equipmentId === newItem.equipmentId) { + // if (newItem.electricityConsumptionDay) { + // electricityConsumptionMonthly.value = newItem.electricityConsumptionMonthly + // } + // } + // }) + // }) setValueA() }, {deep: true}); onMounted(() => { @@ -108,25 +104,13 @@ const setValueB = () => { valueB.value.style.height = `${width}px`; } const getBasicData = (data) => { - let tranObj = {} - let tranArr = [] - data?.map(item => { - electricityConsumptionMonthly.value = item.electricityConsumptionMonthly, - tranObj = { - equipmentId: item.equipmentId, - // equipmentName: item.equipmentName, - // electricityConsumptionDay: item.electricityConsumptionDay, - // electricityConsumptionMonthly: item.electricityConsumptionMonthly, - // electricityConsumptionTotal: item.electricityConsumptionTotal, - } - tranArr.push(tranObj) - }) - eleData.value = tranArr + if(data!==null){ + electricityConsumptionMonthly.value = data[0].electricityConsumptionMonthly + } } const handleOpenChart = () => { console.log('用电量弹窗') isVisited.value = true - // showLoading.value=true nextTick(() => { initChart() }) diff --git a/src/views/tunnel-manage/index.vue b/src/views/tunnel-manage/index.vue index 5dc6556..cd1d35d 100644 --- a/src/views/tunnel-manage/index.vue +++ b/src/views/tunnel-manage/index.vue @@ -5,11 +5,11 @@
返回 - - - +