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