diff --git a/src/components/CustomChart/index.vue b/src/components/CustomChart/index.vue
index c38f28c..8dac754 100644
--- a/src/components/CustomChart/index.vue
+++ b/src/components/CustomChart/index.vue
@@ -6,7 +6,7 @@ import * as echarts from 'echarts'
import 'echarts-gl'
const events = ['click', 'brushEnd']
-const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick']
+const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick', 'contextmenu']
export default {
props: {
option: {
diff --git a/src/views/spectrumAnalysis/beta-gamma-analysis.vue b/src/views/spectrumAnalysis/beta-gamma-analysis.vue
index 7d5f098..e87c043 100644
--- a/src/views/spectrumAnalysis/beta-gamma-analysis.vue
+++ b/src/views/spectrumAnalysis/beta-gamma-analysis.vue
@@ -251,7 +251,6 @@ export default {
if (success) {
this.sampleDetail = result
this.changeChartByType('sample')
- this.isLoading = false
this.$emit('getFiles', {
detFileName: result.detBg.fileName,
gasFileName: result.gasBg.fileName,
@@ -262,6 +261,8 @@ export default {
}
} catch (error) {
console.error(error)
+ } finally {
+ this.isLoading = false
}
},
async getSampleDetail_file() {
@@ -323,7 +324,6 @@ export default {
histogramDataDList, // 左侧 Beta-Gamma Spectrum: Sample 图表的3D部分
Boundary, // 左侧2d图表的矩形
- XeData, // 右下角Result Display
spectrumData,
AcqTimeBtn, // QC Flags 相关
@@ -333,6 +333,10 @@ export default {
GasBgBtn, // QC Flags 相关
DetBgBtn, // QC Flags 相关
} = this.sampleDetail[this.spectraType]
+ const {
+ XeData, // 右下角Result Display
+ savedAnalysisResult,
+ } = this.sampleDetail
this.spectrumData = spectrumData
@@ -348,9 +352,9 @@ export default {
this.betaProjectedData = betaProjectedData
this.betaEnergyData = betaEnergyData
- this.resultDisplay = XeData
+ this.resultDisplay = this.resultDisplay.length > 0 ? this.resultDisplay : XeData
- this.$emit('sendInfo', this.resultDisplay, this.spectrumData.stationCode)
+ this.$emit('sendInfo', this.resultDisplay, this.spectrumData.stationCode, savedAnalysisResult)
this.qcFlags = {
AcqTimeBtn,
@@ -432,6 +436,7 @@ export default {
watch: {
sample: {
handler(newVal, oldVal) {
+ this.resultDisplay = []
if (newVal.sampleId) {
this.getSampleDetail()
} else {
@@ -443,8 +448,8 @@ export default {
},
analyseCurrentSpectrum: {
handler(newVal, oldVal) {
- this.currResultDisplay = newVal.XeData
- this.resultDisplay = newVal.XeData
+ // this.currResultDisplay = newVal.XeData
+ this.resultDisplay = newVal.XeData || []
},
immediate: true,
deep: true,
diff --git a/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue b/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue
index 0315866..5b3bd3f 100644
--- a/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue
+++ b/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue
@@ -24,8 +24,8 @@
@brushEnd="handleBrushEnd"
/>
Cancel
@@ -181,7 +181,9 @@
@@ -461,13 +463,21 @@ export default {
model: cloneDeep(nuclideIdentifyModal),
currChannel: undefined, // 当currChannel前选中的channel
+
+ channel_1: undefined, // 用于Fit Peaks And Baseline Modal的道值
+ channel_2: undefined,
+ isInsertPeak: false, // 是否是插入Peak
+
selectedTableItem: undefined, // 当前选中的表格项
isModifying: false, // 正在修改控制点
isFitting: false, // 正在进行Fit操作
firstFittingChannel: null, // Fit操作时点击的第一个channel
+ isAccepting: false,
+ isReploting: false,
- operationStack: [] // 操作记录
+ operationStack: [], // 操作记录
+ replotNeeded: false
}
},
created() {
@@ -517,25 +527,10 @@ export default {
this.energy = energy
this.BaseCtrls = BaseCtrls
this.FitBaseLine = FitBaseLine
+ this.barChart = barChart
- const series = []
-
- // 推入BaseLine
- series.push(this.buildBaseLine(channelBaseLineChart))
-
- // 推入Count
- series.push(this.buildCountLine(channelCountChart))
-
- // 推入Peak
- series.push(...this.buildPeaks(channelPeakChart))
-
- // 推入基线控制点
- series.push(this.buildCtrlPoint(channelBaseCPChart))
-
- this.thumbnailOption.series = this.buildBarChart(barChart)
-
+ this.setChartOption(channelBaseLineChart, channelCountChart, channelPeakChart, channelBaseCPChart, barChart)
this.list = table
- this.option.series = series
} else {
this.$message.error(message)
}
@@ -544,11 +539,32 @@ export default {
}
},
+ setChartOption(baseLine, count, peaks, baseCP, bar) {
+ const series = []
+
+ // 推入BaseLine
+ series.push(this.buildBaseLine(baseLine))
+
+ // 推入Count
+ series.push(this.buildCountLine(count))
+
+ // 推入Peak
+ series.push(...this.buildPeaks(peaks))
+
+ // 推入基线控制点
+ series.push(this.buildCtrlPoint(baseCP))
+
+ this.thumbnailOption.series = this.buildBarChart(bar)
+
+ this.option.series = series
+ },
+
reset() {
this.currChannel = undefined
this.btnGroupType = 1
this.opts.notMerge = false
this.isFitting = false
+ this.replotNeeded = false
this.$nextTick(() => {
this.option.brush = { toolbox: [] }
this.selectedKeys = []
@@ -597,13 +613,12 @@ export default {
}
}
- const selectedRow = this.list[index]
-
- this.selectedKeys = [selectedRow.index]
-
- this.getSelPosNuclide(selectedRow)
-
- this.selectedTableItem = selectedRow
+ if (this.list.length) {
+ const selectedRow = this.list[index]
+ this.selectedKeys = [selectedRow.index]
+ this.getSelPosNuclide(selectedRow)
+ this.selectedTableItem = selectedRow
+ }
// 如果点击了Fit按钮
if (this.isFitting) {
@@ -636,6 +651,9 @@ export default {
return
}
+ this.channel_1 = left
+ this.channel_2 = right
+ this.isInsertPeak = false
this.fitPeaksAndBaselineModalVisible = true
this.isFitting = false
@@ -737,7 +755,10 @@ export default {
return
}
+ this.channel_1 = this.currChannel
+
this.fitPeaksAndBaselineModalVisible = true
+ this.isInsertPeak = true
},
// 点击 Fit Peak XXX 弹窗中的 Peaks 按钮
@@ -765,47 +786,32 @@ export default {
this.channelPeakChart = channelPeakChart
this.channelBaseLineChart = channelBaseLineChart
+ this.barChart = barChart
- const series = []
-
- // 推入BaseLine
- series.push(this.buildBaseLine(channelBaseLineChart))
-
- // 推入旧的Count
- series.push(this.buildCountLine(channelCountChart))
-
- // 推入Peak
- series.push(...this.buildPeaks(channelPeakChart))
-
- // 推入旧的基线控制点
- series.push(this.buildCtrlPoint(channelBaseCPChart))
-
- this.thumbnailOption.series = this.buildBarChart(barChart)
-
+ this.setChartOption(
+ channelBaseLineChart,
+ this.channelCountChart,
+ channelPeakChart,
+ this.channelBaseCPChart,
+ barChart
+ )
this.list = table
- this.option.series = series
},
// 点击 Fit Peak XXX 弹窗中的 Cancel 按钮
handleCancelSuccess(result) {
const { channelPeakChart, table } = result
this.channelPeakChart = channelPeakChart
- const series = []
- // 推入旧的BaseLine
- series.push(this.buildBaseLine(this.channelBaseLineChart))
-
- // 推入旧的Count
- series.push(this.buildCountLine(this.channelCountChart))
-
- // 推入Peak
- series.push(...this.buildPeaks(channelPeakChart))
-
- // 推入旧的基线控制点
- series.push(this.buildCtrlPoint(this.channelBaseCPChart))
+ this.setChartOption(
+ this.channelBaseLineChart,
+ this.channelCountChart,
+ channelPeakChart,
+ this.channelBaseCPChart,
+ this.barChart
+ )
this.list = table
- this.option.series = series
},
// 删除
@@ -1022,6 +1028,7 @@ export default {
if (this.btnGroupType == 1) {
this.btnGroupType = 2
this.baseCtrls_Copy = cloneDeep(this.BaseCtrls)
+ this.replotNeeded = false
// 供编辑的白色基线
const baseLineEditSeries = buildLineSeries(
@@ -1042,7 +1049,10 @@ export default {
else {
this.btnGroupType = 1
this.opts.notMerge = true
- this.option.series.splice(this.option.series.length - 1, 1) // 去掉白色的基线副本
+ const baseLineEditSeries = findSeriesByName(this.option.series, 'BaseLine_Edit')
+ const index = this.option.series.findIndex(item => item == baseLineEditSeries)
+ this.option.series.splice(index, 1)
+
this.clearRect()
const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine')
@@ -1051,6 +1061,8 @@ export default {
const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point')
baseLineCP.data = this.buildCPPointData(this.channelBaseCPChart)
+ this.redrawPeaks(this.channelPeakChart)
+
this.$nextTick(() => {
this.resetChartOpts()
})
@@ -1090,6 +1102,7 @@ export default {
// 重新生成基线
redrawBaseLine() {
+ this.replotNeeded = true
try {
console.time('updateBaseLine')
const res = updateBaseLine(JSON.stringify(this.baseCtrls_Copy))
@@ -1105,6 +1118,14 @@ export default {
}
},
+ // 重绘Peaks
+ redrawPeaks(peakList) {
+ this.option.series = this.option.series.filter(item => {
+ return !item.name.includes('Peak_')
+ })
+ this.option.series.push(...this.buildPeaks(peakList))
+ },
+
/**
* 设置小方块可拖拽
*/
@@ -1238,26 +1259,57 @@ export default {
},
// 将原先的基线和控制点移动到新位置
- handleReplot() {
- const { xctrl, yctrl, yslope, baseline } = this.baseCtrls_Copy
- const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine')
- baseLineSeries.data = baseline.map((val, index) => [index + 1, val])
+ async handleReplot() {
+ if (!this.replotNeeded) {
+ return
+ }
+ try {
+ const { inputFileName: fileName } = this.sampleData
+ this.isReploting = true
+ const { success, result, message } = await postAction('/gamma/replotBaseLine', {
+ ...this.baseCtrls_Copy,
+ fileName,
+ replotNeeded: this.replotNeeded
+ })
+ if (success) {
+ const { chartData, peakSet, shapeData } = result
- const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point')
- // 第一个控制点(因为第一个和最后一个不会被删除)
- const firstCP = this.channelBaseCPChart[0]
- const { color, size } = firstCP
- const baseCPPoints = xctrl.map((xAxis, index) => {
- return {
- size,
- color,
- point: {
- x: xAxis,
- y: yctrl[index]
- }
+ const { xctrl, yctrl, yslope, baseline } = this.baseCtrls_Copy
+ const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine')
+ baseLineSeries.data = baseline.map((val, index) => [index + 1, val])
+
+ const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point')
+ // 第一个控制点(因为第一个和最后一个不会被删除)
+ const firstCP = this.channelBaseCPChart[0]
+ const { color, size } = firstCP
+ const baseCPPoints = xctrl.map((xAxis, index) => {
+ return {
+ size,
+ color,
+ point: {
+ x: xAxis,
+ y: yctrl[index]
+ }
+ }
+ })
+ baseLineCP.data = this.buildCPPointData(baseCPPoints)
+
+ this.opts.notMerge = true
+ this.redrawPeaks(peakSet)
+ this.$nextTick(() => {
+ this.resetChartOpts()
+ })
+
+ this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
+ this.replotNeeded = false
+ } else {
+ this.$message.error(message)
}
- })
- baseLineCP.data = this.buildCPPointData(baseCPPoints)
+ } catch (error) {
+ console.error(error)
+ } finally {
+ this.isReploting = false
+ }
},
/**
@@ -1278,31 +1330,75 @@ export default {
},
// 确定对Baseline Control Points 的操作
- handleAccept() {
- this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
- const { baseline, xctrl, yctrl } = this.BaseCtrls
- this.channelBaseLineChart.pointlist = baseline.map((val, index) => {
- return {
- x: index + 1,
- y: val
+ async handleAccept() {
+ // this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
+ // const { baseline, xctrl, yctrl } = this.BaseCtrls
+ // this.channelBaseLineChart.pointlist = baseline.map((val, index) => {
+ // return {
+ // x: index + 1,
+ // y: val
+ // }
+ // })
+
+ // this.channelBaseCPChart = xctrl.map((val, index) => {
+ // return {
+ // color: this.channelBaseCPChart[0].color,
+ // name: index.toString(),
+ // point: {
+ // x: val,
+ // y: yctrl[index]
+ // },
+ // size: 4
+ // }
+ // })
+
+ const { inputFileName: fileName } = this.sampleData
+
+ try {
+ this.isAccepting = true
+ const { success, result, message } = await postAction('/gamma/acceptBaseLine', {
+ ...this.baseCtrls_Copy,
+ fileName
+ })
+ if (success) {
+ this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
+
+ const {
+ allData,
+ barChart,
+ channelBaseLineChart,
+ peakSet,
+ shadowChannelChart,
+ shadowEnergyChart,
+ shapeChannelData,
+ shapeData,
+ shapeEnergyData
+ } = result
+
+ this.channelBaseLineChart = channelBaseLineChart
+ this.channelPeakChart = peakSet
+ this.shadowChannelChart = shadowChannelChart
+ this.channelBaseCPChart = shapeChannelData
+ this.barChart = barChart
+
+ this.btnGroupType = 1
+ this.opts.notMerge = true
+ this.clearRect()
+
+ this.setChartOption(channelBaseLineChart, this.channelCountChart, peakSet, this.channelBaseCPChart, barChart)
+ this.$nextTick(() => {
+ this.resetChartOpts()
+ })
+
+ this.$bus.$emit('accept', result)
+ } else {
+ this.$message.error(message)
}
- })
-
- this.channelBaseCPChart = xctrl.map((val, index) => {
- return {
- color: this.channelBaseCPChart[0].color,
- name: index.toString(),
- point: {
- x: val,
- y: yctrl[index]
- },
- size: 4
- }
- })
-
- this.handleSwitchOperation()
-
- this.$bus.$emit('accept')
+ } catch (error) {
+ console.error(error)
+ } finally {
+ this.isAccepting = false
+ }
},
// 右下角添加当前选中的nuclide
diff --git a/src/views/spectrumAnalysis/components/Modals/ArrRrrModal.vue b/src/views/spectrumAnalysis/components/Modals/ArrRrrModal.vue
index ba28f60..64ff88d 100644
--- a/src/views/spectrumAnalysis/components/Modals/ArrRrrModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/ArrRrrModal.vue
@@ -52,16 +52,43 @@ export default {
url = '/spectrumAnalysis/viewRRR'
break
}
+ console.log(this.extraData)
try {
this.content = ''
this.isLoading = true
- const { sampleId, inputFileName: fileName } = this.sampleData
- const method = this.type == 4? postAction : getAction
- const res = await method(url, {
+ console.log(this.sampleData)
+ const {
sampleId,
- fileName,
- ...this.extraData,
- })
+ inputFileName: fileName,
+ dbName,
+ detFileName,
+ gasFileName,
+ qcFileName,
+ sampleFileName,
+ } = this.sampleData
+ // const method = this.type == 4 ? postAction : getAction
+ let res = null
+ if (this.type == 4) {
+ let params = {
+ dbName,
+ sampleId,
+ sampleData: this.extraData.sampleData,
+ gasBgData: this.extraData.GasBgData,
+ detBgData: this.extraData.DetBgData,
+ qcData: this.extraData.QCData,
+ sampleFileName,
+ gasFileName,
+ detFileName,
+ qcFileName,
+ }
+ res = await postAction(url, params)
+ } else {
+ res = await getAction(url, {
+ sampleId,
+ fileName,
+ ...this.extraData,
+ })
+ }
if (typeof res == 'string') {
this.content = res
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 9d16ab4..c098dba 100644
--- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/BetaDetectorCalibration.vue
+++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/BetaDetectorCalibration.vue
@@ -596,6 +596,7 @@ export default {
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
isFirstFitting: true,
isInverse: false, // 是否需要反算
+ betaIsFitting: false,
}
},
created() {
@@ -869,6 +870,8 @@ export default {
})
if (success) {
this.isFirstFitting = false
+ this.betaIsFitting = true
+ this.$emit('isFitting', this.betaIsFitting)
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
this.newE2C = EToC
diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue
index 2fc9bb9..aa1ec94 100644
--- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue
+++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue
@@ -467,6 +467,7 @@ export default {
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
isFirstFitting: true,
isInverse: false, // 是否需要反算
+ gammaIsFitting: false,
}
},
created() {
@@ -646,6 +647,8 @@ export default {
})
if (success) {
this.isFirstFitting = false
+ this.gammaIsFitting = false
+ this.$emit('isFitting', this.gammaIsFitting)
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
this.newE2C = EToC
diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue
index df6f889..eb43c15 100644
--- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue
+++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue
@@ -9,19 +9,19 @@
>
-
+
-
+
-
+