feat : 隧道模拟
This commit is contained in:
@@ -26,10 +26,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"
|
||||
/>
|
||||
@@ -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 = '加载中...'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user