formfile模块Beta 对接loadFromFile接口,数据显示
This commit is contained in:
		
							parent
							
								
									0fbdc38690
								
							
						
					
					
						commit
						e48d029827
					
				| 
						 | 
				
			
			@ -242,8 +242,33 @@ 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() {
 | 
			
		||||
    changeChartByType(val) {
 | 
			
		||||
      if (val==="qc"&&!this.sample.qcFileStatus) {
 | 
			
		||||
        this.$message.warning("No qc spectrum file!")
 | 
			
		||||
      } else {
 | 
			
		||||
        const {
 | 
			
		||||
          betaOriginalData,
 | 
			
		||||
          betaProjectedData,
 | 
			
		||||
| 
						 | 
				
			
			@ -292,6 +317,7 @@ export default {
 | 
			
		|||
          GasBgBtn,
 | 
			
		||||
          DetBgBtn
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    resize() {
 | 
			
		||||
| 
						 | 
				
			
			@ -363,8 +389,13 @@ export default {
 | 
			
		|||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
    sample: {
 | 
			
		||||
      handler() {
 | 
			
		||||
      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