feat: Strip中增加Reference线
This commit is contained in:
parent
e667205ba0
commit
f0efa99df5
|
@ -707,6 +707,7 @@ export default {
|
||||||
const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
|
const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
|
||||||
const thumbnailSpectrumLineSeries = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
|
const thumbnailSpectrumLineSeries = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
|
||||||
const compareLineSeries = findSeriesByName(this.option.series, 'Compare')
|
const compareLineSeries = findSeriesByName(this.option.series, 'Compare')
|
||||||
|
const stripReferenceLineSeries = findSeriesByName(this.option.series, 'StripReference')
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
// 折线y轴类型变化
|
// 折线y轴类型变化
|
||||||
|
@ -794,6 +795,10 @@ export default {
|
||||||
this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
|
this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.channelStripReferenceLine) {
|
||||||
|
this.redrawLineBySeriesName('StripReference', this.energyStripReferenceLine, this.channelStripReferenceLine)
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
||||||
// Lines 和 Scatter 的切换
|
// Lines 和 Scatter 的切换
|
||||||
|
@ -808,11 +813,22 @@ export default {
|
||||||
compareLineSeries.type = 'line'
|
compareLineSeries.type = 'line'
|
||||||
compareLineSeries.symbol = 'none'
|
compareLineSeries.symbol = 'none'
|
||||||
|
|
||||||
|
stripReferenceLineSeries.type = 'line'
|
||||||
|
stripReferenceLineSeries.symbol = 'none'
|
||||||
|
|
||||||
this.redrawLineBySeriesName('Spectrum', this.energyData.spectrumLine, this.channelData.spectrumLine)
|
this.redrawLineBySeriesName('Spectrum', this.energyData.spectrumLine, this.channelData.spectrumLine)
|
||||||
|
|
||||||
if (this.channelCompareLine) {
|
if (this.channelCompareLine) {
|
||||||
this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
|
this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.channelStripReferenceLine) {
|
||||||
|
this.redrawLineBySeriesName(
|
||||||
|
'StripReference',
|
||||||
|
this.energyStripReferenceLine,
|
||||||
|
this.channelStripReferenceLine
|
||||||
|
)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
spectrumLineSeries.type = 'scatterGL'
|
spectrumLineSeries.type = 'scatterGL'
|
||||||
spectrumLineSeries.symbol = 'circle'
|
spectrumLineSeries.symbol = 'circle'
|
||||||
|
@ -823,6 +839,9 @@ export default {
|
||||||
compareLineSeries.type = 'scatterGL'
|
compareLineSeries.type = 'scatterGL'
|
||||||
compareLineSeries.symbol = 'circle'
|
compareLineSeries.symbol = 'circle'
|
||||||
|
|
||||||
|
stripReferenceLineSeries.type = 'scatterGL'
|
||||||
|
stripReferenceLineSeries.symbol = 'circle'
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.rangeScatter()
|
this.rangeScatter()
|
||||||
})
|
})
|
||||||
|
@ -870,7 +889,7 @@ export default {
|
||||||
|
|
||||||
clearPeakLine() {
|
clearPeakLine() {
|
||||||
this.opts.notMerge = true
|
this.opts.notMerge = true
|
||||||
this.option.series.splice(6)
|
this.option.series.splice(7)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.resetChartOpts()
|
this.resetChartOpts()
|
||||||
})
|
})
|
||||||
|
@ -1261,14 +1280,40 @@ export default {
|
||||||
? this.pointlistLimitY(this.channelCompareLine.pointlist)
|
? this.pointlistLimitY(this.channelCompareLine.pointlist)
|
||||||
: this.pointlistLimit(this.channelCompareLine.pointlist, x1, x2, y1, y2),
|
: this.pointlistLimit(this.channelCompareLine.pointlist, x1, x2, y1, y2),
|
||||||
}
|
}
|
||||||
const energyCompareLine = {
|
|
||||||
...this.energyCompareLine,
|
let energyCompareLine = []
|
||||||
pointlist: isReset
|
if (this.energyCompareLine) {
|
||||||
? this.pointlistLimitY(this.energyCompareLine.pointlist)
|
energyCompareLine = {
|
||||||
: this.pointlistLimit(this.energyCompareLine.pointlist, x1, x2, y1, y2),
|
...this.energyCompareLine,
|
||||||
|
pointlist: isReset
|
||||||
|
? this.pointlistLimitY(this.energyCompareLine.pointlist)
|
||||||
|
: this.pointlistLimit(this.energyCompareLine.pointlist, x1, x2, y1, y2),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.redrawLineBySeriesName('Compare', energyCompareLine, channelCompareLine)
|
this.redrawLineBySeriesName('Compare', energyCompareLine, channelCompareLine)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.channelStripReferenceLine) {
|
||||||
|
const channelStripReferenceLine = {
|
||||||
|
...this.channelStripReferenceLine,
|
||||||
|
pointlist: isReset
|
||||||
|
? this.pointlistLimitY(this.channelStripReferenceLine.pointlist)
|
||||||
|
: this.pointlistLimit(this.channelStripReferenceLine.pointlist, x1, x2, y1, y2),
|
||||||
|
}
|
||||||
|
|
||||||
|
let energyStripReferenceLine = []
|
||||||
|
if (this.energyStripReferenceLine) {
|
||||||
|
energyStripReferenceLine = {
|
||||||
|
...this.energyStripReferenceLine,
|
||||||
|
pointlist: isReset
|
||||||
|
? this.pointlistLimitY(this.energyStripReferenceLine.pointlist)
|
||||||
|
: this.pointlistLimit(this.energyStripReferenceLine.pointlist, x1, x2, y1, y2),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.redrawLineBySeriesName('StripReference', energyStripReferenceLine, channelStripReferenceLine)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1440,7 +1485,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.handleResetChart()
|
this.handleResetChart()
|
||||||
this.clearCompareLine()
|
this.clearCompareLine()
|
||||||
if(isOperating) {
|
if (isOperating) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1508,14 +1553,42 @@ export default {
|
||||||
|
|
||||||
const { success, result, message } = await getAction(url, param)
|
const { success, result, message } = await getAction(url, param)
|
||||||
if (success) {
|
if (success) {
|
||||||
const [channelData, energyData] = result
|
if (this.isStrip) {
|
||||||
this.channelCompareLine = channelData
|
const { reference: referenceLine, result: compareLine } = result
|
||||||
this.energyCompareLine = energyData
|
|
||||||
this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.channelCompareLine = compareLine[0]
|
||||||
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
|
this.energyCompareLine = compareLine[1]
|
||||||
})
|
this.redrawLineBySeriesName(
|
||||||
|
'Compare',
|
||||||
|
this.energyCompareLine,
|
||||||
|
this.channelCompareLine,
|
||||||
|
true,
|
||||||
|
this.channelCompareLine.color
|
||||||
|
)
|
||||||
|
|
||||||
|
this.channelStripReferenceLine = referenceLine[0]
|
||||||
|
this.energyStripReferenceLine = referenceLine[1]
|
||||||
|
this.redrawLineBySeriesName(
|
||||||
|
'StripReference',
|
||||||
|
this.energyStripReferenceLine,
|
||||||
|
this.channelStripReferenceLine,
|
||||||
|
true,
|
||||||
|
this.channelStripReferenceLine.color
|
||||||
|
)
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const [channelData, energyData] = result
|
||||||
|
this.channelCompareLine = channelData
|
||||||
|
this.energyCompareLine = energyData
|
||||||
|
this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.$emit('compareSuccess', this.isStrip)
|
this.$emit('compareSuccess', this.isStrip)
|
||||||
} else {
|
} else {
|
||||||
|
@ -1537,6 +1610,14 @@ export default {
|
||||||
}
|
}
|
||||||
this.channelCompareLine = undefined
|
this.channelCompareLine = undefined
|
||||||
this.energyCompareLine = undefined
|
this.energyCompareLine = undefined
|
||||||
|
|
||||||
|
const stripReferenceLine = findSeriesByName(this.option.series, 'StripReference')
|
||||||
|
if (stripReferenceLine) {
|
||||||
|
stripReferenceLine.data = []
|
||||||
|
this.resetThumbnailChartDataMax()
|
||||||
|
}
|
||||||
|
this.channelStripReferenceLine = undefined
|
||||||
|
this.energyStripReferenceLine = undefined
|
||||||
},
|
},
|
||||||
|
|
||||||
// 重新分析
|
// 重新分析
|
||||||
|
|
|
@ -976,7 +976,6 @@ export default {
|
||||||
|
|
||||||
// Compare 或 Strip 了
|
// Compare 或 Strip 了
|
||||||
handleCompareSuccess(isStrip) {
|
handleCompareSuccess(isStrip) {
|
||||||
console.log('%c [ isStrip ]-973', 'font-size:13px; background:pink; color:#bf2c9f;', isStrip)
|
|
||||||
if (isStrip) {
|
if (isStrip) {
|
||||||
this.isStriping = true
|
this.isStriping = true
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -44,3 +44,8 @@ export const compareLineSeries = buildLineSeries('Compare', [], '#fff', {
|
||||||
symbolSize: 2,
|
symbolSize: 2,
|
||||||
z: 7
|
z: 7
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const stripReferenceLineSeries = buildLineSeries('StripReference', [], '#fff', {
|
||||||
|
symbolSize: 2,
|
||||||
|
z: 8
|
||||||
|
})
|
||||||
|
|
|
@ -5,7 +5,8 @@ import {
|
||||||
compareLineSeries,
|
compareLineSeries,
|
||||||
lcLineSeries,
|
lcLineSeries,
|
||||||
scacLineSeries,
|
scacLineSeries,
|
||||||
spectrumSeries
|
spectrumSeries,
|
||||||
|
stripReferenceLineSeries
|
||||||
} from './seriesBuilder'
|
} from './seriesBuilder'
|
||||||
|
|
||||||
export const GammaOptions = {
|
export const GammaOptions = {
|
||||||
|
@ -103,7 +104,15 @@ export const GammaOptions = {
|
||||||
max: 'dataMax',
|
max: 'dataMax',
|
||||||
animation: false
|
animation: false
|
||||||
},
|
},
|
||||||
series: [spectrumSeries, baseLineSeries, lcLineSeries, scacLineSeries, baseLineCtrlPoint, compareLineSeries],
|
series: [
|
||||||
|
spectrumSeries,
|
||||||
|
baseLineSeries,
|
||||||
|
lcLineSeries,
|
||||||
|
scacLineSeries,
|
||||||
|
baseLineCtrlPoint,
|
||||||
|
compareLineSeries,
|
||||||
|
stripReferenceLineSeries
|
||||||
|
],
|
||||||
brush: {}
|
brush: {}
|
||||||
},
|
},
|
||||||
// 缩略图配置
|
// 缩略图配置
|
||||||
|
|
Loading…
Reference in New Issue
Block a user