gamma 的 save to file功能(Save as Txt ,Save as Excel)接口对接联调
gamma 的 Save PHD to File 功能接口对接,联调
This commit is contained in:
		
							parent
							
								
									eddab8db4c
								
							
						
					
					
						commit
						aa6ac23fd5
					
				| 
						 | 
				
			
			@ -2,16 +2,14 @@
 | 
			
		|||
  <custom-modal v-model="visible" title="Save Setting" :width="380" :okHandler="handleOk">
 | 
			
		||||
    <div class="save-setting">
 | 
			
		||||
      <div class="save-setting-all">
 | 
			
		||||
        <a-checkbox v-model="saveAll">
 | 
			
		||||
          Save All
 | 
			
		||||
        </a-checkbox>
 | 
			
		||||
        <a-checkbox v-model="saveAll"> Save All </a-checkbox>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div>
 | 
			
		||||
        <title-over-border title="Format">
 | 
			
		||||
          <a-radio-group v-model="saveFormat" class="format-radio-group">
 | 
			
		||||
            <a-radio value="txt">Save as Txt</a-radio>
 | 
			
		||||
            <a-radio value="xls">Save as Excel</a-radio>
 | 
			
		||||
            <a-radio value="html">Save as Html</a-radio>
 | 
			
		||||
            <!-- <a-radio value="html">Save as Html</a-radio> -->
 | 
			
		||||
          </a-radio-group>
 | 
			
		||||
        </title-over-border>
 | 
			
		||||
      </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -25,13 +23,13 @@ export default {
 | 
			
		|||
  components: { TitleOverBorder },
 | 
			
		||||
  props: {
 | 
			
		||||
    value: {
 | 
			
		||||
      type: Boolean
 | 
			
		||||
    }
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      saveAll: false,
 | 
			
		||||
      saveFormat: 'txt'
 | 
			
		||||
      saveFormat: 'txt',
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +40,7 @@ export default {
 | 
			
		|||
 | 
			
		||||
    handleOk() {
 | 
			
		||||
      this.$emit('save', this.saveFormat)
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    visible: {
 | 
			
		||||
| 
						 | 
				
			
			@ -55,9 +53,9 @@ export default {
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        return this.value
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1193,7 +1193,6 @@ export default {
 | 
			
		|||
      this.channelData.baseLineCP = shapeChannelData
 | 
			
		||||
      this.energyData.baseLineCP = shapeEnergyData
 | 
			
		||||
      this.redrawCtrlPointBySeriesName()
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    // 显示比较弹窗
 | 
			
		||||
| 
						 | 
				
			
			@ -1475,7 +1474,6 @@ export default {
 | 
			
		|||
  watch: {
 | 
			
		||||
    currStep: {
 | 
			
		||||
      handler(val) {
 | 
			
		||||
        console.log('dfad', val)
 | 
			
		||||
        if (val && val == '0') {
 | 
			
		||||
          this.abc = true
 | 
			
		||||
          this.reprocessingModalVisible = true
 | 
			
		||||
| 
						 | 
				
			
			@ -1496,7 +1494,6 @@ export default {
 | 
			
		|||
    },
 | 
			
		||||
    updateFlag: {
 | 
			
		||||
      handler(val) {
 | 
			
		||||
        console.log('dfad', val)
 | 
			
		||||
        this.newCheckBox_updateCal = val
 | 
			
		||||
      },
 | 
			
		||||
      immediate: true,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -481,30 +481,39 @@ export default {
 | 
			
		|||
 | 
			
		||||
    // 保存结果到文件, 服务端生成文件,前端下载
 | 
			
		||||
    async handleSaveResultsToFile(saveFormat) {
 | 
			
		||||
      const url =
 | 
			
		||||
        saveFormat == 'xls'
 | 
			
		||||
          ? '/spectrumAnalysis/saveToExcel'
 | 
			
		||||
          : saveFormat == 'txt'
 | 
			
		||||
          ? '/spectrumAnalysis/saveToTxt'
 | 
			
		||||
          : saveFormat == 'html'
 | 
			
		||||
          ? '/spectrumAnalysis/saveToHTML'
 | 
			
		||||
          : ''
 | 
			
		||||
      if (!this.resultDisplayFlag) {
 | 
			
		||||
        this.$message.warn('Please Analyse Spectrum First')
 | 
			
		||||
        return
 | 
			
		||||
      if (this.isGamma) {
 | 
			
		||||
        const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
 | 
			
		||||
        let params = {
 | 
			
		||||
          fileName: this.newSampleData.inputFileName,
 | 
			
		||||
        }
 | 
			
		||||
        downloadFile(url, `result.${saveFormat}`, params, 'get')
 | 
			
		||||
      }
 | 
			
		||||
      if (this.isBetaGamma) {
 | 
			
		||||
        const url =
 | 
			
		||||
          saveFormat == 'xls'
 | 
			
		||||
            ? '/spectrumAnalysis/saveToExcel'
 | 
			
		||||
            : saveFormat == 'txt'
 | 
			
		||||
            ? '/spectrumAnalysis/saveToTxt'
 | 
			
		||||
            : saveFormat == 'html'
 | 
			
		||||
            ? '/spectrumAnalysis/saveToHTML'
 | 
			
		||||
            : ''
 | 
			
		||||
        if (!this.resultDisplayFlag) {
 | 
			
		||||
          this.$message.warn('Please Analyse Spectrum First')
 | 
			
		||||
          return
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      this.resultDisplayFlag.forEach((item) => {
 | 
			
		||||
        this.params_toDB[`${item.nuclideName.toLowerCase()}Flag`] = item.nidFlag
 | 
			
		||||
      })
 | 
			
		||||
        this.resultDisplayFlag.forEach((item) => {
 | 
			
		||||
          this.params_toDB[`${item.nuclideName.toLowerCase()}Flag`] = item.nidFlag
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
      this.params_toDB.sampleFileName = this.newSampleData.inputFileName
 | 
			
		||||
      this.params_toDB.gasFileName = this.newSampleData.gasFileName
 | 
			
		||||
      this.params_toDB.detFileName = this.newSampleData.detFileName
 | 
			
		||||
      this.params_toDB.qcFileName = this.newSampleData.qcFileName
 | 
			
		||||
      this.params_toDB.dbName = this.newSampleData.dbName
 | 
			
		||||
        this.params_toDB.sampleFileName = this.newSampleData.inputFileName
 | 
			
		||||
        this.params_toDB.gasFileName = this.newSampleData.gasFileName
 | 
			
		||||
        this.params_toDB.detFileName = this.newSampleData.detFileName
 | 
			
		||||
        this.params_toDB.qcFileName = this.newSampleData.qcFileName
 | 
			
		||||
        this.params_toDB.dbName = this.newSampleData.dbName
 | 
			
		||||
 | 
			
		||||
      downloadFile(url, `result.${saveFormat}`, this.params_toDB, 'post')
 | 
			
		||||
        downloadFile(url, `result.${saveFormat}`, this.params_toDB, 'post')
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -572,6 +581,13 @@ export default {
 | 
			
		|||
     */
 | 
			
		||||
    handleSavePHDToFile(type) {
 | 
			
		||||
      console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', type)
 | 
			
		||||
      if (this.isGamma) {
 | 
			
		||||
        const url = '/gamma/saveToPHD'
 | 
			
		||||
        let params = {
 | 
			
		||||
          fileName: this.newSampleData.inputFileName,
 | 
			
		||||
        }
 | 
			
		||||
        downloadFile(url, `result.PHD`, params, 'get')
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    handleReprocessAll() {
 | 
			
		||||
| 
						 | 
				
			
			@ -797,6 +813,7 @@ export default {
 | 
			
		|||
              },
 | 
			
		||||
              on: {
 | 
			
		||||
                menuClick: () => {
 | 
			
		||||
                  console.log(this.isBetaGamma, this.isGamma)
 | 
			
		||||
                  this.saveSettingModalVisible = true
 | 
			
		||||
                },
 | 
			
		||||
                submenuClick: ({ item, child }) => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user