接口数据结构调整,完成普的切换功能

This commit is contained in:
任珮宇 2024-01-18 09:56:58 +08:00
parent 0e9e68ec76
commit 90a0140b91
2 changed files with 13 additions and 19 deletions

View File

@ -87,17 +87,9 @@ const SampleType = [
label: 'Sample Data',
value: 'sample',
},
{
label: 'GasBg Data',
value: 'gasBg',
},
{
label: 'DetBg Data',
value: 'detBg',
},
{
label: 'QC Data',
value: 'qc',
value: 'det',
},
]
export default {
@ -143,7 +135,7 @@ export default {
if (sampleData) {
const { data, from } = sampleData
this.sampleDetail = data
this.handleChangeResult(data)
this.changeChartByType('sample')
if (from == 'db') {
this.sampleDetail = data
this.emitGetFiles(data)
@ -185,6 +177,7 @@ export default {
}
},
async getSelfStationSampleDetail() {
this.spectraType = this.SampleType[0].value
const { inputFileName, detFileName } = this.sample
let params = {
sampleFileName: inputFileName,
@ -204,7 +197,7 @@ export default {
from: 'file',
})
this.sampleDetail = result
this.handleChangeResult(result)
this.changeChartByType('sample')
this.isLoading = false
} else {
this.$message.error(message)
@ -213,7 +206,10 @@ export default {
console.error(error)
}
},
handleChangeResult(res) {
changeChartByType(val) {
this.roiParamList = []
this.boundaryList = []
this.ROILists = []
const {
spectrumData,
betaEnergyData,
@ -231,7 +227,7 @@ export default {
ROIThreeStop,
ROIFourStart,
ROIFourStop,
} = this.sampleDetail
} = this.sampleDetail[this.spectraType]
this.spectrumData = spectrumData
this.histogramDataList = histogramDataList
this.gammaEnergyData = gammaEnergyData
@ -241,12 +237,12 @@ export default {
let roiParam2 = { start: ROITwoStart, stop: ROITwoStop }
let roiParam3 = { start: ROIThreeStart, stop: ROIThreeStop }
let roiParam4 = { start: ROIFourStart, stop: ROIFourStop }
this.roiParamList.push(roiParam1, roiParam2, roiParam3, roiParam4)
this.roiParamList = [roiParam1, roiParam2, roiParam3, roiParam4]
let boundary1 = { minX: ROIOneStart, maxX: ROIOneStop, minY: 0, maxY: 4096 }
let boundary2 = { minX: ROITwoStart, maxX: ROITwoStop, minY: 0, maxY: 4096 }
let boundary3 = { minX: ROIThreeStart, maxX: ROIThreeStop, minY: 0, maxY: 4096 }
let boundary4 = { minX: ROIFourStart, maxX: ROIFourStop, minY: 0, maxY: 4096 }
this.boundaryList.push(boundary1, boundary2, boundary3, boundary4)
this.boundaryList = [boundary1, boundary2, boundary3, boundary4]
},
cancelLastRequest() {
if (this._cancelToken && typeof this._cancelToken == 'function') {
@ -260,9 +256,6 @@ export default {
})
return cancelToken
},
changeChartByType(val) {
console.log(val)
},
handleQcFlagClick(item) {
console.log(item)
},

View File

@ -256,6 +256,7 @@ const gammaOption = {
type: 'line',
smooth: true,
showSymbol: false,
animation: false,
symbol: 'circle',
symbolSize: 6,
data: [],
@ -580,7 +581,7 @@ export default {
this.twoDOption.yAxis.max = 4096
// this.emitRangeChange([0, 256, 0, 256])
// this.reDrawRect()
this.reDrawRect()
this.buildScatterList()
},