fix:reviewModal, gamma 分析和 interactive讲请求不同的接口,如果从 gamma 分析页面将请求另外的接口

This commit is contained in:
orgin 2023-12-20 13:51:53 +08:00
parent 92b8b33c9b
commit 6e8f8baf00
2 changed files with 26 additions and 10 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<custom-modal v-model="visible" :width="1280" title="Nuclide Review" :footer="null" destroy-on-close> <custom-modal v-model="visible" :width="1280" title="Nuclide Review" :footer="null" @close="handleCancel">
<a-spin :spinning="isLoading"> <a-spin :spinning="isLoading">
<div class="nuclide-review-search"> <div class="nuclide-review-search">
<span @click="handleNuclideChange('prev')">&lt;</span> <span @click="handleNuclideChange('prev')">&lt;</span>
@ -163,6 +163,10 @@ export default {
nuclide: { nuclide: {
type: String, type: String,
}, },
page: {
type: String,
default: 'AnalyzeInteractiveToolModal'
},
}, },
data() { data() {
this.columns = columns this.columns = columns
@ -267,7 +271,12 @@ export default {
try { try {
this.isLoading = true this.isLoading = true
const { sampleId, inputFileName: fileName } = this.sampleData const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/nuclideReview', { let url = '/gamma/nuclideReview'
// 20231219:xiao
if(this.page === 'gamma-analysis'){
url = '/gamma/nuclideReviewGamma'
}
const { success, result, message } = await getAction(url, {
sampleId: sampleId, sampleId: sampleId,
channel: this.channel, channel: this.channel,
fileName, fileName,
@ -331,7 +340,12 @@ export default {
try { try {
this.isLoading = true this.isLoading = true
const { sampleId, inputFileName } = this.sampleData const { sampleId, inputFileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/changeNuclide', { let url = '/gamma/changeNuclide'
// 20231219:xiao
if(this.page === 'gamma-analysis'){
url = '/gamma/changeNuclideGamma'
}
const { success, result, message } = await getAction(url, {
sampleId, sampleId,
nuclideName: this.currNuclide, nuclideName: this.currNuclide,
fileName: inputFileName, fileName: inputFileName,

View File

@ -87,6 +87,7 @@
:sampleId="sample.sampleId" :sampleId="sample.sampleId"
:channel="currChannel" :channel="currChannel"
:nuclide="nuclideReview.nuclide" :nuclide="nuclideReview.nuclide"
:page="`gamma-analysis`"
/> />
<compare-file-list-modal v-model="compareFileListModalVisible" @fileSelect="handleFileSelect" /> <compare-file-list-modal v-model="compareFileListModalVisible" @fileSelect="handleFileSelect" />
@ -392,7 +393,7 @@ export default {
counts: rightCounts, counts: rightCounts,
} = this.getEnergyAndCountsByXAxis(rightAxis) } = this.getEnergyAndCountsByXAxis(rightAxis)
this.setChartBottomTitle(rightChannel, rightEnergy, rightCounts) this.setChartBottomTitle(rightChannel, rightEnergy, rightCounts)
this.getSelPosNuclide(rightChannel) this.getSelPosNuclide(rightChannel, rightEnergy)
break break
case 'ArrowLeft': case 'ArrowLeft':
if (markLineXAxis <= this.xAxisMin) { if (markLineXAxis <= this.xAxisMin) {
@ -412,7 +413,7 @@ export default {
counts: leftCounts, counts: leftCounts,
} = this.getEnergyAndCountsByXAxis(leftAxis) } = this.getEnergyAndCountsByXAxis(leftAxis)
this.setChartBottomTitle(leftChannel, leftEnergy, leftCounts) this.setChartBottomTitle(leftChannel, leftEnergy, leftCounts)
this.getSelPosNuclide(leftChannel) this.getSelPosNuclide(leftChannel, leftEnergy)
break break
} }
}, },
@ -972,7 +973,7 @@ export default {
const { channel, energy, counts } = this.getEnergyAndCountsByXAxis(xAxis) const { channel, energy, counts } = this.getEnergyAndCountsByXAxis(xAxis)
this.setChartBottomTitle(channel, energy, counts) this.setChartBottomTitle(channel, energy, counts)
this.getSelPosNuclide(channel) this.getSelPosNuclide(channel, energy)
} }
}, },
@ -1012,17 +1013,18 @@ export default {
}, },
// Nuclide Library // Nuclide Library
async getSelPosNuclide(channel) { async getSelPosNuclide(channel, energy) {
this.currChannel = channel this.currChannel = channel
try { try {
this.isLoadingNuclide = true this.isLoadingNuclide = true
const { sampleId, inputFileName: fileName } = this.sample const { sampleId, inputFileName: fileName } = this.sample
const { success, result, message } = await getAction('/gamma/getSelPosNuclide', { const { success, result, message } = await getAction('/gamma/getGammaSelPosNuclide', {
sampleId, sampleId,
channel, channel,
fileName, fileName,
energy
}) })
if (success) { if (success) {
const { possible } = result const { possible } = result
@ -1126,7 +1128,7 @@ export default {
if (centroid > prevChannel) { if (centroid > prevChannel) {
const energy = this.getEnergyByChannel(centroid) const energy = this.getEnergyByChannel(centroid)
this.setMarkLineXAxis(this.isEnergy ? energy : centroid, i) this.setMarkLineXAxis(this.isEnergy ? energy : centroid, i)
this.getSelPosNuclide(centroid) this.getSelPosNuclide(centroid, energy)
const { counts } = this.getEnergyAndCountsByXAxis(this.isEnergy ? energy : centroid) const { counts } = this.getEnergyAndCountsByXAxis(this.isEnergy ? energy : centroid)
this.setChartBottomTitle(centroid, energy, counts) this.setChartBottomTitle(centroid, energy, counts)
return return
@ -1138,7 +1140,7 @@ export default {
if (Math.round(centroid) < prevChannel) { if (Math.round(centroid) < prevChannel) {
const energy = this.getEnergyByChannel(centroid) const energy = this.getEnergyByChannel(centroid)
this.setMarkLineXAxis(this.isEnergy ? energy : centroid, i) this.setMarkLineXAxis(this.isEnergy ? energy : centroid, i)
this.getSelPosNuclide(centroid) this.getSelPosNuclide(centroid, energy)
const { counts } = this.getEnergyAndCountsByXAxis(this.isEnergy ? energy : centroid) const { counts } = this.getEnergyAndCountsByXAxis(this.isEnergy ? energy : centroid)
this.setChartBottomTitle(centroid, energy, counts) this.setChartBottomTitle(centroid, energy, counts)
return return