删除普后,在次加载普的时候,上次数据没有清空的问题
This commit is contained in:
		
							parent
							
								
									bd7dcfa030
								
							
						
					
					
						commit
						900abc7adc
					
				| 
						 | 
					@ -11,7 +11,7 @@
 | 
				
			||||||
      </span>
 | 
					      </span>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="beta-gamma-spectrum-chart-main">
 | 
					    <div class="beta-gamma-spectrum-chart-main">
 | 
				
			||||||
      <CustomChart key="1" ref="roiLimitsRef" :option="roiLimitsOption" />
 | 
					      <CustomChart :key="chartKey" ref="roiLimitsRef" :opts="opts" :option="roiLimitsOption" />
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
| 
						 | 
					@ -106,36 +106,33 @@ export default {
 | 
				
			||||||
  watch: {
 | 
					  watch: {
 | 
				
			||||||
    ROILists: {
 | 
					    ROILists: {
 | 
				
			||||||
      handler(newVal) {
 | 
					      handler(newVal) {
 | 
				
			||||||
        // this.active = 0
 | 
					 | 
				
			||||||
        // this.$emit('sendIndex', 0)
 | 
					 | 
				
			||||||
        // const [ROIOneList, ...lists] = newVal
 | 
					 | 
				
			||||||
        this.buildOneLineList(newVal[this.active])
 | 
					        this.buildOneLineList(newVal[this.active])
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      // immediate: true,
 | 
					      immediate: true,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					  beforeDestroy() {
 | 
				
			||||||
 | 
					    const myChart = this.$refs.roiLimitsRef.getChartInstance()
 | 
				
			||||||
 | 
					    myChart.dispose()
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
  data() {
 | 
					  data() {
 | 
				
			||||||
    this.buttons = buttons
 | 
					    this.buttons = buttons
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
      active: 0,
 | 
					      active: 0,
 | 
				
			||||||
      roiLimitsOption,
 | 
					      roiLimitsOption,
 | 
				
			||||||
 | 
					      opts: {
 | 
				
			||||||
 | 
					        notMerge: true,
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      chartKey: 'limit',
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  mounted() {
 | 
					 | 
				
			||||||
    // this.$bus.$on('updateRoi', this.updateRoi)
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  destroyed() {
 | 
					 | 
				
			||||||
    // this.$bus.$off('updateRoi', this.updateRoi)
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    // updateRoi(data) {
 | 
					 | 
				
			||||||
    //   this.buildOneLineList(data)
 | 
					 | 
				
			||||||
    //   this.active = 0
 | 
					 | 
				
			||||||
    // },
 | 
					 | 
				
			||||||
    buildOneLineList(val) {
 | 
					    buildOneLineList(val) {
 | 
				
			||||||
      if (val) {
 | 
					 | 
				
			||||||
      const currSeries = this.roiLimitsOption.series
 | 
					      const currSeries = this.roiLimitsOption.series
 | 
				
			||||||
 | 
					      if (val) {
 | 
				
			||||||
        currSeries.data = val.map((item) => [item.x, item.y])
 | 
					        currSeries.data = val.map((item) => [item.x, item.y])
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        currSeries.data = []
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    // 点击改变Beta-Gamma Spectrum: Sample图表类型
 | 
					    // 点击改变Beta-Gamma Spectrum: Sample图表类型
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user