longyvfengyun
2024-03-28 c9edc21dac11a334c1a49aec5cb829760def34c2
内容修改
4个文件已修改
1个文件已添加
112 ■■■■ 已修改文件
src/util/getChartLinesMax.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/analysis/fhAnalysis.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/analysis/fusionAnalysis.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/analysis/hdAnalysis.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/analysis/lofAnalysis.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/util/getChartLinesMax.js
New file
@@ -0,0 +1,18 @@
export default function getChartLinesMax(data) {
  let result = {
    x: -1,
    y: -Infinity,
    z: 0
  };
  data.map((item,key)=>{
    item.map((item1, key1)=>{
      if(Number(item1)>Number(result.y)) {
        result.x = key1;
        result.y = item1;
        result.z = key;
      }
    });
  });
  return result;
}
src/views/analysis/fhAnalysis.vue
@@ -7,6 +7,7 @@
import HdwChart from "@/components/echarts/hdwChart.vue";
import getNormalLine from "@/components/echarts/options/normalLine";
import {ElMessage} from "element-plus";
import getChartLinesMax from "@/util/getChartLinesMax";
const carName = ref("");
const timeRange = ref([]);
@@ -173,6 +174,7 @@
        title4.value = data.y4Name;
        let chart4Data = formatData(data.bmsAlgorithmVoList4);
        chart4Option.xAxis.data = chart4Data.x;
        const chart4MaxInfo = getChartLinesMax(chart4Data.y);
        chart4Option.series = chart4Data.y.map((item, key)=>{
            return {
                name: '#'+(key+1),
@@ -180,6 +182,19 @@
                sampling: "lttb",
                smooth: false,
                symbolSize: 0,
                markPoint: {
                    data: [
                        {
                            name: "最大值",
                            value: "#"+(chart4MaxInfo.x+1),
                            xAxis: chart4Data.x[chart4MaxInfo.x],
                            yAxis: chart4MaxInfo.y,
                            itemStyle: {
                                color: '#ff0000'
                            }
                        },
                    ]
                },
                data: item,
            }
        });
@@ -260,7 +275,6 @@
            left: '1%',
            right: '4%',
            bottom: '3%',
            top: "6%",
            containLabel: true
        }
    });
src/views/analysis/fusionAnalysis.vue
@@ -7,6 +7,7 @@
import HdwChart from "@/components/echarts/hdwChart.vue";
import getNormalLine from "@/components/echarts/options/normalLine";
import {ElMessage} from "element-plus";
import getChartLinesMax from "@/util/getChartLinesMax";
const carName = ref("");
const timeRange = ref([]);
@@ -146,6 +147,7 @@
        title3.value = data.y3Name;
        let chart3Data = formatData(data.bmsAlgorithmVoList3);
        chart3Option.xAxis.data = chart3Data.x;
        const chart3MaxInfo = getChartLinesMax(chart3Data.y);
        chart3Option.series = chart3Data.y.map((item, key)=>{
            return {
                name: '#'+(key+1),
@@ -154,6 +156,19 @@
                smooth: false,
                symbolSize: 0,
                data: item,
                markPoint: {
                    data: [
                        {
                            name: "最大值",
                            value: "#"+(chart3MaxInfo.z+1),
                            xAxis: chart3Data.x[chart3MaxInfo.x],
                            yAxis: chart3MaxInfo.y,
                            itemStyle: {
                                color: '#ff0000'
                            }
                        },
                    ]
                },
            }
        });
        chart3Option.series.push({
@@ -173,6 +188,7 @@
        title4.value = data.y4Name;
        let chart4Data = formatData(data.bmsAlgorithmVoList4);
        chart4Option.xAxis.data = chart4Data.x;
        const chart4MaxInfo = getChartLinesMax(chart4Data.y);
        chart4Option.series = chart4Data.y.map((item, key)=>{
            return {
                name: '#'+(key+1),
@@ -180,6 +196,19 @@
                sampling: "lttb",
                smooth: false,
                symbolSize: 0,
                markPoint: {
                    data: [
                        {
                            name: "最大值",
                            value: "#"+(chart4MaxInfo.z+1),
                            xAxis: chart4Data.x[chart4MaxInfo.x],
                            yAxis: chart4MaxInfo.y,
                            itemStyle: {
                                color: '#ff0000'
                            }
                        },
                    ]
                },
                data: item,
            }
        });
@@ -244,7 +273,6 @@
            left: '1%',
            right: '4%',
            bottom: '3%',
            top: "6%",
            containLabel: true
        }
    });
@@ -260,7 +288,6 @@
            left: '1%',
            right: '4%',
            bottom: '3%',
            top: "6%",
            containLabel: true
        }
    });
src/views/analysis/hdAnalysis.vue
@@ -7,6 +7,7 @@
import HdwChart from "@/components/echarts/hdwChart.vue";
import getNormalLine from "@/components/echarts/options/normalLine";
import {ElMessage} from "element-plus";
import getChartLinesMax from "@/util/getChartLinesMax";
const carName = ref("");
const timeRange = ref([]);
@@ -145,10 +146,13 @@
        // 图表3
        title3.value = data.y3Name;
        let chart3Data = formatData(data.bmsAlgorithmVoList3);
        chart3Option.xAxis.data = chart3Data.x;
        chart3Option.xAxis.data = chart3Data.x.map(item=>{
            return '#'+(item+1);
        });
        const chart3MaxInfo = getChartLinesMax(chart3Data.y);
        chart3Option.series = chart3Data.y.map((item, key)=>{
            return {
                name: '#'+(key+1),
                name: data.y3Name,
                type: 'line',
                sampling: "lttb",
                smooth: false,
@@ -156,8 +160,10 @@
                markPoint: {
                    data: [
                        {
                            type: 'max',
                            name: 'Max',
                            name: "最大值",
                            value: "#"+(chart3MaxInfo.x+1),
                            xAxis: chart3Data.x[chart3MaxInfo.x],
                            yAxis: chart3MaxInfo.y,
                            itemStyle: {
                                color: '#ff0000'
                            }
@@ -183,10 +189,13 @@
        // 图表4
        title4.value = data.y4Name;
        let chart4Data = formatData(data.bmsAlgorithmVoList4);
        chart4Option.xAxis.data = chart4Data.x;
        chart4Option.xAxis.data = chart4Data.x.map(item=>{
            return '#'+(item+1);
        });
        const chart4MaxInfo = getChartLinesMax(chart4Data.y);
        chart4Option.series = chart4Data.y.map((item, key)=>{
            return {
                name: '#'+(key+1),
                name: data.y4Name,
                type: 'line',
                sampling: "lttb",
                smooth: false,
@@ -194,8 +203,10 @@
                markPoint: {
                    data: [
                        {
                            type: 'max',
                            name: 'Max',
                            name: "最大值",
                            value: "#"+(chart4MaxInfo.x+1),
                            xAxis: chart4Data.x[chart4MaxInfo.x],
                            yAxis: chart4MaxInfo.y,
                            itemStyle: {
                                color: '#ff0000'
                            }
@@ -269,7 +280,7 @@
            containLabel: true
        }
    });
    chart3Option.tooltip.show = false;
    chart3Option.tooltip.show = true;
    chart3Option.xAxis.axisLabel.show = true;
    chart3Option.xAxis.axisLine.show = true;
@@ -284,7 +295,7 @@
            containLabel: true
        }
    });
    chart4Option.tooltip.show = false;
    chart4Option.tooltip.show = true;
    chart4Option.xAxis.axisLabel.show = true;
    chart4Option.xAxis.axisLine.show = true;
}
src/views/analysis/lofAnalysis.vue
@@ -7,6 +7,7 @@
import HdwChart from "@/components/echarts/hdwChart.vue";
import getNormalLine from "@/components/echarts/options/normalLine";
import {ElMessage} from "element-plus";
import getChartLinesMax from "@/util/getChartLinesMax";
const carName = ref("");
const timeRange = ref([]);
@@ -173,6 +174,7 @@
        title4.value = data.y4Name;
        let chart4Data = formatData(data.bmsAlgorithmVoList4);
        chart4Option.xAxis.data = chart4Data.x;
        const chart4MaxInfo = getChartLinesMax(chart4Data.y);
        chart4Option.series = chart4Data.y.map((item, key)=>{
            return {
                name: '#'+(key+1),
@@ -180,6 +182,19 @@
                sampling: "lttb",
                smooth: false,
                symbolSize: 0,
                markPoint: {
                    data: [
                        {
                            name: "最大值",
                            value: "#"+(chart4MaxInfo.x+1),
                            xAxis: chart4Data.x[chart4MaxInfo.x],
                            yAxis: chart4MaxInfo.y,
                            itemStyle: {
                                color: '#ff0000'
                            }
                        },
                    ]
                },
                data: item,
            }
        });
@@ -260,7 +275,6 @@
            left: '1%',
            right: '4%',
            bottom: '3%',
            top: "6%",
            containLabel: true
        }
    });