feat : 对接用电量/省电量数据及新增用电量echarts图表模块
This commit is contained in:
@@ -34,8 +34,8 @@
|
||||
<div style="width: 1px"></div>
|
||||
</div>
|
||||
<div class="time-select">
|
||||
<choose-time v-if="selectTimeButton===2" :time="dayValue" @select="daySelect"/>
|
||||
<choose-month v-if="selectTimeButton===1" :time="monthValue" @select="monthSelect"/>
|
||||
<choose-time v-if="selectTimeButton===2" ref="chooseDayRef" @select="daySelect"/>
|
||||
<choose-month v-if="selectTimeButton===1" ref="chooseMonthRef" @select="monthSelect"/>
|
||||
<time-range-btn
|
||||
:buttonList="timeList"
|
||||
v-model="selectTimeButton"
|
||||
@@ -56,14 +56,15 @@ import TimeRangeBtn from "@/components/timeRangeBtn/index.vue";
|
||||
import {getBadGasEchartsInfo} from "@/api/largeScreen";
|
||||
import ChooseTime from "@/components/chooseTime/index.vue"
|
||||
import ChooseMonth from "@/components/chooseMonth/index.vue"
|
||||
const dayValue = ref('');
|
||||
const monthValue = ref('');
|
||||
|
||||
const props = defineProps({
|
||||
list: Array,
|
||||
badGasData: Array,
|
||||
tunnelId: Number,
|
||||
loading: Number,
|
||||
});
|
||||
const chooseDayRef = ref();
|
||||
const chooseMonthRef = ref();
|
||||
const timeList = ref(["年", "月", "日"]);
|
||||
const selectTimeButton = ref(2);
|
||||
const isBadGasVisited = ref(false);
|
||||
@@ -105,11 +106,9 @@ watch(
|
||||
{deep: true}
|
||||
);
|
||||
const daySelect = (val) => {
|
||||
dayValue.value = val
|
||||
getBadGasChartInfo('day', val)
|
||||
}
|
||||
const monthSelect = (val) => {
|
||||
monthValue.value = val
|
||||
getBadGasChartInfo('month', val)
|
||||
}
|
||||
const changeDate = (index) => {
|
||||
@@ -123,8 +122,6 @@ const changeDate = (index) => {
|
||||
}
|
||||
}
|
||||
const timeSelect = (index) => {
|
||||
dayValue.value = ''
|
||||
monthValue.value = ''
|
||||
getBadGasChartInfo(changeDate(index))
|
||||
};
|
||||
const getBadGasInfo = (now) => {
|
||||
@@ -171,6 +168,14 @@ const getBadGasChartInfo = (type, time = '') => {
|
||||
})
|
||||
}
|
||||
const handleOpenChart = () => {
|
||||
nextTick(()=>{
|
||||
if(chooseMonthRef.value){
|
||||
chooseMonthRef.value.clearData()
|
||||
}
|
||||
if(chooseDayRef.value){
|
||||
chooseDayRef.value.clearData()
|
||||
}
|
||||
})
|
||||
getBadGasChartInfo('day')
|
||||
};
|
||||
const getImageUrl = (name) => {
|
||||
|
||||
Reference in New Issue
Block a user