邓洁: 修改细节
This commit is contained in:
@@ -106,6 +106,9 @@ watch(() => props.airData, (now) => {
|
||||
} else {
|
||||
getAirInfo(now.sensorList)
|
||||
}
|
||||
}else {
|
||||
airList.value = []
|
||||
windSpeed.value = 0
|
||||
}
|
||||
}, {deep: true});
|
||||
const getChartInfo = (equipmentId) => {
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user