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 e40ddc7..73283c2 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,24 @@
@@ -546,15 +561,15 @@ const newCalibrationFuncModel = {
export default {
mixins: [SampleDataMixin],
components: { CustomChart, TitleOverBorder },
- props: {
+ props: {
isFirstFitting: {
type: Boolean,
required: false,
},
- isBetaReset:{
+ isBetaReset: {
type: Boolean,
required: false,
- }
+ },
},
data() {
this.columns = columns
@@ -614,12 +629,16 @@ export default {
this.$bus.$on('betaRefresh', this.getData)
this.getData()
},
+ beforeDestroy() {
+ this.$bus.$off('betaRefresh', this.handleReset)
+ this.$bus.$off('betaRefresh', this.getData)
+ },
watch: {
isFirstFitting: {
handler() {
// this.getData()
},
- immediate: true
+ immediate: true,
},
},
methods: {
@@ -636,11 +655,20 @@ export default {
sampleId,
qcFileName,
sampleFileName: inputFileName,
- fittingBtn: this.isFirstFitting
+ fittingBtn: this.isFirstFitting,
})
if (res.success) {
- const { CToE, EToC, betaEnergy, gammaEnergy, gammaGatedBetaSpectrum, histogramData, oldScatterSeries } =
- res.result
+ const {
+ CToE,
+ EToC,
+ betaEnergy,
+ gammaEnergy,
+ gammaGatedBetaSpectrum,
+ histogramData,
+ oldScatterSeries,
+ newCToE,
+ newEToC,
+ } = res.result
this.c2e = CToE
this.e2c = EToC
@@ -669,9 +697,19 @@ export default {
// 如果点击过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;
+ if (this.getCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName)) {
+ this.setFirringResult(this.getCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName))
+ return false
+ }
+
+ /**
+ * 对人工交互的返回数据单独处理
+ */
+ if (this.sampleData.dbName == 'man') {
+ const result = res.result
+ result.EToC = newEToC || []
+ result.CToE = newCToE
+ this.setFirringResult(res.result)
}
} else {
this.$message.error(res.message)
@@ -723,7 +761,7 @@ export default {
chartHeight: this.gammaEnergy.length,
channelWidth: this.gammaChannelWidth,
qcFileName,
- sampleFileName
+ sampleFileName,
},
cancelToken
)
@@ -797,7 +835,7 @@ export default {
}
this.tooltipVisible = true
this.channelAndEnergyModel.channel = xAxis
- if(!isNullOrUndefined(this.currEnergy)) {
+ if (!isNullOrUndefined(this.currEnergy)) {
this.channelAndEnergyModel.energy = add(661.657, -this.currEnergy)
}
}
@@ -816,12 +854,12 @@ export default {
channel,
energy,
})
-
+
// add之后 需要清空chart黄色的线 20231028:Xiao
- if(this.figureChartOption.series[1].data) {
+ 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()
@@ -850,10 +888,10 @@ export default {
// 输入内容的时候 需要清空table数据 20231028:Xiao
this.list = []
// 需要清空chart黄色的线 20231028:Xiao
- if(this.figureChartOption.series[1].data) {
+ if (this.figureChartOption.series[1].data) {
this.figureChartOption.series[1].data = []
}
- if(this.figureChartOption.series[1].markPoint.data) {
+ if (this.figureChartOption.series[1].markPoint.data) {
this.figureChartOption.series[1].markPoint.data = []
}
},
@@ -894,19 +932,22 @@ export default {
// 点击Reset Button 重置
async handleReset() {
this.$emit('isFitting', false)
- this.removeCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
+ this.removeCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
this.list = []
this.newE2C = []
// 按乔的要求增加请求reset的接口 20231211:xiao
- const res = await postAction('/spectrumAnalysis/resetButton?tabName=beta&sampleFileName='+this.newSampleData.inputFileName, {})
+ const res = await postAction(
+ '/spectrumAnalysis/resetButton?tabName=beta&sampleFileName=' + this.newSampleData.inputFileName,
+ {}
+ )
this.figureChartOption = this.oldChartOption
this.figureChartOption = cloneDeep(this.oldChartOption)
// this.isFirstFitting = true
-
+
this.isInverse = false
},
@@ -918,13 +959,14 @@ export default {
}
try {
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
- ...this.list.length <= 0 ? this.newCalibrationFuncModel : [], // 如果list有数据则不传 C to E 表单数据 20231101:xiao
+ ...(this.list.length <= 0 ? this.newCalibrationFuncModel : []), // 如果list有数据则不传 C to E 表单数据 20231101:xiao
sampleFileName: this.newSampleData.inputFileName,
- tabName: "beta",
+ tabName: 'beta',
// 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
- tempPoints: this.list.length > 0
- ? this.list.map((item) => ({ x: item.channel, y: item.energy }))
- : this.oldScatterSeries,
+ 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 })),
@@ -934,10 +976,9 @@ export default {
this.betaIsFitting = true
this.$emit('isFitting', true) // 点击reAnalyze按钮,将isFirstFitting改为true 20231101:xiao
- this.setCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
+ this.setCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
this.setFirringResult(result)
-
} else {
this.$message.error(message)
}
@@ -947,7 +988,7 @@ export default {
},
// 封装 fitting后数据填充方法,如果点击ReAnalyze需要回显数据 20231101:xiao
- setFirringResult(result){
+ setFirringResult(result) {
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
this.newE2C = EToC
this.newLineSeries = newLineSeries
@@ -964,21 +1005,23 @@ export default {
paramC: Number(paramC).toPrecision(6),
}
}
+ if (newLineSeries) {
+ const energyValues = newLineSeries.map((item) => item.y)
- const energyValues = newLineSeries.map((item) => item.y)
+ const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
- 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 energyMax = Math.max(Math.max(...energyValues), prevMax)
- const energyMin = Math.min(Math.min(...energyValues), prevMin)
+ const { min, max, interval } = splitAxis(energyMax, energyMin, 4)
- 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.yAxis.max = max
- this.figureChartOption.yAxis.min = min
- this.figureChartOption.yAxis.interval = interval
+ this.figureChartOption.series[1].data = newLineSeries.map(({ x, y }) => [x, y])
+ }
- this.figureChartOption.series[1].data = newLineSeries.map(({ x, y }) => [x, y])
if (newScatterSeriesData) {
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => {
return {
@@ -1032,15 +1075,15 @@ export default {
}
return 0
},
- getCache(name){
+ getCache(name) {
return this.$ls.get(name)
},
- setCache(name, data){
+ setCache(name, data) {
this.$ls.set(name, data)
},
- removeCache(name){
+ removeCache(name) {
this.$ls.remove(name) // 删除fitting之后缓存的数据 20231101:xiao
- }
+ },
},
computed: {
rectHeight() {
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 f523e7c..9fe21dd 100644
--- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue
+++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue
@@ -95,9 +95,24 @@
C to E :
E =
- +
- *C +
- *C 2
+
+ +
+
+ *C +
+
+ *C 2
@@ -494,11 +509,11 @@ export default {
sampleId,
qcFileName,
sampleFileName: inputFileName,
- fittingBtn: this.isFirstFitting
+ fittingBtn: this.isFirstFitting,
})
if (res.success) {
- const { CToE, EToC, gammaEnergy, gammaSpectrum, max, min, oldScatterSeries } = res.result
+ const { CToE, EToC, gammaEnergy, gammaSpectrum, max, min, oldScatterSeries, newCToE, newEToC } = res.result
this.c2e = CToE
this.e2c = EToC
@@ -530,9 +545,19 @@ export default {
// 如果点击过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;
+ if (this.getCache('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)) {
+ this.setFirringResult(this.getCache('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName))
+ return false
+ }
+
+ /**
+ * 对人工交互的返回数据单独处理
+ */
+ if (this.sampleData.dbName == 'man') {
+ const result = res.result
+ result.EToC = newEToC || []
+ result.CToE = newCToE
+ this.setFirringResult(result)
}
} else {
this.$message.error(res.message)
@@ -588,7 +613,7 @@ export default {
})
// add之后 需要清空chart黄色的线 20231028:Xiao
- if(this.figureChartOption.series[1].data) {
+ if (this.figureChartOption.series[1].data) {
this.figureChartOption.series[1].data = []
}
@@ -615,14 +640,14 @@ export default {
this.isInverse = true
},
// 输入框发生变化
- newCalibrationFuncModelChange(val,a) {
+ newCalibrationFuncModelChange(val, a) {
// 输入内容的时候 需要清空table数据 20231028:Xiao
this.list = []
// 需要清空chart黄色的线 20231028:Xiao
- if(this.figureChartOption.series[1].data) {
+ if (this.figureChartOption.series[1].data) {
this.figureChartOption.series[1].data = []
}
- if(this.figureChartOption.series[1].markPoint.data) {
+ if (this.figureChartOption.series[1].markPoint.data) {
this.figureChartOption.series[1].markPoint.data = []
}
},
@@ -655,13 +680,16 @@ export default {
// 点击Reset Button 重置
async handleReset() {
- this.$ls.remove("CALIBRATION_GAMMA_"+this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
+ this.$ls.remove('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
this.list = []
this.newE2C = []
// 按乔的要求增加请求reset的接口 20231211:xiao
- const res = await postAction('/spectrumAnalysis/resetButton?tabName=gamma&sampleFileName='+ this.newSampleData.inputFileName, { })
+ const res = await postAction(
+ '/spectrumAnalysis/resetButton?tabName=gamma&sampleFileName=' + this.newSampleData.inputFileName,
+ {}
+ )
this.$emit('isFitting', false)
@@ -680,32 +708,32 @@ export default {
}
try {
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
- ...this.list.length <= 0 ? this.newCalibrationFuncModel : [], // 如果list有数据则不传 C to E 表单数据 20231101:xiao
+ ...(this.list.length <= 0 ? this.newCalibrationFuncModel : []), // 如果list有数据则不传 C to E 表单数据 20231101:xiao
sampleFileName: this.newSampleData.inputFileName,
- tabName: "gamma",
+ tabName: 'gamma',
// 如果列表中有数据 以列表的数据优先进行分析 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 })),
+ 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,
- fittingBtn : this.isFirstFitting
+ fittingBtn: this.isFirstFitting,
})
if (success) {
this.gammaIsFitting = true
this.$emit('isFitting', true) // 点击reAnalyze按钮,将isFirstFitting改为true 20231101:xiao
- this.setCache("CALIBRATION_GAMMA_"+this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
+ this.setCache('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
this.setFirringResult(result)
// 通知Beta页清空数据
this.$bus.$emit('betaRefresh', {})
- console.log("betaRefresh>>>");
-
+ console.log('betaRefresh>>>')
} else {
this.$message.error(message)
}
@@ -715,7 +743,7 @@ export default {
},
// 封装 fitting后数据填充方法,如果点击ReAnalyze需要回显数据 20231101:xiao
- setFirringResult(result){
+ setFirringResult(result) {
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
this.newE2C = EToC
this.newLineSeries = newLineSeries
@@ -732,20 +760,24 @@ export default {
paramC: Number(paramC).toPrecision(6),
}
}
- const energyValues = newLineSeries.map((item) => item.y)
- const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
+ if (newLineSeries) {
+ const energyValues = newLineSeries.map((item) => item.y)
- const energyMax = Math.max(Math.max(...energyValues), prevMax)
- const energyMin = Math.min(Math.min(...energyValues), prevMin)
+ const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
- const { min, max, interval } = splitAxis(energyMax, energyMin, 4)
+ const energyMax = Math.max(Math.max(...energyValues), prevMax)
+ const energyMin = Math.min(Math.min(...energyValues), prevMin)
- this.figureChartOption.yAxis.max = max
- this.figureChartOption.yAxis.min = min
- this.figureChartOption.yAxis.interval = interval
+ 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])
+ }
- 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,
@@ -797,15 +829,15 @@ export default {
}
return 0
},
- getCache(name){
+ getCache(name) {
return this.$ls.get(name)
},
- setCache(name, data){
+ setCache(name, data) {
this.$ls.set(name, data)
},
- removeCache(name){
+ removeCache(name) {
this.$ls.remove(name) // 删除fitting之后缓存的数据 20231101:xiao
- }
+ },
},
}
diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue
index 351bae0..4d31536 100644
--- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue
+++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue
@@ -50,6 +50,7 @@ import { postAction } from '@/api/manage'
import BetaDetectorCalibration from './components/BetaDetectorCalibration.vue'
import GammaDetectorCalibration from './components/GammaDetectorCalibration.vue'
import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder.vue'
+import { removeSampleData } from '@/utils/SampleStore'
export default {
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
mixins: [ModalMixin, SampleDataMixin],
@@ -153,11 +154,15 @@ export default {
item.mdc = parseFloat(item.mdc.toPrecision(6))
})
this.$emit('sendXeData', res.result.XeData)
- this.$emit('reAnalyCurr', true, res.result.XeData)
- this.$message.success('Analyse Success!')
+ this.$emit('reAnalyCurr', res.result.savedAnalysisResult, res.result.XeData)
this.isReanlyze = true
this.handleExit()
this.$bus.$emit('ReAnalyses', res.result)
+ if (res.result.bProcessed) {
+ this.$message.success(res.result.message)
+ } else {
+ this.$message.warning(res.result.message)
+ }
if (this.newCalibrationIsAppliedTo == 'AllSpectrum') {
let sameStation = matchedSampleList.filter(
@@ -175,8 +180,7 @@ export default {
// 清理相同台站的缓存
clearSameStationCache(sampleList) {
sampleList.forEach(({ inputFileName }) => {
- console.log('inputFileName>>' + inputFileName)
- this.$store.commit('REMOVE_SAMPLE_DATA', inputFileName)
+ removeSampleData(inputFileName)
})
},
// 相同台站能谱缓存一样的Calibration数据 20231115:xiao
diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSampleInfomationModal.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSampleInfomationModal.vue
index 225787e..26ae678 100644
--- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSampleInfomationModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSampleInfomationModal.vue
@@ -1,7 +1,7 @@
-
+
diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSpectrumModal.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSpectrumModal.vue
index 0e48f15..990600c 100644
--- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSpectrumModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSpectrumModal.vue
@@ -3,16 +3,16 @@
-
+
-
+
-
+
-
+
diff --git a/src/views/spectrumAnalysis/components/Modals/ConfigUserLibraryModal.vue b/src/views/spectrumAnalysis/components/Modals/ConfigUserLibraryModal.vue
index 62c74fe..2a7ec0b 100644
--- a/src/views/spectrumAnalysis/components/Modals/ConfigUserLibraryModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/ConfigUserLibraryModal.vue
@@ -7,24 +7,28 @@
:dataSource="list"
:list-style="{
width: '200px',
- height: '400px'
+ height: '400px',
}"
:target-keys="targetKeys"
- :render="item => item.title"
+ :render="(item) => item.title"
:showSearch="true"
:showSelectAll="false"
@change="handleChange"
>
-
-
@@ -43,7 +47,7 @@ export default {
return {
list: [],
targetKeys: [],
- isSaving: false
+ isSaving: false,
}
},
methods: {
@@ -58,17 +62,17 @@ export default {
const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/configUserLibrary', {
sampleId,
- fileName
+ fileName,
})
if (success) {
this.isLoading = false
const { AllNuclides, UserNuclides } = result
- this.list = AllNuclides.map(item => ({
+ this.list = AllNuclides.map((item) => ({
key: item,
- title: item
+ title: item,
}))
- this.targetKeys = UserNuclides.map(item => item)
+ this.targetKeys = UserNuclides.map((item) => item)
this.initialTargetKeys = cloneDeep(this.targetKeys)
} else {
@@ -95,7 +99,7 @@ export default {
const { inputFileName: fileName } = this.sampleData
const { success, result, message } = await postAction('/gamma/saveUserLibrary', {
fileName,
- userLibraryName: this.targetKeys
+ userLibraryName: this.targetKeys,
})
if (success) {
this.$message.success('Save Success')
@@ -107,8 +111,8 @@ export default {
} finally {
this.isSaving = false
}
- }
- }
+ },
+ },
}
diff --git a/src/views/spectrumAnalysis/components/Modals/DataProcessingLogModal.vue b/src/views/spectrumAnalysis/components/Modals/DataProcessingLogModal.vue
index 1e9344a..44d79b1 100644
--- a/src/views/spectrumAnalysis/components/Modals/DataProcessingLogModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/DataProcessingLogModal.vue
@@ -1,7 +1,7 @@
- {{ text }}
+ {{ text }}
diff --git a/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue b/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
index e8f25a4..44b10d1 100644
--- a/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
@@ -23,7 +23,7 @@
-
+
From Auto DB
From Interactive DB
@@ -162,6 +162,10 @@ export default {
},
methods: {
loadData(arg) {
+ //加载数据 若传入参数1则加载第一页的内容
+ if (arg === 1) {
+ this.ipagination.current = 1
+ }
const params = this.getQueryParams() //查询条件
const { startDate, endDate, menuTypes } = params
if (!menuTypes) {
@@ -179,11 +183,6 @@ export default {
return
}
- //加载数据 若传入参数1则加载第一页的内容
- if (arg === 1) {
- this.ipagination.current = 1
- }
-
params.AllUsers = this.allUsersValue
params.CollectStopB = this.collectStopValue
params.AcqStartB = this.acqStartValue
@@ -220,6 +219,11 @@ export default {
})
},
+ // 来源改变
+ handleSourceChange() {
+ this.searchQuery()
+ },
+
show() {
this.visible = true
},
diff --git a/src/views/spectrumAnalysis/components/Modals/LoadFromFileModal.vue b/src/views/spectrumAnalysis/components/Modals/LoadFromFileModal.vue
index 925d08d..42d20cc 100644
--- a/src/views/spectrumAnalysis/components/Modals/LoadFromFileModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/LoadFromFileModal.vue
@@ -202,7 +202,7 @@
diff --git a/src/views/spectrumAnalysis/components/SubOperators/BetaGammaQcFlags.vue b/src/views/spectrumAnalysis/components/SubOperators/BetaGammaQcFlags.vue
index 99eed46..3a04118 100644
--- a/src/views/spectrumAnalysis/components/SubOperators/BetaGammaQcFlags.vue
+++ b/src/views/spectrumAnalysis/components/SubOperators/BetaGammaQcFlags.vue
@@ -57,20 +57,23 @@ export default {
diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue
index 9c77ea1..1fe5be1 100644
--- a/src/views/spectrumAnalysis/index.vue
+++ b/src/views/spectrumAnalysis/index.vue
@@ -63,6 +63,7 @@
:sampleInfo="sampleInfo"
:sample="sampleData"
:analyseCurrentSpectrum="analyseCurrentSpectrumData"
+ :sampleList="sampleList"
/>
Please Select a Sample
@@ -281,6 +282,7 @@ import BGLogViewer from './components/Modals/BetaGammaModals/BGLogViewer.vue'
import { saveAs } from 'file-saver'
import CompareFromDbModal from './components/Modals/CompareFromDBModal.vue'
+import { clearSampleData, getSampleData, updateSampleDataAnaly } from '@/utils/SampleStore'
// 分析类型
const ANALYZE_TYPE = {
@@ -465,9 +467,9 @@ export default {
window.addEventListener('beforeunload', this.handleCleanAll)
},
- destroyed() {
+ beforeDestroy() {
this.$bus.$off('reanalyse', this.handleReanalyse)
- this.$store.commit('CLEAR_SAMPLE_DATA')
+ clearSampleData()
this.handleCleanAll()
window.removeEventListener('beforeunload', this.handleCleanAll)
},
@@ -475,11 +477,13 @@ export default {
methods: {
getReAnalyCurr(flag, val) {
this.isReAnalyed_beta = flag
- this.params_toDB.savedAnalysisResult = true
+ this.params_toDB.savedAnalysisResult = flag
this.resultDisplayFlag = val
},
- getReAnalyAll(val) {
+ getReAnalyAll(flag, val) {
+ this.isReAnalyed_beta = flag
this.resultDisplayFlag = val
+ this.params_toDB.savedAnalysisResult = flag
},
handleReAnalyed(val) {
this.isReAnalyed_gamma = val
@@ -501,6 +505,7 @@ export default {
}
this.resultDisplayFlag = arg
this.params_toDB.stationName = val
+ this.params_toDB.savedAnalysisResult = flag
this.isReAnalyed_beta = this.isReAnalyed_beta ? this.isReAnalyed_beta : flag
},
getCheckFlag(val) {
@@ -509,10 +514,10 @@ export default {
this.params_toDB.checkDet = val.checkDet
},
getXeData(val) {
- if (val && val.length) {
- this.$set(this.analyseCurrentSpectrumData, 'XeData', val)
- this.resultDisplayFlag = val
- }
+ // if (val && val.length) {
+ this.$set(this.analyseCurrentSpectrumData, 'XeData', val)
+ this.resultDisplayFlag = val
+ // }
},
// formDB 来源 吧接口返回的文件名称添加到sampleData
getFiles(val) {
@@ -602,16 +607,16 @@ export default {
// 加载选中的样本
async loadSelectedSample(sample) {
- console.log('%c [ sample ]-381', 'font-size:13px; background:pink; color:red;', sample)
// B是beta-gamma P G是gamma
if (sample.sampleType == 'B') {
this.analysisType = ANALYZE_TYPE.BETA_GAMMA
+ const sampleData = getSampleData(sample.inputFileName)
+ this.params_toDB.savedAnalysisResult = sampleData ? sampleData.data.savedAnalysisResult : false
} else {
this.analysisType = ANALYZE_TYPE.GAMMA
}
this.sampleData = this.newSampleData = sample
this.currSampleDet = this.allSampleDet[sample.inputFileName]
- this.params_toDB.savedAnalysisResult = sample.sampleId ? true : false
this.params_toDB.comment = ''
},
@@ -842,7 +847,6 @@ export default {
* @param { 'all' | 'current' } type
*/
handleSavePHDToFile(type) {
- console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', type)
if (this.isGamma) {
if (type == 'current') {
let params = {
@@ -902,7 +906,7 @@ export default {
try {
const { success, result, message } = await postAction(`/gamma/Reprocessing?fileName=${fileNames[0]}`)
if (success) {
- this.$store.commit('UPDATE_SAMPLE_DATA_ANALY', {
+ updateSampleDataAnaly({
inputFileName: fileNames[0],
data: result,
})
@@ -1372,11 +1376,13 @@ export default {
children: [
{
type: 'a-menu-item',
+ show: this.isGamma,
title: 'Nuclide Library',
handler: () => (this.nuclideLibraryModalVisible = true),
},
{
type: 'a-menu-item',
+ show: this.isGamma,
title: 'Config User Library',
handler: () => (this.configUserLibModalVisible = true),
},
@@ -1709,49 +1715,10 @@ export default {
}
// 顶部操作栏结束
- ::v-deep {
- // 二级操作栏开始
- .spectrum-analysis-sub-operators {
- flex-shrink: 0;
- margin-bottom: 19px;
- display: flex;
- flex-wrap: nowrap;
- overflow: auto;
-
- .pop-over-with-icon {
- height: 32px;
-
- &:not(:last-child) {
- margin-right: 11px;
- }
-
- &:nth-child(1) {
- width: 256px;
- }
- &:nth-child(2) {
- width: 186px;
- }
- &:nth-child(3) {
- width: 246px;
- }
- &:nth-child(4) {
- width: 246px;
- }
- }
-
- .peak-info {
- width: 306px;
- height: 32px;
- display: inline-block;
- }
- }
- // 二级操作栏结束
- }
-
// 主体部分开始
&-main {
- margin-top: 15px;
- height: calc(100% - 45px);
+ padding-top: 5px;
+ height: calc(100% - 15px);
overflow: hidden;
}
// 主体部分结束
@@ -1797,6 +1764,8 @@ export default {
\ No newline at end of file
diff --git a/src/views/system/stationList.vue b/src/views/system/stationList.vue
index 2a0ecfa..2053e38 100644
--- a/src/views/system/stationList.vue
+++ b/src/views/system/stationList.vue
@@ -79,7 +79,23 @@
-
+
+
+
+
+
+
@@ -99,76 +115,76 @@ const columns = [
align: 'left',
width: 100,
scopedSlots: {
- customRender: 'index'
+ customRender: 'index',
},
customHeaderCell: () => {
return {
style: {
- 'padding-left': '60px !important'
- }
+ 'padding-left': '60px !important',
+ },
}
},
customCell: () => {
return {
style: {
- 'padding-left': '60px !important'
- }
+ 'padding-left': '60px !important',
+ },
}
- }
+ },
},
{
title: 'STATION ID',
align: 'left',
dataIndex: 'stationId',
- width: 100
+ width: 100,
},
{
title: 'STATION CODE',
align: 'left',
width: 100,
- dataIndex: 'stationCode'
+ dataIndex: 'stationCode',
},
{
title: 'COUNTRY CODE',
align: 'left',
width: 100,
- dataIndex: 'countryCode'
+ dataIndex: 'countryCode',
},
{
title: 'TYPE',
align: 'left',
width: 100,
- dataIndex: 'type'
+ dataIndex: 'type',
},
{
title: 'LON',
align: 'left',
width: 100,
- dataIndex: 'lon'
+ dataIndex: 'lon',
},
{
title: 'LAT',
align: 'left',
width: 100,
- dataIndex: 'lat'
+ dataIndex: 'lat',
},
{
title: 'ELEVATION',
width: 100,
- dataIndex: 'elevation'
+ dataIndex: 'elevation',
},
{
title: 'DESCRIPTION',
width: 100,
dataIndex: 'description',
- ellipsis: true
+ ellipsis: true,
},
{
title: 'STATUS',
align: 'left',
width: 100,
- dataIndex: 'status'
- }
+ dataIndex: 'status',
+ },
]
export default {
@@ -188,38 +204,66 @@ export default {
}
const validateCountryCode = (_, value, callback) => {
- if (value && value.length > 2) {
+ if (!value) {
+ callback(new Error('Please Enter Country Code'))
+ } else if (value.length > 2) {
callback(new Error('Country Code Limit 2 Char'))
} else {
callback()
}
}
return {
+ categoryOptions: [],
queryParam: {},
rules: {
stationId: [{ required: true, message: 'Please Enter Station Id' }],
stationCode: [{ required: true, validator: validateStationCode }],
- countryCode: [{ validator: validateCountryCode }]
+ countryCode: [{ required: true, validator: validateCountryCode }],
+ status: [{ required: true, message: 'Please Select Status', trigger: 'change' }],
+ category: [{ required: true, message: 'Please Select Category', trigger: 'change' }],
},
url: {
list: '/gardsStations/findPage',
delete: '/gardsStations/deleteById',
add: '/gardsStations/create',
- edit: '/gardsStations/update'
+ edit: '/gardsStations/update',
},
countryCodeList: [],
- typeList: []
+ typeList: [],
}
},
created() {
this.getTypeList()
this.getCountryCodeList()
},
+ mounted() {
+ this.$set(this.model, 'status', 'Operating')
+ },
methods: {
+ async getCategoryItem() {
+ try {
+ const res = await getAction('/sys/dict/getItems', { dictCode: 'Station Category' })
+ console.log(res)
+ this.categoryOptions = res.map((item) => {
+ return {
+ label: item.text,
+ value: item.value,
+ }
+ })
+ } catch (error) {
+ console.error(error)
+ }
+ },
+ onCategoryChange(val) {
+ console.log(val)
+ },
+ handleStatus(val) {
+ this.model.status = val
+ },
async getTypeList() {
try {
const res = await getAction('/gardsStations/findType')
- this.typeList = res.filter(item => item).map(item => ({ label: item, value: item }))
+ this.typeList = res.filter((item) => item).map((item) => ({ label: item, value: item }))
} catch (error) {
console.error(error)
}
@@ -228,7 +272,7 @@ export default {
async getCountryCodeList() {
try {
const res = await getAction('/gardsStations/findCountryCode')
- this.countryCodeList = res.filter(item => item).map(item => ({ label: item, value: item }))
+ this.countryCodeList = res.filter((item) => item).map((item) => ({ label: item, value: item }))
} catch (error) {
console.error(error)
}
@@ -239,15 +283,20 @@ export default {
},
onAdd() {
+ this.getCategoryItem()
this.isAdd = true
- this.model = {}
+ // this.model = {}
this.visible = true
},
onEdit() {
+ this.getCategoryItem()
if (this.selectedRowKeys && this.selectedRowKeys.length) {
this.isAdd = false
this.visible = true
- const find = this.dataSource.find(item => item.stationId === this.selectedRowKeys[0])
+ const find = this.dataSource.find((item) => item.stationId === this.selectedRowKeys[0])
+ if (find) {
+ find.category = find.category.toString()
+ }
this.model = cloneDeep(find)
} else {
this.$message.warn('Please Select An Item To Edit')
@@ -261,12 +310,12 @@ export default {
cancelText: 'Cancel',
onOk: () => {
this.handleDelete(this.selectedRowKeys[0], 'stationId')
- }
+ },
})
} else {
this.$message.warn('Please Select An Item To Delete')
}
- }
+ },
},
computed: {
formItems() {
@@ -281,12 +330,12 @@ export default {
showSearch: true,
filterOption: this.filterOption,
style: {
- width: '261px'
- }
+ width: '261px',
+ },
},
style: {
- width: 'auto'
- }
+ width: 'auto',
+ },
},
{
label: 'Type',
@@ -298,12 +347,12 @@ export default {
showSearch: true,
filterOption: this.filterOption,
style: {
- width: '261px'
- }
+ width: '261px',
+ },
},
style: {
- width: 'auto'
- }
+ width: 'auto',
+ },
},
{
label: 'Status',
@@ -315,16 +364,16 @@ export default {
return document.body
},
style: {
- width: '261px'
- }
+ width: '261px',
+ },
},
style: {
- width: 'auto'
- }
- }
+ width: 'auto',
+ },
+ },
]
- }
- }
+ },
+ },
}