From 29b05843c7c90ddaf29629084fd60e29c5afbd26 Mon Sep 17 00:00:00 2001 From: zhouwenxuan <1175765986@qq.com> Date: 星期五, 29 十二月 2023 08:35:14 +0800 Subject: [PATCH] 方位查询 --- src/views/bigScreen/components/screen.vue | 37 ++++++++++++++++++++++++++++++++++--- 1 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/views/bigScreen/components/screen.vue b/src/views/bigScreen/components/screen.vue index 3a011f3..1bdcde1 100644 --- a/src/views/bigScreen/components/screen.vue +++ b/src/views/bigScreen/components/screen.vue @@ -165,6 +165,14 @@ :value="item.id" /> </el-select> + <el-select v-model="positionSearch" :teleported="false" class="m-2" placeholder="Select" size="small" @change="changeGas1"> + <el-option + v-for="item in positionOptions" + :key="item.id" + :label="item.name" + :value="item.id" + /> + </el-select> <div class="checkMore" @click="toNdPage()"><el-icon><DArrowRight /></el-icon></div> </div> </div> @@ -252,7 +260,7 @@ </template> <script lang="ts"> -import {toRefs, reactive, onMounted, ref, defineComponent, onUnmounted} from 'vue'; +import {toRefs, reactive, onMounted, ref, defineComponent, onUnmounted, nextTick} from 'vue'; import { ElMessage, ElMessageBox } from 'element-plus'; import { useRouter} from "vue-router"; import * as echarts from "echarts"; @@ -283,6 +291,8 @@ infoParams: {} gasSearch: number | null tlGasSearch: number | null + positionSearch: number | null + positionOptions: Array<gasType> gasOptions: Array<gasType> monthAgo: string, today: string, @@ -349,9 +359,28 @@ startTime: '', endTime: '' }, + positionSearch: null, gasSearch: null, tlGasSearch: null, gasOptions: [], + positionOptions: [ + { + id: null, + name: '全部' + }, + { + id: 1, + name: '方位1' + }, + { + id: 2, + name: '方位2' + }, + { + id: 3, + name: '方位3' + } + ], monthAgo: '', today: '', gasData: [], @@ -562,7 +591,7 @@ } const getGasNdData = async ()=>{ - const res = await bigScreenApi().getGasNdData({startTime: state.today+' 00:00:00',endTime: state.today+' 23:59:59',gasName: state.gasSearch}) + const res = await bigScreenApi().getGasNdData({startTime: state.today+' 00:00:00',endTime: state.today+' 23:59:59',gasName: state.gasSearch,position: state.positionSearch}) if(res.data.code == 100){ if(res.data.data && res.data.data.length>0){ state.hasNd = true @@ -1093,6 +1122,7 @@ } const initgasN =(data:Array<string>,time: Array<string>)=>{ + nextTick(() => { let dom = document.getElementById(gasN.value); let myChart = echarts.init(dom); let option: EChartsOption; @@ -1150,6 +1180,7 @@ option && myChart.setOption(option); window.addEventListener("resize",function (){ myChart.resize(); + }); }); } const initgasT =(time: Array<string>,data: Array<any>)=>{ @@ -1883,4 +1914,4 @@ } } } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.2