feat : 隧道模拟

This commit is contained in:
dj
2024-12-29 00:48:25 +08:00
parent f57023a509
commit e111b10806
20 changed files with 896 additions and 7420 deletions

View File

@@ -36,10 +36,10 @@
<div class="export-btn" @click="handleExport">
导出
</div>
<choose-day v-if="selectTimeButton===2" ref="chooseDayRef" @select="daySelect"/>
<choose-day v-if="isSimulate?selectTimeButton === 0:selectTimeButton===2" ref="chooseDayRef" @select="daySelect"/>
<choose-month v-if="selectTimeButton===1" ref="chooseMonthRef" @select="monthSelect"/>
<time-range-btn
:buttonList="timeList"
:buttonList="isSimulate?timeSimulateList:timeList"
v-model="selectTimeButton"
@select="timeSelect"
/>
@@ -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 = '加载中...'
})