From 2dba018b9c04c4fe71bbc533a6d825411c1381b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9C=8B?= Date: Mon, 11 Mar 2024 17:06:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=96=E6=AE=B5=E7=AE=A1=E7=90=86,=E9=87=8C?= =?UTF-8?q?=E7=A8=8B=E8=81=94=E5=8A=A8=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/emergencyAgencies/index.vue | 5 +- .../views/jurisdictionalManagement/data.js | 51 ++++++++++++++++++- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/emergencyAgencies/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/emergencyAgencies/index.vue index 98f6f6a5..d3bea36a 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/emergencyAgencies/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/emergencyAgencies/index.vue @@ -157,7 +157,6 @@ export default { params: {}, }) .then(({ data, code }) => { - console.log("Success", data); if (code != 200) return; //Message.error("详情获取失败"); this.vehicleTypeList = data; }) @@ -223,7 +222,6 @@ export default { if (item.car.length > 0) { for (var i = 0; i < item.car.length; i++) { if (item.car[i].vehicleType == items.dictValue) { - // let data = data.push(items.dictLabel + "*" + item.car[i].carNum); // item.cars = items.dictLabel + "*" + item.car[i].carNum; } @@ -231,8 +229,7 @@ export default { } }); }); - console.log(999, this.dataList); - console.log(999, data); + this.dataList.forEach((item) => { if (item.car.length > 0) { item.cars = data.join("、"); diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/data.js b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/data.js index 23793e1f..88ca4ce7 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/data.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/data.js @@ -1,11 +1,20 @@ import { cloneDeep, merge } from "lodash"; import * as PresetFormItems from "@screen/common/PresetFormItems.js"; +import { formList } from "../../../dispatch/EventDetailDialog/data"; export const searchFormList = [ PresetFormItems.startStation, PresetFormItems.endStation ]; +//里程计算 +const mileCal = (data) => { + const { startStakeMark, endStakeMark } = data; + const start = startStakeMark[0] + "." + Number(startStakeMark[1]); + const end = endStakeMark[0] + "." + Number(endStakeMark[1]); + data.mileage = (Number(end) - Number(start)).toFixed(3); +} + export const addEditFormList = [ { label: "部门:", @@ -38,11 +47,51 @@ export const addEditFormList = [ merge(cloneDeep(PresetFormItems.startStation), { required: true, + options: { + options: [ + { + ons: { + input(value, ...args) { + const { data, formList } = args.slice(-1)[0]; + mileCal(data); + } + }, + }, + { + ons: { + input(value, ...args) { + const { data, formList } = args.slice(-1)[0]; + mileCal(data); + } + }, + }, + ] + } }), merge(cloneDeep(PresetFormItems.endStation), { required: true, + options: { + options: [ + { + ons: { + input(value, ...args) { + const { data, formList } = args.slice(-1)[0]; + mileCal(data); + } + }, + }, + { + ons: { + input(value, ...args) { + const { data, formList } = args.slice(-1)[0]; + mileCal(data); + } + }, + }, + ] + } }), - + { label: "辖区路段编号:", key: "roadCode",