|
|
@ -7,7 +7,7 @@ import * as echarts from "echarts"; |
|
|
|
import chartsStatistics from "./charts"; |
|
|
|
import request from '@/utils/request' |
|
|
|
import moment from "moment"; |
|
|
|
import { exportFile } from "@screen/utils/common"; |
|
|
|
import { exportImgFile,exportFile } from "@screen/utils/common"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "RailWayDay", |
|
|
@ -22,12 +22,23 @@ export default { |
|
|
|
created() {}, |
|
|
|
methods: { |
|
|
|
export(name){ |
|
|
|
exportFile({ |
|
|
|
method:'get', |
|
|
|
this.myChart = echarts.init(document.getElementById("railwayDay")); |
|
|
|
this.data.fileUrl = this.myChart.getDataURL({ |
|
|
|
type: 'png', // 可以选择 'png' 或 'jpeg' |
|
|
|
backgroundColor: '#132d38' // 指定背景色,确保与图表一致 |
|
|
|
}) |
|
|
|
exportImgFile({ |
|
|
|
method:'post', |
|
|
|
url: "/perceivedEvents/warning/exportSelectStateType", |
|
|
|
filename: name, |
|
|
|
data:this.data, |
|
|
|
}); |
|
|
|
// exportFile({ |
|
|
|
// method:'get', |
|
|
|
// url: "/perceivedEvents/warning/exportSelectStateType", |
|
|
|
// filename: name, |
|
|
|
// data:this.data, |
|
|
|
// }); |
|
|
|
}, |
|
|
|
bind(){ |
|
|
|
this.data = { |
|
|
@ -43,7 +54,7 @@ export default { |
|
|
|
const {currentlyMap,lastYearMap,stateDuration} = result.data; |
|
|
|
const xListSource = [...currentlyMap,...lastYearMap,...stateDuration] |
|
|
|
let xList = Array.from(new Set(xListSource.map(x=>x.sectionName))); |
|
|
|
|
|
|
|
|
|
|
|
const value0 = []; //上报 warningState = 1 |
|
|
|
const value1 = []; //已完成 warningState = 2 |
|
|
|
const value2 = []; //已终止 warningState = 3 |
|
|
@ -77,7 +88,7 @@ export default { |
|
|
|
chartsStatistics.series[4].data = value4; |
|
|
|
chartsStatistics.series[5].data = value5; |
|
|
|
if(!this.myChart){ |
|
|
|
this.myChart = echarts.init(document.getElementById("railwayDay")); |
|
|
|
this.myChart = echarts.init(document.getElementById("railwayDay")); |
|
|
|
} |
|
|
|
this.myChart.setOption(chartsStatistics); |
|
|
|
|
|
|
@ -88,7 +99,7 @@ export default { |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.bind(); |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// getSectionPerceivedNumber().then((res) => { |
|
|
|
// if (res.code == 200) { |
|
|
|
// this.dataList = res.data; |
|
|
|