| | |
| | | |
| | | 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, |
| | |
| | | } |
| | | |
| | | let seriesData = [] |
| | | if (data.lastTime) { |
| | | if (data.predictTime) { |
| | | seriesData.push({ |
| | | name: '', |
| | | data: [null], |
| | |
| | | width: 2 |
| | | }, |
| | | data: [{ |
| | | xAxis: data.lastTime |
| | | xAxis: data.predictTime |
| | | }], |
| | | label: { |
| | | normal: { |
| | | formatter: data.lastTime |
| | | formatter: data.predictTime |
| | | } |
| | | }, |
| | | symbol: ['circle', 'none'], |
| | |
| | | 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", |
| | |
| | | ], |
| | | series: seriesData, |
| | | }; |
| | | myChart.clear() |
| | | myChart.setOption(option); |
| | | } catch (error) { |
| | | console.error(error) |