fix:1 修改fitting逻辑解决计算错误问题;2 增加数据缓存,再次打开他弹窗回显上一次fitting结果
This commit is contained in:
parent
9e1377d5df
commit
fea099fe4f
|
@ -545,6 +545,12 @@ const newCalibrationFuncModel = {
|
||||||
export default {
|
export default {
|
||||||
mixins: [SampleDataMixin],
|
mixins: [SampleDataMixin],
|
||||||
components: { CustomChart, TitleOverBorder },
|
components: { CustomChart, TitleOverBorder },
|
||||||
|
props: {
|
||||||
|
isFirstFitting: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
|
|
||||||
|
@ -594,7 +600,7 @@ export default {
|
||||||
recalculateROICountsFor: [],
|
recalculateROICountsFor: [],
|
||||||
|
|
||||||
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
||||||
isFirstFitting: true,
|
// isFirstFitting: true,
|
||||||
isInverse: false, // 是否需要反算
|
isInverse: false, // 是否需要反算
|
||||||
betaIsFitting: false,
|
betaIsFitting: false,
|
||||||
}
|
}
|
||||||
|
@ -608,12 +614,14 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
const { sampleId = '', qcFileName } = this.newSampleData
|
// 增加sampleFileName参数 20231101:xiao
|
||||||
|
const { sampleId = '', qcFileName, sampleFileName = inputFileName } = this.newSampleData
|
||||||
try {
|
try {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
const res = await getAction('/spectrumAnalysis/viewBetaDetectorCalibration', {
|
const res = await getAction('/spectrumAnalysis/viewBetaDetectorCalibration', {
|
||||||
sampleId,
|
sampleId,
|
||||||
qcFileName,
|
qcFileName,
|
||||||
|
sampleFileName
|
||||||
})
|
})
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const { CToE, EToC, betaEnergy, gammaEnergy, gammaGatedBetaSpectrum, histogramData, oldScatterSeries } =
|
const { CToE, EToC, betaEnergy, gammaEnergy, gammaGatedBetaSpectrum, histogramData, oldScatterSeries } =
|
||||||
|
@ -623,7 +631,7 @@ export default {
|
||||||
|
|
||||||
this.oldScatterSeries = oldScatterSeries
|
this.oldScatterSeries = oldScatterSeries
|
||||||
this.count = oldScatterSeries.length
|
this.count = oldScatterSeries.length
|
||||||
this.isFirstFitting = true
|
// this.isFirstFitting = true
|
||||||
|
|
||||||
this.betaGammaChartOption.series.data = histogramData.map(({ b, g, c }) => [b, g, c])
|
this.betaGammaChartOption.series.data = histogramData.map(({ b, g, c }) => [b, g, c])
|
||||||
this.gammaEnergy = gammaEnergy
|
this.gammaEnergy = gammaEnergy
|
||||||
|
@ -644,6 +652,13 @@ export default {
|
||||||
this.figureChartOption.series[0].markPoint.data = oldScatterSeries.map(({ x, y }) => ({ xAxis: x, yAxis: y }))
|
this.figureChartOption.series[0].markPoint.data = oldScatterSeries.map(({ x, y }) => ({ xAxis: x, yAxis: y }))
|
||||||
|
|
||||||
this.oldChartOption = cloneDeep(this.figureChartOption)
|
this.oldChartOption = cloneDeep(this.figureChartOption)
|
||||||
|
|
||||||
|
// 如果点击过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;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
}
|
}
|
||||||
|
@ -861,6 +876,7 @@ export default {
|
||||||
|
|
||||||
// 点击Reset Button 重置
|
// 点击Reset Button 重置
|
||||||
handleReset() {
|
handleReset() {
|
||||||
|
this.removeCache("calibration-beta:"+this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
|
||||||
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
|
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
|
||||||
this.list = []
|
this.list = []
|
||||||
this.newE2C = []
|
this.newE2C = []
|
||||||
|
@ -880,7 +896,9 @@ export default {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
|
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
|
||||||
...this.newCalibrationFuncModel,
|
...this.list.length <= 0 ? this.newCalibrationFuncModel : [], // 如果list有数据则不传 C to E 表单数据 20231101:xiao
|
||||||
|
sampleFileName: this.newSampleData.inputFileName,
|
||||||
|
tabName: "beta",
|
||||||
// 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
|
// 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
|
||||||
tempPoints: this.list.length > 0
|
tempPoints: this.list.length > 0
|
||||||
? this.list.map((item) => ({ x: item.channel, y: item.energy }))
|
? this.list.map((item) => ({ x: item.channel, y: item.energy }))
|
||||||
|
@ -891,49 +909,15 @@ export default {
|
||||||
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
|
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.isFirstFitting = false
|
// this.isFirstFitting = false
|
||||||
this.betaIsFitting = true
|
this.betaIsFitting = true
|
||||||
this.$emit('isFitting', this.betaIsFitting)
|
this.$emit('isFitting', true) // 点击reAnalyze按钮,将isFirstFitting改为true 20231101:xiao
|
||||||
|
|
||||||
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
|
this.setCache("calibration-beta:"+this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||||
this.newE2C = EToC
|
|
||||||
this.newLineSeries = newLineSeries
|
|
||||||
|
|
||||||
if (tableWidgets) {
|
this.setFirringResult(result)
|
||||||
this.list = tableWidgets
|
|
||||||
}
|
|
||||||
// 反算时重新设置C to E 的值
|
|
||||||
if (CToE) {
|
|
||||||
const [paramA, paramB, paramC] = CToE
|
|
||||||
this.newCalibrationFuncModel = {
|
|
||||||
paramA: Number(paramA).toPrecision(6),
|
|
||||||
paramB: Number(paramB).toPrecision(6),
|
|
||||||
paramC: Number(paramC).toPrecision(6),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const energyValues = newLineSeries.map((item) => item.y)
|
|
||||||
|
|
||||||
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
|
||||||
|
|
||||||
const energyMax = Math.max(Math.max(...energyValues), prevMax)
|
|
||||||
const energyMin = Math.min(Math.min(...energyValues), prevMin)
|
|
||||||
|
|
||||||
const { min, max, interval } = splitAxis(energyMax, energyMin, 4)
|
|
||||||
|
|
||||||
this.figureChartOption.yAxis.max = max
|
|
||||||
this.figureChartOption.yAxis.min = min
|
|
||||||
this.figureChartOption.yAxis.interval = interval
|
|
||||||
|
|
||||||
this.figureChartOption.series[1].data = newLineSeries.map(({ x, y }) => [x, y])
|
|
||||||
if (newScatterSeriesData) {
|
|
||||||
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => {
|
|
||||||
return {
|
|
||||||
xAxis: x,
|
|
||||||
yAxis: y,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
|
@ -942,6 +926,49 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 封装 fitting后数据填充方法,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||||
|
setFirringResult(result){
|
||||||
|
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
|
||||||
|
this.newE2C = EToC
|
||||||
|
this.newLineSeries = newLineSeries
|
||||||
|
|
||||||
|
if (tableWidgets) {
|
||||||
|
this.list = tableWidgets
|
||||||
|
}
|
||||||
|
// 反算时重新设置C to E 的值
|
||||||
|
if (CToE) {
|
||||||
|
const [paramA, paramB, paramC] = CToE
|
||||||
|
this.newCalibrationFuncModel = {
|
||||||
|
paramA: Number(paramA).toPrecision(6),
|
||||||
|
paramB: Number(paramB).toPrecision(6),
|
||||||
|
paramC: Number(paramC).toPrecision(6),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const energyValues = newLineSeries.map((item) => item.y)
|
||||||
|
|
||||||
|
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
||||||
|
|
||||||
|
const energyMax = Math.max(Math.max(...energyValues), prevMax)
|
||||||
|
const energyMin = Math.min(Math.min(...energyValues), prevMin)
|
||||||
|
|
||||||
|
const { min, max, interval } = splitAxis(energyMax, energyMin, 4)
|
||||||
|
|
||||||
|
this.figureChartOption.yAxis.max = max
|
||||||
|
this.figureChartOption.yAxis.min = min
|
||||||
|
this.figureChartOption.yAxis.interval = interval
|
||||||
|
|
||||||
|
this.figureChartOption.series[1].data = newLineSeries.map(({ x, y }) => [x, y])
|
||||||
|
if (newScatterSeriesData) {
|
||||||
|
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => {
|
||||||
|
return {
|
||||||
|
xAxis: x,
|
||||||
|
yAxis: y,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 获取Figure Chart 最大值 和 最小值
|
// 获取Figure Chart 最大值 和 最小值
|
||||||
getFigureChartMaxAndMin() {
|
getFigureChartMaxAndMin() {
|
||||||
const [series0, series1] = this.figureChartOption.series
|
const [series0, series1] = this.figureChartOption.series
|
||||||
|
@ -985,6 +1012,15 @@ export default {
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
},
|
},
|
||||||
|
getCache(name){
|
||||||
|
return this.$ls.get(name)
|
||||||
|
},
|
||||||
|
setCache(name, data){
|
||||||
|
this.$ls.set(name, data)
|
||||||
|
},
|
||||||
|
removeCache(name){
|
||||||
|
this.$ls.remove(name) // 删除fitting之后缓存的数据 20231101:xiao
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rectHeight() {
|
rectHeight() {
|
||||||
|
|
|
@ -435,6 +435,12 @@ const newCalibrationFuncModel = {
|
||||||
export default {
|
export default {
|
||||||
mixins: [SampleDataMixin],
|
mixins: [SampleDataMixin],
|
||||||
components: { CustomChart, TitleOverBorder },
|
components: { CustomChart, TitleOverBorder },
|
||||||
|
props: {
|
||||||
|
isFirstFitting: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
|
|
||||||
|
@ -466,7 +472,7 @@ export default {
|
||||||
recalculateROICountsFor: [],
|
recalculateROICountsFor: [],
|
||||||
|
|
||||||
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
||||||
isFirstFitting: true,
|
// isFirstFitting: true,
|
||||||
isInverse: false, // 是否需要反算
|
isInverse: false, // 是否需要反算
|
||||||
gammaIsFitting: false,
|
gammaIsFitting: false,
|
||||||
}
|
}
|
||||||
|
@ -480,12 +486,16 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
const { sampleId = '', qcFileName } = this.newSampleData
|
console.log("isFirstFitting>>>"+this.isFirstFitting);
|
||||||
|
// 增加sampleFileName参数 20231101:xiao
|
||||||
|
const { sampleId = '', qcFileName, sampleFileName = inputFileName } = this.newSampleData
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
const res = await getAction('/spectrumAnalysis/viewGammaDetectorCalibration', {
|
const res = await getAction('/spectrumAnalysis/viewGammaDetectorCalibration', {
|
||||||
sampleId,
|
sampleId,
|
||||||
qcFileName,
|
qcFileName,
|
||||||
|
sampleFileName
|
||||||
})
|
})
|
||||||
|
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
@ -495,7 +505,7 @@ export default {
|
||||||
this.e2c = EToC
|
this.e2c = EToC
|
||||||
this.oldScatterSeries = oldScatterSeries
|
this.oldScatterSeries = oldScatterSeries
|
||||||
this.count = oldScatterSeries.length
|
this.count = oldScatterSeries.length
|
||||||
this.isFirstFitting = true
|
// this.isFirstFitting = true
|
||||||
|
|
||||||
const { max: _max, min: _min, interval: _interval } = splitAxis(max, min, 4)
|
const { max: _max, min: _min, interval: _interval } = splitAxis(max, min, 4)
|
||||||
|
|
||||||
|
@ -519,6 +529,13 @@ export default {
|
||||||
this.figureChartOption.series[0].markPoint.data = oldScatterSeries.map(({ x, y }) => ({ xAxis: x, yAxis: y }))
|
this.figureChartOption.series[0].markPoint.data = oldScatterSeries.map(({ x, y }) => ({ xAxis: x, yAxis: y }))
|
||||||
|
|
||||||
this.oldChartOption = cloneDeep(this.figureChartOption)
|
this.oldChartOption = cloneDeep(this.figureChartOption)
|
||||||
|
|
||||||
|
// 如果点击过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;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
}
|
}
|
||||||
|
@ -640,12 +657,13 @@ export default {
|
||||||
|
|
||||||
// 点击Reset Button 重置
|
// 点击Reset Button 重置
|
||||||
handleReset() {
|
handleReset() {
|
||||||
|
this.$ls.remove("calibration-gamma:"+this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
|
||||||
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
|
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
|
||||||
this.list = []
|
this.list = []
|
||||||
this.newE2C = []
|
this.newE2C = []
|
||||||
|
|
||||||
this.figureChartOption = cloneDeep(this.oldChartOption)
|
this.figureChartOption = cloneDeep(this.oldChartOption)
|
||||||
this.isFirstFitting = true
|
this.isFirstFitting = false
|
||||||
this.isInverse = false
|
this.isInverse = false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -657,8 +675,10 @@ export default {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
|
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
|
||||||
...this.newCalibrationFuncModel,
|
...this.list.length <= 0 ? this.newCalibrationFuncModel : [], // 如果list有数据则不传 C to E 表单数据 20231101:xiao
|
||||||
// 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
|
sampleFileName: this.newSampleData.inputFileName,
|
||||||
|
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.list.map((item) => ({ x: item.channel, y: item.energy }))
|
||||||
: this.oldScatterSeries,
|
: this.oldScatterSeries,
|
||||||
|
@ -669,47 +689,14 @@ export default {
|
||||||
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
|
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.isFirstFitting = false
|
// this.isFirstFitting = true
|
||||||
this.gammaIsFitting = false
|
this.gammaIsFitting = false
|
||||||
this.$emit('isFitting', this.gammaIsFitting)
|
this.$emit('isFitting', true) // 点击reAnalyze按钮,将isFirstFitting改为true 20231101:xiao
|
||||||
|
|
||||||
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
|
this.setCache("calibration-gamma:"+this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||||
this.newE2C = EToC
|
|
||||||
this.newLineSeries = newLineSeries
|
|
||||||
|
|
||||||
if (tableWidgets) {
|
this.setFirringResult(result)
|
||||||
this.list = tableWidgets
|
|
||||||
}
|
|
||||||
// 反算时重新设置C to E 的值
|
|
||||||
if (CToE) {
|
|
||||||
const [paramA, paramB, paramC] = CToE
|
|
||||||
this.newCalibrationFuncModel = {
|
|
||||||
paramA: Number(paramA).toPrecision(6),
|
|
||||||
paramB: Number(paramB).toPrecision(6),
|
|
||||||
paramC: Number(paramC).toPrecision(6),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const energyValues = newLineSeries.map((item) => item.y)
|
|
||||||
|
|
||||||
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
|
||||||
|
|
||||||
const energyMax = Math.max(Math.max(...energyValues), prevMax)
|
|
||||||
const energyMin = Math.min(Math.min(...energyValues), prevMin)
|
|
||||||
|
|
||||||
const { min, max, interval } = splitAxis(energyMax, energyMin, 4)
|
|
||||||
|
|
||||||
this.figureChartOption.yAxis.max = max
|
|
||||||
this.figureChartOption.yAxis.min = min
|
|
||||||
this.figureChartOption.yAxis.interval = interval
|
|
||||||
|
|
||||||
this.figureChartOption.series[1].data = newLineSeries.map(({ x, y }) => [x, y])
|
|
||||||
if (newScatterSeriesData) {
|
|
||||||
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => ({
|
|
||||||
xAxis: x,
|
|
||||||
yAxis: y,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
|
@ -718,6 +705,46 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 封装 fitting后数据填充方法,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||||
|
setFirringResult(result){
|
||||||
|
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
|
||||||
|
this.newE2C = EToC
|
||||||
|
this.newLineSeries = newLineSeries
|
||||||
|
|
||||||
|
if (tableWidgets) {
|
||||||
|
this.list = tableWidgets
|
||||||
|
}
|
||||||
|
// 反算时重新设置C to E 的值
|
||||||
|
if (CToE) {
|
||||||
|
const [paramA, paramB, paramC] = CToE
|
||||||
|
this.newCalibrationFuncModel = {
|
||||||
|
paramA: Number(paramA).toPrecision(6),
|
||||||
|
paramB: Number(paramB).toPrecision(6),
|
||||||
|
paramC: Number(paramC).toPrecision(6),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const energyValues = newLineSeries.map((item) => item.y)
|
||||||
|
|
||||||
|
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
||||||
|
|
||||||
|
const energyMax = Math.max(Math.max(...energyValues), prevMax)
|
||||||
|
const energyMin = Math.min(Math.min(...energyValues), prevMin)
|
||||||
|
|
||||||
|
const { min, max, interval } = splitAxis(energyMax, energyMin, 4)
|
||||||
|
|
||||||
|
this.figureChartOption.yAxis.max = max
|
||||||
|
this.figureChartOption.yAxis.min = min
|
||||||
|
this.figureChartOption.yAxis.interval = interval
|
||||||
|
|
||||||
|
this.figureChartOption.series[1].data = newLineSeries.map(({ x, y }) => [x, y])
|
||||||
|
if (newScatterSeriesData) {
|
||||||
|
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => ({
|
||||||
|
xAxis: x,
|
||||||
|
yAxis: y,
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 获取Figure Chart 最大值 和 最小值
|
// 获取Figure Chart 最大值 和 最小值
|
||||||
getFigureChartMaxAndMin() {
|
getFigureChartMaxAndMin() {
|
||||||
const [series0, series1] = this.figureChartOption.series
|
const [series0, series1] = this.figureChartOption.series
|
||||||
|
@ -761,6 +788,15 @@ export default {
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
},
|
},
|
||||||
|
getCache(name){
|
||||||
|
return this.$ls.get(name)
|
||||||
|
},
|
||||||
|
setCache(name, data){
|
||||||
|
this.$ls.set(name, data)
|
||||||
|
},
|
||||||
|
removeCache(name){
|
||||||
|
this.$ls.remove(name) // 删除fitting之后缓存的数据 20231101:xiao
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,10 +6,11 @@
|
||||||
class="beta-gamma-tool-of-calibration"
|
class="beta-gamma-tool-of-calibration"
|
||||||
:footer="null"
|
:footer="null"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
|
@cancel="handleExit"
|
||||||
>
|
>
|
||||||
<a-tabs :animated="false" v-model="currTab">
|
<a-tabs :animated="false" v-model="currTab">
|
||||||
<a-tab-pane tab="Gamma Detector Calibration" key="gamma">
|
<a-tab-pane tab="Gamma Detector Calibration" key="gamma">
|
||||||
<gamma-detector-calibration @isFitting="getFittingFlag_gamma" />
|
<gamma-detector-calibration @isFitting="getFittingFlag_gamma" :isFirstFitting="gammaEnergyValid"/>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane tab="Beta Detector Calibration" key="beta">
|
<a-tab-pane tab="Beta Detector Calibration" key="beta">
|
||||||
<beta-detector-calibration @isFitting="getFittingFlag_beta" />
|
<beta-detector-calibration @isFitting="getFittingFlag_beta" />
|
||||||
|
@ -69,7 +70,8 @@ export default {
|
||||||
checkDet: false,
|
checkDet: false,
|
||||||
},
|
},
|
||||||
betaEnergyValid: false,
|
betaEnergyValid: false,
|
||||||
gammaEnergyValid: true,
|
gammaEnergyValid: false,
|
||||||
|
isReanlyze: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -88,9 +90,15 @@ export default {
|
||||||
this.betaEnergyValid = val
|
this.betaEnergyValid = val
|
||||||
},
|
},
|
||||||
getFittingFlag_gamma(val) {
|
getFittingFlag_gamma(val) {
|
||||||
|
console.log("zhiqian>>>"+this.gammaEnergyValid);
|
||||||
this.gammaEnergyValid = val
|
this.gammaEnergyValid = val
|
||||||
|
console.log("zhihou>>>"+this.gammaEnergyValid);
|
||||||
},
|
},
|
||||||
handleReAnalyse() {
|
handleReAnalyse() {
|
||||||
|
// todo 1.fitting之后才能点击; 2.isReAnalyze需要缓存
|
||||||
|
if(!this.gammaEnergyValid){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const regExp = /^([A-Z]{1,}\d{1,})_/
|
const regExp = /^([A-Z]{1,}\d{1,})_/
|
||||||
const regMatched = this.newSampleData.inputFileName.match(regExp)
|
const regMatched = this.newSampleData.inputFileName.match(regExp)
|
||||||
const currStationName = regMatched[1]
|
const currStationName = regMatched[1]
|
||||||
|
@ -140,13 +148,19 @@ export default {
|
||||||
})
|
})
|
||||||
this.$emit('sendXeData', res.result.XeData)
|
this.$emit('sendXeData', res.result.XeData)
|
||||||
this.$message.success('Analyse Success!')
|
this.$message.success('Analyse Success!')
|
||||||
this.visible = false
|
this.isReanlyze = true
|
||||||
|
this.handleExit()
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleExit() {
|
handleExit() {
|
||||||
|
this.gammaEnergyValid = this.isReanlyze
|
||||||
|
console.log("exit>>>this.isReanlyze>>>"+this.isReanlyze);
|
||||||
|
if(!this.isReanlyze && this.$ls.get("calibration-gamma:"+this.newSampleData.inputFileName)){
|
||||||
|
this.$ls.remove("calibration-gamma:"+this.newSampleData.inputFileName) // 如果没有点击ReANalyze,删除fitting之后缓存的数据 20231101:xiao
|
||||||
|
}
|
||||||
this.visible = false
|
this.visible = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user