Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
		
						commit
						2d22ac7db4
					
				| 
						 | 
					@ -95,9 +95,9 @@
 | 
				
			||||||
                  <span>C to E : </span>
 | 
					                  <span>C to E : </span>
 | 
				
			||||||
                  <span>
 | 
					                  <span>
 | 
				
			||||||
                    E =
 | 
					                    E =
 | 
				
			||||||
                    <a-input-number size="small" v-model="newCalibrationFuncModel.paramA" /> +
 | 
					                    <a-input-number size="small" v-model="newCalibrationFuncModel.paramA" @change="newCalibrationFuncModelChange()"/> +
 | 
				
			||||||
                    <a-input-number size="small" v-model="newCalibrationFuncModel.paramB" /> *C +
 | 
					                    <a-input-number size="small" v-model="newCalibrationFuncModel.paramB" @change="newCalibrationFuncModelChange()"/> *C +
 | 
				
			||||||
                    <a-input-number size="small" v-model="newCalibrationFuncModel.paramC" /> *C <sup>2</sup>
 | 
					                    <a-input-number size="small" v-model="newCalibrationFuncModel.paramC" @change="newCalibrationFuncModelChange()"/> *C <sup>2</sup>
 | 
				
			||||||
                  </span>
 | 
					                  </span>
 | 
				
			||||||
                </p>
 | 
					                </p>
 | 
				
			||||||
                <div class="func">
 | 
					                <div class="func">
 | 
				
			||||||
| 
						 | 
					@ -154,6 +154,7 @@ import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/
 | 
				
			||||||
import { cloneDeep } from 'lodash'
 | 
					import { cloneDeep } from 'lodash'
 | 
				
			||||||
import { isNullOrUndefined } from '@/utils/util'
 | 
					import { isNullOrUndefined } from '@/utils/util'
 | 
				
			||||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
 | 
					import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
 | 
				
			||||||
 | 
					import { f } from 'vue-area-linkage'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const initialGammaSpectrumChartOption = {
 | 
					const initialGammaSpectrumChartOption = {
 | 
				
			||||||
  grid: {
 | 
					  grid: {
 | 
				
			||||||
| 
						 | 
					@ -571,6 +572,11 @@ export default {
 | 
				
			||||||
        energy,
 | 
					        energy,
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // add之后 需要清空chart黄色的线 20231028:Xiao
 | 
				
			||||||
 | 
					      if(this.figureChartOption.series[1].data) {
 | 
				
			||||||
 | 
					        this.figureChartOption.series[1].data = []
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy })
 | 
					      this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const { min, max } = this.getFigureChartMaxAndMin()
 | 
					      const { min, max } = this.getFigureChartMaxAndMin()
 | 
				
			||||||
| 
						 | 
					@ -593,6 +599,18 @@ export default {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      this.isInverse = true
 | 
					      this.isInverse = true
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    // 输入框发生变化
 | 
				
			||||||
 | 
					    newCalibrationFuncModelChange(val,a) {
 | 
				
			||||||
 | 
					      // 输入内容的时候 需要清空table数据 20231028:Xiao
 | 
				
			||||||
 | 
					      this.list = []
 | 
				
			||||||
 | 
					      // 需要清空chart黄色的线 20231028:Xiao
 | 
				
			||||||
 | 
					      if(this.figureChartOption.series[1].data) {
 | 
				
			||||||
 | 
					        this.figureChartOption.series[1].data = []
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      if(this.figureChartOption.series[1].markPoint.data) {
 | 
				
			||||||
 | 
					        this.figureChartOption.series[1].markPoint.data = []
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // 删除表格里的单项
 | 
					    // 删除表格里的单项
 | 
				
			||||||
    handleDel(index) {
 | 
					    handleDel(index) {
 | 
				
			||||||
| 
						 | 
					@ -634,15 +652,20 @@ export default {
 | 
				
			||||||
    // 点击Fitting按钮执行重新计算
 | 
					    // 点击Fitting按钮执行重新计算
 | 
				
			||||||
    async handleFitting() {
 | 
					    async handleFitting() {
 | 
				
			||||||
      const hasEmpty = Object.entries(this.newCalibrationFuncModel).some(([_, v]) => !v)
 | 
					      const hasEmpty = Object.entries(this.newCalibrationFuncModel).some(([_, v]) => !v)
 | 
				
			||||||
      if (hasEmpty) {
 | 
					      if (hasEmpty && this.list.length < 3) {
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
 | 
					        const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
 | 
				
			||||||
          ...this.newCalibrationFuncModel,
 | 
					          ...this.newCalibrationFuncModel,
 | 
				
			||||||
          tempPoints: this.isFirstFitting
 | 
					          // 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
 | 
				
			||||||
            ? this.oldScatterSeries
 | 
					          tempPoints: this.list.length > 0
 | 
				
			||||||
            : this.list.map((item) => ({ x: item.channel, y: item.energy })),
 | 
					            ? this.list.map((item) => ({ x: item.channel, y: item.energy }))
 | 
				
			||||||
 | 
					            : this.oldScatterSeries,
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            // tempPoints: this.isFirstFitting
 | 
				
			||||||
 | 
					            // ? this.oldScatterSeries
 | 
				
			||||||
 | 
					            // : this.list.map((item) => ({ x: item.channel, y: item.energy })),
 | 
				
			||||||
          count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
 | 
					          count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        if (success) {
 | 
					        if (success) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,25 +37,32 @@ export default {
 | 
				
			||||||
        detBg: [],
 | 
					        detBg: [],
 | 
				
			||||||
        gasBg: [],
 | 
					        gasBg: [],
 | 
				
			||||||
        qc: [],
 | 
					        qc: [],
 | 
				
			||||||
        sample: []
 | 
					        sample: [],
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      isLoading: true,
 | 
					      isLoading: true,
 | 
				
			||||||
      fileName: '',
 | 
					      fileName: '',
 | 
				
			||||||
      currTab: 1
 | 
					      currTab: 1,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    async getContent() {
 | 
					    async getContent() {
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        this.isLoading = true
 | 
					        this.isLoading = true
 | 
				
			||||||
        const { sampleId, dbName, sampleFileName, gasFileName, detFileName, qcFileName } = this.newSampleData 
 | 
					        const {
 | 
				
			||||||
 | 
					          sampleId,
 | 
				
			||||||
 | 
					          dbName,
 | 
				
			||||||
 | 
					          inputFileName: sampleFileName,
 | 
				
			||||||
 | 
					          gasFileName,
 | 
				
			||||||
 | 
					          detFileName,
 | 
				
			||||||
 | 
					          qcFileName,
 | 
				
			||||||
 | 
					        } = this.newSampleData
 | 
				
			||||||
        const { success, result, message } = await getAction('/spectrumAnalysis/viewSpectrum', {
 | 
					        const { success, result, message } = await getAction('/spectrumAnalysis/viewSpectrum', {
 | 
				
			||||||
          sampleId,
 | 
					          sampleId,
 | 
				
			||||||
          dbName,
 | 
					          dbName,
 | 
				
			||||||
          sampleFileName,
 | 
					          sampleFileName,
 | 
				
			||||||
          gasFileName,
 | 
					          gasFileName,
 | 
				
			||||||
          detFileName,
 | 
					          detFileName,
 | 
				
			||||||
          qcFileName
 | 
					          qcFileName,
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        if (success) {
 | 
					        if (success) {
 | 
				
			||||||
          if (result) {
 | 
					          if (result) {
 | 
				
			||||||
| 
						 | 
					@ -78,8 +85,8 @@ export default {
 | 
				
			||||||
      this.currTab = key
 | 
					      this.currTab = key
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    handleOk() {
 | 
					    handleOk() {
 | 
				
			||||||
      this.fileName=""
 | 
					      this.fileName = ''
 | 
				
			||||||
      let text = ""
 | 
					      let text = ''
 | 
				
			||||||
      if (this.currTab == 1) {
 | 
					      if (this.currTab == 1) {
 | 
				
			||||||
        text = this.content.sample.join('\n')
 | 
					        text = this.content.sample.join('\n')
 | 
				
			||||||
      } else if (this.currTab == 2) {
 | 
					      } else if (this.currTab == 2) {
 | 
				
			||||||
| 
						 | 
					@ -90,30 +97,30 @@ export default {
 | 
				
			||||||
        text = this.content.qc.join('\n')
 | 
					        text = this.content.qc.join('\n')
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      if (text) {
 | 
					      if (text) {
 | 
				
			||||||
        let strData = new Blob([text], { type: 'text/plain;charset=utf-8' });
 | 
					        let strData = new Blob([text], { type: 'text/plain;charset=utf-8' })
 | 
				
			||||||
        // saveAs(strData, `GammaViewer Log.txt`)
 | 
					        // saveAs(strData, `GammaViewer Log.txt`)
 | 
				
			||||||
        let _this = this
 | 
					        let _this = this
 | 
				
			||||||
        this.$confirm({
 | 
					        this.$confirm({
 | 
				
			||||||
          title: 'Please enter file name',
 | 
					          title: 'Please enter file name',
 | 
				
			||||||
          content:  h => <a-input v-model={_this.fileName} />,
 | 
					          content: (h) => <a-input v-model={_this.fileName} />,
 | 
				
			||||||
          okText: 'Cancle',
 | 
					          okText: 'Cancle',
 | 
				
			||||||
          cancelText: 'Save',
 | 
					          cancelText: 'Save',
 | 
				
			||||||
          okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}},
 | 
					          okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
 | 
				
			||||||
          cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}},
 | 
					          cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
 | 
				
			||||||
          onOk() {
 | 
					          onOk() {
 | 
				
			||||||
            console.log('Cancel');
 | 
					            console.log('Cancel')
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          onCancel() {
 | 
					          onCancel() {
 | 
				
			||||||
            if (_this.fileName) {
 | 
					            if (_this.fileName) {
 | 
				
			||||||
              saveAs(strData, `${_this.fileName}.txt`)
 | 
					              saveAs(strData, `${_this.fileName}.txt`)
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
        });
 | 
					        })
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        this.$message.warning("No data can be saved!")
 | 
					        this.$message.warning('No data can be saved!')
 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user