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.
97 lines
2.2 KiB
97 lines
2.2 KiB
<template> |
|
<div class="mile_warp"> |
|
<table class="table_box"> |
|
<colgroup> |
|
<col width="20%"/> |
|
<col width="30%"/> |
|
<col width="25%"/> |
|
<col width="25%"/> |
|
</colgroup> |
|
<thead> |
|
<tr> |
|
<td>排名</td> |
|
<td>车牌号</td> |
|
<td>昨日里程<br />(km/h)</td> |
|
<td>轨迹查询</td> |
|
</tr> |
|
</thead> |
|
</table> |
|
<div style="width:100%;height:4.5rem;overflow-y:auto;"> |
|
<table class="table_box"> |
|
<colgroup> |
|
<col width="20%"/> |
|
<col width="30%"/> |
|
<col width="25%"/> |
|
<col width="25%"/> |
|
</colgroup> |
|
<tbody> |
|
<tr v-for="(item, index) in carMile" :key="'car' + index"> |
|
<td>{{ index+ 1}}</td> |
|
<td title="点击定位到该车辆位置" @click="queryMap(item)"><a href="javascript:;">{{ item.cardNo }}</a></td> |
|
<td>{{ item.mile }}</td> |
|
<td><a :href="`https://lcrm3.lunz.cn/#/Equipment/LocatMonitor/Path/${item.key}`" target="_blank">查询</a></td> |
|
</tr> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
</template> |
|
|
|
<script> |
|
import { lunzApi, key, carList } from "@/api/data"; |
|
export default { |
|
data() { |
|
return { |
|
carList: carList,//车辆设备 |
|
carMile: [], |
|
} |
|
}, |
|
mounted() { |
|
this.queryYesterdayMile(); |
|
}, |
|
methods: { |
|
//定位 |
|
queryMap(item) { |
|
this.$emit('doMap',item); |
|
}, |
|
//昨日里程 |
|
queryYesterdayMile() { |
|
lunzApi.getYesterdayMile(key).then(res => { |
|
let resData = res.Data; |
|
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; |
|
}) |
|
}) |
|
}, |
|
}, |
|
} |
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
.mile_warp { |
|
width: 100%; |
|
height: 100%; |
|
overflow: hidden; |
|
|
|
.table_box { |
|
width: 100%; |
|
|
|
tr { |
|
td { |
|
font-size: 0.18rem; |
|
color: #fff; |
|
padding: 0.08rem 0; |
|
} |
|
} |
|
a{ |
|
color:#0e94ea; |
|
text-decoration: none; |
|
} |
|
} |
|
} |
|
</style> |