From 18f343d89943b9060a8c07d228dcd0de7dbd0c59 Mon Sep 17 00:00:00 2001
From: xiaoguangbin
Date: Sat, 28 Oct 2023 17:36:02 +0800
Subject: [PATCH] =?UTF-8?q?fix:Beta=20=E7=9A=84energy=20calibration?=
=?UTF-8?q?=E7=9A=84=E6=93=8D=E4=BD=9C=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/BetaDetectorCalibration.vue | 38 +++++++++++++++----
1 file changed, 30 insertions(+), 8 deletions(-)
diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/BetaDetectorCalibration.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/BetaDetectorCalibration.vue
index c098dba..1e00d3a 100644
--- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/BetaDetectorCalibration.vue
+++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/BetaDetectorCalibration.vue
@@ -128,9 +128,9 @@
C to E :
E =
- +
- *C +
- *C 2
+ +
+ *C +
+ *C 2
@@ -784,7 +784,12 @@ export default {
channel,
energy,
})
-
+
+ // add之后 需要清空chart黄色的线 20231028:Xiao
+ if(this.figureChartOption.series[1].data) {
+ this.figureChartOption.series[1].data = []
+ }
+
this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy })
const { min, max } = this.getFigureChartMaxAndMin()
@@ -808,6 +813,19 @@ export default {
this.isInverse = true
},
+ // 输入框发生变化
+ newCalibrationFuncModelChange() {
+ // 输入内容的时候 需要清空table数据 20231028:Xiao
+ this.list = []
+ // 需要清空chart黄色的线 20231028:Xiao
+ if(this.figureChartOption.series[1].data) {
+ this.figureChartOption.series[1].data = []
+ }
+ if(this.figureChartOption.series[1].markPoint.data) {
+ this.figureChartOption.series[1].markPoint.data = []
+ }
+ },
+
// 删除表格里的单项
handleDel(index) {
const willDelItem = this.list.splice(index, 1)[0]
@@ -857,15 +875,19 @@ export default {
// 点击Fitting按钮执行重新计算
async handleFitting() {
const hasEmpty = Object.entries(this.newCalibrationFuncModel).some(([_, v]) => !v)
- if (hasEmpty) {
+ if (hasEmpty && this.list.length < 3) {
return
}
try {
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
...this.newCalibrationFuncModel,
- tempPoints: this.isFirstFitting
- ? this.oldScatterSeries
- : this.list.map((item) => ({ x: item.channel, y: item.energy })),
+ // 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
+ tempPoints: this.list.length > 0
+ ? this.list.map((item) => ({ x: item.channel, y: item.energy }))
+ : this.oldScatterSeries,
+ // tempPoints: this.isFirstFitting
+ // ? this.oldScatterSeries
+ // : this.list.map((item) => ({ x: item.channel, y: item.energy })),
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
})
if (success) {