xytSk-App/pages/rain/Table.vue

114 lines
3.2 KiB
Vue
Raw Normal View History

2024-05-31 09:31:56 +08:00
<template>
<div class="table_div">
<div class="table_cur">
2024-06-13 16:22:28 +08:00
<table style="width:100%;display:block">
2024-05-31 09:31:56 +08:00
<tr>
2024-06-13 16:22:28 +08:00
<th style="width: 11%;">
2024-06-05 16:16:58 +08:00
<div style="margin-top: 6px;">序号</div>
</th>
2024-06-13 16:22:28 +08:00
<th style="width: 27%">
2024-06-05 16:16:58 +08:00
<div style="margin-top: 6px;">站名</div></th>
2024-06-13 13:55:33 +08:00
<th style="width: 20%;">
2024-06-05 16:16:58 +08:00
<div>时段雨量</div>
<div style="margin-top: -12px;">(mm)</div>
</th>
2024-06-13 13:55:33 +08:00
<th style="width: 20%;" >
2024-06-05 16:16:58 +08:00
<div>昨日降雨</div>
<div style="margin-top: -12px;">(mm)</div>
</th>
2024-06-13 13:55:33 +08:00
<th style="width: 22%">
2024-06-05 16:16:58 +08:00
<div style="margin-top: 6px;">所属政区</div></th>
2024-05-31 09:31:56 +08:00
</tr>
2024-06-14 10:19:48 +08:00
<!-- :style="{'max-height':height + 'px', 'overflow-y': 'auto',width:'100%'}" -->
<div class="scroll-table">
2024-06-13 13:55:33 +08:00
<tr v-for="(item, index) in list" :key="index" style="width:100%">
2024-06-13 16:22:28 +08:00
<td style="width: 11%;">{{ index + 1 }}</td>
<td style="width: 27%; color: #3399ef; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" @click="jumpDetail(item)">
2024-06-11 15:35:46 +08:00
{{ item.stnm }}</td>
2024-07-01 11:44:25 +08:00
<td style="width: 20%">{{ item.drp ?? "-" }}</td>
<td style="width: 20%">{{ item.yesDrp ?? "-" }}</td>
2024-06-13 13:55:33 +08:00
<td style="width:23%;">{{ item.adnm }}</td>
2024-05-31 09:31:56 +08:00
</tr>
2024-06-28 13:04:27 +08:00
<div style="height:160px"></div>
2024-05-31 09:31:56 +08:00
</div>
2024-06-14 10:19:48 +08:00
2024-05-31 09:31:56 +08:00
</table>
</div>
</div>
</template>
<script>
2024-06-05 16:16:58 +08:00
export default {
props:{
list:{
type:Array,
default:[],
2024-06-12 18:01:32 +08:00
},
height:{
type:Number,
default:0,
2024-06-05 16:16:58 +08:00
}
},
2024-06-12 18:01:32 +08:00
2024-06-05 16:16:58 +08:00
methods:{
jumpDetail(params){
console.log(123)
uni.navigateTo({
2024-06-28 13:04:27 +08:00
url:`/pages/rainDetail/rainDetail?stcd=${params.stcd}&stnm=${params.stnm}&sttp=${params.sttp}&source=${params.source}`
2024-06-05 16:16:58 +08:00
})
}
2024-06-12 18:01:32 +08:00
},
2024-06-05 16:16:58 +08:00
}
2024-05-31 09:31:56 +08:00
</script>
<style lang="scss" scoped>
.table_div {
height: 100%;
max-width: calc(100% - 0px);
2024-06-05 16:16:58 +08:00
max-height: calc(100vh);
2024-05-31 09:31:56 +08:00
flex: 1;
padding-top: 0px;
overflow-x: scroll;
2024-06-14 10:19:48 +08:00
padding: 0 10px;
2024-05-31 09:31:56 +08:00
}
/*table样式*/
.table_cur {
width: 100%;
empty-cells: show;
border-collapse: collapse;
font-size: 14px;
}
.table_cur tr {
display: flex;
line-height: 56rpx;
}
.table_cur th {
2024-06-05 16:16:58 +08:00
height: 80rpx;
color: #3399ef;
2024-05-31 09:31:56 +08:00
background: #e1f3ff;
font-size: 14px;
2024-06-05 16:16:58 +08:00
// font-weight: bold;
padding: 0px 10px;
2024-05-31 09:31:56 +08:00
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
2024-06-14 10:19:48 +08:00
.scroll-table{
2024-06-28 13:04:27 +08:00
height: calc(100vh - 160px);
2024-06-14 10:19:48 +08:00
overflow-y: auto;
width:'100%'
}
2024-05-31 09:31:56 +08:00
.table_cur td {
2024-06-05 16:16:58 +08:00
height: 65rpx;
2024-05-31 09:31:56 +08:00
// border-bottom: 1px solid #d8ddeb;
font-size: 14px;
color: #2f4056;
padding: 0 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
/*table样式 end*/
</style>