98 lines
2.5 KiB
Vue
98 lines
2.5 KiB
Vue
<template>
|
|
<div class="table_div">
|
|
<div class="table_cur">
|
|
<table style="width:100%;display:block">
|
|
<tr>
|
|
<th style="width: 20%;">
|
|
监测点
|
|
</th>
|
|
<th style="width: 20%;">
|
|
监测时间
|
|
</th>
|
|
<th style="width: 20%;">x方向(mm)</th>
|
|
<th style="width: 20%;">y方向(mm)</th>
|
|
<th style="width: 20%;">h方向(mm)</th>
|
|
</tr>
|
|
<!-- style="max-height: 480px; overflow-y: auto" -->
|
|
<div class="scroll-table">
|
|
<tr v-for="(item, index) in tableData" :key="index">
|
|
<td style="width: 20%; height: 30%;">{{item.cdnm}}</td>
|
|
<td style="width: 20%;">{{simpleData(item.tm)}}</td>
|
|
<td style="width:20%;">{{ item.de }}</td>
|
|
<td style="width:20%;">{{ item.dn }}</td>
|
|
<td style="width:20%;">{{ item.du }}</td>
|
|
</tr>
|
|
<div style="height:180px"></div>
|
|
</div>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import moment from "moment"
|
|
export default {
|
|
props:{
|
|
tableData:{
|
|
type:Array,
|
|
default:[],
|
|
}
|
|
},
|
|
methods: {
|
|
simpleData(tm){
|
|
if(!tm) return ''
|
|
return moment(tm).format("MM-DD HH:mm")
|
|
}
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.table_div {
|
|
height: 100%;
|
|
max-width: calc(100% - 0px);
|
|
// max-height: calc(80vh);
|
|
flex: 1;
|
|
padding-top: 0px;
|
|
// overflow-x: scroll;
|
|
}
|
|
/*table样式*/
|
|
.table_cur {
|
|
width: 100%;
|
|
empty-cells: show;
|
|
border-collapse: collapse;
|
|
font-size: 14px;
|
|
}
|
|
.scroll-table{
|
|
height: calc(100vh - 180px);
|
|
overflow-y: auto;
|
|
width:'100%'
|
|
}
|
|
.table_cur tr {
|
|
display: flex;
|
|
}
|
|
.table_cur th {
|
|
color: #3399ef;
|
|
background: #e1f3ff;
|
|
font-size: 14px;
|
|
padding: 0px 10px;
|
|
box-sizing: border-box;
|
|
white-space: wrap;
|
|
text-align: center !important;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.table_cur td {
|
|
height: 75rpx;
|
|
// border-bottom: 1px solid #d8ddeb;
|
|
font-size: 14px;
|
|
color: #2f4056;
|
|
padding: 0 10px;
|
|
box-sizing: border-box;
|
|
white-space: wrap;
|
|
text-align: center !important;
|
|
}
|
|
/*table样式 end*/
|
|
</style> |