tsg-app/pages/skInfo/index.vue

187 lines
4.5 KiB
Vue
Raw Normal View History

2024-11-13 09:42:42 +08:00
<template>
<view class="skinfo">
<view class="title">
<view class="left">
<u-icon name="file-text" color="#f59d29" size="20"></u-icon>
<text style="margin-left:5px">{{dataform.resName}}</text>
</view>
<view class="right">
{{tm}}
</view>
</view>
<view class="content">
<view class="" style="display: flex;">
<!-- <image src="../../static/c1.png" mode="" style="width:30%;height: 120px;"></image> -->
2025-09-26 17:15:37 +08:00
<image :src="showImg" style="width: 30%;height: 110px;margin: 5px;" @click="previewImage(showImg)"></image>
2024-11-13 09:42:42 +08:00
<view class="listItem" @click="toDetail()">
<view class="item-text" v-for="(v,k) of list" :key="k">
<text>{{v}}</text>:
<text>{{dataform[k]}}</text>
</view>
</view>
</view>
<view class="bottom">
<view class="bottomItem">
2025-04-15 17:48:27 +08:00
<view class="withd-2" @click="toWaterDetail('灌溉供水',shStcd)">
<text>灌溉供水m³/s</text>:
2024-11-13 09:42:42 +08:00
<text>{{shgs}}</text>
</view>
2025-04-15 17:48:27 +08:00
<view class="withd-2" @click="toWaterDetail('水厂取水',stStcd)">
<text>水厂取水m³/s</text>:
2024-11-13 09:42:42 +08:00
<text>{{stgs}}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import moment from 'moment'
export default{
data(){
return{
list:{
"rz":'当前水位m',
"today":'今日雨量mm',
'flLowLimLev':'汛限水位m',
"afsltdz":'比汛期m',
'wcrstel':'堰顶高程m',
'crestElev':'坝顶高程m',
"h24":'24h预报mm',
"yesterdayDrp":'昨日雨量mm',
2025-09-26 17:15:37 +08:00
'totCap':'总库容万m³',
2024-11-13 09:42:42 +08:00
"nowCap":'蓄水量万m³'
},
tm: '',
dataform:{},
stgs:'',
shgs:'',
stStcd:'',
shStcd:'',
imageList:[],
2025-09-30 17:23:21 +08:00
baseUrl:uni.$http.baseUrl,
2025-09-26 17:15:37 +08:00
showImg:'../../static/skimg.png'
2024-11-13 09:42:42 +08:00
}
},
mounted() {
this.getList()
this.getDrp()
},
methods:{
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(){
2025-04-15 17:48:27 +08:00
uni.$http.get(`/gunshiApp/tsg/reservoir/water/detail?stcd=${uni.$stcd}&_=1731028927554`).then(res=>{
2024-11-13 09:42:42 +08:00
this.dataform={...this.dataform,...res.data.data}
})
2025-04-15 17:48:27 +08:00
uni.$http.post('/gunshiApp/tsg/reservoir/water/listV2',{sources:['SW','SK']}).then(res=>{
const filterObj = res.data.data.filter(item => item.stcd == uni.$stcd)
this.dataform={...this.dataform,...filterObj[0]}
this.tm = filterObj[0].tm
2024-11-13 09:42:42 +08:00
})
2025-10-16 15:45:14 +08:00
uni.$http.post('/gunshiApp/tsg/stFlowR/list').then(res=>{
2024-11-13 09:42:42 +08:00
res.data.data.forEach(item=>{
2025-10-16 15:45:14 +08:00
if(item.stcd == '2222222'){
2024-11-13 09:42:42 +08:00
this.stgs=item.q
this.stStcd=item.stcd
}
2025-10-16 15:45:14 +08:00
if(item.stcd == '10498'){
2024-11-13 09:42:42 +08:00
this.shgs=item.q
this.shStcd=item.stcd
}
})
})
2025-04-15 17:48:27 +08:00
uni.$http.post('/gunshiApp/tsg/resProjectImg/list',{resCode:"42112230001"}).then(res=>{
2024-11-13 09:42:42 +08:00
res.data.data.forEach(item=>{
if(item.projType == 1){
this.imageList = item.files.map((item,index)=>
2024-11-15 10:03:41 +08:00
{
item.url = this.baseUrl + item.filePath
2024-11-13 09:42:42 +08:00
if(index == 0){
this.showImg = item.url
}
return item})
}
})
})
},
toDetail(){
uni.navigateTo({
url:'/pages/skInfo/detail/index'
})
},
toWaterDetail(name,stcd){
uni.navigateTo({
url:`/pages/skInfo/waterDatail/index?name=${name}&stcd=${stcd}`,
})
},
getList(){
2024-11-15 10:03:41 +08:00
uni.$http.post('/gunshiApp/tsg/attResBase/list').then(res=>{
2024-11-13 09:42:42 +08:00
this.dataform=res.data.data[0]
})
},
}
}
</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%;
2024-11-15 10:03:41 +08:00
white-space: nowrap;
2024-11-13 09:42:42 +08:00
}
}
}
.bottomItem{
display: flex;
border-top: 1px solid #f0f0f0;
padding: 10px 0 0 0;
font-size: 14px;
}
}
.withd-2{
width: 50%;
text-align: center;
2024-11-15 10:03:41 +08:00
background-color: #caf982;
margin-right: 5px;
padding: 5px;
2024-11-13 09:42:42 +08:00
}
</style>