AnalysisSystemForRadionucli.../src/views/spectrumAnalysis/beta-gamma-analysis.vue

190 lines
5.2 KiB
Vue
Raw Normal View History

2023-06-28 19:25:11 +08:00
<template>
<div class="beta-gamma-analysis">
<div class="beta-gamma-spectrum-sample">
<beta-gamma-chart-container>
<template slot="title">
Beta-Gamma Spectrum: Sample
</template>
<beta-gamma-spectrum-chart ref="betaGammaChartRef" :data="twoDData" @positionChange="handlePositionChange" />
2023-06-28 19:25:11 +08:00
</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" />
</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" />
</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" title="Beta" color="#00ff1e" />
</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" title="Beta" color="#00ff1e" />
</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"></result-display>
</beta-gamma-chart-container>
</div>
</div>
<!-- Comparison Modal 开始 -->
<comparison-modal v-model="comparisonModalVisible" />
<!-- Comparison Modal 结束 -->
2023-06-28 19:25:11 +08:00
</div>
</template>
<script>
import BetaGammaChartContainer from './components/BetaGammaChartContainer.vue'
import BetaGammaSpectrumChart from './components/BetaGammaSpectrumChart.vue'
import ComparisonModal from './components/Modals/ComparisonModal.vue'
2023-06-28 19:25:11 +08:00
import ResultDisplay from './components/ResultDisplay.vue'
import SpectrumLineChart from './components/SpectrumLineChart.vue'
import twoDData from './data.json'
2023-06-28 19:25:11 +08:00
export default {
components: {
BetaGammaChartContainer,
SpectrumLineChart,
ResultDisplay,
BetaGammaSpectrumChart,
ComparisonModal
},
2023-06-28 19:25:11 +08:00
data() {
return {
resultDisplay: [
{
id: 1,
isotope: 'Xe131m',
concentration: '0.03464',
uncertainty: '+/-0.01988',
mdc: '0.03464'
},
{
id: 2,
isotope: 'Xe131m',
concentration: '0.03464',
uncertainty: '+/-0.01988',
mdc: '0.03464'
},
{
id: 3,
isotope: 'Xe131m',
concentration: '0.03464',
uncertainty: '+/-0.01988',
mdc: '0.03464'
},
{
id: 4,
isotope: 'Xe131m',
concentration: '0.03464',
uncertainty: '+/-0.01988',
mdc: '0.03464'
}
],
twoDData: {},
comparisonModalVisible: false
2023-06-28 19:25:11 +08:00
}
},
created() {
this.getData()
},
2023-06-28 19:25:11 +08:00
methods: {
resize() {
this.$refs.betaGammaChartRef && this.$refs.betaGammaChartRef.resize()
2023-06-28 19:25:11 +08:00
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()
},
async getData() {
await 0
this.twoDData = twoDData
},
// 鼠标在左侧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)
2023-06-28 19:25:11 +08:00
}
}
}
</script>
<style lang="less" scoped>
.beta-gamma-analysis {
height: 100%;
display: flex;
overflow: auto hidden;
.beta-gamma-spectrum-sample {
width: calc(100% - 1078px);
}
.beta-and-gamma-spectrum {
width: 1048px;
margin-left: 30px;
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>