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

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

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