修改Energy Calibration交互逻辑

This commit is contained in:
qiaoqinzheng 2023-10-28 17:20:58 +08:00
parent 092da52363
commit 95ba9eed73

View File

@ -95,9 +95,9 @@
<span>C to E : </span> <span>C to E : </span>
<span> <span>
E = E =
<a-input-number size="small" v-model="newCalibrationFuncModel.paramA" /> + <a-input-number size="small" v-model="newCalibrationFuncModel.paramA" @change="newCalibrationFuncModelChange()"/> +
<a-input-number size="small" v-model="newCalibrationFuncModel.paramB" /> *C + <a-input-number size="small" v-model="newCalibrationFuncModel.paramB" @change="newCalibrationFuncModelChange()"/> *C +
<a-input-number size="small" v-model="newCalibrationFuncModel.paramC" /> *C <sup>2</sup> <a-input-number size="small" v-model="newCalibrationFuncModel.paramC" @change="newCalibrationFuncModelChange()"/> *C <sup>2</sup>
</span> </span>
</p> </p>
<div class="func"> <div class="func">
@ -154,6 +154,7 @@ import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
import { isNullOrUndefined } from '@/utils/util' import { isNullOrUndefined } from '@/utils/util'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin' import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import { f } from 'vue-area-linkage'
const initialGammaSpectrumChartOption = { const initialGammaSpectrumChartOption = {
grid: { grid: {
@ -571,6 +572,11 @@ export default {
energy, energy,
}) })
// add chart线 20231028Xiao
if(this.figureChartOption.series[1].data) {
this.figureChartOption.series[1].data = []
}
this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy }) this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy })
const { min, max } = this.getFigureChartMaxAndMin() const { min, max } = this.getFigureChartMaxAndMin()
@ -593,6 +599,18 @@ export default {
this.isInverse = true this.isInverse = true
}, },
//
newCalibrationFuncModelChange(val,a) {
// table 20231028Xiao
this.list = []
// chart线 20231028Xiao
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) { handleDel(index) {
@ -634,15 +652,20 @@ export default {
// Fitting // Fitting
async handleFitting() { async handleFitting() {
const hasEmpty = Object.entries(this.newCalibrationFuncModel).some(([_, v]) => !v) const hasEmpty = Object.entries(this.newCalibrationFuncModel).some(([_, v]) => !v)
if (hasEmpty) { if (hasEmpty && this.list.length < 3) {
return return
} }
try { try {
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', { const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
...this.newCalibrationFuncModel, ...this.newCalibrationFuncModel,
tempPoints: this.isFirstFitting // 20231028Xiao
? this.oldScatterSeries 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,
// tempPoints: this.isFirstFitting
// ? this.oldScatterSeries
// : this.list.map((item) => ({ x: item.channel, y: item.energy })),
count: this.isFirstFitting || !this.isInverse ? undefined : this.count, count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
}) })
if (success) { if (success) {