物流
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.4 KiB

<template>
<div class="mile_warp">
3 years ago
<table class="table_box">
<colgroup>
<col width="40%" />
<col width="30%" />
<col width="30%" />
</colgroup>
<thead>
<tr>
3 years ago
<td>时间</td>
<td>车牌号</td>
<td>报警信息</td>
</tr>
</thead>
</table>
3 years ago
<div style="width:100%;height:1.5rem;overflow-y:auto;">
<table class="table_box">
<colgroup>
<col width="40%" />
<col width="30%" />
<col width="30%" />
</colgroup>
<tbody>
<tr v-for="(item, index) in carWarn" :key="'car' + index">
<td>{{ item.TimeStamp }}</td>
<td>{{ item.carNo }}</td>
<td :title="item.MESSCONTENT">{{ item.MESSTYPE }}</td>
</tr>
3 years ago
<tr v-if="carWarn.length == 0">
<td colspan="3" style="padding-top:0.8rem;">暂无报警信息</td>
</tr>
3 years ago
</tbody>
</table>
</div>
</div>
</template>
<script>
import { lunzApi, key, carList } from "@/api/data";
3 years ago
import { dateFormat } from "@/util/date";
export default {
data() {
return {
carList: carList,//车辆设备
3 years ago
carWarn: [],
}
},
mounted() {
this.queryYesterdayMile();
},
methods: {
3 years ago
//报警信息
queryYesterdayMile() {
3 years ago
let now = new Date();
let yesterDay1 = now.setDate(now.getDate() - 1);
3 years ago
let yesterDay2 = now.setDate(now.getDate() - 1);
3 years ago
let param = {
3 years ago
"StartTime": dateFormat(new Date(yesterDay2), 'yyyy-MM-dd'),
"EndTime": dateFormat(new Date(yesterDay1), 'yyyy-MM-dd')
3 years ago
}
3 years ago
this.carList.map(item => {
param.Imei = item.deviceId;
lunzApi.getMessInfoByMessType(key, param).then(res => {
let resData = res.Data;
let arr = [];
resData.map(item => {
let idx = this.carList.findIndex(item2 => item2.deviceId == item.Imei);
item.carNo = idx > -1 ? this.carList[idx].cardNo : '-';
item.TimeStamp = dateFormat(new Date(item.TimeStamp), 'yyyy-MM-dd hh:mm:ss')
arr.push(item);
})
this.carWarn = this.carWarn.concat(arr);
})
})
3 years ago
},
},
}
</script>
<style lang="scss" scoped>
.mile_warp {
width: 100%;
height: 100%;
overflow: hidden;
3 years ago
3 years ago
.table_box {
3 years ago
width: 100%;
3 years ago
tr {
td {
font-size: 0.18rem;
color: #fff;
padding: 0.08rem 0;
}
3 years ago
}
}
}
</style>