|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="mile_warp"> |
|
|
|
|
<table> |
|
|
|
|
<table class="table"> |
|
|
|
|
<thead> |
|
|
|
|
<tr> |
|
|
|
|
<th>时间</th> |
|
|
|
|
@ -9,10 +9,10 @@ |
|
|
|
|
</tr> |
|
|
|
|
</thead> |
|
|
|
|
<tbody> |
|
|
|
|
<tr v-for="(item,index) in carMile" :key="'car'+index"> |
|
|
|
|
<td>{{item.cardNo}}</td> |
|
|
|
|
<td>{{item.mile}}</td> |
|
|
|
|
<td><a :href="`https://lcrm3.lunz.cn/#/Equipment/LocatMonitor/Path/${item.key}`" target="_blank">查询</a></td> |
|
|
|
|
<tr v-for="(item, index) in carWarn" :key="'car' + index"> |
|
|
|
|
<td>{{ item.TimeStamp }}</td> |
|
|
|
|
<td>{{ item.MESSTYPE }}</td> |
|
|
|
|
<td>{{ item.MESSCONTENT }}</td> |
|
|
|
|
</tr> |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
@ -21,29 +21,33 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { lunzApi, key, carList } from "@/api/data"; |
|
|
|
|
import { dateFormat } from "@/util/date"; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
carList: carList,//车辆设备 |
|
|
|
|
carMile:[], |
|
|
|
|
carWarn: [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.queryYesterdayMile(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//昨日里程 |
|
|
|
|
//报警信息 |
|
|
|
|
queryYesterdayMile() { |
|
|
|
|
lunzApi.getYesterdayMile(key).then(res => { |
|
|
|
|
let now = new Date(); |
|
|
|
|
let yesterDay1 = now.setDate(now.getDate() - 1); |
|
|
|
|
let param = { |
|
|
|
|
"StartTime": dateFormat(new Date(yesterDay1), 'yyyy-MM-dd'), |
|
|
|
|
"EndTime": dateFormat(new Date(), 'yyyy-MM-dd') |
|
|
|
|
} |
|
|
|
|
lunzApi.getMessInfoByMessType(key, param).then(res => { |
|
|
|
|
let resData = res.Data; |
|
|
|
|
console.log(resData) |
|
|
|
|
this.carList.map(item => { |
|
|
|
|
let idx = resData.findIndex(item2 => item2.Imei == item.deviceId); |
|
|
|
|
item.mile = idx > -1 ? res.Data[idx].Mile : 0; |
|
|
|
|
this.carMile.push(item); |
|
|
|
|
}) |
|
|
|
|
this.carMile.sort((a,b) => { |
|
|
|
|
return b.mile - a.mile; |
|
|
|
|
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(TimeStamp), 'yyyy-MM-dd hh:mm:ss') |
|
|
|
|
this.carWarn.push(item); |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
@ -56,6 +60,16 @@ export default { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
|
overflow: hidden; |
|
|
|
|
font-size: 12px; |
|
|
|
|
|
|
|
|
|
.table { |
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
|
|
th, |
|
|
|
|
td { |
|
|
|
|
color: #fff; |
|
|
|
|
font-size: 0.16rem; |
|
|
|
|
padding: 0.03rem 0.05rem; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |