From 40061eef034aec4cfbdb3d71d59047bd60df565a Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Mon, 23 Oct 2023 16:13:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=BD=A6=E6=9B=B2=E7=BA=BF=E5=9B=BE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../line-app/infos/TrainInfoEcharts.vue | 66 ++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/src/components/line-app/infos/TrainInfoEcharts.vue b/src/components/line-app/infos/TrainInfoEcharts.vue index cefc178..c766e51 100644 --- a/src/components/line-app/infos/TrainInfoEcharts.vue +++ b/src/components/line-app/infos/TrainInfoEcharts.vue @@ -40,6 +40,9 @@ let tractionForceList: [Date, number][] = []; let brakeForceList: [Date, number][] = []; let kmList: number[] = []; let km_speedList: [number, number][] = []; +let km_accelerationList: [number, number][] = []; +let km_tractionForceList: [number, number][] = []; +let km_brakeForceList: [number, number][] = []; let maxKm: number; let minKm: number; @@ -62,6 +65,9 @@ function getDataList() { brakeForceList = []; kmList = []; km_speedList = []; + km_accelerationList = []; + km_tractionForceList = []; + km_brakeForceList = []; lineStore.trainStateMap.forEach((list, key) => { const find = list.find((ii) => { return ii.id == props.trainId; @@ -74,6 +80,18 @@ function getDataList() { if (!kmList.includes(find.trainKilometer)) { kmList.push(find.trainKilometer); km_speedList.push([find.trainKilometer, find.dynamicState.speed / 100]); + km_accelerationList.push([ + find.trainKilometer, + find.dynamicState.acceleration, + ]); + km_tractionForceList.push([ + find.trainKilometer, + find.vobcState.tractionForce / 100, + ]); + km_brakeForceList.push([ + find.trainKilometer, + find.vobcState.brakeForce / 100, + ]); } } }); @@ -121,6 +139,28 @@ let km_series: SeriesObj[] = [ data: km_speedList, unit: 'km/h', }, + { + name: '加速度', + type: 'line', + showSymbol: false, + yAxisIndex: 1, + data: km_accelerationList, + unit: 'm/s', + }, + { + name: '牵引力', + type: 'line', + showSymbol: false, + data: km_tractionForceList, + unit: 'kn', + }, + { + name: '制动力', + type: 'line', + showSymbol: false, + data: brakeForceList, + unit: 'kn', + }, ]; function trainKilometerFormat(v: number) { @@ -295,7 +335,7 @@ function initEcharts() { }, }, legend: { - data: ['速度'], + data: ['速度', '加速度', '牵引力', '制动力'], }, xAxis: { type: 'value', @@ -308,13 +348,26 @@ function initEcharts() { yAxis: [ { type: 'value', - max: 100, + // max: 100, axisLine: { show: false, }, axisTick: { show: false, }, + boundaryGap: [0, 0.1], + }, + { + type: 'value', + scale: true, + name: '加速度 m/s', + axisLine: { + show: false, + }, + axisTick: { + show: false, + }, + boundaryGap: [0, 0.4], }, ], series: km_series, @@ -349,6 +402,15 @@ watch( { data: km_speedList, }, + { + data: km_accelerationList, + }, + { + data: km_tractionForceList, + }, + { + data: km_brakeForceList, + }, ], }; }