Commit 16c0b111dd3f939ad3ab336c3d5cd897cc063d28
1 parent
3b9f2ddb
使用分析对比项交互
Showing
1 changed file
with
11 additions
and
4 deletions
src/views/standard/analysis/index.vue
@@ -236,11 +236,18 @@ export default { | @@ -236,11 +236,18 @@ export default { | ||
236 | } | 236 | } |
237 | }, | 237 | }, |
238 | removeQuery(index) { | 238 | removeQuery(index) { |
239 | + let secGraClaSubLen = this.query.secGraClaSub.length; | ||
240 | + let xAxisLen = this.xAxis.length; | ||
241 | + if ( | ||
242 | + secGraClaSubLen == xAxisLen || | ||
243 | + (secGraClaSubLen > xAxisLen && index < xAxisLen) | ||
244 | + ) { | ||
245 | + this.xAxis.pop(); | ||
246 | + this.chartData[0].value.splice(index, 1); | ||
247 | + this.chartData[1].value.splice(index, 1); | ||
248 | + this.$refs.barChart.initData(this.xAxis, this.chartData); | ||
249 | + } | ||
239 | this.query.secGraClaSub.splice(index, 1); | 250 | this.query.secGraClaSub.splice(index, 1); |
240 | - this.chartData[0].value.splice(index, 1); | ||
241 | - this.chartData[1].value.splice(index, 1); | ||
242 | - this.xAxis.pop(); | ||
243 | - this.$refs.barChart.initData(this.xAxis, this.chartData); | ||
244 | }, | 251 | }, |
245 | handleChangeTimeStart(val) { | 252 | handleChangeTimeStart(val) { |
246 | this.query.day = ""; | 253 | this.query.day = ""; |