feat: 增加Energy Calibration重新分析回调后对主页面右侧Energy的影响
This commit is contained in:
parent
b1c86a8077
commit
8459081c5c
|
@ -194,6 +194,8 @@ export default {
|
||||||
// analyseCurrentSpectrum: {},
|
// analyseCurrentSpectrum: {},
|
||||||
qcFlags: {},
|
qcFlags: {},
|
||||||
|
|
||||||
|
sampleDetail: {},
|
||||||
|
|
||||||
spectraVisible: false,
|
spectraVisible: false,
|
||||||
spectraType: 'sample',
|
spectraType: 'sample',
|
||||||
|
|
||||||
|
@ -225,21 +227,54 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$bus.$on('ReAnalyses', this.redrawRect)
|
this.$bus.$on('ReAnalyses', this.handleReAnalyse)
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
this.cancelLastRequest()
|
this.cancelLastRequest()
|
||||||
this.$bus.$off('ReAnalyses', this.redrawRect)
|
this.$bus.$off('ReAnalyses', this.handleReAnalyse)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 重新绘制矩形框
|
// 重新绘制矩形框
|
||||||
redrawRect(result) {
|
handleReAnalyse(result) {
|
||||||
const keys = ['SampleBoundary', 'GasBoundary', 'DetBoundary', 'QCBoundary']
|
const keys = ['SampleBoundary', 'GasBoundary', 'DetBoundary', 'QCBoundary']
|
||||||
SampleType.forEach((item, index) => {
|
SampleType.forEach((item, index) => {
|
||||||
const value = result[keys[index]]
|
const value = result[keys[index]]
|
||||||
this.sampleDetail[item.value].Boundary = value || []
|
this.sampleDetail[item.value].Boundary = value || []
|
||||||
this.changeChartByType(this.spectraType)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const mapper = [{
|
||||||
|
key: 'sample',
|
||||||
|
sampleType: 'sample'
|
||||||
|
}, {
|
||||||
|
key: 'gas',
|
||||||
|
sampleType: 'gasBg'
|
||||||
|
}, {
|
||||||
|
key: 'det',
|
||||||
|
sampleType: 'detBg'
|
||||||
|
}, {
|
||||||
|
key: 'qc',
|
||||||
|
sampleType: 'qc'
|
||||||
|
}]
|
||||||
|
|
||||||
|
const dimension = ['beta', 'gamma'] // sampleDatail的key的维度
|
||||||
|
const dimension2 = ['Beta', 'Gamma'] // 返回值的key的维度
|
||||||
|
|
||||||
|
for (let i = 0; i < mapper.length; i++) {
|
||||||
|
for (let j = 0; j < dimension.length; j++) {
|
||||||
|
const key = `${mapper[i].key}${dimension2[j]}EnergyData` // 返回的result中的key,形如 gasBetaEnergyData
|
||||||
|
const value = result[key]
|
||||||
|
// 如果有值,将值赋给相应的sampleDetail中的谱的energy
|
||||||
|
if(value) {
|
||||||
|
const dimensionKey = dimension[j]
|
||||||
|
const sampleType = mapper[i].sampleType
|
||||||
|
this.sampleDetail[sampleType][`${dimensionKey}EnergyData`] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.changeChartByType(this.spectraType)
|
||||||
},
|
},
|
||||||
|
|
||||||
handleGetFlag(val, obj) {
|
handleGetFlag(val, obj) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user