From 70d8a7e28e69b9653e72f32f14eec073fe0852ad Mon Sep 17 00:00:00 2001 From: ffr <492210217@qq.com> Date: Tue, 9 Apr 2024 18:40:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=98=E5=87=A1=E8=8A=AEcommit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/couplet/VehicleDetection/index.vue | 313 ++++++++++++++++++- src/views/couplet/monitorinData/index.vue | 20 +- 2 files changed, 315 insertions(+), 18 deletions(-) diff --git a/src/views/couplet/VehicleDetection/index.vue b/src/views/couplet/VehicleDetection/index.vue index 2dee44a..36bb565 100644 --- a/src/views/couplet/VehicleDetection/index.vue +++ b/src/views/couplet/VehicleDetection/index.vue @@ -59,11 +59,298 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -89,6 +376,9 @@ export default { //车辆类型 vehicleTypes: [], + gridData:{}, + dialogTableVisible: false, + dialogFormVisible: false, //对话框的参数 formLabelWidth: '120px', dialogEdit: false, @@ -129,12 +419,21 @@ export default { } ) }, - findByVehicle(vin){ - postFindByVin(vin).then(() => { - monitorinDataList(vin).then(() => { - this.$router.push({ path: 'monitorinData', params: { vin } }); + findByVehicle(vin) { + // 异步调用 postFindByVin 方法 + return postFindByVin(vin) + .then(() => { + // 成功后,继续异步调用 monitorinDataList 方法 + return monitorinDataList(vin); + }) + .then((res) => { + // 处理 monitorinDataList 返回的结果 + this.gridData = res.data; + }) + .catch((error) => { + // 添加错误处理,当任一异步操作失败时,打印错误信息或进行其他处理 + console.error('Error fetching vehicle data:', error); }); - }); }, stopViewingData(vin){ stopViewingData(vin).then(res=>{ @@ -159,7 +458,7 @@ export default { created() { //获取车辆列表 this.getVehicleList () - + this.findByVehicle() //获取车辆类型 this.getVehicleTypes() }, diff --git a/src/views/couplet/monitorinData/index.vue b/src/views/couplet/monitorinData/index.vue index 6a038d8..9bea32c 100644 --- a/src/views/couplet/monitorinData/index.vue +++ b/src/views/couplet/monitorinData/index.vue @@ -1,4 +1,4 @@ -