From e8cd8714470addb5ae5f0c8f316a89f8ee9b716a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Mon, 18 Dec 2023 00:33:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/content/airInfo/AirInfo.vue | 24 +++++++++ .../content/badGasInfo/BadGasInfo.vue | 12 +++++ src/components/content/usedEle/UsedEle.vue | 12 +++++ .../content/windPressure/WindPressureList.vue | 54 ++++++++++++------- 4 files changed, 82 insertions(+), 20 deletions(-) diff --git a/src/components/content/airInfo/AirInfo.vue b/src/components/content/airInfo/AirInfo.vue index 830452c..be5161a 100644 --- a/src/components/content/airInfo/AirInfo.vue +++ b/src/components/content/airInfo/AirInfo.vue @@ -179,6 +179,18 @@ const initChart = () => { fontSize: 40 } }, + toolbox: { + show: false, + right: 10, + feature: { + dataZoom: { + yAxisIndex: 'none' + } + } + }, + dataZoom: [{ + type: 'inside' + }], //X轴 xAxis: { type: 'category', @@ -259,6 +271,18 @@ const initAirChart = () => { fontSize: 40 } }, + toolbox: { + show: false, + right: 10, + feature: { + dataZoom: { + yAxisIndex: 'none' + } + } + }, + dataZoom: [{ + type: 'inside' + }], //X轴 xAxis: { type: 'category', diff --git a/src/components/content/badGasInfo/BadGasInfo.vue b/src/components/content/badGasInfo/BadGasInfo.vue index 9bc46d3..37dc796 100644 --- a/src/components/content/badGasInfo/BadGasInfo.vue +++ b/src/components/content/badGasInfo/BadGasInfo.vue @@ -160,6 +160,18 @@ const initChart = () => { fontSize: 40 } }, + toolbox: { + show: false, + right: 10, + feature: { + dataZoom: { + yAxisIndex: 'none' + } + } + }, + dataZoom: [{ + type: 'inside' + }], //X轴 xAxis: { type: "category", diff --git a/src/components/content/usedEle/UsedEle.vue b/src/components/content/usedEle/UsedEle.vue index a239ce8..b6edf70 100644 --- a/src/components/content/usedEle/UsedEle.vue +++ b/src/components/content/usedEle/UsedEle.vue @@ -131,6 +131,18 @@ const initChart = () => { fontSize: 40 } }, + toolbox: { + show: false, + right: 10, + feature: { + dataZoom: { + yAxisIndex: 'none' + } + } + }, + dataZoom: [{ + type: 'inside' + }], //X轴 xAxis: { type: 'category', diff --git a/src/components/content/windPressure/WindPressureList.vue b/src/components/content/windPressure/WindPressureList.vue index fff9c05..243d419 100644 --- a/src/components/content/windPressure/WindPressureList.vue +++ b/src/components/content/windPressure/WindPressureList.vue @@ -2,7 +2,8 @@
风压
- +
@@ -31,21 +32,22 @@ import WindPressureItem from "./childComps/WindPressureItem.vue"; import TimeRangeBtn from "@/components/timeRangeBtn/index.vue" import * as echarts from 'echarts'; import {getEchartsInfo} from "../../../api/largeScreen"; + const props = defineProps({ list: Array, winData: Array }); -const windSort=ref(1) +const windSort = ref(1) const timeList = ref(["年", "月", "日"]); const selectTimeButton = ref(2); const isVisited = ref(false); let myEcharts = reactive({}); const wpList = ref([]); -const chartData=ref() +const chartData = ref() watch(() => props.list, (now) => { - wpList.value.forEach(item=>{ - now.forEach(newItem=>{ - if(item.equipmentId === newItem.equipmentId){ + wpList.value.forEach(item => { + now.forEach(newItem => { + if (item.equipmentId === newItem.equipmentId) { item.value = newItem.value } }) @@ -56,38 +58,38 @@ watch(() => props.winData, (now) => { getScreenInfo(now.windPressureSensorList) }, {deep: true}); -const getWindInfo=(equipmentId)=>{ - getEchartsInfo(equipmentId).then(res=>{ - console.log('res-wind',res) - if(res?.code===1000){ +const getWindInfo = (equipmentId) => { + getEchartsInfo(equipmentId).then(res => { + console.log('res-wind', res) + if (res?.code === 1000) { isVisited.value = true nextTick(() => { - initChart(res.data.dates,res.data.values) + initChart(res.data.dates, res.data.values) }) } }) } -const handleOpenChart = (item,index) => { +const handleOpenChart = (item, index) => { getWindInfo(item.equipmentId) - windSort.value=index + windSort.value = index } const timeSelect = (index) => { console.log('选择时间', index) - if(index===0){ + if (index === 0) { console.log('--年') - }else if(index===1){ + } else if (index === 1) { console.log('--月') - }else if(index===2){ + } else if (index === 2) { console.log('--日') } }; -const getScreenInfo = (now) => { +const getScreenInfo = (now) => { let windPressureObj = {} let windPressureArr = [] now.map(item => { windPressureObj = { - equipmentId:item.equipmentId, + equipmentId: item.equipmentId, max: 120, value: item.value, point: item.valueThreshold, @@ -100,7 +102,7 @@ const getScreenInfo = (now) => { /** * 初始化echarts实例方法 */ -const initChart = (type,values) => { +const initChart = (type, values) => { //3.初始化container容器 myEcharts = echarts.init(document.getElementById('container')); //5.传入数据 @@ -131,6 +133,18 @@ const initChart = (type,values) => { fontSize: 40 } }, + toolbox: { + show: false, + right: 10, + feature: { + dataZoom: { + yAxisIndex: 'none' + } + } + }, + dataZoom: [{ + type: 'inside' + }], //X轴 xAxis: { type: 'category', @@ -163,7 +177,7 @@ const initChart = (type,values) => { symbolSize: 24, lineStyle: { width: 5 - } + }, } ] }