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