799 lines
23 KiB
Vue
799 lines
23 KiB
Vue
<template>
|
||
<div class="beta-gamma-analysis">
|
||
<a-spin :spinning="isLoading">
|
||
<!-- 二级交互栏 -->
|
||
<div class="spectrum-analysis-sub-operators">
|
||
<pop-over-with-icon placement="bottomLeft">
|
||
Detailed-Information
|
||
<beta-gamma-detailed-infomation slot="content" :data="spectrumData" />
|
||
</pop-over-with-icon>
|
||
<custom-select
|
||
v-model="spectraType"
|
||
:options="SampleType"
|
||
@change="changeChartByType"
|
||
style="width: 154px"
|
||
class="sample-select"
|
||
></custom-select>
|
||
<pop-over-with-icon placement="right" v-model="qcFlagsVisible">
|
||
QC Flags
|
||
<beta-gamma-qc-flags slot="content" :data="qcFlags" @click="handleQcFlagClick" />
|
||
</pop-over-with-icon>
|
||
</div>
|
||
|
||
<!-- 二级交互栏结束 -->
|
||
<!-- 主体部分 -->
|
||
<div class="beta-gamma-analysis-main">
|
||
<!-- 左侧图表 -->
|
||
<div class="beta-gamma-spectrum-sample">
|
||
<beta-gamma-chart-container>
|
||
<template slot="title"> Beta-Gamma Spectrum: {{ currSpectrum }} </template>
|
||
<beta-gamma-spectrum-chart
|
||
ref="betaGammaChartRef"
|
||
:histogramDataList="histogramDataList"
|
||
:histogramDataDList="histogramDataDList"
|
||
:boundary="boundaryList"
|
||
@positionChange="handlePositionChange"
|
||
@rangeChange="handleRangeChange"
|
||
/>
|
||
</beta-gamma-chart-container>
|
||
</div>
|
||
<!-- 左侧图表结束 -->
|
||
|
||
<!-- 右侧 -->
|
||
<div class="beta-and-gamma-spectrum">
|
||
<!-- 四个图表开始 -->
|
||
<div class="spectrum-charts">
|
||
<div class="gamma-spectrum">
|
||
<div class="gamma-spectrum-item">
|
||
<beta-gamma-chart-container>
|
||
<template slot="title"> Gamma Spectrum: Original </template>
|
||
<spectrum-line-chart
|
||
ref="lineChart1Ref"
|
||
:data="gammaOriginalData"
|
||
:energy="gammaEnergyData"
|
||
@rangeChange="handleLineChartRangeChange($event, 'y')"
|
||
/>
|
||
</beta-gamma-chart-container>
|
||
</div>
|
||
<div class="gamma-spectrum-item">
|
||
<beta-gamma-chart-container>
|
||
<template slot="title"> Gamma Spectrum: Projected </template>
|
||
<spectrum-line-chart
|
||
ref="lineChart2Ref"
|
||
:data="gammaProjectedData"
|
||
:energy="gammaEnergyData"
|
||
@rangeChange="handleLineChartRangeChange($event, 'y')"
|
||
/>
|
||
</beta-gamma-chart-container>
|
||
</div>
|
||
</div>
|
||
<div class="gamma-spectrum">
|
||
<div class="gamma-spectrum-item">
|
||
<beta-gamma-chart-container>
|
||
<template slot="title"> Beta Spectrum: Original </template>
|
||
<spectrum-line-chart
|
||
ref="lineChart3Ref"
|
||
:data="betaOriginalData"
|
||
:energy="betaEnergyData"
|
||
title="Beta"
|
||
color="#00ff1e"
|
||
@rangeChange="handleLineChartRangeChange($event, 'x')"
|
||
/>
|
||
</beta-gamma-chart-container>
|
||
</div>
|
||
<div class="gamma-spectrum-item">
|
||
<beta-gamma-chart-container>
|
||
<template slot="title"> Beta Spectrum: Projected </template>
|
||
<spectrum-line-chart
|
||
ref="lineChart4Ref"
|
||
:data="betaProjectedData"
|
||
:energy="betaEnergyData"
|
||
title="Beta"
|
||
color="#00ff1e"
|
||
@rangeChange="handleLineChartRangeChange($event, 'x')"
|
||
/>
|
||
</beta-gamma-chart-container>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- 四个图表结束 -->
|
||
|
||
<!-- 结果显示开始 -->
|
||
<div class="result-display">
|
||
<beta-gamma-chart-container>
|
||
<template slot="title"> Result display </template>
|
||
<result-display :data="resultDisplay" @sendFlag="handleGetFlag" @zoom="handleZoom"></result-display>
|
||
</beta-gamma-chart-container>
|
||
</div>
|
||
<!-- 结果显示结束 -->
|
||
</div>
|
||
<!-- 右侧结束 -->
|
||
|
||
<!-- Comparison Modal 开始 -->
|
||
<comparison-modal v-model="comparisonModalVisible" />
|
||
<!-- Comparison Modal 结束 -->
|
||
</div>
|
||
<!-- 主体部分结束 -->
|
||
</a-spin>
|
||
|
||
<statistics-paramer-history-modal-for-qc-flags v-model="statisticModalVisible" :statisticsType="statisticsType" />
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import { getAction, postAction } from '../../api/manage'
|
||
import BetaGammaChartContainer from './components/BetaGammaChartContainer.vue'
|
||
import BetaGammaSpectrumChart from './components/BetaGammaSpectrumChart.vue'
|
||
import StatisticsParamerHistoryModalForQcFlags from './components/Modals/BetaGammaModals/StatisticsParamerHistoryModalForQCFlags.vue'
|
||
import ComparisonModal from './components/Modals/ComparisonModal.vue'
|
||
import ResultDisplay from './components/ResultDisplay.vue'
|
||
import SpectrumLineChart from './components/SpectrumLineChart.vue'
|
||
import BetaGammaDetailedInfomation from './components/SubOperators/BetaGammaDetailedInfomation.vue'
|
||
import BetaGammaQcFlags from './components/SubOperators/BetaGammaQcFlags.vue'
|
||
import PopOverWithIcon from './components/SubOperators/PopOverWithIcon.vue'
|
||
import Spectra from './components/SubOperators/Spectra.vue'
|
||
import CustomSelect from '@/components/CustomSelect/index.vue'
|
||
import axios from 'axios'
|
||
|
||
const StatisticsType = {
|
||
'Collection Time': 'Colloc_Time',
|
||
'Acq Time': 'Acq_Time',
|
||
'Xe Volume': 'Xe_volumn',
|
||
'Air Volume': 'Sample_Volumn',
|
||
}
|
||
|
||
const SampleType = [
|
||
{
|
||
label: 'Sample Data',
|
||
value: 'sample',
|
||
},
|
||
{
|
||
label: 'GasBg Data',
|
||
value: 'gasBg',
|
||
},
|
||
{
|
||
label: 'DetBg Data',
|
||
value: 'detBg',
|
||
},
|
||
{
|
||
label: 'QC Data',
|
||
value: 'qc',
|
||
},
|
||
]
|
||
|
||
const sortList = ['Xe131m', 'Xe133', 'Xe133m', 'Xe135']
|
||
|
||
export default {
|
||
components: {
|
||
BetaGammaChartContainer,
|
||
SpectrumLineChart,
|
||
ResultDisplay,
|
||
BetaGammaSpectrumChart,
|
||
ComparisonModal,
|
||
|
||
PopOverWithIcon,
|
||
Spectra,
|
||
BetaGammaQcFlags,
|
||
BetaGammaDetailedInfomation,
|
||
StatisticsParamerHistoryModalForQcFlags,
|
||
CustomSelect,
|
||
},
|
||
props: {
|
||
sample: {
|
||
type: Object,
|
||
},
|
||
sampleInfo: {
|
||
type: Object,
|
||
},
|
||
analyseCurrentSpectrum: {
|
||
type: Object,
|
||
},
|
||
},
|
||
data() {
|
||
this.SampleType = SampleType
|
||
|
||
return {
|
||
currSpectrum: '',
|
||
// analyseCurrentSpectrum: {},
|
||
qcFlags: {},
|
||
|
||
sampleDetail: {},
|
||
|
||
spectraVisible: false,
|
||
spectraType: 'sample',
|
||
|
||
isLoading: false,
|
||
|
||
spectrumData: {}, // Detailed Infomation 信息
|
||
|
||
resultDisplay: [],
|
||
currResultDisplay: [],
|
||
|
||
histogramDataList: [],
|
||
histogramDataDList: [],
|
||
boundaryList: [],
|
||
|
||
gammaOriginalData: [],
|
||
gammaProjectedData: [],
|
||
|
||
betaOriginalData: [],
|
||
betaProjectedData: [],
|
||
|
||
gammaEnergyData: [],
|
||
betaEnergyData: [],
|
||
|
||
comparisonModalVisible: false,
|
||
|
||
statisticModalVisible: false, // Qc Flags 点击后的弹窗
|
||
statisticsType: StatisticsType['Collection Time'],
|
||
currSample: {},
|
||
copyXeData: null,
|
||
qcFlagsVisible: false,
|
||
}
|
||
},
|
||
created() {
|
||
this.$bus.$on('ReAnalyses', this.handleReAnalyse)
|
||
},
|
||
mounted() {
|
||
this.qcFlagsTimer = setTimeout(() => {
|
||
this.qcFlagsVisible = true
|
||
}, 100)
|
||
},
|
||
destroyed() {
|
||
this.cancelLastRequest()
|
||
this.$bus.$off('ReAnalyses', this.handleReAnalyse)
|
||
|
||
if (this.qcFlagsTimer) {
|
||
clearTimeout(this.qcFlagsTimer)
|
||
}
|
||
},
|
||
methods: {
|
||
// 重新绘制矩形框
|
||
handleReAnalyse(result) {
|
||
const keys = ['SampleBoundary', 'GasBoundary', 'DetBoundary', 'QCBoundary']
|
||
SampleType.forEach((item, index) => {
|
||
const value = result[keys[index]]
|
||
this.sampleDetail[item.value].Boundary = value || []
|
||
})
|
||
|
||
const mapper = [
|
||
{
|
||
key: 'sample',
|
||
sampleType: 'sample',
|
||
},
|
||
{
|
||
key: 'gas',
|
||
sampleType: 'gasBg',
|
||
},
|
||
{
|
||
key: 'det',
|
||
sampleType: 'detBg',
|
||
},
|
||
{
|
||
key: 'qc',
|
||
sampleType: 'qc',
|
||
},
|
||
]
|
||
|
||
const dimension = ['beta', 'gamma'] // sampleDatail的key的维度
|
||
const dimension2 = ['Beta', 'Gamma'] // 返回值的key的维度
|
||
|
||
for (let i = 0; i < mapper.length; i++) {
|
||
for (let j = 0; j < dimension.length; j++) {
|
||
const key = `${mapper[i].key}${dimension2[j]}EnergyData` // 返回的result中的key,形如 gasBetaEnergyData
|
||
const value = result[key]
|
||
// 如果有值,将值赋给相应的sampleDetail中的谱的energy
|
||
if (value) {
|
||
const dimensionKey = dimension[j]
|
||
const sampleType = mapper[i].sampleType
|
||
this.sampleDetail[sampleType][`${dimensionKey}EnergyData`] = value
|
||
}
|
||
}
|
||
}
|
||
|
||
this.changeChartByType(this.spectraType)
|
||
},
|
||
|
||
handleGetFlag(val, obj) {
|
||
this.resultDisplay.forEach((item) => {
|
||
if (item.nuclideName === obj.nuclideName) {
|
||
item.nidFlag = val ? 1 : 0
|
||
}
|
||
})
|
||
this.$emit('sendInfo', this.resultDisplay, this.spectrumData.stationCode)
|
||
},
|
||
async getSampleDetail() {
|
||
this.spectraType = this.SampleType[0].value
|
||
|
||
const { dbName, sampleId, inputFileName, analyst } = this.sample
|
||
try {
|
||
this.cancelLastRequest()
|
||
this.isLoading = true
|
||
const cancelToken = this.createCancelToken()
|
||
const { success, result, message } = await getAction(
|
||
'/spectrumAnalysis/getDBSpectrumChart',
|
||
{
|
||
dbName,
|
||
sampleId,
|
||
analyst,
|
||
},
|
||
cancelToken
|
||
)
|
||
if (success) {
|
||
this.isLoading = false
|
||
this.sampleDetail = result
|
||
this.changeChartByType('sample')
|
||
this.emitGetFiles(result)
|
||
|
||
this.$store.commit('ADD_SAMPLE_DATA', {
|
||
inputFileName,
|
||
data: result,
|
||
from: 'db',
|
||
})
|
||
} else {
|
||
this.$message.error(message)
|
||
}
|
||
} catch (error) {
|
||
console.error(error)
|
||
const isCancel = axios.isCancel(error)
|
||
if(!isCancel) {
|
||
this.isLoading = false
|
||
}
|
||
}
|
||
},
|
||
|
||
emitGetFiles(result) {
|
||
this.$emit('getFiles', {
|
||
detFileName: result.detBg.fileName,
|
||
gasFileName: result.gasBg.fileName,
|
||
qcFileName: result.qc ? result.qc.fileName : '',
|
||
})
|
||
},
|
||
|
||
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.cancelLastRequest()
|
||
this.isLoading = true
|
||
const cancelToken = this.createCancelToken()
|
||
const { success, result, message } = await getAction(
|
||
'/spectrumAnalysis/getFileSpectrumChart',
|
||
params,
|
||
cancelToken
|
||
)
|
||
if (success) {
|
||
this.sampleDetail = result
|
||
this.changeChartByType('sample')
|
||
|
||
this.$store.commit('ADD_SAMPLE_DATA', {
|
||
inputFileName: this.sample.sampleFileName,
|
||
data: result,
|
||
from: 'file',
|
||
})
|
||
this.isLoading = false
|
||
} else {
|
||
this.$message.error(message)
|
||
}
|
||
} catch (error) {
|
||
console.error(error)
|
||
const isCancel = axios.isCancel(error)
|
||
if(!isCancel) {
|
||
this.isLoading = false
|
||
}
|
||
}
|
||
},
|
||
|
||
cancelLastRequest() {
|
||
if (this._cancelToken && typeof this._cancelToken == 'function') {
|
||
this._cancelToken()
|
||
this._cancelToken = undefined
|
||
}
|
||
},
|
||
|
||
createCancelToken() {
|
||
const cancelToken = new axios.CancelToken((c) => {
|
||
this._cancelToken = c
|
||
})
|
||
return cancelToken
|
||
},
|
||
|
||
changeChartByType(val) {
|
||
if (val === 'qc' && !this.sampleDetail.qc) {
|
||
this.$message.warning('No qc spectrum file!')
|
||
} else {
|
||
if (val == 'sample') this.currSpectrum = 'Sample'
|
||
if (val == 'gasBg') this.currSpectrum = 'Gas'
|
||
if (val == 'detBg') this.currSpectrum = 'Det'
|
||
if (val == 'qc') this.currSpectrum = 'QC'
|
||
|
||
const {
|
||
betaOriginalData,
|
||
betaProjectedData,
|
||
betaEnergyData,
|
||
|
||
gammaOriginalData,
|
||
gammaProjectedData,
|
||
gammaEnergyData,
|
||
|
||
histogramDataList, // 左侧 Beta-Gamma Spectrum: Sample 图表
|
||
histogramDataDList, // 左侧 Beta-Gamma Spectrum: Sample 图表的3D部分
|
||
Boundary, // 左侧2d图表的矩形
|
||
|
||
spectrumData,
|
||
|
||
AcqTimeBtn, // QC Flags 相关
|
||
CollectTimeBtn, // QC Flags 相关
|
||
SampleVolumeBtn, // QC Flags 相关
|
||
XeVolumeBtn, // QC Flags 相关
|
||
GasBgBtn, // QC Flags 相关
|
||
DetBgBtn, // QC Flags 相关
|
||
} = this.sampleDetail[this.spectraType]
|
||
const {
|
||
XeData, // 右下角Result Display
|
||
savedAnalysisResult,
|
||
} = this.sampleDetail
|
||
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
|
||
|
||
console.log('this.resultDisplaythis.resultDisplay', this.resultDisplay)
|
||
|
||
this.resultDisplay = this.copyXeData
|
||
? this.copyXeData
|
||
: this.resultDisplay.length > 0
|
||
? this.resultDisplay
|
||
: XeData
|
||
|
||
this.sortResultDisplay()
|
||
|
||
this.$emit('sendInfo', this.resultDisplay, this.spectrumData.stationCode, savedAnalysisResult)
|
||
|
||
this.qcFlags = {
|
||
AcqTimeBtn,
|
||
CollectTimeBtn,
|
||
SampleVolumeBtn,
|
||
XeVolumeBtn,
|
||
GasBgBtn,
|
||
DetBgBtn,
|
||
}
|
||
}
|
||
},
|
||
|
||
resize() {
|
||
this.$refs.betaGammaChartRef && this.$refs.betaGammaChartRef.resize()
|
||
this.$refs.lineChart1Ref && this.$refs.lineChart1Ref.resize()
|
||
this.$refs.lineChart2Ref && this.$refs.lineChart2Ref.resize()
|
||
this.$refs.lineChart3Ref && this.$refs.lineChart3Ref.resize()
|
||
this.$refs.lineChart4Ref && this.$refs.lineChart4Ref.resize()
|
||
},
|
||
|
||
// 鼠标在左侧2d图表上移动时
|
||
handlePositionChange([xAxis, yAxis]) {
|
||
// Gamma Spectrum,根据bata-gamma的gamma channel的值(y轴)进行定位
|
||
this.$refs.lineChart1Ref.setLinePosition(yAxis)
|
||
this.$refs.lineChart2Ref.setLinePosition(yAxis)
|
||
|
||
// Beta Spectrum,根据bata-gamma的bata channel的值(x轴)进行定位
|
||
this.$refs.lineChart3Ref.setLinePosition(xAxis)
|
||
this.$refs.lineChart4Ref.setLinePosition(xAxis)
|
||
},
|
||
|
||
// 鼠标在左侧2d图表上刷选时
|
||
handleRangeChange([x1, x2, y1, y2]) {
|
||
this.$refs.lineChart1Ref.setRange(y1, y2)
|
||
this.$refs.lineChart2Ref.setRange(y1, y2)
|
||
|
||
this.$refs.lineChart3Ref.setRange(x1, x2)
|
||
this.$refs.lineChart4Ref.setRange(x1, x2)
|
||
},
|
||
|
||
/**
|
||
* 右侧折线图表刷选时
|
||
* @param {number[]} range 范围
|
||
* @param {'x'|'y'} type 类型
|
||
**/
|
||
|
||
handleLineChartRangeChange([x1, x2], type) {
|
||
if (type == 'y') {
|
||
// 如果是gamma channel变化
|
||
this.$refs.lineChart1Ref.setRange(x1, x2)
|
||
this.$refs.lineChart2Ref.setRange(x1, x2)
|
||
} else if (type == 'x') {
|
||
this.$refs.lineChart3Ref.setRange(x1, x2)
|
||
this.$refs.lineChart4Ref.setRange(x1, x2)
|
||
}
|
||
|
||
this.$refs.betaGammaChartRef.setRange(x1, x2, type)
|
||
},
|
||
|
||
// QC Flags 除去GasBg 和 DetBg其他四个点击时
|
||
handleQcFlagClick(item) {
|
||
const statisticsType = StatisticsType[item]
|
||
if (statisticsType) {
|
||
this.statisticsType = statisticsType
|
||
this.statisticModalVisible = true
|
||
}
|
||
},
|
||
|
||
// 重新分析,设置右侧折线图的Energy
|
||
reanalyse([type, data]) {
|
||
const energy = data.map((item) => [item.y])
|
||
if (type == 'gamma') {
|
||
this.gammaEnergyData = energy
|
||
} else {
|
||
this.betaEnergyData = energy
|
||
}
|
||
},
|
||
// beta Analyze current spectrum 分析接口
|
||
getAnalyzeCurrentSpectrum() {
|
||
let params = {
|
||
dbNames: [this.sample.dbName],
|
||
sampleIds: [this.sample.sampleId ? this.sample.sampleId : ''],
|
||
sampleFileNames: [this.sample.inputFileName],
|
||
gasFileNames: [this.sample.gasFileName],
|
||
detFileNames: [this.sample.detFileName],
|
||
qcFileNames: [this.sample.qcFileName],
|
||
}
|
||
postAction('/spectrumAnalysis/analyseCurrentSpectrum', params).then((res) => {
|
||
if (res.success) {
|
||
// this.isReAnalyed_beta = true
|
||
// this.analyseCurrentSpectrum = res.result
|
||
this.$emit('sendXeData', res.result.XeData)
|
||
if (res.result.XeData && res.result.XeData.length > 0) {
|
||
res.result.XeData.forEach((item) => {
|
||
item.conc = parseFloat(item.conc.toPrecision(6))
|
||
item.concErr = parseFloat(item.concErr.toPrecision(6))
|
||
item.lc = parseFloat(item.lc.toPrecision(6))
|
||
item.mdc = parseFloat(item.mdc.toPrecision(6))
|
||
})
|
||
this.$emit('reAnalyCurr', true, res.result.XeData)
|
||
this.copyXeData = res.result.XeData
|
||
|
||
this.handleReAnalyse(res.result)
|
||
}
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
}
|
||
})
|
||
},
|
||
getAnalyzeAllSpectrum() {
|
||
let params = {
|
||
dbNames: [this.sample.dbName],
|
||
sampleIds: [this.sample.sampleId ? this.sample.sampleId : ''],
|
||
sampleFileNames: [this.sample.inputFileName],
|
||
gasFileNames: [this.sample.gasFileName],
|
||
detFileNames: [this.sample.detFileName],
|
||
qcFileNames: [this.sample.qcFileName],
|
||
currentFileName: this.sample.inputFileName,
|
||
}
|
||
postAction('/spectrumAnalysis/analyseAllSpectrum', params).then((res) => {
|
||
if (res.success) {
|
||
// this.analyseCurrentSpectrum = res.result
|
||
this.$emit('sendXeData', res.result.XeData)
|
||
res.result.XeData.forEach((item) => {
|
||
item.conc = parseFloat(item.conc.toPrecision(6))
|
||
item.concErr = parseFloat(item.concErr.toPrecision(6))
|
||
item.lc = parseFloat(item.lc.toPrecision(6))
|
||
item.mdc = parseFloat(item.mdc.toPrecision(6))
|
||
})
|
||
this.$emit('reAnalyAll', true, res.result.XeData)
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
}
|
||
})
|
||
},
|
||
|
||
// 右下角放大镜
|
||
handleZoom(nuclideName) {
|
||
let ROI_nums = []
|
||
switch (nuclideName) {
|
||
case 'Xe131m':
|
||
ROI_nums = [5]
|
||
break
|
||
case 'Xe133m':
|
||
ROI_nums = [6]
|
||
break
|
||
case 'Xe133':
|
||
ROI_nums = [3, 4]
|
||
break
|
||
case 'Xe135':
|
||
ROI_nums = [2]
|
||
break
|
||
}
|
||
|
||
if (this.boundaryList.length) {
|
||
let left = 0,
|
||
right = 0,
|
||
top = 0,
|
||
bottom = 0
|
||
for (let i = 0; i < ROI_nums.length; ++i) {
|
||
const ROI_line = this.boundaryList[ROI_nums[i]]
|
||
left = Math.min(left, ROI_line.minX)
|
||
right = Math.max(right, ROI_line.maxX)
|
||
top = Math.max(top, ROI_line.maxY)
|
||
bottom = Math.min(bottom, ROI_line.minY)
|
||
}
|
||
|
||
const minX = left - 10,
|
||
maxX = right + 10,
|
||
minY = bottom - 10,
|
||
maxY = top + 10
|
||
|
||
this.$refs.betaGammaChartRef.setRange(minX, maxX, 'x')
|
||
this.$refs.betaGammaChartRef.setRange(minY, maxY, 'y')
|
||
|
||
this.$refs.lineChart1Ref.setRange(minY, maxY)
|
||
this.$refs.lineChart2Ref.setRange(minY, maxY)
|
||
|
||
this.$refs.lineChart3Ref.setRange(minX, maxX)
|
||
this.$refs.lineChart4Ref.setRange(minX, maxX)
|
||
}
|
||
},
|
||
|
||
// 排序result display
|
||
sortResultDisplay() {
|
||
this.resultDisplay.sort((a, b) => {
|
||
const index1 = sortList.indexOf(a.nuclideName)
|
||
const index2 = sortList.indexOf(b.nuclideName)
|
||
return index1 - index2
|
||
})
|
||
},
|
||
},
|
||
watch: {
|
||
sample: {
|
||
async handler(newVal, oldVal) {
|
||
this.resultDisplay = []
|
||
const sampleData = await this.$store.dispatch('GET_SAMPLE_DATA', newVal.inputFileName)
|
||
if (sampleData) {
|
||
this.cancelLastRequest()
|
||
this.isLoading = false
|
||
const { data, from } = sampleData
|
||
this.sampleDetail = data
|
||
this.changeChartByType('sample')
|
||
if (from == 'db') {
|
||
this.sampleDetail = data
|
||
this.emitGetFiles(data)
|
||
}
|
||
} else {
|
||
if (newVal.sampleId) {
|
||
this.getSampleDetail()
|
||
} else {
|
||
this.getSampleDetail_file()
|
||
}
|
||
}
|
||
this.$refs.betaGammaChartRef.handleUnzoom()
|
||
},
|
||
immediate: true,
|
||
deep: true,
|
||
},
|
||
analyseCurrentSpectrum: {
|
||
handler(newVal, oldVal) {
|
||
// this.currResultDisplay = newVal.XeData
|
||
this.resultDisplay = newVal.XeData || []
|
||
this.sortResultDisplay()
|
||
this.$store.commit('UPDATE_SAMPLE_DATA', {
|
||
inputFileName: this.sample.inputFileName,
|
||
key: 'XeData',
|
||
data: newVal.XeData,
|
||
})
|
||
},
|
||
// immediate: true,
|
||
deep: true,
|
||
},
|
||
sampleInfo: {
|
||
handler(newVal, oldVal) {
|
||
this.spectrumData.sampleId = newVal.sampleId
|
||
this.spectrumData.status = newVal.status
|
||
},
|
||
immediate: true,
|
||
deep: true,
|
||
},
|
||
},
|
||
}
|
||
</script>
|
||
|
||
<style lang="less" scoped>
|
||
.beta-gamma-analysis {
|
||
height: 100%;
|
||
|
||
.ant-spin-nested-loading {
|
||
height: 100%;
|
||
|
||
::v-deep {
|
||
.ant-spin-container {
|
||
height: 100%;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 二级操作栏开始
|
||
.spectrum-analysis-sub-operators {
|
||
flex-shrink: 0;
|
||
margin-bottom: 19px;
|
||
display: flex;
|
||
gap: 11px;
|
||
flex-wrap: nowrap;
|
||
overflow: auto;
|
||
height: 46px;
|
||
align-items: center;
|
||
|
||
.pop-over-with-icon {
|
||
height: 32px;
|
||
|
||
&:nth-child(1) {
|
||
width: 224px;
|
||
}
|
||
|
||
&:nth-child(3) {
|
||
width: 125px;
|
||
}
|
||
}
|
||
}
|
||
// 二级操作栏结束
|
||
|
||
.sample-select {
|
||
::v-deep {
|
||
.ant-select-selection {
|
||
background-color: transparent !important;
|
||
color: #ade6ee;
|
||
}
|
||
}
|
||
}
|
||
|
||
&-main {
|
||
height: calc(100% - 65px);
|
||
display: flex;
|
||
gap: 30px;
|
||
overflow: auto hidden;
|
||
}
|
||
|
||
.beta-gamma-spectrum-sample {
|
||
flex: 788;
|
||
}
|
||
|
||
.beta-and-gamma-spectrum {
|
||
flex: 1048;
|
||
flex-direction: column;
|
||
|
||
.spectrum-charts {
|
||
display: flex;
|
||
flex-direction: column;
|
||
height: calc(100% - 208px);
|
||
|
||
.gamma-spectrum {
|
||
display: flex;
|
||
height: 50%;
|
||
|
||
&-item {
|
||
flex: 509px;
|
||
|
||
&:first-child {
|
||
margin-right: 30px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
.result-display {
|
||
flex-shrink: 0;
|
||
}
|
||
}
|
||
}
|
||
</style>
|