From 802278c2864eff91259d34d0e3ded6f45e08acbd Mon Sep 17 00:00:00 2001 From: DongZeLiang <2746733890@qq.com> Date: Thu, 12 Dec 2024 17:12:48 +0800 Subject: [PATCH] =?UTF-8?q?fix():=20=E6=8A=A5=E6=96=87=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/vehicle/instance.js | 17 ++------------ src/views/vehicle/index.vue | 45 ++++++++++--------------------------- 2 files changed, 14 insertions(+), 48 deletions(-) diff --git a/src/api/vehicle/instance.js b/src/api/vehicle/instance.js index bc0d226..732afb3 100644 --- a/src/api/vehicle/instance.js +++ b/src/api/vehicle/instance.js @@ -27,9 +27,9 @@ export function editStatus(vin, statusKey, statusValue) { * @param vin * @returns {*} */ -export function instanceClientInit(vin) { +export function instanceClientStart(vin) { return request({ - url: `/vehicle/instance/client/init/${vin}`, + url: `/vehicle/instance/client/start/${vin}`, method: 'post' }) } @@ -59,19 +59,6 @@ export function instanceCheckPosition(vin, positionCode) { }) } -/** - * 车辆报文控制 - * @param vin - * @param msgCode - * @returns {*} - */ -export function instanceMsg(vin, msgCode) { - return request({ - url: `/vehicle/instance/msg`, - method: 'post', - data: { 'vin': vin, 'msgCode': msgCode } - }) -} /** * 车辆档位 * @param vin diff --git a/src/views/vehicle/index.vue b/src/views/vehicle/index.vue index d8e1634..22eb712 100644 --- a/src/views/vehicle/index.vue +++ b/src/views/vehicle/index.vue @@ -62,10 +62,10 @@ >{{ checkVin === vehicle.vin ? "已选择" : "选择" }} | - 上线 + 启动 - 下线 + 关闭 @@ -84,14 +84,6 @@ - - - - - - - - {{ vehicle.mileage }}/KM @@ -205,7 +197,7 @@ title="添加车辆" :visible.sync="addVehicleDrawer" direction="ltr" - size="50%" + size="30%" > @@ -222,21 +214,22 @@ - - + @@ -246,7 +239,7 @@ 取 消 确 定 - + @@ -255,10 +248,9 @@ import { editStatus, instanceCheckPosition, instanceClientClose, - instanceClientInit, instanceData, + instanceClientStart, instanceData, instanceGear, - instanceList, - instanceMsg + instanceList } from '@/api/vehicle/instance' import { positionList } from '@/api/vehicle/position' import { create, gen, remove } from '@/api/vehicle/vehicle' @@ -314,6 +306,7 @@ export default { this.initInstanceList() this.initPositionList() this.selectMessageTemplateList() + setInterval(this.vehicleDataContinued, 1000) }, methods: { @@ -411,20 +404,6 @@ export default { }) }) }, - /** - * 选中报文上报状态 - * @param vehicle 车辆 - */ - checkMsg(vehicle) { - instanceMsg(vehicle.vin, vehicle.msgCode).then(response => { - this.getInstanceList() - this.$notify({ - title: '操作提示', - message: response.msg, - type: response.code === 200 ? 'success' : 'error' - }) - }) - }, /** * 选择车辆路径 * @param vehicle @@ -470,7 +449,7 @@ export default { * @param vin */ clientInit(vin) { - instanceClientInit(vin).then(response => { + instanceClientStart(vin).then(response => { this.getInstanceList() this.$notify({ title: '操作提示',