formfile模块Beta 对接loadFromFile接口,数据显示
This commit is contained in:
		
							parent
							
								
									0fbdc38690
								
							
						
					
					
						commit
						e48d029827
					
				| 
						 | 
				
			
			@ -242,55 +242,81 @@ export default {
 | 
			
		|||
        console.error(error)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    async getSampleDetail_file() {
 | 
			
		||||
      this.spectraType = this.SampleType[0].value
 | 
			
		||||
      let params = {
 | 
			
		||||
        sampleFileName: this.sample.sampleFileName,
 | 
			
		||||
        gasFileName: this.sample.gasFileName,
 | 
			
		||||
        detFileName: this.sample.detFileName,
 | 
			
		||||
        qcFileName: this.sample.qcFileStatus?this.sample.qcFileName:"",
 | 
			
		||||
      }
 | 
			
		||||
      try {
 | 
			
		||||
        this.isLoading = true
 | 
			
		||||
        const { success, result, message } = await getAction('/spectrumAnalysis/getFileSpectrumChart', params)
 | 
			
		||||
        if (success) {
 | 
			
		||||
          this.sampleDetail = result
 | 
			
		||||
          this.changeChartByType('sample')
 | 
			
		||||
          this.isLoading = false
 | 
			
		||||
        } else {
 | 
			
		||||
          this.$message.error(message)
 | 
			
		||||
        }
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        console.error(error)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    changeChartByType() {
 | 
			
		||||
      const {
 | 
			
		||||
        betaOriginalData,
 | 
			
		||||
        betaProjectedData,
 | 
			
		||||
        betaEnergyData,
 | 
			
		||||
    changeChartByType(val) {
 | 
			
		||||
      if (val==="qc"&&!this.sample.qcFileStatus) {
 | 
			
		||||
        this.$message.warning("No qc spectrum file!")
 | 
			
		||||
      } else {
 | 
			
		||||
        const {
 | 
			
		||||
          betaOriginalData,
 | 
			
		||||
          betaProjectedData,
 | 
			
		||||
          betaEnergyData,
 | 
			
		||||
  
 | 
			
		||||
        gammaOriginalData,
 | 
			
		||||
        gammaProjectedData,
 | 
			
		||||
        gammaEnergyData,
 | 
			
		||||
          gammaOriginalData,
 | 
			
		||||
          gammaProjectedData,
 | 
			
		||||
          gammaEnergyData,
 | 
			
		||||
  
 | 
			
		||||
        histogramDataList, // 左侧 Beta-Gamma Spectrum: Sample 图表
 | 
			
		||||
        histogramDataDList, // 左侧 Beta-Gamma Spectrum: Sample 图表的3D部分
 | 
			
		||||
        Boundary, // 左侧2d图表的矩形
 | 
			
		||||
          histogramDataList, // 左侧 Beta-Gamma Spectrum: Sample 图表
 | 
			
		||||
          histogramDataDList, // 左侧 Beta-Gamma Spectrum: Sample 图表的3D部分
 | 
			
		||||
          Boundary, // 左侧2d图表的矩形
 | 
			
		||||
  
 | 
			
		||||
        XeData, // 右下角Result Display
 | 
			
		||||
        spectrumData,
 | 
			
		||||
          XeData, // 右下角Result Display
 | 
			
		||||
          spectrumData,
 | 
			
		||||
  
 | 
			
		||||
        AcqTimeBtn, // QC Flags 相关
 | 
			
		||||
        CollectTimeBtn, // QC Flags 相关
 | 
			
		||||
        SampleVolumeBtn, // QC Flags 相关
 | 
			
		||||
        XeVolumeBtn, // QC Flags 相关
 | 
			
		||||
        GasBgBtn, // QC Flags 相关
 | 
			
		||||
        DetBgBtn // QC Flags 相关
 | 
			
		||||
      } = this.sampleDetail[this.spectraType]
 | 
			
		||||
          AcqTimeBtn, // QC Flags 相关
 | 
			
		||||
          CollectTimeBtn, // QC Flags 相关
 | 
			
		||||
          SampleVolumeBtn, // QC Flags 相关
 | 
			
		||||
          XeVolumeBtn, // QC Flags 相关
 | 
			
		||||
          GasBgBtn, // QC Flags 相关
 | 
			
		||||
          DetBgBtn // QC Flags 相关
 | 
			
		||||
        } = this.sampleDetail[this.spectraType]
 | 
			
		||||
  
 | 
			
		||||
      this.spectrumData = spectrumData
 | 
			
		||||
        this.spectrumData = spectrumData
 | 
			
		||||
  
 | 
			
		||||
      this.histogramDataList = histogramDataList
 | 
			
		||||
      this.histogramDataDList = histogramDataDList
 | 
			
		||||
      this.boundaryList = Boundary
 | 
			
		||||
        this.histogramDataList = histogramDataList
 | 
			
		||||
        this.histogramDataDList = histogramDataDList
 | 
			
		||||
        this.boundaryList = Boundary
 | 
			
		||||
  
 | 
			
		||||
      this.gammaOriginalData = gammaOriginalData
 | 
			
		||||
      this.gammaProjectedData = gammaProjectedData
 | 
			
		||||
      this.gammaEnergyData = gammaEnergyData
 | 
			
		||||
        this.gammaOriginalData = gammaOriginalData
 | 
			
		||||
        this.gammaProjectedData = gammaProjectedData
 | 
			
		||||
        this.gammaEnergyData = gammaEnergyData
 | 
			
		||||
  
 | 
			
		||||
      this.betaOriginalData = betaOriginalData
 | 
			
		||||
      this.betaProjectedData = betaProjectedData
 | 
			
		||||
      this.betaEnergyData = betaEnergyData
 | 
			
		||||
        this.betaOriginalData = betaOriginalData
 | 
			
		||||
        this.betaProjectedData = betaProjectedData
 | 
			
		||||
        this.betaEnergyData = betaEnergyData
 | 
			
		||||
  
 | 
			
		||||
      this.resultDisplay = XeData
 | 
			
		||||
        this.resultDisplay = XeData
 | 
			
		||||
  
 | 
			
		||||
      this.qcFlags = {
 | 
			
		||||
        AcqTimeBtn,
 | 
			
		||||
        CollectTimeBtn,
 | 
			
		||||
        SampleVolumeBtn,
 | 
			
		||||
        XeVolumeBtn,
 | 
			
		||||
        GasBgBtn,
 | 
			
		||||
        DetBgBtn
 | 
			
		||||
        this.qcFlags = {
 | 
			
		||||
          AcqTimeBtn,
 | 
			
		||||
          CollectTimeBtn,
 | 
			
		||||
          SampleVolumeBtn,
 | 
			
		||||
          XeVolumeBtn,
 | 
			
		||||
          GasBgBtn,
 | 
			
		||||
          DetBgBtn
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -363,8 +389,13 @@ export default {
 | 
			
		|||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
    sample: {
 | 
			
		||||
      handler() {
 | 
			
		||||
        this.getSampleDetail()
 | 
			
		||||
      handler(newVal, oldVal) {
 | 
			
		||||
        console.log("newValnewVal", newVal);
 | 
			
		||||
        if (newVal.sampleId) {
 | 
			
		||||
          this.getSampleDetail()
 | 
			
		||||
        } else {
 | 
			
		||||
          this.getSampleDetail_file()
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      immediate: true
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,7 +32,7 @@
 | 
			
		|||
          </div>
 | 
			
		||||
        </template>
 | 
			
		||||
        <template slot="status" slot-scope="text,record">
 | 
			
		||||
          <span :class="[record.detFileStatus&&record.gasFileStatus&&record.qcFileStatus?'status_true':'status_false','status']"></span>
 | 
			
		||||
          <span :class="[record.detFileStatus&&record.gasFileStatus&&record.qcFileStatus  || record.sampleFileName&&!record.gasFileName&&!record.detFileName&&!record.qcFileName?'status_true':'status_false','status']"></span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </a-table>
 | 
			
		||||
  
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <a-menu class="spectra-list-in-menu">
 | 
			
		||||
    <a-menu-item class="spectra-list-in-menu-item" v-for="item in list" :key="item.sampleId" @click="handleClick(item)">
 | 
			
		||||
    <a-menu-item class="spectra-list-in-menu-item" v-for="(item,index) in list" :key="`${item.sampleId}${index}`" @click="handleClick(item)">
 | 
			
		||||
      <span class="checkbox">
 | 
			
		||||
        <a-icon v-if="item.checked" type="check" style="color: #0de30d" />
 | 
			
		||||
      </span>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -384,9 +384,11 @@ export default {
 | 
			
		|||
      this.sampleList = this.sampleList.concat(willAddList)
 | 
			
		||||
    },
 | 
			
		||||
    handleLoadSampleFromFile(sampleList) {
 | 
			
		||||
      console.log("sampleListsampleListsampleListsampleListsampleList",sampleList);
 | 
			
		||||
      let arr = sampleList.filter(item => {
 | 
			
		||||
        return Object.keys(item).length>4
 | 
			
		||||
        return Object.keys(item).length>4&&item.gasFileStatus&&item.detFileStatus
 | 
			
		||||
      })
 | 
			
		||||
      console.log("sampleListsampleList",arr);
 | 
			
		||||
      arr.forEach(item => {
 | 
			
		||||
        item.sampleId = ""
 | 
			
		||||
        item.inputFileName = item.sampleFileName
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user