From 5061b8bc40b0ae8891cf652d69b52124b74ace8f Mon Sep 17 00:00:00 2001 From: DongZeLiang <2746733890@qq.com> Date: Sat, 2 Dec 2023 09:20:40 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=94=AF=E6=8C=81=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BD=A6=E8=BE=86=202=E3=80=81=E6=94=AF?= =?UTF-8?q?=E6=8C=81vin=E6=A3=80=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/vehicle/vehicle.js | 9 ++++++ src/views/vehicle/index.vue | 62 ++++++++++++++++++++++++++++++++++--- 2 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 src/api/vehicle/vehicle.js diff --git a/src/api/vehicle/vehicle.js b/src/api/vehicle/vehicle.js new file mode 100644 index 0000000..060d407 --- /dev/null +++ b/src/api/vehicle/vehicle.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function create(params) { + return request({ + url: '/vehicle/create', + method: 'post', + data: params + }) +} diff --git a/src/views/vehicle/index.vue b/src/views/vehicle/index.vue index a226227..82c7bf3 100644 --- a/src/views/vehicle/index.vue +++ b/src/views/vehicle/index.vue @@ -4,18 +4,23 @@
- 添加车辆 + 添加车辆
+ + + + +
{{ vehicle.vin }} - 选择 + 选择 | 上线 @@ -158,6 +163,26 @@
+ + + +

一行一个VIN,多VIN进行换行

+ + + + + + 添加车辆 + 取消 + + +
+
+
@@ -172,20 +197,32 @@ import { instanceMsg } from "@/api/vehicle/instance"; import {positionList} from "@/api/vehicle/position"; +import {create} from "@/api/vehicle/vehicle"; export default { data() { return { contentHeight: 1024, + // 选中的VIN checkVin: null, + // 路径列表 positionCodeList: [], + // 车辆列表 vehicleList: [], + // 查询 queryParams: { vin: null, }, + // 定时获取车辆列表 intervalInstanceList: null, + // 定时获取车辆数据 intervalVehicleDataContinued: null, - vehicleData: {} + // 车辆模拟数据 + vehicleData: {}, + // 添加车辆抽屉 + addVehicleDrawer: false, + // 添加表单 + addForm: {} } }, created() { @@ -196,6 +233,19 @@ export default { }, methods: { + /** + * 车辆添加 + */ + vehicleCreate(){ + create(this.addForm).then(response => { + this.$notify({ + title: '操作提示', + message: response.msg, + type: response.code === 200 ? 'success' : 'error' + }) + }) + }, + /** * 获取车辆数据 */ @@ -211,7 +261,7 @@ export default { * 状态发生改变 * @param statusKey 状态Key */ - statusChange(statusKey){ + statusChange(statusKey) { debugger editStatus(this.checkVin, statusKey, this.vehicleData[statusKey]).then(response => { this.$notify({ @@ -310,6 +360,10 @@ export default { clientClose(vin){ instanceClientClose(vin).then(response => { this.getInstanceList(); + // 如果下线的是本车则关闭实时车况查看 + if (vin === this.checkVin){ + this.checkVin = null + } this.$notify({ title: '操作提示', message: response.msg,