Merge pull request 'fix : 修复用电量弹窗' (#410) from dengjie into dev
Reviewed-on: http://git.feashow.cn/clay/tunnel-cloud-web/pulls/410
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="used-ele" :style="{ backgroundColor: bgImage }" @click="handleOpenChart">
|
<div id="used-ele" :style="{ backgroundColor: bgImage }" @click="handleOpenChart(fanList)">
|
||||||
<!-- <div v-if="electricityConsumptionMonthly===0&&monthlySavings===0" class="showNull ">-->
|
<!-- <div v-if="electricityConsumptionMonthly===0&&monthlySavings===0" class="showNull ">-->
|
||||||
<!-- <div class="loading" v-if="loading===0"></div>-->
|
<!-- <div class="loading" v-if="loading===0"></div>-->
|
||||||
<!-- {{ loading === 0 ? '加载中...' : '暂无数据~' }}-->
|
<!-- {{ loading === 0 ? '加载中...' : '暂无数据~' }}-->
|
||||||
@@ -142,10 +142,10 @@ watch(() => props.eleData, (now) => {
|
|||||||
if (now) {
|
if (now) {
|
||||||
let fanObj = {}
|
let fanObj = {}
|
||||||
now.frequencyChangerList.forEach(item => {
|
now.frequencyChangerList.forEach(item => {
|
||||||
if (item.equipmentId === 22 || item.equipmentId === 23) {
|
if (item.equipmentType === 'frequency1' || item.equipmentType === "frequency2") {
|
||||||
fanObj = {
|
fanObj = {
|
||||||
value: item.equipmentId,
|
value: item.equipmentId,
|
||||||
label: changeNum(item.equipmentId)
|
label: changeNum(item.equipmentId, item.equipmentType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fanList.value.push(fanObj)
|
fanList.value.push(fanObj)
|
||||||
@@ -224,30 +224,30 @@ const shrinkScreen = () => {
|
|||||||
initChart(chartData.dates, chartData.consumptionValues, chartData.saveElectricityValues, dataZoomTop)
|
initChart(chartData.dates, chartData.consumptionValues, chartData.saveElectricityValues, dataZoomTop)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const changeNum = (item) => {
|
const changeNum = (item,equipmentType) => {
|
||||||
switch (item) {
|
switch (equipmentType) {
|
||||||
case 22:
|
case 'frequency1':
|
||||||
return '一号风机';
|
return '一号风机';
|
||||||
case 23:
|
case 'frequency2':
|
||||||
return '二号风机';
|
return '二号风机';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const setValueA = () => {
|
const setValueA = () => {
|
||||||
if (electricityConsumptionMonthly.value === 0 || length.value === null||electricityConsumptionMonthly.value<0) {
|
if (electricityConsumptionMonthly.value === 0 || length.value === null || electricityConsumptionMonthly.value < 0) {
|
||||||
valueA.value.style.height = `0px`;
|
valueA.value.style.height = `0px`;
|
||||||
}
|
}
|
||||||
let width = (electricityConsumptionMonthly.value * length.value?.offsetHeight) / 1000000;
|
let width = (electricityConsumptionMonthly.value * length.value?.offsetHeight) / 1000000;
|
||||||
valueA.value.style.height = `${width}px`;
|
valueA.value.style.height = `${width}px`;
|
||||||
}
|
}
|
||||||
const setValueB = () => {
|
const setValueB = () => {
|
||||||
if (monthlySavings.value === 0 || length.value === null||monthlySavings.value<0) {
|
if (monthlySavings.value === 0 || length.value === null || monthlySavings.value < 0) {
|
||||||
valueB.value.style.height = `0px`;
|
valueB.value.style.height = `0px`;
|
||||||
}
|
}
|
||||||
let width = (monthlySavings.value * length.value?.offsetHeight) / 1000000;
|
let width = (monthlySavings.value * length.value?.offsetHeight) / 1000000;
|
||||||
valueB.value.style.height = `${width}px`;
|
valueB.value.style.height = `${width}px`;
|
||||||
}
|
}
|
||||||
const getBasicData = (data) => {
|
const getBasicData = (data) => {
|
||||||
if(!data)return;
|
if (!data) return;
|
||||||
electricityConsumptionMonthly.value = data.electricityConsumptionCount
|
electricityConsumptionMonthly.value = data.electricityConsumptionCount
|
||||||
monthlySavings.value = data.conserveElectricityCount
|
monthlySavings.value = data.conserveElectricityCount
|
||||||
}
|
}
|
||||||
@@ -327,12 +327,12 @@ const getFanInfo = (equipmentId, type = 'month', time = '', flag) => {
|
|||||||
loadingText.value = '加载中...'
|
loadingText.value = '加载中...'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const handleOpenChart = () => {
|
const handleOpenChart = (list) => {
|
||||||
monthValue.value=''
|
monthValue.value = ''
|
||||||
selectTimeButton.value = 1
|
selectTimeButton.value = 1
|
||||||
isVisited.value = true
|
isVisited.value = true
|
||||||
openEquipmentId.value = fanList.value[0].value
|
openEquipmentId.value = list[0].value
|
||||||
chooseChartFan.value = fanList.value[0].value
|
chooseChartFan.value = list[0].value
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (chooseMonthRef.value) {
|
if (chooseMonthRef.value) {
|
||||||
chooseMonthRef.value.clearData()
|
chooseMonthRef.value.clearData()
|
||||||
|
|||||||
Reference in New Issue
Block a user