物流
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.

91 lines
2.1 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>
</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);
let param = {
"StartTime": dateFormat(new Date(yesterDay1), 'yyyy-MM-dd'),
3 years ago
"EndTime": dateFormat(new Date(), 'yyyy-MM-dd'),
"Imei": "41000001254"
3 years ago
}
lunzApi.getMessInfoByMessType(key, param).then(res => {
let resData = res.Data;
3 years ago
resData.map(item => {
let idx = this.carList.findIndex(item2 => item2.deviceId == item.Imei);
item.carNo = idx > -1 ? this.carList[idx].cardNo : '-';
3 years ago
item.TimeStamp = dateFormat(new Date(item.TimeStamp), 'yyyy-MM-dd hh:mm:ss')
3 years ago
this.carWarn.push(item);
})
})
},
},
}
</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>