Commit fc7bd542 authored by 张伯涛's avatar 张伯涛

判断是否获取图表数据,防止接口请求中切换页面造成下个页面的echarts图污染

parent a4a1c23a
......@@ -288,6 +288,7 @@ export default {
complePropo1: '0.0'
},
HistoricalInvestigation: [],
getDateType: true, // 判断是否获取图表数据,防止接口请求中切换页面造成下个页面的echarts图污染
// 图标x轴数据
xData: [],
// 计划数量数据
......@@ -298,13 +299,13 @@ export default {
goodPropoData: []
}
},
watch: {
HistoricalInvestigation: {
handler() {
this.getProLineMonitor()
}
}
},
// watch: {
// HistoricalInvestigation: {
// handler() {
// this.getProLineMonitor()
// }
// }
// },
created() {
this.getImagData()
this.getTableData()
......@@ -328,6 +329,9 @@ export default {
})
})
},
beforeDestroy() {
this.getDateType = false
},
methods: {
changeTime() {
const that = this
......@@ -491,7 +495,10 @@ export default {
}
getEchartsData(params).then(response => {
// this.xData = response.data.line
if (this.getDateType === true) {
this.HistoricalInvestigation = response.data.nums
this.getProLineMonitor()
}
})
},
/**
......
......@@ -244,6 +244,7 @@ export default {
logo: require('@/assets/image/btnChose.png'),
choseType: 'day',
dataList: [],
getDateType: true, // 判断是否获取图表数据,防止接口请求中切换页面造成下个页面的echarts图污染
btnList: [
{ dictLabel: '日报', dictLabelEnglish: 'Daily', dictValue: 'day' },
{ dictLabel: '周报', dictLabelEnglish: 'Weekly', dictValue: 'week' },
......@@ -289,6 +290,9 @@ export default {
})
})
},
beforeDestroy() {
this.getDateType = false
},
methods: {
/** 导出按钮操作*/
handleExport() {
......@@ -325,9 +329,11 @@ export default {
type: this.choseType
}
getProDetails(params).then(res => {
if (this.getDateType === true) {
this.dataList = res.data
this.getProLineMonitor()
this.getStatistics()
}
})
},
/** 更改筛选时间*/
......@@ -338,9 +344,11 @@ export default {
type: this.choseType
}
getProDetails(params).then(res => {
if (this.getDateType === true) {
this.dataList = res.data
this.getProLineMonitor()
this.getStatistics()
}
})
},
/** 选择按钮类型*/
......@@ -354,9 +362,11 @@ export default {
type: this.choseType
}
getProDetails(params).then(res => {
if (this.getDateType === true) {
this.dataList = res.data
this.getProLineMonitor()
this.getStatistics()
}
})
},
/** 统计占比echarts*/
......
......@@ -248,6 +248,7 @@ export default {
logo: require('@/assets/image/btnChose.png'),
choseType: 'day',
dataList: [],
getDateType: true, // 判断是否获取图表数据,防止接口请求中切换页面造成下个页面的echarts图污染
btnList: [
{ dictLabel: '日报', dictLabelEnglish: 'Daily', dictValue: 'day' },
{ dictLabel: '周报', dictLabelEnglish: 'Weekly', dictValue: 'week' },
......@@ -285,6 +286,9 @@ export default {
})
})
},
beforeDestroy() {
this.getDateType = false
},
methods: {
/** 导出按钮操作*/
handleExport() {
......@@ -321,8 +325,10 @@ export default {
type: this.choseType
}
getDataDetails(params).then(res => {
if(this.getDateType === true) {
this.dataList = res.data
this.getProLineMonitor()
}
})
},
/** 更改筛选时间*/
......@@ -333,8 +339,10 @@ export default {
type: this.choseType
}
getDataDetails(params).then(res => {
if(this.getDateType === true) {
this.dataList = res.data
this.getProLineMonitor()
}
})
},
/** 选择按钮类型*/
......@@ -348,8 +356,10 @@ export default {
type: this.choseType
}
getDataDetails(params).then(res => {
if(this.getDateType === true) {
this.dataList = res.data
this.getProLineMonitor()
}
})
},
/** 生产线监控*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment