|
|
@@ -7,10 +7,25 @@
|
|
|
</view>
|
|
|
<view class="history-table">
|
|
|
<view class="table-container">
|
|
|
+ <!-- 固定列:上报时间 -->
|
|
|
+ <view class="fixed-column">
|
|
|
+ <view class="fixed-header">
|
|
|
+ <text class="header-cell fixed">{{ fixedColumn.label }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="fixed-body">
|
|
|
+ <view
|
|
|
+ v-for="(item, index) in historyData"
|
|
|
+ :key="index"
|
|
|
+ class="fixed-row"
|
|
|
+ >
|
|
|
+ <text class="body-cell fixed">{{ formatDate(item[fixedColumn.prop] * 1000) }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<!-- 可滑动列 -->
|
|
|
<view class="scrollable-column">
|
|
|
<view class="scrollable-header">
|
|
|
- <text class="header-cell" v-for="(item, index) in columns" :key="index">{{ item.label }}</text>
|
|
|
+ <text class="header-cell" v-for="(col, index) in scrollableColumns" :key="index">{{ col.label }}</text>
|
|
|
</view>
|
|
|
<view class="scrollable-body">
|
|
|
<view
|
|
|
@@ -18,8 +33,7 @@
|
|
|
:key="index"
|
|
|
class="scrollable-row"
|
|
|
>
|
|
|
- <view class="body-cell" v-for="(col, index) in columns" :key="index">
|
|
|
- <text v-if="col.customRender === 'addtime'">{{ formatDate(item[col.prop] * 1000) }}</text>
|
|
|
+ <view class="body-cell" v-for="(col, index) in scrollableColumns" :key="index">
|
|
|
<text v-if="col.customRender === 'ds'">{{ item[col.prop] == 1 ? '开机' : '关机' }}</text>
|
|
|
<text v-if="col.customRender === 'at'">{{ formatAt(item[col.prop],item) }}</text>
|
|
|
<text v-if="col.customRender === 'ah'">{{ formatAh(item[col.prop],item) }}</text>
|
|
|
@@ -252,6 +266,12 @@ export default {
|
|
|
totalPages(){
|
|
|
return Math.ceil(this.totalPage / this.page_size) || 1
|
|
|
},
|
|
|
+ fixedColumn() {
|
|
|
+ return this.columns[0] || {};
|
|
|
+ },
|
|
|
+ scrollableColumns() {
|
|
|
+ return this.columns.slice(1);
|
|
|
+ },
|
|
|
formatDevImg() {
|
|
|
if(this.devImg == 'lowcbd'){
|
|
|
return 'https://s3.hnyfwlw.com/webstaticimg/bigdata_pc/menu/cbd.png';
|
|
|
@@ -1014,7 +1034,7 @@ export default {
|
|
|
|
|
|
.fixed-header {
|
|
|
border-bottom: 2rpx solid #F0F0F0;
|
|
|
- padding: 16rpx 0;
|
|
|
+ padding: 20rpx 0;
|
|
|
|
|
|
.header-cell.fixed {
|
|
|
font-size: 24rpx;
|
|
|
@@ -1079,9 +1099,6 @@ export default {
|
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
|
margin-right: 10rpx;
|
|
|
- &:first-child {
|
|
|
- min-width: 220rpx;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1104,9 +1121,6 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- &:first-child {
|
|
|
- min-width: 220rpx;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|