From e111b10806052f8339323e69fbd6c47c314e42d9 Mon Sep 17 00:00:00 2001 From: dj <1042039504@qq.com> Date: Sun, 29 Dec 2024 00:48:25 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E9=9A=A7=E9=81=93=E6=A8=A1=E6=8B=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/largeScreen.js | 51 +- src/api/tunnelManage.js | 43 + src/components/content/airInfo/AirInfo.vue | 83 +- .../content/badGasInfo/BadGasInfo.vue | 76 +- src/components/content/fanInfo/FanInfo.vue | 9 +- .../tunnelScene/TunnelSceneSimulate.vue | 408 ++++++ src/components/content/usedEle/UsedEle.vue | 1 + .../content/windPressure/WindPressureList.vue | 82 +- src/components/deviceManage/index.vue | 189 +-- src/views/device-manage/index-new.vue | 861 ------------- src/views/device-manage/index-or.vue | 860 ------------- src/views/device-manage/index-origanl.vue | 860 ------------- src/views/edit/edit-new.vue | 415 ------- src/views/edit/edit-or.vue | 342 ------ src/views/edit/edit-orignal.vue | 342 ------ src/views/tunnel-manage/index-new.vue | 1093 ----------------- src/views/tunnel-manage/index-or.vue | 1060 ---------------- src/views/tunnel-manage/index-origanl.vue | 1060 ---------------- src/views/tunnel-simulate/index.vue | 264 ++-- src/views/tunnel-simulate/tunnel-list.vue | 217 ++-- 20 files changed, 896 insertions(+), 7420 deletions(-) create mode 100644 src/components/content/tunnelScene/TunnelSceneSimulate.vue delete mode 100644 src/views/device-manage/index-new.vue delete mode 100644 src/views/device-manage/index-or.vue delete mode 100644 src/views/device-manage/index-origanl.vue delete mode 100644 src/views/edit/edit-new.vue delete mode 100644 src/views/edit/edit-or.vue delete mode 100644 src/views/edit/edit-orignal.vue delete mode 100644 src/views/tunnel-manage/index-new.vue delete mode 100644 src/views/tunnel-manage/index-or.vue delete mode 100644 src/views/tunnel-manage/index-origanl.vue diff --git a/src/api/largeScreen.js b/src/api/largeScreen.js index f914bb3..2e87e5b 100644 --- a/src/api/largeScreen.js +++ b/src/api/largeScreen.js @@ -38,7 +38,7 @@ export const getEchartsInfo = (id,time,type,startTime,endTime) => { // 有害气体echarts数据 export const getBadGasEchartsInfo = (id,time,type,startTime,endTime) => { return request({ - url: '/tunnel/large/screen/echarts/gas/sensor/', + url: '/tunnel/large/screen/echarts/gas/sensor', method: 'get', params: { id: id, @@ -128,3 +128,52 @@ export const deleteAlarmSate = (tunnelAlarmIdList) => { method: 'delete' }) } +// 传感器模拟echarts数据 +export const getSimulationEchartsInfo = (id,time,type,startTime,endTime) => { + return request({ + url: '/tunnel/simulation/large/screen/echarts/sensor', + method: 'get', + params: { + id: id, + time: time, + type: type, + startTime:startTime, + endTime:endTime, + } + }) +} +// 有害气体模拟echarts数据 +export const getSimulationBadGasEchartsInfo = (id,time,type,startTime,endTime) => { + return request({ + url: '/tunnel/simulation/large/screen/echarts/gas/sensor', + method: 'get', + params: { + id: id, + time: time, + type: type, + startTime:startTime, + endTime:endTime, + } + }) +} +//开始 模拟 +export const startSimulation = (projectId) => { + return request({ + url: `/tunnel/simulation/start/${projectId}`, + method: 'post' + }) +} +// 结束模拟 +export const endSimulation = (projectId) => { + return request({ + url: `/tunnel/simulation/stop/${projectId}`, + method: 'post' + }) +} +//模拟爆破 +export const blastingSimulation = (projectId,level) => { + return request({ + url: `/tunnel/simulation/blasting/${projectId}/${level}`, + method: 'post' + }) +} \ No newline at end of file diff --git a/src/api/tunnelManage.js b/src/api/tunnelManage.js index c9e0472..680d7bb 100644 --- a/src/api/tunnelManage.js +++ b/src/api/tunnelManage.js @@ -84,3 +84,46 @@ export const getSerialNumberOnUse = (tunnelId) => { } }) } + + +//模拟隧道 +export const getSimulateTunnelList = (params) => { + return request({ + url: '/tunnel/simulate', + method: 'get', + params + }) +} +export const getSimulateTunnelDetail = (projectId) => { + return request({ + url: `/tunnel/simulate/${projectId}`, + method: 'get' + }) +} +export const addSimulateTunnel = (data) => { + return request({ + url: '/tunnel/simulate', + method: 'post', + data + }) +} + +export const editSimulateEquipment = (data) => { + return request({ + url: '/tunnel/simulate', + method: 'put', + data + }) +} +export const deleteSimulateTunnel = (projectIdList) => { + return request({ + url: `/tunnel/simulate/${projectIdList}`, + method: 'delete' + }) +} +export const getScreenSimulateTunnel = (projectId) => { + return request({ + url: `/tunnel/simulate/equipment/${projectId}`, + method: 'get' + }) +} \ No newline at end of file diff --git a/src/components/content/airInfo/AirInfo.vue b/src/components/content/airInfo/AirInfo.vue index 94b3b54..cbe10c2 100644 --- a/src/components/content/airInfo/AirInfo.vue +++ b/src/components/content/airInfo/AirInfo.vue @@ -36,10 +36,10 @@
导出
- + @@ -62,7 +62,7 @@ import ItemInfo from "./childComps/ItemInfo.vue"; import TimeRangeBtn from "@/components/timeRangeBtn/index.vue" import * as echarts from 'echarts'; -import {getEchartsInfo} from "@/api/largeScreen"; +import {getEchartsInfo, getSimulationEchartsInfo} from "@/api/largeScreen"; import ChooseDay from "@/components/chooseDates/index.vue" import ChooseMonth from "@/components/chooseMonth/index.vue" import elementResizeDetectorMaker from "element-resize-detector"; @@ -74,7 +74,8 @@ let myEcharts = reactive({}); const props = defineProps({ list: Array, windSpeed: Array, - airData: Array + airData: Array, + isSimulate: Boolean, }); const isFullScreen = ref(false); let dataZoomTop = reactive('87%') @@ -94,11 +95,12 @@ const dialogTitle = ref('风速') const openDialogId = ref(0) const airList = ref([]) const timeList = ref(["年", "月", "日"]); -const selectTimeButton = ref(2); +const timeSimulateList = ref(["日"]); const isWindSpeedVisited = ref(false); const showSpeedLoading = ref(false) const clickMonth = ref('') const clickDay = ref('') +const selectTimeButton = ref(props.isSimulate?0:2); watch(() => props.windSpeed, (now) => { now.forEach(newItem => { windSpeed.value =newItem.value @@ -248,29 +250,56 @@ const getChartInfo = (equipmentId, type = 'day', time = '', flag, startTime, end } } }) - getEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { - if (res?.code === 1000) { - showSpeedLoading.value = false - chartData = res.data - nextTick(() => { - if (flag) { - const fanChart = document.getElementById('containerWind') - const erd = elementResizeDetectorMaker(); - erd.listenTo(document.getElementById('airDialog'), (element) => { - fanChart.style.height = element.offsetHeight - 140 + 'px' - myEcharts.resize(); - }); - if (isFullScreen.value) { - initChart(res.data.dates, res.data.values, dataZoomTop) + if(props.isSimulate){ + + getSimulationEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { + if (res?.code === 1000) { + showSpeedLoading.value = false + chartData = res.data + nextTick(() => { + if (flag) { + const fanChart = document.getElementById('containerWind') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('airDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 140 + 'px' + myEcharts.resize(); + }); + if (isFullScreen.value) { + initChart(res.data.dates, res.data.values, dataZoomTop) + } + } else { + shrinkScreen() } - } else { - shrinkScreen() - } - }) - } else { - loadingText.value = res.msg - } - }) + }) + } else { + loadingText.value = res.msg + } + }) + }else{ + getEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { + if (res?.code === 1000) { + showSpeedLoading.value = false + chartData = res.data + nextTick(() => { + if (flag) { + const fanChart = document.getElementById('containerWind') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('airDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 140 + 'px' + myEcharts.resize(); + }); + if (isFullScreen.value) { + initChart(res.data.dates, res.data.values, dataZoomTop) + } + } else { + shrinkScreen() + } + }) + } else { + loadingText.value = res.msg + } + }) + } nextTick(() => { loadingText.value = '加载中...' }) diff --git a/src/components/content/badGasInfo/BadGasInfo.vue b/src/components/content/badGasInfo/BadGasInfo.vue index c0e20b8..cda0968 100644 --- a/src/components/content/badGasInfo/BadGasInfo.vue +++ b/src/components/content/badGasInfo/BadGasInfo.vue @@ -25,9 +25,9 @@
导出
- + - +
(isBadGasVisited.value ? "sp_active.png" : "bg.png")); + watch( () => props.list, (now) => { @@ -288,27 +291,52 @@ const getBadGasChartInfo = (type, time = '', flag, startTime, endTime) => { } } }) - getBadGasEchartsInfo(id, time, type, startTime, endTime).then(res => { - if (res?.code === 1000) { - showLoading.value = false - chartData = res.data - nextTick(() => { - if (flag) { - const fanChart = document.getElementById('containerBad') - const erd = elementResizeDetectorMaker(); - erd.listenTo(document.getElementById('badDialog'), (element) => { - fanChart.style.height = element.offsetHeight - 140 + 'px' - myEcharts.resize(); - }); - if (isFullScreen.value) { - initChart(res.data.dates, res.data, dataZoomTop) + if(props.isSimulate){ + getSimulationBadGasEchartsInfo(id, time, type, startTime, endTime).then(res => { + if (res?.code === 1000) { + showLoading.value = false + chartData = res.data + nextTick(() => { + if (flag) { + const fanChart = document.getElementById('containerBad') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('badDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 140 + 'px' + myEcharts.resize(); + }); + if (isFullScreen.value) { + initChart(res.data.dates, res.data, dataZoomTop) + } + } else { + shrinkScreen() } - } else { - shrinkScreen() - } - }) - } - }) + }) + } + }) + }else{ + getBadGasEchartsInfo(id, time, type, startTime, endTime).then(res => { + if (res?.code === 1000) { + showLoading.value = false + chartData = res.data + nextTick(() => { + if (flag) { + const fanChart = document.getElementById('containerBad') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('badDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 140 + 'px' + myEcharts.resize(); + }); + if (isFullScreen.value) { + initChart(res.data.dates, res.data, dataZoomTop) + } + } else { + shrinkScreen() + } + }) + } + }) + + } } const handleOpenChart = () => { clickMonth.value = '' diff --git a/src/components/content/fanInfo/FanInfo.vue b/src/components/content/fanInfo/FanInfo.vue index 29257db..39e18b2 100644 --- a/src/components/content/fanInfo/FanInfo.vue +++ b/src/components/content/fanInfo/FanInfo.vue @@ -12,7 +12,7 @@
{{ changeNum(item) }}号风机
-
+
@@ -36,7 +36,7 @@
-
+
@@ -46,7 +46,7 @@ 手动
-
+
给定频率 @@ -68,7 +68,7 @@
-
+
@@ -152,6 +152,7 @@ const props = defineProps({ fanData: Array, transducerData: Array, loading: Number, + isSimulate: Boolean, }); const chooseDayRef = ref(); const chooseMonthRef = ref(); diff --git a/src/components/content/tunnelScene/TunnelSceneSimulate.vue b/src/components/content/tunnelScene/TunnelSceneSimulate.vue new file mode 100644 index 0000000..be8af38 --- /dev/null +++ b/src/components/content/tunnelScene/TunnelSceneSimulate.vue @@ -0,0 +1,408 @@ + + + + + diff --git a/src/components/content/usedEle/UsedEle.vue b/src/components/content/usedEle/UsedEle.vue index e8298c5..9720f8d 100644 --- a/src/components/content/usedEle/UsedEle.vue +++ b/src/components/content/usedEle/UsedEle.vue @@ -247,6 +247,7 @@ const setValueB = () => { valueB.value.style.height = `${width}px`; } const getBasicData = (data) => { + if(!data)return; electricityConsumptionMonthly.value = data.electricityConsumptionCount monthlySavings.value = data.conserveElectricityCount } diff --git a/src/components/content/windPressure/WindPressureList.vue b/src/components/content/windPressure/WindPressureList.vue index b8272c2..94e4b05 100644 --- a/src/components/content/windPressure/WindPressureList.vue +++ b/src/components/content/windPressure/WindPressureList.vue @@ -26,10 +26,10 @@
导出
- + @@ -52,7 +52,7 @@ import WindPressureItem from "./childComps/WindPressureItem.vue"; import TimeRangeBtn from "@/components/timeRangeBtn/index.vue" import * as echarts from 'echarts'; -import {getEchartsInfo} from "@/api/largeScreen"; +import {getEchartsInfo, getSimulationEchartsInfo} from "@/api/largeScreen"; import ChooseDay from "@/components/chooseDates/index.vue" import ChooseMonth from "@/components/chooseMonth/index.vue" import elementResizeDetectorMaker from "element-resize-detector"; @@ -63,6 +63,7 @@ const props = defineProps({ list: Array, winData: Array, loading: Number, + isSimulate: Boolean, }); const loadingText = ref('加载中...') const chooseDayRef = ref(); @@ -70,7 +71,7 @@ const chooseMonthRef = ref(); const windSort = ref(1) const windSortId = ref(1) const timeList = ref(["年", "月", "日"]); -const selectTimeButton = ref(2); +const timeSimulateList = ref(["日"]); const isVisited = ref(false); const isFullScreen = ref(false); let chartData = reactive([]) @@ -80,6 +81,7 @@ let myEcharts = reactive({}); const wpList = ref([]); const clickMonth = ref('') const clickDay = ref('') +const selectTimeButton = ref(props.isSimulate?0:2); watch(() => props.list, (now) => { wpList.value.forEach(item => { now.forEach(newItem => { @@ -201,29 +203,57 @@ const getWindInfo = (equipmentId, type = 'day', time = '', flag, startTime, endT } } }) - getEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { - if (res?.code === 1000) { - showLoading.value = false - chartData = res.data - nextTick(() => { - if (flag) { - const fanChart = document.getElementById('container') - const erd = elementResizeDetectorMaker(); - erd.listenTo(document.getElementById('windDialog'), (element) => { - fanChart.style.height = element.offsetHeight - 140 + 'px' - myEcharts.resize(); - }); - if (isFullScreen.value) { - initChart(res.data.dates, res.data.values, dataZoomTop) + if(props.isSimulate) { + getSimulationEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { + if (res?.code === 1000) { + showLoading.value = false + chartData = res.data + nextTick(() => { + if (flag) { + const fanChart = document.getElementById('container') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('windDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 140 + 'px' + myEcharts.resize(); + }); + if (isFullScreen.value) { + initChart(res.data.dates, res.data.values, dataZoomTop) + } + } else { + shrinkScreen() } - } else { - shrinkScreen() - } - }) - } else { - loadingText.value = res.msg - } - }) + }) + } else { + loadingText.value = res.msg + } + }) + + }else{ + getEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { + if (res?.code === 1000) { + showLoading.value = false + chartData = res.data + nextTick(() => { + if (flag) { + const fanChart = document.getElementById('container') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('windDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 140 + 'px' + myEcharts.resize(); + }); + if (isFullScreen.value) { + initChart(res.data.dates, res.data.values, dataZoomTop) + } + } else { + shrinkScreen() + } + }) + } else { + loadingText.value = res.msg + } + }) + + } nextTick(() => { loadingText.value = '加载中...' }) diff --git a/src/components/deviceManage/index.vue b/src/components/deviceManage/index.vue index e0f15a5..7f146b9 100644 --- a/src/components/deviceManage/index.vue +++ b/src/components/deviceManage/index.vue @@ -39,47 +39,33 @@ :header-cell-style="{backgroundColor: '#064B66',color: '#fff',fontSize: '40px',borderBottom: 'none' }" :cell-style="{textAlign: 'center',borderBottom: 'none'}" :data="fanData"> - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +