From 02bbf25456f3a0165313340be277cfa4a2b3b24f Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期三, 25 十二月 2024 18:09:51 +0800 Subject: [PATCH] 调度记录查看 --- src/views/model/pre/item/MmPredictItemChart.vue | 35 +++++++++++++++++++---------------- 1 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/views/model/pre/item/MmPredictItemChart.vue b/src/views/model/pre/item/MmPredictItemChart.vue index b4dca60..2670907 100644 --- a/src/views/model/pre/item/MmPredictItemChart.vue +++ b/src/views/model/pre/item/MmPredictItemChart.vue @@ -58,8 +58,8 @@ const message = useMessage() // 消息弹窗 const visible = ref(false); -const chartDomPre = ref(null); -let myChart = null; +const chartDomPre = ref(); +let myChart = undefined; const chartParams = reactive({ itemId: undefined, startTime: undefined, @@ -102,7 +102,7 @@ } let seriesData = [] - if (data.lastTime) { + if (data.predictTime) { seriesData.push({ name: '', data: [null], @@ -116,11 +116,11 @@ width: 2 }, data: [{ - xAxis: data.lastTime + xAxis: data.predictTime }], label: { normal: { - formatter: data.lastTime + formatter: data.predictTime } }, symbol: ['circle', 'none'], @@ -131,18 +131,20 @@ if (data.viewMap) { Object.keys(data.viewMap).forEach(key => { let viewData = data.viewMap[key] - seriesData.push({ - name: key + ":" + '真实值', - type: "line", - data: viewData.realData, - showSymbol: false, - smooth: false, - lineStyle: { - normal: { - width: 1, + if(viewData.realData) { + seriesData.push({ + name: key + ":" + '真实值', + type: "line", + data: viewData.realData, + showSymbol: false, + smooth: false, + lineStyle: { + normal: { + width: 1, + }, }, - }, - }) + }) + } seriesData.push({ name: key + ":" + '预测值', type: "line", @@ -206,6 +208,7 @@ ], series: seriesData, }; + myChart.clear() myChart.setOption(option); } catch (error) { console.error(error) -- Gitblit v1.9.3