24 lines
		
	
	
		
			704 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			704 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import { deleteAction } from '@/api/manage'
 | 
						|
import store from '@/store'
 | 
						|
import Vue from 'vue'
 | 
						|
 | 
						|
/**
 | 
						|
 * 发起请求清理后端对sample的缓存
 | 
						|
 * @param {Array<any>} sampleList
 | 
						|
 */
 | 
						|
export const clearSampleCache = sampleList => {
 | 
						|
  sampleList.forEach(sample => {
 | 
						|
    const { inputFileName: fileName } = sample
 | 
						|
    let url = '/gamma/delPHDCache',
 | 
						|
      params = { fileName }
 | 
						|
    if (sample.sampleType == 'B') {
 | 
						|
      url = '/spectrumAnalysis/deleteSpectrumCacheData'
 | 
						|
      params = { sampleFileName: fileName }
 | 
						|
    }
 | 
						|
    deleteAction(url, params)
 | 
						|
    store.commit('REMOVE_SAMPLE_DATA', fileName)
 | 
						|
    Vue.ls.remove(`CALIBRATION_GAMMA_${fileName}`)
 | 
						|
    Vue.ls.remove(`CALIBRATION_BETA_${fileName}`)
 | 
						|
  })
 | 
						|
}
 |