xytSk-App/pages/skInfo/index.vue

191 lines
4.4 KiB
Vue
Raw Normal View History

2024-09-14 09:22:12 +08:00
<template>
2024-11-08 15:11:23 +08:00
<view class="skinfo">
2024-09-14 09:22:12 +08:00
<view class="title">
<view class="left">
2024-11-07 17:46:03 +08:00
<u-icon name="file-text" color="#f59d29" size="20"></u-icon>
2024-11-08 15:11:23 +08:00
2024-11-07 17:46:03 +08:00
<text style="margin-left:5px">{{dataform.resName}}</text>
2024-09-14 09:22:12 +08:00
</view>
<view class="right">
2024-10-31 17:39:30 +08:00
{{tm}}
2024-09-14 09:22:12 +08:00
</view>
</view>
<view class="content">
<view class="" style="display: flex;">
2024-11-08 15:11:23 +08:00
<!-- <image src="../../static/c1.png" mode="" style="width:30%;height: 120px;"></image> -->
<image :src="showImg" style="width: 30%;height: 120px;margin: 5px;" @click="previewImage(showImg)"></image>
<view class="listItem" @click="toDetail()">
2024-11-07 17:46:03 +08:00
<view class="item-text" v-for="(v,k) of list" :key="k">
2024-09-14 09:22:12 +08:00
<text>{{v}}</text>:
<text>{{dataform[k]}}</text>
</view>
</view>
</view>
2024-11-08 15:11:23 +08:00
<view class="bottom" @click="toDetail()">
2024-09-14 09:22:12 +08:00
<view class="bottomItem">
<view class="withd-2">
<text>生活供水m³/s</text>:
2024-11-08 15:11:23 +08:00
<text>{{shgs}}</text>
2024-09-14 09:22:12 +08:00
</view>
<view class="withd-2">
<text>生态供水m³/s</text>:
2024-11-08 15:11:23 +08:00
<text>{{stgs}}</text>
2024-09-14 09:22:12 +08:00
</view>
</view>
</view>
</view>
</view>
</template>
<script>
2024-10-31 17:39:30 +08:00
import moment from 'moment'
2024-09-14 09:22:12 +08:00
export default{
data(){
return{
list:{
2024-11-07 17:46:03 +08:00
"rz":'当前水位m',
"today":'今日雨量mm',
2024-10-31 17:39:30 +08:00
'flLowLimLev':'汛限水位m',
2024-11-08 15:11:23 +08:00
"afsltdz":'比汛期m',
2024-10-31 17:39:30 +08:00
'wcrstel':'堰顶高程m',
'crestElev':'坝顶高程m',
2024-11-08 15:11:23 +08:00
"h24":'24h预报mm',
2024-11-07 17:46:03 +08:00
"yesterdayDrp":'昨日雨量mm',
2024-10-31 17:39:30 +08:00
'totCap':'总库容m³',
2024-11-07 17:46:03 +08:00
"cap":'蓄水量万m³'
2024-09-14 09:22:12 +08:00
},
2024-10-31 17:39:30 +08:00
tm: moment().format('YYYY-MM-DD HH:mm:ss'),
2024-09-14 09:22:12 +08:00
dataform:{
2024-10-31 17:39:30 +08:00
// resName:'',
// 1:192.41,
// 2:112,
// 3:194.00,
// 4:-1.59,
// 5:194.00,
// 6:196.28,
// 7:12,
// 8:15.4,
// 9:129.06,
// 10:75.34
2024-11-08 15:11:23 +08:00
},
stgs:'',
shgs:'',
imageList:[],
baseUrl:'http://223.75.53.141:9102/test.by-lyf.tmp',
showImg:''
2024-09-14 09:22:12 +08:00
}
},
2024-10-31 17:39:30 +08:00
mounted() {
console.log('小玉潭水库222');
this.getList()
2024-11-08 15:11:23 +08:00
this.getDrp()
2024-10-31 17:39:30 +08:00
},
2024-09-14 09:22:12 +08:00
methods:{
2024-11-08 15:11:23 +08:00
previewImage(item){
uni.previewImage({
urls: [this.showImg],
longPressActions: {
itemList: ['发送给朋友', '保存图片', '收藏'],
success: function(data) {
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
},
fail: function(err) {
console.log(err.errMsg);
}
}
});
},
getDrp(){
uni.$http.get('/gunshiApp/xyt/reservoir/water/detail?stcd=716164061&_=1731028927554').then(res=>{
this.dataform={...this.dataform,...res.data.data}
console.log(this.dataform,'drp yesterdayDrp');
})
uni.$http.post('/gunshiApp/xyt/reservoir/water/list').then(res=>{
console.log(res,'drp list');
this.dataform={...this.dataform,...res.data.data[0]}
console.log(this.dataform,'drp list');
})
uni.$http.post('/gunshiApp/xyt/stWaterRReal/list').then(res=>{
res.data.data.forEach(item=>{
if(item.sttp == 'QQ'){
this.stgs=item.q
}
if(item.sttp == 'PQ'){
this.shgs=item.q
}
})
})
uni.$http.post('/gunshiApp/xyt/resProjectImg/list',{resCode:42120250085}).then(res=>{
res.data.data.forEach(item=>{
if(item.projType == 1){
this.imageList = item.files.map((item,index)=>
{item.url = this.baseUrl + item.filePath
if(index == 0){
this.showImg = item.url
console.log(this.showImg,'this.showImg');
}
return item})
}
})
})
},
2024-09-14 09:22:12 +08:00
toDetail(){
uni.navigateTo({
url:'/pages/skInfo/detail/index'
})
2024-10-31 17:39:30 +08:00
},
getList(){
uni.$http.post('/gunshiApp/xyt/attResBase/list').then(res=>{
console.log(res.data.data[0]);
this.dataform=res.data.data[0]
})
},
2024-09-14 09:22:12 +08:00
}
}
</script>
<style lang="scss" scoped>
.skinfo {
.title {
display: flex;
justify-content: space-between;
align-items: center;
.left{
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑', sans-serif;
font-weight: 700;
font-style: normal;
font-size: 16px;
display: flex;
}
}
.content{
.listItem{
font-size: 13px;
color: #333333;
display: flex;
flex-wrap: wrap;
width: 70%;
height: 22px;
.item-text{
width: 50%;
}
}
}
.bottomItem{
display: flex;
border-top: 1px solid #f0f0f0;
padding: 10px 0 0 0;
font-size: 14px;
}
}
.withd-2{
width: 50%;
text-align: center;
}
</style>