修改轮胎生命周期

master
夜笙歌 2 years ago
parent 900a406546
commit 033f48da71

@ -155,7 +155,7 @@
</el-row> </el-row>
<el-dialog v-model="open" :title="title" append-to-body width="800px"> <el-dialog v-model="open" :title="title" append-to-body width="800px">
<el-descriptions class="margin-top" :column="2" border width="150px"> <el-descriptions :column="2" border class="margin-top" width="150px">
<el-descriptions-item> <el-descriptions-item>
<template #label> <template #label>
胎号 胎号
@ -270,7 +270,7 @@
</template> </template>
<script setup> <script setup>
import {listBaseCar, getCarGpsList,getTyreList} from '@/api/realTimeMonitoring/carMonitoring' import {listBaseCar, getCarGpsList, getTyreList} from '@/api/realTimeMonitoring/carMonitoring'
import AMapLoader from '@amap/amap-jsapi-loader'; import AMapLoader from '@amap/amap-jsapi-loader';
import {useI18n} from "vue-i18n"; import {useI18n} from "vue-i18n";
import {ref} from 'vue' import {ref} from 'vue'
@ -364,14 +364,14 @@ const tableChange = async (e) => {
title.push(parseInt(res.split('-')[1])) title.push(parseInt(res.split('-')[1]))
}) })
TireRow.value = title TireRow.value = title
let tyreListData = info[0].tyreList.map(e=>{ let tyreListData = info[0].tyreList.map(e => {
return { return {
...e, ...e,
tyrePositionS : e.tyrePosition?.split('-')[0] + '-' + e.tyrePosition?.split('-')[1] + '-' + e.tyrePosition?.split('-')[2] tyrePositionS: e.tyrePosition?.split('-')[0] + '-' + e.tyrePosition?.split('-')[1] + '-' + e.tyrePosition?.split('-')[2]
} }
}) })
tyreList.value = tyreListData tyreList.value = tyreListData
tyreDataList.value = tyreListData.map(e=>e.tyrePositionS) tyreDataList.value = tyreListData.map(e => e.tyrePositionS)
console.log(tyreList.value) console.log(tyreList.value)
let timeOut = () => { let timeOut = () => {
setTimeout(() => { setTimeout(() => {
@ -398,7 +398,6 @@ const queryParams = ref({
const tableData = ref([]) const tableData = ref([])
/** 取消按钮 */ /** 取消按钮 */
function cancel() { function cancel() {
open.value = false; open.value = false;
@ -529,7 +528,8 @@ onBeforeUnmount(() => {
background-size: 100% 100%; background-size: 100% 100%;
background-image: url("../../../assets/images/trucks.png"); background-image: url("../../../assets/images/trucks.png");
} }
.el-descriptions__label{
.el-descriptions__label {
width: 170px; width: 170px;
} }
</style> </style>

@ -67,7 +67,7 @@
{{ tyrePosition(i.carPosition) || '' }} {{ tyrePosition(i.carPosition) || '' }}
</div> </div>
<div style="width:100%;padding-left: 4px;line-height: 24px"> <div style="width:100%;padding-left: 4px;line-height: 24px">
{{ i.datetime ? parseTime(new Date(i.datetime), '{y}-{m}-{d}') : '' }} {{ i.datetime ? parseTime(new Date(i.datetime), '{y}-{m}-{d} {h}:{i}:{s}') : '' }}
</div> </div>
</div> </div>
</div> </div>
@ -130,11 +130,14 @@ const getList = () => {
}) })
} }
const outerTireNumberSearchClick = async () => { const outerTireNumberSearchClick = async () => {
if(!tireInfo.value.title) return
const {data: info} = await getTyreLife({ const {data: info} = await getTyreLife({
outerTireNumber: tireInfo.value.title outerTireNumber: tireInfo.value.title
}) })
list.value = info.lifeList list.value = info.lifeList
tireInfo.value = info.tyresLifeInfo tireInfo.value = {...info.tyresLifeInfo,title:tireInfo.value.title}
percentage.value = info.tyresLifeInfo.percentage || ''
run.value = info.tyresLifeInfo.mileage || ''
list.value.push({ list.value.push({
datetime: new Date().getTime(), datetime: new Date().getTime(),
description: '今日' description: '今日'
@ -151,9 +154,11 @@ const tyrePosition = (e) => {
return `${position[0]}${Enum1[position[1] - 1]}${Enum2[position[2] - 1]}` return `${position[0]}${Enum1[position[1] - 1]}${Enum2[position[2] - 1]}`
} }
const percentage = '3.33' //
const percentage = ref('')
const run = '3.33' //
const run = ref('')
const tireInfo = ref({ const tireInfo = ref({
title: '1001', title: '1001',

Loading…
Cancel
Save