diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 93332c7..487419d 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -314,7 +314,7 @@ body, } } -.full-screen-dialog { +.shrink-screen-dialog { width: 2175px !important; //width: 100% !important; //height: 100% !important; @@ -452,6 +452,17 @@ body, } } +.shrink-icon { + margin: -36px -20px 0 30px; + cursor: pointer; + width: 65px; + height: 65px; + background-image: url("@/assets/images/fanInfo/shrink.png"); +} +.full-icon { + cursor: pointer; + margin: -36px -20px 0 30px; +} //弹窗样式 .digital-tunnel { .chat-dialog { @@ -563,11 +574,15 @@ body, background-image: url(@/assets/images/badGasInfo/sp_jz.png); transform: rotate(90deg); } - +.change-screen{ + position: absolute; + right: 126px; + top: 50px; +} .time-select { position: absolute; - top: 47px; - right: 119px; + top: 20px; + right: 200px; display: flex; .choose-day { diff --git a/src/components/content/airInfo/AirInfo.vue b/src/components/content/airInfo/AirInfo.vue index 1225da4..8672ade 100644 --- a/src/components/content/airInfo/AirInfo.vue +++ b/src/components/content/airInfo/AirInfo.vue @@ -21,7 +21,7 @@
+ :modal="false" id="airDialog">
@@ -41,6 +41,13 @@ @select="timeSelect" />
+
+ + + +
+
@@ -55,12 +62,16 @@ import * as echarts from 'echarts'; import {getEchartsInfo} from "@/api/largeScreen"; import ChooseDay from "@/components/chooseDay/index.vue" import ChooseMonth from "@/components/chooseMonth/index.vue" +import elementResizeDetectorMaker from "element-resize-detector"; let myEcharts = reactive({}); const props = defineProps({ list: Array, airData: Array }); +const isFullScreen = ref(false); +let dataZoomTop = reactive('87%') +let chartData = reactive([]) const chooseDayRef = ref(); const chooseMonthRef = ref(); const windSpeed = ref(0) @@ -108,19 +119,79 @@ watch(() => props.airData, (now) => { // } }, {deep: true}); const daySelect = (val) => { - getChartInfo(openDialogId.value, 'day', val) + if (isFullScreen.value) { + getChartInfo(openDialogId.value, 'day', val) + } else { + getChartInfo(openDialogId.value, 'day', val,true) + } } const monthSelect = (val) => { - getChartInfo(openDialogId.value, 'month', val) + if (isFullScreen.value) { + getChartInfo(openDialogId.value, 'month', val) + } else { + getChartInfo(openDialogId.value, 'month', val,true) + } } -const getChartInfo = (equipmentId, type = 'day', time = '') => { - isWindSpeedVisited.value = true +//放大弹窗 +const handleFullScreen = () => { + const titleName = document.getElementsByClassName('el-dialog__title')[0] + const fan = document.getElementById('airDialog') + const fanChart = document.getElementById('containerWind') + const erd = elementResizeDetectorMaker(); + fan.classList.remove('shrink-screen-dialog') + titleName.style.fontSize = '70px' + erd.listenTo(document.getElementById('airDialog'), (element) => { + fanChart.style.height = (element.offsetHeight - 120) + 'px' + myEcharts.resize(); + }); + nextTick(() => { + isFullScreen.value = false + initChart(chartData.dates, chartData.values, '93%') + }) +} +const shrinkScreen = () => { + const fan = document.getElementById('airDialog') + const fanChart = document.getElementById('containerWind') + const titleName = document.getElementsByClassName('el-dialog__title')[0] + titleName.style.fontSize = '50px' + fan.classList.add('shrink-screen-dialog') + fanChart.style.height = '1200px' + myEcharts.resize(); + nextTick(() => { + isFullScreen.value = true + initChart(chartData.dates, chartData.values,dataZoomTop) + }) +} +const getChartInfo = (equipmentId, type = 'day', time = '', flag) => { showSpeedLoading.value = true + nextTick(() => { + if (flag) { + const fan = document.getElementById('airDialog') + fan.classList.remove('shrink-screen-dialog') + if (!isFullScreen.value) { + const titleName = document.getElementsByClassName('el-dialog__title')[0] + titleName.style.fontSize = '70px' + } + } + }) getEchartsInfo(equipmentId, time, type).then(res => { if (res?.code === 1000) { showSpeedLoading.value = false + chartData=res.data nextTick(() => { - initChart(res.data.dates, res.data.values) + if (flag) { + const fanChart = document.getElementById('containerWind') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('airDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 120 + 'px' + myEcharts.resize(); + }); + if (!isFullScreen.value) { + initChart(res.data.dates, res.data.values,'93%') + } + } else { + shrinkScreen() + } }) } else { loadingText.value = res.msg @@ -132,6 +203,7 @@ const getChartInfo = (equipmentId, type = 'day', time = '') => { } const handleOpenChart = (id, type) => { selectTimeButton.value = 2 + isWindSpeedVisited.value = true nextTick(() => { if (chooseMonthRef.value) { chooseMonthRef.value.clearData() @@ -140,10 +212,11 @@ const handleOpenChart = (id, type) => { chooseDayRef.value.clearData() } }) + isFullScreen.value = false if (type === 'air') { dialogTitle.value = id.name openDialogId.value = id.equipmentId - getChartInfo(id.equipmentId, 'day') + getChartInfo(id.equipmentId, 'day','',true) } else { if (id === "windDirection") { dialogTitle.value = '风向' @@ -151,9 +224,8 @@ const handleOpenChart = (id, type) => { dialogTitle.value = '风速' } openDialogId.value = type - getChartInfo(type, 'day') + getChartInfo(type, 'day','',true) } - } const changeDate = (index) => { switch (index) { @@ -166,7 +238,11 @@ const changeDate = (index) => { } } const timeSelect = (index) => { - getChartInfo(openDialogId.value, changeDate(index)) + if (isFullScreen.value) { + getChartInfo(openDialogId.value, changeDate(index)) + } else { + getChartInfo(openDialogId.value, changeDate(index),'',true) + } }; const changeData = (item) => { @@ -215,7 +291,7 @@ const getAirInfo = (now) => { airList.value = airArr } } -const initChart = (type, values) => { +const initChart = (type, values,top) => { //3.初始化container容器 myEcharts = echarts.init(document.getElementById('containerWind')); //5.传入数据 @@ -272,7 +348,7 @@ const initChart = (type, values) => { }, { type: 'slider', - top: 1050, + top: top, height: 100, textStyle: { fontSize: 45, diff --git a/src/components/content/badGasInfo/BadGasInfo.vue b/src/components/content/badGasInfo/BadGasInfo.vue index cfe20da..aafd466 100644 --- a/src/components/content/badGasInfo/BadGasInfo.vue +++ b/src/components/content/badGasInfo/BadGasInfo.vue @@ -21,6 +21,7 @@ title="有害气体监控数据" width="2175px" :modal="false" + id="badDialog" >
@@ -41,6 +42,13 @@ @select="timeSelect" />
+
+ + + +
+
@@ -55,6 +63,7 @@ import TimeRangeBtn from "@/components/timeRangeBtn/index.vue"; import {getBadGasEchartsInfo} from "@/api/largeScreen"; import ChooseDay from "@/components/chooseDay/index.vue" import ChooseMonth from "@/components/chooseMonth/index.vue" +import elementResizeDetectorMaker from "element-resize-detector"; const props = defineProps({ list: Array, @@ -68,6 +77,9 @@ const timeList = ref(["年", "月", "日"]); const selectTimeButton = ref(2); const isBadGasVisited = ref(false); const showLoading = ref(false) +const isFullScreen = ref(false); +let chartData = reactive([]) +let dataZoomTop = reactive('87%') const badGasList = ref([]); let myEcharts = reactive({}); const bgImage = computed(() => (isBadGasVisited.value ? "sp_active.png" : "bg.png")); @@ -104,11 +116,49 @@ watch( }, {deep: true} ); +//放大弹窗 +const handleFullScreen = () => { + const titleName = document.getElementsByClassName('el-dialog__title')[0] + const fan = document.getElementById('badDialog') + const fanChart = document.getElementById('containerBad') + const erd = elementResizeDetectorMaker(); + fan.classList.remove('shrink-screen-dialog') + titleName.style.fontSize = '70px' + erd.listenTo(document.getElementById('badDialog'), (element) => { + fanChart.style.height = (element.offsetHeight - 120) + 'px' + myEcharts.resize(); + }); + nextTick(() => { + isFullScreen.value = false + initChart(chartData.dates, chartData, '93%') + }) +} +const shrinkScreen = () => { + const fan = document.getElementById('badDialog') + const fanChart = document.getElementById('containerBad') + const titleName = document.getElementsByClassName('el-dialog__title')[0] + titleName.style.fontSize = '50px' + fan.classList.add('shrink-screen-dialog') + fanChart.style.height = '1200px' + myEcharts.resize(); + nextTick(() => { + isFullScreen.value = true + initChart(chartData.dates, chartData, dataZoomTop) + }) +} const daySelect = (val) => { - getBadGasChartInfo('day', val) + if (isFullScreen.value) { + getBadGasChartInfo('day', val) + } else { + getBadGasChartInfo('day', val,true) + } } const monthSelect = (val) => { - getBadGasChartInfo('month', val) + if (isFullScreen.value) { + getBadGasChartInfo('month', val) + } else { + getBadGasChartInfo('month', val,true) + } } const changeDate = (index) => { switch (index) { @@ -121,7 +171,11 @@ const changeDate = (index) => { } } const timeSelect = (index) => { - getBadGasChartInfo(changeDate(index)) + if (isFullScreen.value) { + getBadGasChartInfo(changeDate(index)) + } else { + getBadGasChartInfo(changeDate(index),'',true) + } }; const getBadGasInfo = (now) => { if (now === null) return; @@ -153,15 +207,37 @@ const changeData = (item) => { unit: item.unit, }; }; -const getBadGasChartInfo = (type, time = '') => { - isBadGasVisited.value = true +const getBadGasChartInfo = (type, time = '',flag) => { showLoading.value = true let id = props.tunnelId + nextTick(() => { + if (flag) { + const fan = document.getElementById('badDialog') + fan.classList.remove('shrink-screen-dialog') + if (!isFullScreen.value) { + const titleName = document.getElementsByClassName('el-dialog__title')[0] + titleName.style.fontSize = '70px' + } + } + }) getBadGasEchartsInfo(id, time, type).then(res => { if (res?.code === 1000) { showLoading.value = false + chartData = res.data nextTick(() => { - initChart(res.data.dates, res.data) + if (flag) { + const fanChart = document.getElementById('containerBad') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('badDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 120 + 'px' + myEcharts.resize(); + }); + if (!isFullScreen.value) { + initChart(res.data.dates, res.data, '93%') + } + } else { + shrinkScreen() + } }) } }) @@ -175,7 +251,9 @@ const handleOpenChart = () => { chooseDayRef.value.clearData() } }) - getBadGasChartInfo('day') + isBadGasVisited.value = true + isFullScreen.value = false + getBadGasChartInfo('day','',true) }; const getImageUrl = (name) => { return new URL(`../../../assets/images/badGasInfo/${name}`, import.meta.url) @@ -184,7 +262,7 @@ const getImageUrl = (name) => { /** * 初始化echarts实例方法 */ -const initChart = (type, values) => { +const initChart = (type, values,top) => { //3.初始化container容器 myEcharts = echarts.init(document.getElementById("containerBad")); //5.传入数据 @@ -245,7 +323,7 @@ const initChart = (type, values) => { }, { type: 'slider', - top: 1050, + top: top, height: 100, textStyle: { fontSize: 45, diff --git a/src/components/content/fanInfo/FanInfo.vue b/src/components/content/fanInfo/FanInfo.vue index 8389179..553aad9 100644 --- a/src/components/content/fanInfo/FanInfo.vue +++ b/src/components/content/fanInfo/FanInfo.vue @@ -105,10 +105,13 @@ v-model="selectTimeButton" @select="timeSelect" /> - + +
+ -
+
@@ -141,7 +144,6 @@ const props = defineProps({ transducerData: Array, loading: Number, }); -const isFullScreen = ref(false); const chooseDayRef = ref(); const chooseMonthRef = ref(); const socketData = ref() @@ -167,11 +169,11 @@ const stateB = ref(false) const stateC = ref(false) const isVisited = ref(false) const showLoading = ref(false) +const isFullScreen = ref(false); +let dataZoomTop = reactive('87%') let chartData = reactive([]) const fanIndex = ref('') const openEquipmentId = ref(0) -let dataZoomTop = reactive('87%') -const screenHeight = ref(0) let myEcharts = reactive({}); watch(() => props.loading, (now) => { props.loading = now @@ -213,10 +215,18 @@ watch(() => props.list, (now) => { handleOnMounted() }, {deep: true}); const daySelect = (val) => { - getFanInfo(openEquipmentId.value, 'day', val,true) + if (isFullScreen.value) { + getFanInfo(openEquipmentId.value, 'day', val) + } else { + getFanInfo(openEquipmentId.value, 'day', val, true) + } } const monthSelect = (val) => { - getFanInfo(openEquipmentId.value, 'month', val, true) + if (isFullScreen.value) { + getFanInfo(openEquipmentId.value, 'month', val) + } else { + getFanInfo(openEquipmentId.value, 'month', val, true) + } } const changeDate = (index) => { switch (index) { @@ -229,15 +239,19 @@ const changeDate = (index) => { } } const timeSelect = (index) => { - getFanInfo(openEquipmentId.value, changeDate(index), '',true) -}; + if (isFullScreen.value) { + getFanInfo(openEquipmentId.value, changeDate(index)) + } else { + getFanInfo(openEquipmentId.value, changeDate(index), '', true) + } +} //放大弹窗 -const fullScreen = () => { +const handleFullScreen = () => { const titleName = document.getElementsByClassName('el-dialog__title')[0] const fan = document.getElementById('fanDialog') const fanChart = document.getElementById('containerFan') const erd = elementResizeDetectorMaker(); - fan.classList.remove('full-screen-dialog') + fan.classList.remove('shrink-screen-dialog') titleName.style.fontSize = '70px' erd.listenTo(document.getElementById('fanDialog'), (element) => { fanChart.style.height = (element.offsetHeight - 120) + 'px' @@ -253,7 +267,7 @@ const shrinkScreen = () => { const fanChart = document.getElementById('containerFan') const titleName = document.getElementsByClassName('el-dialog__title')[0] titleName.style.fontSize = '50px' - fan.classList.add('full-screen-dialog') + fan.classList.add('shrink-screen-dialog') fanChart.style.height = '1200px' myEcharts.resize(); nextTick(() => { @@ -342,31 +356,37 @@ const changeModel = (item) => { }); } const getFanInfo = (equipmentId, type = 'day', time = '', flag) => { - isVisited.value = true showLoading.value = true + nextTick(() => { + if (flag) { + const fan = document.getElementById('fanDialog') + fan.classList.remove('shrink-screen-dialog') + if (!isFullScreen.value) { + const titleName = document.getElementsByClassName('el-dialog__title')[0] + titleName.style.fontSize = '70px' + } + } + }) getFanEchartsInfo(equipmentId, time, type).then(res => { if (res?.code === 1000) { showLoading.value = false chartData = res.data nextTick(() => { if (flag) { - const titleName = document.getElementsByClassName('el-dialog__title')[0] const fanChart = document.getElementById('containerFan') const erd = elementResizeDetectorMaker(); - erd.listenTo(document.getElementById('fanDialog'), (element) => { - fanChart.style.height = element.offsetHeight - 120+ 'px' + fanChart.style.height = element.offsetHeight - 120 + 'px' myEcharts.resize(); }); - if(isFullScreen.value){ - titleName.style.fontSize = '50px' - initChart(res.data.dates, res.data.currentsA, res.data.currentsB, res.data.currentsC, dataZoomTop) - }else { - titleName.style.fontSize = '70px' - initChart(res.data.dates, res.data.currentsA, res.data.currentsB, res.data.currentsC, '93%') + if (!isFullScreen.value) { + initChart(res.data.dates, res.data.currentsA, res.data.currentsB, res.data.currentsC, '93%') } - }else { - initChart(res.data.dates, res.data.currentsA, res.data.currentsB, res.data.currentsC, dataZoomTop) + } else { + shrinkScreen() + // const fan = document.getElementById('fanDialog') + // fan.classList.add('shrink-screen-dialog') + // initChart(res.data.dates, res.data.currentsA, res.data.currentsB, res.data.currentsC, dataZoomTop) } }) } @@ -381,10 +401,12 @@ const handleOpenChart = (item) => { chooseDayRef.value.clearData() } }) + isVisited.value = true selectTimeButton.value = 2 openEquipmentId.value = item.equipmentId - getFanInfo(item.equipmentId, 'day','',true) - if (item.equipmentId === 22) { + isFullScreen.value = false + getFanInfo(item.equipmentId, 'day', '', true) + if (item.equipmentType ==="frequency1") { fanIndex.value = '一' } else { fanIndex.value = '二' @@ -415,10 +437,10 @@ const getTransData = (data) => { } const changeNum = (item) => { - switch (item.equipmentName) { - case '1号变频器': + switch (item.equipmentType) { + case "frequency1": return '一'; - case '2号变频器': + case "frequency2": return '二'; } } @@ -588,7 +610,6 @@ const changeStateText = (breakdown, running) => { * 初始化echarts实例方法 */ const initChart = (type, valueA, valueB, valueC, top) => { - console.log('initChart---',top) //3.初始化container容器 myEcharts = echarts.init(document.getElementById('containerFan')); //5.传入数据 @@ -723,20 +744,11 @@ const initChart = (type, valueA, valueB, valueC, top) => {