|
@@ -1,9 +1,9 @@
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
-import { computed, onMounted, reactive, ref, watch } from 'vue'
|
|
|
|
-import { useRoute } from 'vue-router'
|
|
|
|
|
|
+import {computed, onMounted, reactive, ref, watch} from 'vue'
|
|
|
|
+import {useRoute} from 'vue-router'
|
|
import RightFrame from '@/components/RightFrame.vue'
|
|
import RightFrame from '@/components/RightFrame.vue'
|
|
import Card01 from '@/components/card/Card01.vue'
|
|
import Card01 from '@/components/card/Card01.vue'
|
|
-import { getStation, stationList } from '@/utils/station'
|
|
|
|
|
|
+import {getStation, stationList} from '@/utils/station'
|
|
import ColorTag from '@/components/tag/ColorTag.vue'
|
|
import ColorTag from '@/components/tag/ColorTag.vue'
|
|
import Chart from '@/components/Chart.vue'
|
|
import Chart from '@/components/Chart.vue'
|
|
import DataTag from '@/components/tag/DataTag.vue'
|
|
import DataTag from '@/components/tag/DataTag.vue'
|
|
@@ -13,13 +13,13 @@ import {
|
|
getWaterLevelAndFlowListOfPageByStcd,
|
|
getWaterLevelAndFlowListOfPageByStcd,
|
|
getWaterQualityLatest
|
|
getWaterQualityLatest
|
|
} from '@/api/gx'
|
|
} from '@/api/gx'
|
|
-import { formatd } from '@/utils/ruoyi'
|
|
|
|
-import { filterWaterQualitys } from '@/utils/unit'
|
|
|
|
-import { getLatestTimeWithMinuteMultipleOfFive } from '@/utils/date'
|
|
|
|
|
|
+import {formatd} from '@/utils/ruoyi'
|
|
|
|
+import {filterWaterQualitys} from '@/utils/unit'
|
|
|
|
+import {getLatestTimeWithMinuteMultipleOfFive} from '@/utils/date'
|
|
import StationRightButtonGroup from '@/components/StationRightButtonGroup.vue'
|
|
import StationRightButtonGroup from '@/components/StationRightButtonGroup.vue'
|
|
-import { useStationStore } from '@/stores/station'
|
|
|
|
-import { Operate } from '@/utils/tdInstruction'
|
|
|
|
-import { jumpPage } from '@/utils'
|
|
|
|
|
|
+import {useStationStore} from '@/stores/station'
|
|
|
|
+import {Operate} from '@/utils/tdInstruction'
|
|
|
|
+import {jumpPage} from '@/utils'
|
|
|
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
const store = useStationStore()
|
|
const store = useStationStore()
|
|
@@ -31,7 +31,7 @@ const left2Ref = ref(null)
|
|
const left3Ref = ref(null)
|
|
const left3Ref = ref(null)
|
|
const right1Ref = ref(null)
|
|
const right1Ref = ref(null)
|
|
const right3Ref = ref(null)
|
|
const right3Ref = ref(null)
|
|
-const wqData = ref({ d1: '6', d2: '22.3', d3: '5', d4: '20', d5: '6', d6: '22.3', d7: '5', d8: '20' })
|
|
|
|
|
|
+const wqData = ref({d1: '6', d2: '22.3', d3: '5', d4: '20', d5: '6', d6: '22.3', d7: '5', d8: '20'})
|
|
const station = computed(() => getStation(route.params.stcd))
|
|
const station = computed(() => getStation(route.params.stcd))
|
|
const wlData = reactive({
|
|
const wlData = reactive({
|
|
ss: '0',
|
|
ss: '0',
|
|
@@ -108,7 +108,7 @@ async function reloadLeft2() {
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
color: '#02cacf'
|
|
color: '#02cacf'
|
|
},
|
|
},
|
|
- axisTick: { show: false },
|
|
|
|
|
|
+ axisTick: {show: false},
|
|
data: flowData.map(item => item.tm ? item.tm.substring(11, 16) + '\n' + item.tm.substring(5, 10) : '')
|
|
data: flowData.map(item => item.tm ? item.tm.substring(11, 16) + '\n' + item.tm.substring(5, 10) : '')
|
|
}],
|
|
}],
|
|
yAxis: [{
|
|
yAxis: [{
|
|
@@ -154,7 +154,7 @@ async function reloadLeft2() {
|
|
async function reloadLeft3() {
|
|
async function reloadLeft3() {
|
|
const stcds = stationList.map(s => s.stcd).join(',')
|
|
const stcds = stationList.map(s => s.stcd).join(',')
|
|
const tm = formatd(getLatestTimeWithMinuteMultipleOfFive(new Date(), 20), 'yyyy-MM-dd hh:mm:ss')
|
|
const tm = formatd(getLatestTimeWithMinuteMultipleOfFive(new Date(), 20), 'yyyy-MM-dd hh:mm:ss')
|
|
- const waterData = await getWaterLevelAndFlowLatest({ stcds, tm }).then(res => res.data)
|
|
|
|
|
|
+ const waterData = await getWaterLevelAndFlowLatest({stcds, tm}).then(res => res.data)
|
|
const currentStationData = waterData.find(d => d.stcd === route.params.stcd)
|
|
const currentStationData = waterData.find(d => d.stcd === route.params.stcd)
|
|
if (currentStationData) {
|
|
if (currentStationData) {
|
|
store.setZ(currentStationData.z)
|
|
store.setZ(currentStationData.z)
|
|
@@ -190,7 +190,7 @@ async function reloadLeft3() {
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
color: '#02cacf'
|
|
color: '#02cacf'
|
|
},
|
|
},
|
|
- axisTick: { show: false },
|
|
|
|
|
|
+ axisTick: {show: false},
|
|
data: stationList.map(s => s.stnm)
|
|
data: stationList.map(s => s.stnm)
|
|
}],
|
|
}],
|
|
yAxis: [{
|
|
yAxis: [{
|
|
@@ -265,7 +265,7 @@ async function reloadRight1() {
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
color: '#02cacf'
|
|
color: '#02cacf'
|
|
},
|
|
},
|
|
- axisTick: { show: false },
|
|
|
|
|
|
+ axisTick: {show: false},
|
|
data: rainfallData.map(item => item.tm ? item.tm.substring(11, 16) + '\n' + item.tm.substring(5, 10) : '')
|
|
data: rainfallData.map(item => item.tm ? item.tm.substring(11, 16) + '\n' + item.tm.substring(5, 10) : '')
|
|
}],
|
|
}],
|
|
yAxis: [{
|
|
yAxis: [{
|
|
@@ -306,7 +306,7 @@ async function reloadRight1() {
|
|
async function reloadRight3() {
|
|
async function reloadRight3() {
|
|
const stcds = stationList.map(s => s.stcd).join(',')
|
|
const stcds = stationList.map(s => s.stcd).join(',')
|
|
const tm = formatd(getLatestTimeWithMinuteMultipleOfFive(new Date(), 20), 'yyyy-MM-dd hh:mm:ss')
|
|
const tm = formatd(getLatestTimeWithMinuteMultipleOfFive(new Date(), 20), 'yyyy-MM-dd hh:mm:ss')
|
|
- const waterData = await getWaterQualityLatest({ stcds }).then(res => res.data)
|
|
|
|
|
|
+ const waterData = await getWaterQualityLatest({stcds}).then(res => res.data)
|
|
const list = []
|
|
const list = []
|
|
|
|
|
|
stationList.forEach(s => {
|
|
stationList.forEach(s => {
|
|
@@ -355,7 +355,7 @@ async function reloadRight3() {
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
color: '#02cacf'
|
|
color: '#02cacf'
|
|
},
|
|
},
|
|
- axisTick: { show: false },
|
|
|
|
|
|
+ axisTick: {show: false},
|
|
data: list.map(s => s.stnm)
|
|
data: list.map(s => s.stnm)
|
|
}],
|
|
}],
|
|
yAxis: [{
|
|
yAxis: [{
|
|
@@ -398,7 +398,7 @@ async function reloadRight3() {
|
|
* 获取最新水质数据
|
|
* 获取最新水质数据
|
|
*/
|
|
*/
|
|
function getLatestWaterQuality() {
|
|
function getLatestWaterQuality() {
|
|
- getWaterQualityLatest({ stcds: route.params.stcd }).then(res => {
|
|
|
|
|
|
+ getWaterQualityLatest({stcds: route.params.stcd}).then(res => {
|
|
const data = res.data[0]
|
|
const data = res.data[0]
|
|
wqData.value = {
|
|
wqData.value = {
|
|
d1: data.ph,
|
|
d1: data.ph,
|
|
@@ -413,12 +413,8 @@ function getLatestWaterQuality() {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-function handleSetWaterLevel(value) {
|
|
|
|
- Operate.setWaterLevel(route.params.stcd, value)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
function handleControlWaterLevel(value) {
|
|
function handleControlWaterLevel(value) {
|
|
- waterLevel.value = value * 0.05
|
|
|
|
|
|
+ waterLevel.value = value / 0.05
|
|
}
|
|
}
|
|
|
|
|
|
function jumpTo(value) {
|
|
function jumpTo(value) {
|
|
@@ -450,8 +446,8 @@ onMounted(() => {
|
|
})
|
|
})
|
|
|
|
|
|
watch(() => waterLevel, (value) => {
|
|
watch(() => waterLevel, (value) => {
|
|
- handleSetWaterLevel(value.value * 0.05)
|
|
|
|
-}, { deep: true })
|
|
|
|
|
|
+ Operate.setWaterLevel(route.params.stcd, value.value * 0.05)
|
|
|
|
+}, {deep: true})
|
|
</script>
|
|
</script>
|
|
<template>
|
|
<template>
|
|
<right-frame>
|
|
<right-frame>
|
|
@@ -459,36 +455,36 @@ watch(() => waterLevel, (value) => {
|
|
<card01 style="height: 33%;" title="特征水位">
|
|
<card01 style="height: 33%;" title="特征水位">
|
|
<el-row :gutter="10" justify="space-around" style="height: 100%;">
|
|
<el-row :gutter="10" justify="space-around" style="height: 100%;">
|
|
<el-col :span="16" style="height: 66%;margin-bottom: 1%;position: relative;"
|
|
<el-col :span="16" style="height: 66%;margin-bottom: 1%;position: relative;"
|
|
- @click="handleSetWaterLevel(wlData.ss)">
|
|
|
|
|
|
+ @click="handleControlWaterLevel(wlData.ss)">
|
|
<div class="difang-water-level">
|
|
<div class="difang-water-level">
|
|
<span class="difang-water-level-value">{{ wlData.ss }}m</span>
|
|
<span class="difang-water-level-value">{{ wlData.ss }}m</span>
|
|
</div>
|
|
</div>
|
|
- <img :src="dibaImage" alt="" class="difang-image" />
|
|
|
|
|
|
+ <img :src="dibaImage" alt="" class="difang-image"/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="8"
|
|
<el-col :span="8"
|
|
style="height: 66%;margin-bottom: 1%;display: flex;flex-direction: column;justify-content: space-between;">
|
|
style="height: 66%;margin-bottom: 1%;display: flex;flex-direction: column;justify-content: space-between;">
|
|
<color-tag :value="wlData.ss" label="实时水位" style="height: 48%;" unit="m"
|
|
<color-tag :value="wlData.ss" label="实时水位" style="height: 48%;" unit="m"
|
|
- @click="handleControlWaterLevel(wlData.ss)" />
|
|
|
|
|
|
+ @click="handleControlWaterLevel(wlData.ss)"/>
|
|
<color-tag :value="wlData.zg" label="历史最高水位" style="height: 48%;" unit="m"
|
|
<color-tag :value="wlData.zg" label="历史最高水位" style="height: 48%;" unit="m"
|
|
- @click="handleSetWaterLevel(wlData.zg)" />
|
|
|
|
|
|
+ @click="handleControlWaterLevel(wlData.zg)"/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="8" style="height: 33%;">
|
|
<el-col :span="8" style="height: 33%;">
|
|
<color-tag :value="wlData.bz" backgroundColor="#bb232f" label="保证水位" unit="m"
|
|
<color-tag :value="wlData.bz" backgroundColor="#bb232f" label="保证水位" unit="m"
|
|
- @click="handleSetWaterLevel(wlData.bz)" />
|
|
|
|
|
|
+ @click="handleControlWaterLevel(wlData.bz)"/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="8" style="height: 33%;">
|
|
<el-col :span="8" style="height: 33%;">
|
|
<color-tag :value="wlData.jj" backgroundColor="#b38b30" label="警戒水位" unit="m"
|
|
<color-tag :value="wlData.jj" backgroundColor="#b38b30" label="警戒水位" unit="m"
|
|
- @click="handleSetWaterLevel(wlData.jj)" />
|
|
|
|
|
|
+ @click="handleControlWaterLevel(wlData.jj)"/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="8" style="height: 33%;">
|
|
<el-col :span="8" style="height: 33%;">
|
|
<color-tag :value="wlData.zd" backgroundColor="#adcbe0" label="历史最低水位" unit="m"
|
|
<color-tag :value="wlData.zd" backgroundColor="#adcbe0" label="历史最低水位" unit="m"
|
|
- @click="handleSetWaterLevel(wlData.zd)" />
|
|
|
|
|
|
+ @click="handleControlWaterLevel(wlData.zd)"/>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<div :style="{'background-image': `url(${waterSliderBackground})`}" class="water-level-slider-container">
|
|
<div :style="{'background-image': `url(${waterSliderBackground})`}" class="water-level-slider-container">
|
|
<div class="water-level-slider-main">
|
|
<div class="water-level-slider-main">
|
|
<el-slider v-model="waterLevel" :format-tooltip="formatWaterLevelTooltip" :marks="waterLevelMarks"
|
|
<el-slider v-model="waterLevel" :format-tooltip="formatWaterLevelTooltip" :marks="waterLevelMarks"
|
|
- height="90%" placement="right" tooltip-class="slider-tooltip" vertical />
|
|
|
|
|
|
+ height="90%" placement="right" tooltip-class="slider-tooltip" vertical/>
|
|
<span class="water-level-slider-title">水位动态模拟</span>
|
|
<span class="water-level-slider-title">水位动态模拟</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|