feat: 对接清理sample缓存功能
This commit is contained in:
parent
e69f1b7c06
commit
961f9752f6
17
src/views/spectrumAnalysis/clearSampleCache.js
Normal file
17
src/views/spectrumAnalysis/clearSampleCache.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { deleteAction } from '@/api/manage'
|
||||
/**
|
||||
* 发起请求清理后端对sample的缓存
|
||||
* @param {Array<any>} sampleList
|
||||
*/
|
||||
export const clearSampleCache = (sampleList) => {
|
||||
sampleList.forEach(sample => {
|
||||
const { inputFileName: fileName, sampleFileName, qcFileName } = sample
|
||||
let url = '/gamma/delPHDCache',
|
||||
params = { fileName }
|
||||
if (sample.sampleType == 'B') {
|
||||
url = '/spectrumAnalysis/deleteSpectrumCacheData'
|
||||
params = { sampleFileName , qcFileName }
|
||||
}
|
||||
deleteAction(url, params)
|
||||
})
|
||||
}
|
|
@ -16,6 +16,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { clearSampleCache } from '../clearSampleCache'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
list: {
|
||||
|
@ -43,7 +45,8 @@ export default {
|
|||
this.handleClick(this.list[index + 1])
|
||||
}
|
||||
}
|
||||
this.list.splice(index, 1)
|
||||
const deleted = this.list.splice(index, 1)
|
||||
clearSampleCache(deleted)
|
||||
this.$forceUpdate()
|
||||
}
|
||||
},
|
||||
|
|
|
@ -236,6 +236,7 @@ import BetaGammaEnergyCalibrationModal from './components/Modals/BetaGammaModals
|
|||
import AutomaticAnalysisLogModal from './components/Modals/BetaGammaModals/AutomaticAnalysisLogModal.vue'
|
||||
import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { clearSampleCache } from './clearSampleCache'
|
||||
|
||||
// 分析类型
|
||||
const ANALYZE_TYPE = {
|
||||
|
@ -479,6 +480,8 @@ export default {
|
|||
|
||||
// 清理全部
|
||||
handleCleanAll() {
|
||||
clearSampleCache(this.sampleList)
|
||||
|
||||
this.sampleList = []
|
||||
this.analysisType = undefined
|
||||
this.sampleData = {}
|
||||
|
@ -746,7 +749,9 @@ export default {
|
|||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll,
|
||||
handler: () => {
|
||||
this.handleCleanAll()
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -770,7 +775,8 @@ export default {
|
|||
if (spectra) {
|
||||
this.loadSelectedSample(spectra)
|
||||
} else {
|
||||
this.handleCleanAll()
|
||||
this.analysisType = undefined
|
||||
this.sampleData = {}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user