邓洁: 切换隧道面板数据加载

This commit is contained in:
邓洁
2024-01-03 17:47:35 +08:00
parent 2298b674f4
commit 5557b7109e
3 changed files with 16 additions and 9 deletions

View File

@@ -100,7 +100,7 @@ watch(() => props.list, (now) => {
})
}, {deep: true});
watch(() => props.airData, (now) => {
if (now.sensorList !== null) {
if (now.sensorList.length !== 0) {
if (now.sensorList.length === 0) {
airList.value = []
} else {

View File

@@ -74,7 +74,12 @@ const bgImage = computed(() =>
: "bg.png"
);
watch(() => props.eleData, (now) => {
getBasicData(now.frequencyChangerList)
console.log('now.frequencyChangerList',now)
if(now.frequencyChangerList.length===0){
electricityConsumptionMonthly.value=0
}else {
getBasicData(now.frequencyChangerList)
}
setValueA()
}, {deep: true});
watch(() => props.list, (now) => {
@@ -94,19 +99,21 @@ onMounted(() => {
setValueB()
})
const setValueA = () => {
if (electricityConsumptionMonthly.value === 0 || length.value === null) return
if (electricityConsumptionMonthly.value === 0 || length.value === null) {
valueA.value.style.height = `0px`;
}
let width = (electricityConsumptionMonthly.value * length.value.offsetHeight) / 10000;
valueA.value.style.height = `${width}px`;
}
const setValueB = () => {
if (monthlySavings.value === 0 || length.value === null) return
if (monthlySavings.value === 0 || length.value === null) {
valueB.value.style.height = `0px`;
}
let width = (monthlySavings.value * length.value.offsetHeight) / 10000;
valueB.value.style.height = `${width}px`;
}
const getBasicData = (data) => {
if(data!==null){
electricityConsumptionMonthly.value = data[0].electricityConsumptionMonthly
}
}
const handleOpenChart = () => {
console.log('用电量弹窗')

View File

@@ -194,17 +194,17 @@ const getScreenInfo = (id) => {
tunnelId.value = id
getLargeScreen(id).then((res) => {
if (res?.code === 1000) {
if(res.data.frequencyChangerList!==null&&res.data.frequencyChangerList.length!==0){
if(res.data.frequencyChangerList.length!==0){
showFanLoading.value=0
}else {
showFanLoading.value=1
}
if(res.data.windPressureSensorList!==null&&res.data.windPressureSensorList.length!==0){
if(res.data.windPressureSensorList.length!==0){
showWindLoading.value=0
}else {
showWindLoading.value=1
}
if(res.data.sensorList!==null&&res.data.sensorList.length!==0){
if(res.data.sensorList.length!==0){
res.data.sensorList.forEach((item,index)=>{
if (
item.equipmentType === "carbonDioxide" ||