|
|
@@ -22,14 +22,14 @@
|
|
|
<div class="list-wrap__item truck">
|
|
|
<div class="map-card-wrap__info-box">
|
|
|
<div class="item">
|
|
|
- <div class="name">今日里程</div>
|
|
|
- <div class="value">{{ truckInfo.mileage.toFixed(0) }} <span class="unit">公里</span></div>
|
|
|
+ <div class="name">累计里程</div>
|
|
|
+ <div class="value">{{ cumulative.mileage.toFixed(0) }} <span class="unit">公里</span></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="item-info">
|
|
|
<div class="label speed">
|
|
|
- <span>{{ truckInfo.speed || '-' }}</span>公里/小时
|
|
|
- <span class="status" :class="'status__' + truckInfo.speedStatus">{{ truckStatusList[truckInfo.speedStatus] }}</span>
|
|
|
+ <span>{{ cumulative.speed || '-' }}</span>公里/小时
|
|
|
+ <span class="status" :class="'status__' + cumulative.speedStatus">{{ truckStatusList[cumulative.speedStatus] }}</span>
|
|
|
</div>
|
|
|
<div class="label local">{{ truckInfo.currAddress || '-' }}</div>
|
|
|
</div>
|
|
|
@@ -37,18 +37,17 @@
|
|
|
<div class="list-wrap__item truck">
|
|
|
<div class="map-card-wrap__info-box">
|
|
|
<div class="item">
|
|
|
- <div class="name">今日耗能</div>
|
|
|
- <div class="value">{{ truckInfo.consumption }} <span class="unit">公斤</span></div>
|
|
|
+ <div class="name">累计耗能</div>
|
|
|
+ <div class="value">{{ cumulative.consumption }} <span class="unit">公斤</span></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="volume">剩余气量:{{ truckInfo.filterPercent > 0 ? `${truckInfo.filterPercent}%` : '无' }}</div>
|
|
|
+ <div class="volume" :class="`percent_${ cumulativeStatus(cumulative.filterPercent) }`">剩余气量:{{ cumulative.filterPercent > 0 ? `${cumulative.filterPercent}%` : '无' }}</div>
|
|
|
<div class="map-card-wrap__info-box">
|
|
|
<div class="item">
|
|
|
- <div class="name">今日减碳</div>
|
|
|
- <div class="value">{{ truckInfo.carbon }} <span class="unit">公斤</span></div>
|
|
|
+ <div class="name">累计减碳</div>
|
|
|
+ <div class="value">{{ cumulative.carbon }} <span class="unit">公斤</span></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -105,6 +104,14 @@ export default {
|
|
|
min: 0,
|
|
|
max: 100
|
|
|
},
|
|
|
+ cumulative: {
|
|
|
+ mileage: 0,
|
|
|
+ speed: 0,
|
|
|
+ carbon: 0,
|
|
|
+ consumption: 0,
|
|
|
+ speedStatus: '',
|
|
|
+ filterPercent: 0
|
|
|
+ },
|
|
|
datatime: {
|
|
|
startTime: formatDate((new Date().getTime() - 86400000), 'yyyy-MM-dd hh:mm:ss'),
|
|
|
endTime: formatDate(new Date().getTime(), 'yyyy-MM-dd hh:mm:ss')
|
|
|
@@ -130,15 +137,15 @@ export default {
|
|
|
timer: null,
|
|
|
mapHeight: 400,
|
|
|
cardList: [{
|
|
|
- name: '今日里程',
|
|
|
+ name: '累计里程',
|
|
|
value: '0',
|
|
|
unit: '公里'
|
|
|
}, {
|
|
|
- name: '今日耗能',
|
|
|
+ name: '累计耗能',
|
|
|
value: '0',
|
|
|
unit: '公斤'
|
|
|
}, {
|
|
|
- name: '今日减碳',
|
|
|
+ name: '累计减碳',
|
|
|
value: '0',
|
|
|
unit: '公斤'
|
|
|
}],
|
|
|
@@ -184,6 +191,16 @@ export default {
|
|
|
console.log('BMapGLLib.Lushu is loaded!')
|
|
|
}
|
|
|
},
|
|
|
+ // 剩余气量的状态
|
|
|
+ cumulativeStatus(value) {
|
|
|
+ if (value >= 0 && value < 10) {
|
|
|
+ return 1
|
|
|
+ } else if (value >= 10 && value < 30) {
|
|
|
+ return 2
|
|
|
+ } else if (value >= 30) {
|
|
|
+ return 3
|
|
|
+ }
|
|
|
+ },
|
|
|
timeEvent(type) {
|
|
|
this.timeStatus = Number(type)
|
|
|
|
|
|
@@ -233,8 +250,21 @@ export default {
|
|
|
const len = this.lushu.path.length
|
|
|
const max = this.slider.max
|
|
|
let tmpSoliderValue = Number(this.slider.value)
|
|
|
+ const lushuItem = this.lushu.path[this.lushu.i]
|
|
|
|
|
|
- this.center = [this.lushu.path[this.lushu.i].lng, this.lushu.path[this.lushu.i].lat]
|
|
|
+ // 累计
|
|
|
+ this.cardList[0].value = lushuItem.mileage1
|
|
|
+ this.cardList[1].value = lushuItem.consumption1
|
|
|
+ this.cardList[2].value = lushuItem.carbon1
|
|
|
+ this.cumulative = {
|
|
|
+ mileage: lushuItem.mileage1,
|
|
|
+ speed: lushuItem.speed,
|
|
|
+ carbon: lushuItem.carbon1,
|
|
|
+ consumption: lushuItem.consumption1,
|
|
|
+ speedStatus: lushuItem.speed > 0 ? 0 : 1,
|
|
|
+ filterPercent: lushuItem.literPercent
|
|
|
+ }
|
|
|
+ this.center = [lushuItem.lng, lushuItem.lat]
|
|
|
if (len > 0) {
|
|
|
tmpSoliderValue = tmpSoliderValue > max * (index / len) ? tmpSoliderValue : max * (index / len)
|
|
|
tmpSoliderValue += (index / (len * 10))
|
|
|
@@ -350,10 +380,6 @@ export default {
|
|
|
this.markers = []
|
|
|
$gasdataTruckInfo(params).then(async response => {
|
|
|
this.truckInfo = response
|
|
|
- // 统计数据
|
|
|
- this.cardList[0].value = response.mileage.toFixed(0)
|
|
|
- this.cardList[1].value = response.consumption
|
|
|
- this.cardList[2].value = response.carbon
|
|
|
|
|
|
// 根据金纬度获取地理位置信息
|
|
|
const addressInfo = await this.queryCurrAddress(response.lat + ',' + response.lng)
|