|
@@ -1,9 +1,9 @@
|
|
|
<script lang="ts" setup>
|
|
|
-import { computed, onMounted, reactive, ref } from 'vue'
|
|
|
-import { useRoute } from 'vue-router'
|
|
|
+import {computed, onMounted, reactive, ref} from 'vue'
|
|
|
+import {useRoute} from 'vue-router'
|
|
|
import RightFrame from '@/components/RightFrame.vue'
|
|
|
import Card01 from '@/components/card/Card01.vue'
|
|
|
-import { getStation, stationSqList, stationSzList } from '@/utils/station'
|
|
|
+import {getStation, stationSqList, stationSzList} from '@/utils/station'
|
|
|
import ColorTag from '@/components/tag/ColorTag.vue'
|
|
|
import Chart from '@/components/Chart.vue'
|
|
|
import DataTag from '@/components/tag/DataTag.vue'
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
getWaterLevelAndFlowListOfPageByStcd,
|
|
|
getWaterQualityLatest
|
|
|
} 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, getNearestHour} from '@/utils/date'
|
|
|
import StationRightButtonGroup from '@/components/StationRightButtonGroup.vue'
|
|
|
-import { useStationStore } from '@/stores/station'
|
|
|
-import { jumpPage } from '@/utils'
|
|
|
+import {useStationStore} from '@/stores/station'
|
|
|
+import {jumpPage} from '@/utils'
|
|
|
import bus from '@/utils/bus'
|
|
|
import moment from 'moment'
|
|
|
|
|
@@ -30,7 +30,7 @@ const left2Ref = ref(null)
|
|
|
const left3Ref = ref(null)
|
|
|
const right1Ref = 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 wlData = reactive({
|
|
|
ss: '0',
|
|
@@ -72,12 +72,12 @@ async function reloadLeft2() {
|
|
|
},
|
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
|
color: '#02cacf',
|
|
|
- formatter: function(value) {
|
|
|
+ formatter: function (value) {
|
|
|
// 使用 moment.js 进行时间格式化
|
|
|
return moment(value).format('HH:mm')
|
|
|
}
|
|
|
},
|
|
|
- axisTick: { show: false },
|
|
|
+ axisTick: {show: false},
|
|
|
data: flowData.map(item => item.tm ? item.tm.substring(11, 16) + '\n' + item.tm.substring(5, 10) : '')
|
|
|
}],
|
|
|
yAxis: [{
|
|
@@ -122,8 +122,8 @@ async function reloadLeft2() {
|
|
|
|
|
|
async function reloadLeft3() {
|
|
|
const stcds = stationSqList.map(s => s.stcd).join(',')
|
|
|
- const tm = formatd(getLatestTimeWithMinuteMultipleOfFive(new Date(), 20), 'yyyy-MM-dd hh:mm:ss')
|
|
|
- const waterData = await getWaterLevelAndFlowLatest({ stcds}).then(res => res.data)
|
|
|
+ const tm = formatd(getNearestHour(), 'yyyy-MM-dd hh:mm:ss')
|
|
|
+ const waterData = await getWaterLevelAndFlowLatest({stcds, tm}).then(res => res.data)
|
|
|
|
|
|
const currentStationData = waterData.find(d => d.stcd === route.params.stcd)
|
|
|
if (currentStationData) {
|
|
@@ -162,7 +162,7 @@ async function reloadLeft3() {
|
|
|
rotate: 45, // 旋转标签,使之不垂直
|
|
|
interval: 0 // 显示所有标签
|
|
|
},
|
|
|
- axisTick: { show: false },
|
|
|
+ axisTick: {show: false},
|
|
|
data: stationSqList.map(s => s.stnm)
|
|
|
}],
|
|
|
yAxis: [{
|
|
@@ -237,7 +237,7 @@ async function reloadRight1() {
|
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
|
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) : '')
|
|
|
}],
|
|
|
yAxis: [{
|
|
@@ -278,7 +278,7 @@ async function reloadRight1() {
|
|
|
async function reloadRight3() {
|
|
|
const stcds = stationSzList.map(s => s.stcd).join(',')
|
|
|
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 = []
|
|
|
|
|
|
stationSzList.forEach(s => {
|
|
@@ -327,7 +327,7 @@ async function reloadRight3() {
|
|
|
axisLabel: { // 坐标轴刻度标签的相关设置
|
|
|
color: '#02cacf'
|
|
|
},
|
|
|
- axisTick: { show: false },
|
|
|
+ axisTick: {show: false},
|
|
|
data: list.map(s => s.stnm)
|
|
|
}],
|
|
|
yAxis: [{
|
|
@@ -370,7 +370,7 @@ async function reloadRight3() {
|
|
|
* 获取最新水质数据
|
|
|
*/
|
|
|
function getLatestWaterQuality() {
|
|
|
- getWaterQualityLatest({ stcds: route.params.stcd }).then(res => {
|
|
|
+ getWaterQualityLatest({stcds: route.params.stcd}).then(res => {
|
|
|
const data = res.data[0]
|
|
|
wqData.value = {
|
|
|
d1: data.ph,
|
|
@@ -426,26 +426,26 @@ onMounted(() => {
|
|
|
<div class="difang-water-level">
|
|
|
<span class="difang-water-level-value">{{ wlData.ss }}m</span>
|
|
|
</div>
|
|
|
- <img :src="dibaImage" alt="" class="difang-image" />
|
|
|
+ <img :src="dibaImage" alt="" class="difang-image"/>
|
|
|
</el-col>
|
|
|
<el-col :span="8"
|
|
|
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"
|
|
|
- @click="handleControlWaterLevel(wlData.ss)" />
|
|
|
+ @click="handleControlWaterLevel(wlData.ss)"/>
|
|
|
<color-tag :value="wlData.zg" label="历史最高水位" style="height: 48%;" unit="m"
|
|
|
- @click="handleControlWaterLevel(wlData.zg)" />
|
|
|
+ @click="handleControlWaterLevel(wlData.zg)"/>
|
|
|
</el-col>
|
|
|
<el-col :span="8" style="height: 33%;">
|
|
|
<color-tag :value="wlData.bz" backgroundColor="#bb232f" label="保证水位" unit="m"
|
|
|
- @click="handleControlWaterLevel(wlData.bz)" />
|
|
|
+ @click="handleControlWaterLevel(wlData.bz)"/>
|
|
|
</el-col>
|
|
|
<el-col :span="8" style="height: 33%;">
|
|
|
<color-tag :value="wlData.jj" backgroundColor="#b38b30" label="警戒水位" unit="m"
|
|
|
- @click="handleControlWaterLevel(wlData.jj)" />
|
|
|
+ @click="handleControlWaterLevel(wlData.jj)"/>
|
|
|
</el-col>
|
|
|
<el-col :span="8" style="height: 33%;">
|
|
|
<color-tag :value="wlData.zd" backgroundColor="#adcbe0" label="历史最低水位" unit="m"
|
|
|
- @click="handleControlWaterLevel(wlData.zd)" />
|
|
|
+ @click="handleControlWaterLevel(wlData.zd)"/>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</card01>
|