formfile模块Beta 对接loadFromFile接口,数据显示

This commit is contained in:
renpy 2023-09-08 16:23:18 +08:00
parent 0fbdc38690
commit e48d029827
4 changed files with 86 additions and 53 deletions

View File

@ -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,
gammaOriginalData,
gammaProjectedData,
gammaEnergyData,
histogramDataList, // Beta-Gamma Spectrum: Sample
histogramDataDList, // Beta-Gamma Spectrum: Sample 3D
Boundary, // 2d
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]
this.spectrumData = spectrumData
this.histogramDataList = histogramDataList
this.histogramDataDList = histogramDataDList
this.boundaryList = Boundary
this.gammaOriginalData = gammaOriginalData
this.gammaProjectedData = gammaProjectedData
this.gammaEnergyData = gammaEnergyData
this.betaOriginalData = betaOriginalData
this.betaProjectedData = betaProjectedData
this.betaEnergyData = betaEnergyData
this.resultDisplay = XeData
this.qcFlags = {
AcqTimeBtn,
CollectTimeBtn,
SampleVolumeBtn,
XeVolumeBtn,
GasBgBtn,
DetBgBtn
changeChartByType(val) {
if (val==="qc"&&!this.sample.qcFileStatus) {
this.$message.warning("No qc spectrum file!")
} else {
const {
betaOriginalData,
betaProjectedData,
betaEnergyData,
gammaOriginalData,
gammaProjectedData,
gammaEnergyData,
histogramDataList, // Beta-Gamma Spectrum: Sample
histogramDataDList, // Beta-Gamma Spectrum: Sample 3D
Boundary, // 2d
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]
this.spectrumData = spectrumData
this.histogramDataList = histogramDataList
this.histogramDataDList = histogramDataDList
this.boundaryList = Boundary
this.gammaOriginalData = gammaOriginalData
this.gammaProjectedData = gammaProjectedData
this.gammaEnergyData = gammaEnergyData
this.betaOriginalData = betaOriginalData
this.betaProjectedData = betaProjectedData
this.betaEnergyData = betaEnergyData
this.resultDisplay = XeData
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
}

View File

@ -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>

View File

@ -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>

View File

@ -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