master
张林 2024-06-14 13:53:13 +08:00
commit ba8c475412
2 changed files with 451 additions and 335 deletions

View File

@ -5,7 +5,7 @@
<div class="left"> <div class="left">
<div class="icon"> <div class="icon">
<image <image
style="width: 100%; height: 100%;border-radius: 50%;" style="width: 100%; height: 100%; border-radius: 50%"
:src="default_src" :src="default_src"
mode="aspectFill" mode="aspectFill"
></image> ></image>
@ -32,8 +32,13 @@
:src="item.icon" :src="item.icon"
mode="aspectFit" mode="aspectFit"
></image> ></image>
<div class="readStatus" v-show="(readStatus && item.key == 3) || (limit == 1 && readYjStatus && item.key == 5)"> <div
</div> class="readStatus"
v-show="
(readStatus && item.key == 3) ||
(limit == 1 && readYjStatus && item.key == 5)
"
></div>
</div> </div>
<div class="navTxt">{{ item.value }}</div> <div class="navTxt">{{ item.value }}</div>
</div> </div>
@ -50,8 +55,8 @@
src="../../static/tabs/ld.png" src="../../static/tabs/ld.png"
mode="aspectFit" mode="aspectFit"
></image ></image
><span style="color:#000">当前防汛应急响应</span> ><span style="color: #000">当前防汛应急响应</span>
<span style="color:#59A7FF ">{{level}}</span> <span style="color: #59a7ff">{{ level }}</span>
</view> </view>
<!-- 24小时综述 --> <!-- 24小时综述 -->
@ -67,7 +72,9 @@
<span class="g1">{{ list.data.yesterday }}</span <span class="g1">{{ list.data.yesterday }}</span
><span class="g1">{{ list.data.today }}</span ><span class="g1">{{ list.data.today }}</span
>24小时中共有<span class="ye">{{ list.data.stationNum }}</span >24小时中共有<span class="ye">{{ list.data.stationNum }}</span
>个降雨测站(山洪测站<span class="ye">{{ list.data.shStationNum }}</span >个降雨测站(山洪测站<span class="ye">{{
list.data.shStationNum
}}</span
>)其中最大降雨测站为<span class="ye">{{ >)其中最大降雨测站为<span class="ye">{{
list.data.maxRain ? list.data.maxRain.stnm : '-' list.data.maxRain ? list.data.maxRain.stnm : '-'
}}</span }}</span
@ -118,7 +125,7 @@
<span class="line"></span><span class="h4">24小时天气预报</span> <span class="line"></span><span class="h4">24小时天气预报</span>
</p> </p>
<div> <div>
<span class="time">{{ ydate }}{{ date }}</span> <span class="time">{{ imgData[0] }}{{ imgData[1] }}</span>
<!-- <image <!-- <image
style="width: 16px; height: 16px; vertical-align: middle" style="width: 16px; height: 16px; vertical-align: middle"
src="../../static/tabs/panelTitle.png" src="../../static/tabs/panelTitle.png"
@ -158,27 +165,35 @@
<div class="imgs" style="height: 100%; text-align: center"> <div class="imgs" style="height: 100%; text-align: center">
<!-- 24h天气预报图像--> <!-- 24h天气预报图像-->
<image <image
v-if="!changeBool" v-if="!changeBool && imgList.img24h"
src="../../static/tabs/bigImg.png" :src="imgList.img24h.url"
mode="aspectFit" mode="aspectFit"
></image> ></image>
<!-- 表格--> <!-- 表格-->
<div v-else class="tableBox"> <div v-else class="tableBox">
<div class="table_div"> <div class="table_div">
<div class="table_cur"> <div class="table_cur">
<table style="width:100%;margin-top:-10%"> <table style="width: 100%; margin-top: -10%">
<tr> <tr>
<th style="width: 50px;color:#59A7FF">序号</th> <th style="width: 50px; color: #59a7ff">序号</th>
<th v-if="showTextTypeTab == 1" style="width: 70%;color:#59A7FF"></th> <th
<th v-else style="width: 70%;color:#59A7FF">区域</th> v-if="showTextTypeTab == 1"
style="width: 70%; color: #59a7ff"
>
水库
</th>
<th v-else style="width: 70%; color: #59a7ff">区域</th>
<th style="width: 50%;color:#59A7FF">降雨量(mm)</th> <th style="width: 50%; color: #59a7ff">降雨量(mm)</th>
</tr> </tr>
<div style="max-height: 260px; overflow-y: auto"> <div style="max-height: 260px; overflow-y: auto">
<tr v-for="(item, index) in tableData.data.data" :key="index"> <tr
v-for="(item, index) in tableData.data.data"
:key="index"
>
<td style="width: 62px">{{ index + 1 }}</td> <td style="width: 62px">{{ index + 1 }}</td>
<td style="width: 70%;"> <td style="width: 70%">
{{ item.name }} {{ item.name }}
</td> </td>
<td style="width: 50%">{{ item.drp }}</td> <td style="width: 50%">{{ item.drp }}</td>
@ -201,20 +216,20 @@
<p class="title"> <p class="title">
<span class="line"></span><span class="h4">短时天气预报</span> <span class="line"></span><span class="h4">短时天气预报</span>
</p> </p>
<div class="time">04月25日08时 04月25日10时</div> <div class="time">{{ imgHourstm[0] }} {{ imgHourstm[1] }}</div>
</div> </div>
<div class="imgs" style="height: 100%; text-align: center"> <div class="imgs" style="height: 100%; text-align: center">
<image src="../../static/tabs/bigImg.png" mode="aspectFit"></image> <image :src="imgHours.url" mode="aspectFit"></image>
</div> </div>
</view> </view>
</view> </view>
<view v-show="limit != 1" > <view v-show="limit != 1">
<view class="info_24"> <view class="info_24">
<div class="heart"> <div class="heart">
<p class="title"> <p class="title">
<span class="line"></span><span class="h4">雨情</span> <span class="line"></span><span class="h4">雨情</span>
</p> </p>
<div class="time" style="width:50%;color:#000"> <div class="time" style="width: 50%; color: #000">
<uni-data-select <uni-data-select
v-model="value1" v-model="value1"
:localdata="timeList" :localdata="timeList"
@ -224,46 +239,66 @@
</uni-data-select> </uni-data-select>
</div> </div>
</div> </div>
<div class="info_icon" style="height:260px; width:100%"> <div class="info_icon" style="height: 260px; width: 100%">
<qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts" /> <qiun-data-charts
:chartData="chartData.chartData"
:echartsApp="true"
:eopts="chartData.eopts"
/>
</div> </div>
</view> </view>
<view class="info_24"> <view class="info_24">
<div class="heart" style="margin-bottom:10px"> <div class="heart" style="margin-bottom: 10px">
<p class="title"> <p class="title">
<span class="line"></span><span class="h4">水情</span> <span class="line"></span><span class="h4">水情</span>
</p> </p>
<div class="time" style="width:50%;color:#000"> <div class="time" style="width: 50%; color: #000">
<u-subsection :list="subList" :current="current" @change="subChange" mode="subsection"></u-subsection> <u-subsection
:list="subList"
:current="current"
@change="subChange"
mode="subsection"
></u-subsection>
</div> </div>
</div> </div>
<div class="info_icon" v-if="current == 0"> <div class="info_icon" v-if="current == 0">
<div <div
v-for="(item,i) in hdList" :key="i" v-for="(item, i) in hdList"
:key="i"
@click="jumpHdDetail(item)" @click="jumpHdDetail(item)"
style="display:flex;justify-content:space-between;align-items: center; margin-bottom:10px" style="
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
"
> >
<div> <div>
<div style="font-size:32rpx">{{item.stnm}}</div> <div style="font-size: 32rpx">{{ item.stnm }}</div>
<div style="font-size:24rpx;">实时水位{{item.z}}m</div> <div style="font-size: 24rpx">实时水位{{ item.z }}m</div>
</div>
<div style="color:#91939B">
监测时间{{item.tm}}
</div> </div>
<div style="color: #91939b">监测时间{{ item.tm }}</div>
</div> </div>
</div> </div>
<div class="info_icon" v-else> <div class="info_icon" v-else>
<div v-for="(item,i) in skList" :key="i" <div
style="display:flex;justify-content:space-between;align-items: center; margin-bottom:10px" v-for="(item, i) in skList"
:key="i"
style="
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
"
@click="jumpSkDetail(item)" @click="jumpSkDetail(item)"
> >
<div> <div>
<div style="font-size:32rpx">{{item.stnm}}</div> <div style="font-size: 32rpx">{{ item.stnm }}</div>
<div style="font-size:24rpx;">实时水位{{item.normWatLev}}m</div> <div style="font-size: 24rpx">
实时水位{{ item.normWatLev }}m
</div> </div>
<div style="color:#91939B">
监测时间{{item.tm}}
</div> </div>
<div style="color: #91939b">监测时间{{ item.tm }}</div>
</div> </div>
</div> </div>
</view> </view>
@ -283,9 +318,11 @@ const dataType = {
} }
import moment from 'moment' import moment from 'moment'
import {level} from "../../pages/utils/dicType" import { level } from '../../pages/utils/dicType'
import {disType} from "../utils/dicType.js" import { disType } from '../utils/dicType.js'
import drpOption from "./chartOption.js" import drpOption from './chartOption.js'
import { restm } from '../utils/tool'
export default { export default {
data () { data () {
return { return {
@ -303,37 +340,40 @@ export default {
tableData: {}, tableData: {},
tm: '', tm: '',
level: '', level: '',
limit:disType(uni.getStorageSync('value').adcd), limit: disType(uni.getStorageSync('value').adcd),
timeList:[ timeList: [
{text:'昨天08:00~当前时间',value:1}, { text: '昨天08:00~当前时间', value: 1 },
{text:'今天08:00~当前时间',value:2}, { text: '今天08:00~当前时间', value: 2 },
{text:'昨天08:00~今天08:00',value:3}, { text: '昨天08:00~今天08:00', value: 3 },
{text:'最近1小时',value:4}, { text: '最近1小时', value: 4 },
{text:'最近3小时',value:5}, { text: '最近3小时', value: 5 },
{text:'最近6小时',value:6}, { text: '最近6小时', value: 6 },
{text:'最近12小时',value:7}, { text: '最近12小时', value: 7 },
{text:'最近24小时',value:8}, { text: '最近24小时', value: 8 }
], ],
value1:3, value1: 3,
rainChartData:[], rainChartData: [],
formData:{ formData: {
stm:moment() stm: moment()
.subtract(1, 'days') .subtract(1, 'days')
.startOf('day') .startOf('day')
.set({ hour: 8, minute: 0 }), .set({ hour: 8, minute: 0 }),
etm: moment() etm: moment().startOf('day').set({ hour: 8, minute: 0 })
.startOf('day')
.set({ hour: 8, minute: 0 })
}, },
rainChartData:[], rainChartData: [],
chartData:{}, chartData: {},
subList:["河道水情","水库水情"], subList: ['河道水情', '水库水情'],
current:0, current: 0,
hdList:[], hdList: [],
skList:[], skList: [],
readStatus:false, readStatus: false,
readYjStatus:false, readYjStatus: false,
default_src: uni.getStorageSync('avatar'), default_src: uni.getStorageSync('avatar'),
imgList: {},
imgtm: moment().format('YYYYMMDD'),
imgData: [],
imgHours: '',
imgHourstm: []
} }
}, },
computed: { computed: {
@ -409,25 +449,25 @@ export default {
} }
] ]
} }
}
}, },
watch: {
rainChartData (newValue) {
this.chartData = { ...drpOption(newValue) }
}, },
watch:{ limit: {
rainChartData(newValue){ handler (newValue) {
this.chartData = {...drpOption(newValue)} if (!newValue) {
}, this.getRainList()
limit:{
handler(newValue){
if(!newValue){
this.getRainList();
} }
}, },
immediate: true immediate: true
}, },
current:{ current: {
handler(newValue){ handler (newValue) {
if(newValue == 0){ if (newValue == 0) {
this.getHdList() this.getHdList()
}else{ } else {
this.getSkList() this.getSkList()
} }
}, },
@ -435,128 +475,149 @@ export default {
} }
}, },
methods: { methods: {
async getYjRead(){ async getImgs () {
uni.request({
url: 'http://223.75.53.124:8005/grb/rainimglist?tm=2024061308',
data: {
tm: `${this.imgtm}08`
// tm: `2024061308`
},
success: res => {
console.log(res.data.data)
this.imgList = res.data.data
let h = moment().format('HH') - 1
let inx = restm(h)
this.imgHours = res.data.data.imgHours[inx]
let tm = moment().subtract(1, 'days').format('MM月DD日')
let tm2 = moment().format('MM月DD日')
this.imgData = [`${tm}08时`, `${tm2}08时`]
this.imgHourstm = [`${tm2}${h}`, `${tm2}${h + 1}`]
}
})
},
async getYjRead () {
try { try {
const {data} = await uni.$http.get("/gunshiApp/xfflood/current/situation/flag") const { data } = await uni.$http.get(
if(data.code == 200){ '/gunshiApp/xfflood/current/situation/flag'
)
if (data.code == 200) {
this.readYjStatus = data.data this.readYjStatus = data.data
} }
} catch (error) { } catch (error) {
uni.$showMsg() uni.$showMsg()
} }
}, },
async getReadStatus(){ async getReadStatus () {
try { try {
const {data} = await uni.$http.get("/gunshiApp/xfflood/xfProjectRun/has/read") const { data } = await uni.$http.get(
if(data.code == 200){ '/gunshiApp/xfflood/xfProjectRun/has/read'
)
if (data.code == 200) {
this.readStatus = Object.values(data.data).some(item => item == true) this.readStatus = Object.values(data.data).some(item => item == true)
} }
} catch (error) { } catch (error) {
uni.$showMsg() uni.$showMsg()
} }
}, },
jumpHdDetail(params){ jumpHdDetail (params) {
uni.navigateTo({ uni.navigateTo({
url:`/pages/hdDetail/hdDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&wrz=${params.wrz}&grz=${params.grz}` url: `/pages/hdDetail/hdDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&wrz=${params.wrz}&grz=${params.grz}`
}) })
}, },
jumpSkDetail(params){ jumpSkDetail (params) {
uni.navigateTo({ uni.navigateTo({
url:`/pages/skDetail/skDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&afsltdz=${params.afsltdz}&flLowLimLev=${params.flLowLimLev}&desFloodLev=${params.desFloodLev}&calFloodLev=${params.calFloodLev}&resCode=${params.resCode}` url: `/pages/skDetail/skDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&afsltdz=${params.afsltdz}&flLowLimLev=${params.flLowLimLev}&desFloodLev=${params.desFloodLev}&calFloodLev=${params.calFloodLev}&resCode=${params.resCode}`
}) })
}, },
async getSkList(){ async getSkList () {
try { try {
const {data} = await uni.$http.post('/gunshiApp/xfflood/reservoir/water/list',{ const { data } = await uni.$http.post(
sources:["SW","SK"], '/gunshiApp/xfflood/reservoir/water/list',
adcd:uni.getStorageSync('value').adcd {
}) sources: ['SW', 'SK'],
if(data.code == 200){ adcd: uni.getStorageSync('value').adcd
this.skList = data.data; }
)
if (data.code == 200) {
this.skList = data.data
} }
} catch (error) { } catch (error) {
uni.$showMsg() uni.$showMsg()
} }
}, },
async getHdList(){ async getHdList () {
try { try {
const {data} = await uni.$http.post('/gunshiApp/xfflood/river/water/list',{ const { data } = await uni.$http.post(
sources:["SH","SW"], '/gunshiApp/xfflood/river/water/list',
adcd:uni.getStorageSync('value').adcd {
}) sources: ['SH', 'SW'],
if(data.code == 200){ adcd: uni.getStorageSync('value').adcd
this.hdList = data.data; }
)
if (data.code == 200) {
this.hdList = data.data
} }
} catch (error) { } catch (error) {
uni.$showMsg() uni.$showMsg()
} }
}, },
subChange(e){ subChange (e) {
this.current = e this.current = e
}, },
async getRainList(){ async getRainList () {
try { try {
const {data} = await uni.$http.post('/gunshiApp/xfflood/real/rain/home/list',{ const { data } = await uni.$http.post(
start:this.formData.stm.format("YYYY-MM-DD HH:mm:ss"), '/gunshiApp/xfflood/real/rain/home/list',
end:this.formData.etm.format("YYYY-MM-DD HH:mm:ss") {
}) start: this.formData.stm.format('YYYY-MM-DD HH:mm:ss'),
if(data.code == 200){ end: this.formData.etm.format('YYYY-MM-DD HH:mm:ss')
this.rainChartData = data.data; }
)
if (data.code == 200) {
this.rainChartData = data.data
} }
} catch (error) { } catch (error) {
uni.$showMsg() uni.$showMsg()
} }
}, },
changeTime(params){ changeTime (params) {
let tmValue=[]; let tmValue = []
if(params === 1){ if (params === 1) {
tmValue=[moment() tmValue = [
moment()
.subtract(1, 'days') .subtract(1, 'days')
.startOf('day') .startOf('day')
.set({ hour: 8, minute: 0 }), .set({ hour: 8, minute: 0 }),
moment() moment()
] ]
}else if(params ===2){ } else if (params === 2) {
tmValue=[moment() tmValue = [
.startOf('day') moment().startOf('day').set({ hour: 8, minute: 0 }),
.set({ hour: 8, minute: 0 }),
moment() moment()
] ]
}else if(params ===3){ } else if (params === 3) {
tmValue=[moment() tmValue = [
moment()
.subtract(1, 'days') .subtract(1, 'days')
.startOf('day') .startOf('day')
.set({ hour: 8, minute: 0 }), .set({ hour: 8, minute: 0 }),
moment() moment().startOf('day').set({ hour: 8, minute: 0 })
.startOf('day')
.set({ hour: 8, minute: 0 })
]
}else if(params ===4){
tmValue=[moment().subtract(1, 'hours'),
moment()
]
}else if(params ===5){
tmValue=[moment().subtract(3, 'hours'),
moment()
]
}else if(params ===6){
tmValue=[moment().subtract(6, 'hours'),
moment()
]
}else if(params ===7){
tmValue=[moment().subtract(12, 'hours'),
moment()
]
}else if(params ===8){
tmValue=[moment().subtract(24, 'hours'),
moment()
] ]
} else if (params === 4) {
tmValue = [moment().subtract(1, 'hours'), moment()]
} else if (params === 5) {
tmValue = [moment().subtract(3, 'hours'), moment()]
} else if (params === 6) {
tmValue = [moment().subtract(6, 'hours'), moment()]
} else if (params === 7) {
tmValue = [moment().subtract(12, 'hours'), moment()]
} else if (params === 8) {
tmValue = [moment().subtract(24, 'hours'), moment()]
} }
this.formData.stm=tmValue[0]; this.formData.stm = tmValue[0]
this.formData.etm=tmValue[1]; this.formData.etm = tmValue[1]
this.getRainList() this.getRainList()
}, },
todetail (val) { todetail (val) {
@ -653,14 +714,17 @@ export default {
}, },
async getResponseLevel () { async getResponseLevel () {
try { try {
const {data} = await uni.$http.post('/gunshiApp/xfflood/xfEmerRespR/page',{ const { data } = await uni.$http.post(
pageSo:{pageSize: 10, pageNumber: 1}, '/gunshiApp/xfflood/xfEmerRespR/page',
year:moment().format('YYYY') {
}) pageSo: { pageSize: 10, pageNumber: 1 },
if(data.code == 200){ year: moment().format('YYYY')
if(data.data.records.length > 0){ }
)
if (data.code == 200) {
if (data.data.records.length > 0) {
this.level = level(data.data.records[0].level) this.level = level(data.data.records[0].level)
}else{ } else {
this.level = '无' this.level = '无'
} }
} }
@ -672,20 +736,19 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: url // url: url //
}) })
}, }
// //
}, },
onLoad () { onLoad () {
this.getSwiperList() this.getSwiperList()
this.getOverview() this.getOverview()
this.getDataTime() this.getDataTime()
this.getResponseLevel() this.getResponseLevel()
this.getImgs()
}, },
onShow(){ onShow () {
this.getReadStatus() this.getReadStatus()
if(this.limit == 1){ if (this.limit == 1) {
this.getYjRead() this.getYjRead()
} }
} }
@ -753,7 +816,7 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.readStatus{ .readStatus {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
@ -903,7 +966,7 @@ export default {
.table_cur td { .table_cur td {
height: 56rpx; height: 56rpx;
border-bottom: 1px solid #E5E9F2; border-bottom: 1px solid #e5e9f2;
font-size: 14px; font-size: 14px;
color: #2f4056; color: #2f4056;
padding: 0 10px; padding: 0 10px;

53
pages/utils/tool.js Normal file
View File

@ -0,0 +1,53 @@
export function restm (e) {
let index = ''
if (e == '8') {
index = 0
} else if (e == '9') {
index = 1
} else if (e == '10') {
index = 2
} else if (e == '11') {
index = 3
} else if (e == '12') {
index = 4
} else if (e == '13') {
index = 5
} else if (e == '14') {
index = 6
} else if (e == '15') {
index = 7
} else if (e == '16') {
index = 8
} else if (e == '17') {
index = 9
} else if (e == '18') {
index = 10
} else if (e == '19') {
index = 11
} else if (e == '20') {
index = 12
} else if (e == '21') {
index = 13
} else if (e == '22') {
index = 14
} else if (e == '23') {
index = 15
} else if (e == '0') {
index = 16
} else if (e == '1') {
index = 17
} else if (e == '2') {
index = 18
} else if (e == '3') {
index = 19
} else if (e == '4') {
index = 20
} else if (e == '5') {
index = 21
} else if (e == '6') {
index = 22
} else if (e == '7') {
index = 23
}
return index
}