fix: Load From DB 来源切换时执行一次查询,Beta 谱 -> Energy Calibration弹窗增加获取类型为man的谱时对某些数据的回显
This commit is contained in:
parent
7995f08ccb
commit
2b04b7d7ba
|
@ -128,9 +128,24 @@
|
|||
<span>C to E : </span>
|
||||
<span>
|
||||
E =
|
||||
<a-input-number size="small" v-model="newCalibrationFuncModel.paramA" @change="newCalibrationFuncModelChange"/> +
|
||||
<a-input-number size="small" v-model="newCalibrationFuncModel.paramB" @change="newCalibrationFuncModelChange"/> *C +
|
||||
<a-input-number size="small" v-model="newCalibrationFuncModel.paramC" @change="newCalibrationFuncModelChange" /> *C <sup>2</sup>
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-model="newCalibrationFuncModel.paramA"
|
||||
@change="newCalibrationFuncModelChange"
|
||||
/>
|
||||
+
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-model="newCalibrationFuncModel.paramB"
|
||||
@change="newCalibrationFuncModelChange"
|
||||
/>
|
||||
*C +
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-model="newCalibrationFuncModel.paramC"
|
||||
@change="newCalibrationFuncModelChange"
|
||||
/>
|
||||
*C <sup>2</sup>
|
||||
</span>
|
||||
</p>
|
||||
<div class="func">
|
||||
|
@ -554,7 +569,7 @@ export default {
|
|||
isBetaReset: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
|
@ -619,7 +634,7 @@ export default {
|
|||
handler() {
|
||||
// this.getData()
|
||||
},
|
||||
immediate: true
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
@ -636,11 +651,20 @@ export default {
|
|||
sampleId,
|
||||
qcFileName,
|
||||
sampleFileName: inputFileName,
|
||||
fittingBtn: this.isFirstFitting
|
||||
fittingBtn: this.isFirstFitting,
|
||||
})
|
||||
if (res.success) {
|
||||
const { CToE, EToC, betaEnergy, gammaEnergy, gammaGatedBetaSpectrum, histogramData, oldScatterSeries } =
|
||||
res.result
|
||||
const {
|
||||
CToE,
|
||||
EToC,
|
||||
betaEnergy,
|
||||
gammaEnergy,
|
||||
gammaGatedBetaSpectrum,
|
||||
histogramData,
|
||||
oldScatterSeries,
|
||||
newCToE,
|
||||
newEToC,
|
||||
} = res.result
|
||||
this.c2e = CToE
|
||||
this.e2c = EToC
|
||||
|
||||
|
@ -669,9 +693,27 @@ export default {
|
|||
|
||||
// 如果点击过reanalyze则渲染之前fitting的数据,如果没点Reanalyze,数据会在窗口关闭时删掉 20231101:xiao
|
||||
// todo 现在能谱数据没有缓存,刷新页面时也会获取到fitting的数据
|
||||
if(this.getCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName)) {
|
||||
this.setFirringResult(this.getCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName))
|
||||
return false;
|
||||
if (this.getCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName)) {
|
||||
this.setFirringResult(this.getCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName))
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 对人工交互的返回数据单独处理
|
||||
*/
|
||||
if (this.sampleData.dbName == 'man') {
|
||||
this.setFirringResult(res.result)
|
||||
if (newCToE) {
|
||||
const [paramA, paramB, paramC] = newCToE
|
||||
this.newCalibrationFuncModel = {
|
||||
paramA: Number(paramA).toPrecision(6),
|
||||
paramB: Number(paramB).toPrecision(6),
|
||||
paramC: Number(paramC).toPrecision(6),
|
||||
}
|
||||
}
|
||||
if (newEToC) {
|
||||
this.newE2C = newEToC
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
|
@ -723,7 +765,7 @@ export default {
|
|||
chartHeight: this.gammaEnergy.length,
|
||||
channelWidth: this.gammaChannelWidth,
|
||||
qcFileName,
|
||||
sampleFileName
|
||||
sampleFileName,
|
||||
},
|
||||
cancelToken
|
||||
)
|
||||
|
@ -894,13 +936,16 @@ export default {
|
|||
// 点击Reset Button 重置
|
||||
async handleReset() {
|
||||
this.$emit('isFitting', false)
|
||||
this.removeCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
|
||||
this.removeCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
|
||||
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
|
||||
this.list = []
|
||||
this.newE2C = []
|
||||
|
||||
// 按乔的要求增加请求reset的接口 20231211:xiao
|
||||
const res = await postAction('/spectrumAnalysis/resetButton?tabName=beta&sampleFileName='+this.newSampleData.inputFileName, {})
|
||||
const res = await postAction(
|
||||
'/spectrumAnalysis/resetButton?tabName=beta&sampleFileName=' + this.newSampleData.inputFileName,
|
||||
{}
|
||||
)
|
||||
|
||||
this.figureChartOption = this.oldChartOption
|
||||
|
||||
|
@ -918,11 +963,12 @@ export default {
|
|||
}
|
||||
try {
|
||||
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
|
||||
...this.list.length <= 0 ? this.newCalibrationFuncModel : [], // 如果list有数据则不传 C to E 表单数据 20231101:xiao
|
||||
...(this.list.length <= 0 ? this.newCalibrationFuncModel : []), // 如果list有数据则不传 C to E 表单数据 20231101:xiao
|
||||
sampleFileName: this.newSampleData.inputFileName,
|
||||
tabName: "beta",
|
||||
tabName: 'beta',
|
||||
// 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
|
||||
tempPoints: this.list.length > 0
|
||||
tempPoints:
|
||||
this.list.length > 0
|
||||
? this.list.map((item) => ({ x: item.channel, y: item.energy }))
|
||||
: this.oldScatterSeries,
|
||||
// tempPoints: this.isFirstFitting
|
||||
|
@ -934,10 +980,9 @@ export default {
|
|||
this.betaIsFitting = true
|
||||
this.$emit('isFitting', true) // 点击reAnalyze按钮,将isFirstFitting改为true 20231101:xiao
|
||||
|
||||
this.setCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||
this.setCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||
|
||||
this.setFirringResult(result)
|
||||
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
@ -1040,7 +1085,7 @@ export default {
|
|||
},
|
||||
removeCache(name) {
|
||||
this.$ls.remove(name) // 删除fitting之后缓存的数据 20231101:xiao
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
rectHeight() {
|
||||
|
|
|
@ -95,9 +95,24 @@
|
|||
<span>C to E : </span>
|
||||
<span>
|
||||
E =
|
||||
<a-input-number size="small" v-model="newCalibrationFuncModel.paramA" @change="newCalibrationFuncModelChange()"/> +
|
||||
<a-input-number size="small" v-model="newCalibrationFuncModel.paramB" @change="newCalibrationFuncModelChange()"/> *C +
|
||||
<a-input-number size="small" v-model="newCalibrationFuncModel.paramC" @change="newCalibrationFuncModelChange()"/> *C <sup>2</sup>
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-model="newCalibrationFuncModel.paramA"
|
||||
@change="newCalibrationFuncModelChange()"
|
||||
/>
|
||||
+
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-model="newCalibrationFuncModel.paramB"
|
||||
@change="newCalibrationFuncModelChange()"
|
||||
/>
|
||||
*C +
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-model="newCalibrationFuncModel.paramC"
|
||||
@change="newCalibrationFuncModelChange()"
|
||||
/>
|
||||
*C <sup>2</sup>
|
||||
</span>
|
||||
</p>
|
||||
<div class="func">
|
||||
|
@ -494,11 +509,11 @@ export default {
|
|||
sampleId,
|
||||
qcFileName,
|
||||
sampleFileName: inputFileName,
|
||||
fittingBtn: this.isFirstFitting
|
||||
fittingBtn: this.isFirstFitting,
|
||||
})
|
||||
|
||||
if (res.success) {
|
||||
const { CToE, EToC, gammaEnergy, gammaSpectrum, max, min, oldScatterSeries } = res.result
|
||||
const { CToE, EToC, gammaEnergy, gammaSpectrum, max, min, oldScatterSeries, newCToE, newEToC } = res.result
|
||||
|
||||
this.c2e = CToE
|
||||
this.e2c = EToC
|
||||
|
@ -530,9 +545,27 @@ export default {
|
|||
|
||||
// 如果点击过reanalyze则渲染之前fitting的数据,如果没点Reanalyze,数据会在窗口关闭时删掉 20231101:xiao
|
||||
// todo 现在能谱数据没有缓存,刷新页面时也会获取到fitting的数据
|
||||
if(this.getCache("CALIBRATION_GAMMA_"+this.newSampleData.inputFileName)) {
|
||||
this.setFirringResult(this.getCache("CALIBRATION_GAMMA_"+this.newSampleData.inputFileName))
|
||||
return false;
|
||||
if (this.getCache('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)) {
|
||||
this.setFirringResult(this.getCache('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName))
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 对人工交互的返回数据单独处理
|
||||
*/
|
||||
if (this.sampleData.dbName == 'man') {
|
||||
this.setFirringResult(res.result)
|
||||
if (newCToE) {
|
||||
const [paramA, paramB, paramC] = newCToE
|
||||
this.newCalibrationFuncModel = {
|
||||
paramA: Number(paramA).toPrecision(6),
|
||||
paramB: Number(paramB).toPrecision(6),
|
||||
paramC: Number(paramC).toPrecision(6),
|
||||
}
|
||||
}
|
||||
if (newEToC) {
|
||||
this.newE2C = newEToC
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
|
@ -655,13 +688,16 @@ export default {
|
|||
|
||||
// 点击Reset Button 重置
|
||||
async handleReset() {
|
||||
this.$ls.remove("CALIBRATION_GAMMA_"+this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
|
||||
this.$ls.remove('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
|
||||
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
|
||||
this.list = []
|
||||
this.newE2C = []
|
||||
|
||||
// 按乔的要求增加请求reset的接口 20231211:xiao
|
||||
const res = await postAction('/spectrumAnalysis/resetButton?tabName=gamma&sampleFileName='+ this.newSampleData.inputFileName, { })
|
||||
const res = await postAction(
|
||||
'/spectrumAnalysis/resetButton?tabName=gamma&sampleFileName=' + this.newSampleData.inputFileName,
|
||||
{}
|
||||
)
|
||||
|
||||
this.$emit('isFitting', false)
|
||||
|
||||
|
@ -680,11 +716,12 @@ export default {
|
|||
}
|
||||
try {
|
||||
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
|
||||
...this.list.length <= 0 ? this.newCalibrationFuncModel : [], // 如果list有数据则不传 C to E 表单数据 20231101:xiao
|
||||
...(this.list.length <= 0 ? this.newCalibrationFuncModel : []), // 如果list有数据则不传 C to E 表单数据 20231101:xiao
|
||||
sampleFileName: this.newSampleData.inputFileName,
|
||||
tabName: "gamma",
|
||||
tabName: 'gamma',
|
||||
// 如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
|
||||
tempPoints: this.list.length > 0
|
||||
tempPoints:
|
||||
this.list.length > 0
|
||||
? this.list.map((item) => ({ x: item.channel, y: item.energy }))
|
||||
: this.oldScatterSeries,
|
||||
|
||||
|
@ -692,20 +729,19 @@ export default {
|
|||
// ? this.oldScatterSeries
|
||||
// : this.list.map((item) => ({ x: item.channel, y: item.energy })),
|
||||
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
|
||||
fittingBtn : this.isFirstFitting
|
||||
fittingBtn: this.isFirstFitting,
|
||||
})
|
||||
if (success) {
|
||||
this.gammaIsFitting = true
|
||||
this.$emit('isFitting', true) // 点击reAnalyze按钮,将isFirstFitting改为true 20231101:xiao
|
||||
|
||||
this.setCache("CALIBRATION_GAMMA_"+this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||
this.setCache('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||
|
||||
this.setFirringResult(result)
|
||||
|
||||
// 通知Beta页清空数据
|
||||
this.$bus.$emit('betaRefresh', {})
|
||||
console.log("betaRefresh>>>");
|
||||
|
||||
console.log('betaRefresh>>>')
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
@ -805,7 +841,7 @@ export default {
|
|||
},
|
||||
removeCache(name) {
|
||||
this.$ls.remove(name) // 删除fitting之后缓存的数据 20231101:xiao
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<!-- 底部操作栏 -->
|
||||
<template slot="custom-footer">
|
||||
<a-space>
|
||||
<a-radio-group v-model="queryParam.dbName">
|
||||
<a-radio-group v-model="queryParam.dbName" @change="handleSourceChange">
|
||||
<a-radio value="auto">From Auto DB</a-radio>
|
||||
<a-radio value="man">From Interactive DB</a-radio>
|
||||
</a-radio-group>
|
||||
|
@ -162,7 +162,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
loadData(arg) {
|
||||
debugger
|
||||
//加载数据 若传入参数1则加载第一页的内容
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1
|
||||
|
@ -220,6 +219,12 @@ export default {
|
|||
})
|
||||
},
|
||||
|
||||
// 来源改变
|
||||
handleSourceChange() {
|
||||
console.log('%c [ ]-226', 'font-size:13px; background:pink; color:#bf2c9f;', this.queryParam.dbName)
|
||||
this.searchQuery()
|
||||
},
|
||||
|
||||
show() {
|
||||
this.visible = true
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user