gamma保存后未更新Sample Status的问题
This commit is contained in:
parent
684ccf165a
commit
64729f91df
|
@ -315,7 +315,7 @@ import BGLogViewer from './components/Modals/BetaGammaModals/BGLogViewer.vue'
|
||||||
|
|
||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
import CompareFromDbModal from './components/Modals/CompareFromDBModal.vue'
|
import CompareFromDbModal from './components/Modals/CompareFromDBModal.vue'
|
||||||
import { clearSampleData, getSampleData, updateSampleDataAnaly } from '@/utils/SampleStore'
|
import { clearSampleData, getSampleData, updateSampleData, updateSampleDataAnaly } from '@/utils/SampleStore'
|
||||||
import BetaAnalyzeInteractiveToolModal from './components/Modals/SelfStation/BetaAnalyzeInteractiveToolModal/index.vue'
|
import BetaAnalyzeInteractiveToolModal from './components/Modals/SelfStation/BetaAnalyzeInteractiveToolModal/index.vue'
|
||||||
import SelfStationAnalyzeSettingModal from './components/Modals/SelfStation/SelfStationAnalyzeSettingModal.vue'
|
import SelfStationAnalyzeSettingModal from './components/Modals/SelfStation/SelfStationAnalyzeSettingModal.vue'
|
||||||
|
|
||||||
|
@ -497,8 +497,6 @@ export default {
|
||||||
percentBar: 0,
|
percentBar: 0,
|
||||||
analysedFileName: '', //分析完成的文件名称
|
analysedFileName: '', //分析完成的文件名称
|
||||||
currSampleDet: [], // DetailedInformation
|
currSampleDet: [], // DetailedInformation
|
||||||
allSampleDet: {}, // DetailedInformation all
|
|
||||||
|
|
||||||
isComparing: false,
|
isComparing: false,
|
||||||
isStriping: false,
|
isStriping: false,
|
||||||
}
|
}
|
||||||
|
@ -694,7 +692,6 @@ export default {
|
||||||
this.analysisType = ANALYZE_TYPE.GAMMA
|
this.analysisType = ANALYZE_TYPE.GAMMA
|
||||||
}
|
}
|
||||||
this.sampleData = this.newSampleData = sample
|
this.sampleData = this.newSampleData = sample
|
||||||
this.currSampleDet = this.allSampleDet[sample.inputFileName]
|
|
||||||
this.params_toDB.comment = ''
|
this.params_toDB.comment = ''
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -725,7 +722,7 @@ export default {
|
||||||
this.isSaving = false
|
this.isSaving = false
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let list = this.sampleList.filter((item) => item.sampleType !== 'B')
|
let list = this.sampleList.filter((item) => item.sampleType !== 'B' && item.sampleType !== 'C')
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
list.forEach(async (item) => {
|
list.forEach(async (item) => {
|
||||||
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
|
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
|
||||||
|
@ -839,6 +836,13 @@ export default {
|
||||||
if (success) {
|
if (success) {
|
||||||
this.$message.success('Save Success')
|
this.$message.success('Save Success')
|
||||||
this.currSampleDet = [...result.DetailedInformation]
|
this.currSampleDet = [...result.DetailedInformation]
|
||||||
|
|
||||||
|
// 更新缓存中的DetailedInfomation数据
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName: this.sampleData.inputFileName,
|
||||||
|
key: 'DetailedInformation',
|
||||||
|
data: [...result.DetailedInformation],
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
|
@ -849,37 +853,47 @@ export default {
|
||||||
this.isSaving = false
|
this.isSaving = false
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.allSampleDet = []
|
const gammaList = this.sampleList.filter(({ sampleType }) => sampleType !== 'B' && sampleType !== 'C')
|
||||||
const { inputFileName } = this.sampleData
|
|
||||||
let gammaList = this.sampleList.filter(({ sampleType }) => sampleType !== 'B')
|
|
||||||
|
|
||||||
const gammaInputFileNames = gammaList.map((item) => item.inputFileName)
|
const gammaInputFileNames = gammaList.map((item) => item.inputFileName)
|
||||||
if (gammaInputFileNames.length > 0) {
|
const saveToDbPromises = gammaInputFileNames.map((fileName) => this.gammaSaveToDBRequest(fileName))
|
||||||
this.fatchSaveDbAll(gammaInputFileNames, inputFileName)
|
try {
|
||||||
|
this.isSaving = true
|
||||||
|
await Promise.all(saveToDbPromises)
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
} finally {
|
||||||
|
this.isSaving = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.warn('Please Analyse Spectrum First')
|
this.$message.warn('Please Analyse Spectrum First')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async fatchSaveDbAll(fileNames, currFileName) {
|
|
||||||
|
// 保存gamma谱到数据库
|
||||||
|
async gammaSaveToDBRequest(fileName) {
|
||||||
try {
|
try {
|
||||||
const { result, success, message } = await getAction('/gamma/saveToDB', { fileName: fileNames[0] })
|
const { result, success, message } = await getAction('/gamma/saveToDB', { fileName })
|
||||||
if (success) {
|
if (success) {
|
||||||
this.$set(this.allSampleDet, fileNames[0], [...result.DetailedInformation])
|
// 更新缓存中的DetailedInfomation数据
|
||||||
fileNames.splice(0, 1)
|
updateSampleData({
|
||||||
if (fileNames.length > 0) {
|
inputFileName: fileName,
|
||||||
this.fatchSaveDbAll(fileNames, currFileName)
|
key: 'DetailedInformation',
|
||||||
} else {
|
data: [...result.DetailedInformation],
|
||||||
this.isSaving = false
|
})
|
||||||
this.currSampleDet = this.allSampleDet[this.sampleData.inputFileName]
|
|
||||||
|
console.log('%c [ 更更新缓存 ]-891', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||||
|
|
||||||
|
if (this.sampleData.inputFileName == fileName) {
|
||||||
|
this.currSampleDet = [...result.DetailedInformation]
|
||||||
|
|
||||||
|
console.log('%c [ 更新当前 ]-894', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.isSaving = false
|
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.isSaving = false
|
console.error(error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSaveResultsToDB_Cuurrent() {
|
handleSaveResultsToDB_Cuurrent() {
|
||||||
|
@ -933,7 +947,7 @@ export default {
|
||||||
fetchAndDownload('/gamma/saveToPHD', params, 'get')
|
fetchAndDownload('/gamma/saveToPHD', params, 'get')
|
||||||
} else {
|
} else {
|
||||||
this.sampleList
|
this.sampleList
|
||||||
.filter(({ sampleType }) => sampleType !== 'B')
|
.filter(({ sampleType }) => sampleType !== 'B' && sampleType !== 'C')
|
||||||
.forEach(({ inputFileName: fileName }) => {
|
.forEach(({ inputFileName: fileName }) => {
|
||||||
const params = {
|
const params = {
|
||||||
fileName,
|
fileName,
|
||||||
|
@ -951,7 +965,7 @@ export default {
|
||||||
this.analyzeAllModalVisible = true
|
this.analyzeAllModalVisible = true
|
||||||
const { inputFileName, sampleType } = this.sampleData
|
const { inputFileName, sampleType } = this.sampleData
|
||||||
// 获取所有的gamma list
|
// 获取所有的gamma list
|
||||||
const gammaSampleList = this.sampleList.filter((sample) => sample.sampleType !== 'B')
|
const gammaSampleList = this.sampleList.filter((sample) => sample.sampleType !== 'B' && sample.sampleType !== 'C')
|
||||||
this.gammaSampleNum = gammaSampleList.length
|
this.gammaSampleNum = gammaSampleList.length
|
||||||
const gammaInputFileNames = gammaSampleList.map((item) => item.inputFileName)
|
const gammaInputFileNames = gammaSampleList.map((item) => item.inputFileName)
|
||||||
|
|
||||||
|
@ -960,7 +974,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async fetchReprocessing(fileNames, currFileName, sampleType) {
|
async fetchReprocessing(fileNames, currFileName, sampleType) {
|
||||||
if (fileNames[0] == currFileName && sampleType !== 'B') {
|
if (fileNames[0] == currFileName && sampleType !== 'B' && sampleType !== 'C') {
|
||||||
this.$refs.gammaAnalysisRef.reProcessing(false).then((res) => {
|
this.$refs.gammaAnalysisRef.reProcessing(false).then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.finishCont++
|
this.finishCont++
|
||||||
|
|
Loading…
Reference in New Issue
Block a user