-
-
-
{{item.stnm}}
-
实时水位:{{item.normWatLev}}m
-
-
- 监测时间:{{item.tm}}
+
+
{{ item.stnm }}
+
+ 实时水位:{{ item.normWatLev }}m
+
+
监测时间:{{ item.tm }}
@@ -283,9 +318,11 @@ const dataType = {
}
import moment from 'moment'
-import {level} from "../../pages/utils/dicType"
-import {disType} from "../utils/dicType.js"
-import drpOption from "./chartOption.js"
+import { level } from '../../pages/utils/dicType'
+import { disType } from '../utils/dicType.js'
+import drpOption from './chartOption.js'
+import { restm } from '../utils/tool'
+
export default {
data () {
return {
@@ -303,37 +340,40 @@ export default {
tableData: {},
tm: '',
level: '',
- limit:disType(uni.getStorageSync('value').adcd),
- timeList:[
- {text:'昨天08:00~当前时间',value:1},
- {text:'今天08:00~当前时间',value:2},
- {text:'昨天08:00~今天08:00',value:3},
- {text:'最近1小时',value:4},
- {text:'最近3小时',value:5},
- {text:'最近6小时',value:6},
- {text:'最近12小时',value:7},
- {text:'最近24小时',value:8},
+ limit: disType(uni.getStorageSync('value').adcd),
+ timeList: [
+ { text: '昨天08:00~当前时间', value: 1 },
+ { text: '今天08:00~当前时间', value: 2 },
+ { text: '昨天08:00~今天08:00', value: 3 },
+ { text: '最近1小时', value: 4 },
+ { text: '最近3小时', value: 5 },
+ { text: '最近6小时', value: 6 },
+ { text: '最近12小时', value: 7 },
+ { text: '最近24小时', value: 8 }
],
- value1:3,
- rainChartData:[],
- formData:{
- stm:moment()
- .subtract(1, 'days')
- .startOf('day')
- .set({ hour: 8, minute: 0 }),
- etm: moment()
- .startOf('day')
- .set({ hour: 8, minute: 0 })
+ value1: 3,
+ rainChartData: [],
+ formData: {
+ stm: moment()
+ .subtract(1, 'days')
+ .startOf('day')
+ .set({ hour: 8, minute: 0 }),
+ etm: moment().startOf('day').set({ hour: 8, minute: 0 })
},
- rainChartData:[],
- chartData:{},
- subList:["河道水情","水库水情"],
- current:0,
- hdList:[],
- skList:[],
- readStatus:false,
- readYjStatus:false,
- default_src: uni.getStorageSync('avatar'),
+ rainChartData: [],
+ chartData: {},
+ subList: ['河道水情', '水库水情'],
+ current: 0,
+ hdList: [],
+ skList: [],
+ readStatus: false,
+ readYjStatus: false,
+ default_src: uni.getStorageSync('avatar'),
+ imgList: {},
+ imgtm: moment().format('YYYYMMDD'),
+ imgData: [],
+ imgHours: '',
+ imgHourstm: []
}
},
computed: {
@@ -409,25 +449,25 @@ export default {
}
]
}
- },
+ }
},
- watch:{
- rainChartData(newValue){
- this.chartData = {...drpOption(newValue)}
+ watch: {
+ rainChartData (newValue) {
+ this.chartData = { ...drpOption(newValue) }
},
- limit:{
- handler(newValue){
- if(!newValue){
- this.getRainList();
+ limit: {
+ handler (newValue) {
+ if (!newValue) {
+ this.getRainList()
}
},
immediate: true
},
- current:{
- handler(newValue){
- if(newValue == 0){
+ current: {
+ handler (newValue) {
+ if (newValue == 0) {
this.getHdList()
- }else{
+ } else {
this.getSkList()
}
},
@@ -435,129 +475,150 @@ export default {
}
},
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 {
- const {data} = await uni.$http.get("/gunshiApp/xfflood/current/situation/flag")
- if(data.code == 200){
+ const { data } = await uni.$http.get(
+ '/gunshiApp/xfflood/current/situation/flag'
+ )
+ if (data.code == 200) {
this.readYjStatus = data.data
}
} catch (error) {
- uni.$showMsg()
+ uni.$showMsg()
}
},
- async getReadStatus(){
+ async getReadStatus () {
try {
- const {data} = await uni.$http.get("/gunshiApp/xfflood/xfProjectRun/has/read")
- if(data.code == 200){
+ const { data } = await uni.$http.get(
+ '/gunshiApp/xfflood/xfProjectRun/has/read'
+ )
+ if (data.code == 200) {
this.readStatus = Object.values(data.data).some(item => item == true)
}
} catch (error) {
- uni.$showMsg()
+ uni.$showMsg()
}
},
- jumpHdDetail(params){
- uni.navigateTo({
- url:`/pages/hdDetail/hdDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&wrz=${params.wrz}&grz=${params.grz}`
- })
- },
- jumpSkDetail(params){
- 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}`
- })
- },
- async getSkList(){
- try {
- const {data} = await uni.$http.post('/gunshiApp/xfflood/reservoir/water/list',{
- sources:["SW","SK"],
- adcd:uni.getStorageSync('value').adcd
+ jumpHdDetail (params) {
+ uni.navigateTo({
+ url: `/pages/hdDetail/hdDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&wrz=${params.wrz}&grz=${params.grz}`
})
- if(data.code == 200){
- this.skList = data.data;
- }
- } catch (error) {
- uni.$showMsg()
- }
-
},
- async getHdList(){
- try {
- const {data} = await uni.$http.post('/gunshiApp/xfflood/river/water/list',{
- sources:["SH","SW"],
- adcd:uni.getStorageSync('value').adcd
+ jumpSkDetail (params) {
+ 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}`
})
- if(data.code == 200){
- this.hdList = data.data;
- }
- } catch (error) {
- uni.$showMsg()
- }
-
},
- subChange(e){
+ async getSkList () {
+ try {
+ const { data } = await uni.$http.post(
+ '/gunshiApp/xfflood/reservoir/water/list',
+ {
+ sources: ['SW', 'SK'],
+ adcd: uni.getStorageSync('value').adcd
+ }
+ )
+ if (data.code == 200) {
+ this.skList = data.data
+ }
+ } catch (error) {
+ uni.$showMsg()
+ }
+ },
+ async getHdList () {
+ try {
+ const { data } = await uni.$http.post(
+ '/gunshiApp/xfflood/river/water/list',
+ {
+ sources: ['SH', 'SW'],
+ adcd: uni.getStorageSync('value').adcd
+ }
+ )
+ if (data.code == 200) {
+ this.hdList = data.data
+ }
+ } catch (error) {
+ uni.$showMsg()
+ }
+ },
+ subChange (e) {
this.current = e
},
- async getRainList(){
- try {
- const {data} = await uni.$http.post('/gunshiApp/xfflood/real/rain/home/list',{
- start:this.formData.stm.format("YYYY-MM-DD HH:mm:ss"),
- end:this.formData.etm.format("YYYY-MM-DD HH:mm:ss")
- })
- if(data.code == 200){
- this.rainChartData = data.data;
+ async getRainList () {
+ try {
+ const { data } = await uni.$http.post(
+ '/gunshiApp/xfflood/real/rain/home/list',
+ {
+ start: this.formData.stm.format('YYYY-MM-DD HH:mm:ss'),
+ end: this.formData.etm.format('YYYY-MM-DD HH:mm:ss')
+ }
+ )
+ if (data.code == 200) {
+ this.rainChartData = data.data
+ }
+ } catch (error) {
+ uni.$showMsg()
}
- } catch (error) {
- uni.$showMsg()
- }
-
},
- changeTime(params){
- let tmValue=[];
- if(params === 1){
- tmValue=[moment()
+ changeTime (params) {
+ let tmValue = []
+ if (params === 1) {
+ tmValue = [
+ moment()
.subtract(1, 'days')
.startOf('day')
.set({ hour: 8, minute: 0 }),
- moment()
- ]
- }else if(params ===2){
- tmValue=[moment()
- .startOf('day')
- .set({ hour: 8, minute: 0 }),
- moment()
+ moment()
]
- }else if(params ===3){
- tmValue=[moment()
- .subtract(1, 'days')
- .startOf('day')
- .set({ hour: 8, minute: 0 }),
- moment()
- .startOf('day')
- .set({ hour: 8, minute: 0 })
+ } else if (params === 2) {
+ tmValue = [
+ moment().startOf('day').set({ hour: 8, minute: 0 }),
+ moment()
]
- }else if(params ===4){
- tmValue=[moment().subtract(1, 'hours'),
- moment()
+ } else if (params === 3) {
+ tmValue = [
+ moment()
+ .subtract(1, 'days')
+ .startOf('day')
+ .set({ hour: 8, minute: 0 }),
+ moment().startOf('day').set({ hour: 8, minute: 0 })
]
- }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.etm=tmValue[1];
- this.getRainList()
+ } 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.etm = tmValue[1]
+ this.getRainList()
},
todetail (val) {
console.log('val', val)
@@ -651,19 +712,22 @@ export default {
this.tm = d1 + h1
},
- async getResponseLevel () {
+ async getResponseLevel () {
try {
- const {data} = await uni.$http.post('/gunshiApp/xfflood/xfEmerRespR/page',{
- pageSo:{pageSize: 10, pageNumber: 1},
- year:moment().format('YYYY')
- })
- if(data.code == 200){
- if(data.data.records.length > 0){
- this.level = level(data.data.records[0].level)
- }else{
- this.level = '无'
- }
+ const { data } = await uni.$http.post(
+ '/gunshiApp/xfflood/xfEmerRespR/page',
+ {
+ pageSo: { pageSize: 10, pageNumber: 1 },
+ year: moment().format('YYYY')
}
+ )
+ if (data.code == 200) {
+ if (data.data.records.length > 0) {
+ this.level = level(data.data.records[0].level)
+ } else {
+ this.level = '无'
+ }
+ }
} catch (e) {
uni.$showMsg()
}
@@ -672,20 +736,19 @@ export default {
uni.navigateTo({
url: url // 跳转到对应路径的页面
})
- },
+ }
// 响应级别
-
},
onLoad () {
this.getSwiperList()
this.getOverview()
this.getDataTime()
this.getResponseLevel()
-
+ this.getImgs()
},
- onShow(){
+ onShow () {
this.getReadStatus()
- if(this.limit == 1){
+ if (this.limit == 1) {
this.getYjRead()
}
}
@@ -753,7 +816,7 @@ export default {
justify-content: center;
align-items: center;
}
-.readStatus{
+.readStatus {
position: absolute;
top: 0;
right: 0;
@@ -903,7 +966,7 @@ export default {
.table_cur td {
height: 56rpx;
- border-bottom: 1px solid #E5E9F2;
+ border-bottom: 1px solid #e5e9f2;
font-size: 14px;
color: #2f4056;
padding: 0 10px;
diff --git a/pages/utils/tool.js b/pages/utils/tool.js
new file mode 100644
index 0000000..b832f64
--- /dev/null
+++ b/pages/utils/tool.js
@@ -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
+}