diff --git a/src/views/pictureOnMap/page/components/DialogTabs/component/ylfxJCFX.vue b/src/views/pictureOnMap/page/components/DialogTabs/component/ylfxJCFX.vue index 812f1c4..228a398 100644 --- a/src/views/pictureOnMap/page/components/DialogTabs/component/ylfxJCFX.vue +++ b/src/views/pictureOnMap/page/components/DialogTabs/component/ylfxJCFX.vue @@ -77,6 +77,8 @@ xAxis: [], MGSW: 0, GSW: 0, + MG: 0, + YL: 0, }); const Timers = ref([ moment().subtract(3, "day").format("YYYY-MM-DD HH:mm:ss"), @@ -187,7 +189,7 @@ type: "value", // minInterval: 1, max: function (value) { - return value.max > AllData.MGSW ? value.max : AllData.MGSW; + return value.max > AllData.YL ? value.max : AllData.YL; }, min: 0, axisLabel: { @@ -281,6 +283,40 @@ }, }); } + if (AllData.MG > 0) { + option.series[1].markLine.data.push({ + yAxis: AllData.MG, // 这是水平线的 Y 轴值 + lineStyle: { + type: "dashed", + color: "rgba(255, 191, 0, 1)", // 线的颜色 + cap: "round", + }, + label: { + show: true, + formatter: "满管:" + AllData.MG, + color: "rgba(255, 191, 0, 1)", + fontSize: 12, + position: "middle", + }, + }); + } + if (AllData.YL > 0) { + option.series[1].markLine.data.push({ + yAxis: AllData.YL, // 这是水平线的 Y 轴值 + lineStyle: { + type: "dashed", + color: "#610404", // 线的颜色 + cap: "round", + }, + label: { + show: true, + formatter: "溢流:" + AllData.YL, + color: "#610404", + fontSize: 12, + position: "middle", + }, + }); + } option && chartDom.setOption(option, true); AllData.chart = chartDom; } @@ -303,15 +339,20 @@ res.data.datas.forEach((element) => { switch (element.dataKey) { case "z": - // debugger; AllData.yAxis3 = element.datas; element.cordonLineList.forEach((element) => { - if (element.lineName == "满管水位" || "溢流风险") { + if (element.code == "ylfx") { AllData.MGSW = Number(element.lineValue); } - if (element.lineName == "高水位") { + if (element.code == "gsw") { AllData.GSW = Number(element.lineValue); } + if (element.code == "mg") { + AllData.MG = Number(element.lineValue); + } + if (element.code == "yl") { + AllData.YL = Number(element.lineValue); + } }); break;