| | |
| | | title="预测数据" |
| | | :close-on-click-modal="false" |
| | | width="50%" |
| | | @close="dialogClose" |
| | | v-model="visible" |
| | | > |
| | | <el-form |
| | |
| | | > |
| | | <el-form-item label="开始时间"> |
| | | <el-date-picker |
| | | size="mini" |
| | | v-model="dataForm.startTime" |
| | | format="YYYY-MM-DD HH:mm:00" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | |
| | | </el-form-item> |
| | | <el-form-item label="结束时间"> |
| | | <el-date-picker |
| | | size="mini" |
| | | v-model="dataForm.endTime" |
| | | format="YYYY-MM-DD HH:mm:00" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | |
| | | dataForm.value.id = row.id; |
| | | dataForm.value.itemName = row.itemname; |
| | | if (row.id) { |
| | | myChart = echarts.init(chartDomPre.value); |
| | | myChart.clear() |
| | | nextTick(() => { |
| | | myChart = echarts.init(chartDomPre.value); |
| | | }); |
| | | getDataList(); |
| | | } |
| | | } |
| | | |
| | | const dialogClose = () => { |
| | | if (myChart) { |
| | | myChart.dispose(); // 组件卸载时销毁实例 |
| | | } |
| | | } |
| | | |
| | |
| | | chartParams.endTime = dataForm.value.endTime; |
| | | const data = await McsApi.getPreDataItemChart(chartParams) |
| | | let legendData = [] |
| | | if (data.legend && data.legend.length > 0) { |
| | | data.legend.forEach(item => { |
| | | legendData.push(item + ":" + '真实值') |
| | | legendData.push(item + ":" + '预测值') |
| | | }) |
| | | } |
| | | // if (data.legend && data.legend.length > 0) { |
| | | // data.legend.forEach(item => { |
| | | // legendData.push(item + ":" + '真实值') |
| | | // legendData.push(item + ":" + '预测值') |
| | | // }) |
| | | // } |
| | | |
| | | let seriesData = [] |
| | | if (data.predictTime) { |
| | |
| | | Object.keys(data.viewMap).forEach(key => { |
| | | let viewData = data.viewMap[key] |
| | | if(viewData.realData) { |
| | | legendData.push(key + ":" + '真实值') |
| | | seriesData.push({ |
| | | name: key + ":" + '真实值', |
| | | type: "line", |
| | |
| | | }, |
| | | }) |
| | | } |
| | | legendData.push(key + ":" + '预测值') |
| | | seriesData.push({ |
| | | name: key + ":" + '预测值', |
| | | type: "line", |