修复自建台站中存在的问题

This commit is contained in:
Xu Zhimeng 2024-07-31 14:09:14 +08:00
parent 4de6d60399
commit d0a75dabc5
9 changed files with 402 additions and 24 deletions

View File

@ -52,6 +52,7 @@
:boundary="boundaryList"
:isLoading.sync="isLoading"
@boundaryChange="handleBoundaryChange"
@open-modal="handleOpenModal"
/>
</beta-gamma-chart-container>
</div>
@ -59,7 +60,7 @@
<!-- 右侧开始 -->
<div class="beta-gamma-analysis-main-right">
<beta-gamma-chart-container>
<template slot="title"> ROI LIMITS </template>
<template slot="title"> Beta-Gated-Gamma-Spectrum </template>
<roi-limits
ref="RoiChartRef"
:ROILists="ROILists"
@ -82,6 +83,13 @@
</div>
<!-- 主体部分结束 -->
</a-spin>
<!-- Gamma 按钮的弹窗 -->
<gamma-modal ref="gammaModalRef" />
<!-- Gamma 按钮的弹窗结束 -->
<!-- Beta 按钮的弹窗 -->
<beta-modal ref="betaModalRef" />
<!-- Beta 按钮的弹窗结束 -->
</div>
</template>
@ -100,6 +108,8 @@ import store from '@/store/'
import { getAction, postAction, putAction } from '../../api/manage'
import { addSampleData, getSampleData, updateSampleData } from '@/utils/SampleStore'
import { cloneDeep } from 'lodash'
import GammaModal from './components/Modals/SelfStation/GammaModal.vue'
import BetaModal from './components/Modals/SelfStation/BetaModal.vue'
const SampleType = [
{
@ -131,6 +141,8 @@ export default {
BetaGammaSpectrum,
RoiLimits,
RoiParam,
GammaModal,
BetaModal,
},
props: {
sample: {
@ -450,7 +462,12 @@ export default {
return
}
if (val == 'sample') this.currSpectrum = 'Sample'
if (val == 'sample') {
this.currSpectrum = 'Sample'
this.ROIAnalyzeLists = this.sampleDetail.ROIAnalyzeLists
} else {
this.ROIAnalyzeLists = []
}
if (val == 'detBg') this.currSpectrum = 'Det'
this.roiParamList = cloneDeep(InitialRoiParamList)
this.boundaryList = []
@ -563,6 +580,20 @@ export default {
data: this.ROIAnalyzeLists,
})
},
// GammaBeta
handleOpenModal(index) {
const currSampleDetail = this.sampleDetail[this.spectraType]
if (!currSampleDetail) {
this.$message.warning(`No ${this.spectraType} spectrum file!`)
return
}
if (index == 0) {
this.$refs.gammaModalRef.open(currSampleDetail.gSpectrum, currSampleDetail.gammaEnergyData)
} else if (index == 1) {
this.$refs.betaModalRef.open(currSampleDetail.bSpectrum, currSampleDetail.betaEnergyData)
}
},
},
}
</script>

View File

@ -23,5 +23,7 @@ export const clearSampleCache = sampleList => {
removeSampleData(fileName)
Vue.ls.remove(`CALIBRATION_GAMMA_${fileName}`)
Vue.ls.remove(`CALIBRATION_BETA_${fileName}`)
Vue.ls.remove(`SELF_STATION_CALIBRATION_GAMMA_${fileName}`)
Vue.ls.remove(`SELF_STATION_CALIBRATION_BETA_${fileName}`)
})
}

View File

@ -361,7 +361,7 @@ export default {
// gammabeta
handleChange(index) {
console.log('%c [ 弹窗 ]-582', 'font-size:13px; background:pink; color:#bf2c9f;', index)
this.$emit('open-modal', index)
},
// unzoom
handleUnzoom() {

View File

@ -0,0 +1,171 @@
<template>
<custom-modal v-model="visible" title="Beta" width="800px" destroy-on-close>
<div class="beta-modal">
<div class="beta-modal__header">
<span class="count">Channel: {{ axisInfo.channel }}</span>
<span class="count">Count: {{ axisInfo.count }}</span>
<span class="energy">Energy: {{ axisInfo.energy }}</span>
</div>
<div class="beta-modal__content">
<custom-chart :option="option" autoresize />
</div>
</div>
</custom-modal>
</template>
<script>
import CustomChart from '@/components/CustomChart/index.vue'
import { buildLineSeries } from '@/utils/chartHelper'
import { cloneDeep } from 'lodash'
const initialOption = {
grid: {
top: 10,
left: 60,
right: 20,
bottom: 50,
},
tooltip: {
show: true,
trigger: 'axis',
formatter: () => {},
},
xAxis: {
type: 'value',
name: 'Gamma Channel',
nameTextStyle: {
color: '#5b9cba',
fontSize: 14,
},
nameLocation: 'center',
nameGap: 30,
boundaryGap: false,
splitLine: {
show: true,
interval: 'auto',
lineStyle: {
color: 'rgba(119, 181, 213, .3)',
},
},
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: 'rgba(119, 181, 213, .3)',
},
},
axisLabel: {
fontSize: 12,
color: '#ade6ee',
},
min: 0,
max: 512,
interval: 512 / 4,
},
yAxis: {
type: 'log',
name: 'Count',
nameTextStyle: {
color: '#5b9cba',
fontSize: 14,
},
nameLocation: 'center',
nameGap: 40,
splitLine: {
lineStyle: {
color: 'rgba(119, 181, 213, .3)',
},
},
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: 'rgba(119, 181, 213, .3)',
},
},
axisLabel: {
fontSize: 12,
color: '#ade6ee',
formatter: (value) => {
return value.toFixed(1)
},
},
min: 1,
max: 'dataMax',
},
series: buildLineSeries('Line', [], 'yellow'),
}
const initialAxisInfo = {
channel: 0,
count: 0,
energy: 0,
}
export default {
components: {
CustomChart,
},
data() {
return {
visible: false,
option: cloneDeep(initialOption),
axisInfo: cloneDeep(initialAxisInfo),
}
},
created() {
this.option.tooltip.formatter = this.handleTooltipFormat
},
methods: {
open(seriesData, energys) {
this.option.series.data = (seriesData || []).map(({ x, y }) => [x, y])
this.energys = energys || []
this.visible = true
},
handleTooltipFormat(params) {
const [channel, count] = params[0].value
this.axisInfo = {
channel,
count,
energy: (this.energys[channel] || 0).toFixed(3),
}
},
},
}
</script>
<style lang="less" scoped>
.beta-modal {
height: 400px;
display: flex;
flex-direction: column;
gap: 5px;
overflow: hidden;
&__header {
height: 18px;
display: flex;
justify-content: flex-end;
align-items: center;
gap: 28px;
&-count {
font-family: ArialMT;
font-size: 12px;
color: #ade6ee;
}
.energy {
color: #ff5656;
}
}
&__content {
flex: 1;
overflow: hidden;
}
}
</style>

View File

@ -191,14 +191,14 @@ export default {
// tab
if (this.currTab === 'gamma') {
this.$ls.set(
'CALIBRATION_GAMMA_' + inputFileName,
this.$ls.get('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)
'SELF_STATION_CALIBRATION_GAMMA_' + inputFileName,
this.$ls.get('SELF_STATION_CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)
)
}
if (this.currTab === 'beta') {
this.$ls.set(
'CALIBRATION_BETA_' + inputFileName,
this.$ls.get('CALIBRATION_BETA_' + this.newSampleData.inputFileName)
'SELF_STATION_CALIBRATION_BETA_' + inputFileName,
this.$ls.get('SELF_STATION_CALIBRATION_BETA_' + this.newSampleData.inputFileName)
)
}
})
@ -211,8 +211,8 @@ export default {
// ReANalyzefitting 20231101:xiao
// 1. BetaGamma
// 2. reanalyzebeta
this.$ls.remove('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)
this.$ls.remove('CALIBRATION_BETA_' + this.newSampleData.inputFileName)
this.$ls.remove('SELF_STATION_CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)
this.$ls.remove('SELF_STATION_CALIBRATION_BETA_' + this.newSampleData.inputFileName)
}
this.visible = false
},

View File

@ -0,0 +1,171 @@
<template>
<custom-modal v-model="visible" title="Gamma" width="800px" destroy-on-close>
<div class="gamma-modal">
<div class="gamma-modal__header">
<span class="count">Channel: {{ axisInfo.channel }}</span>
<span class="count">Count: {{ axisInfo.count }}</span>
<span class="energy">Energy: {{ axisInfo.energy }}</span>
</div>
<div class="gamma-modal__content">
<custom-chart :option="option" autoresize />
</div>
</div>
</custom-modal>
</template>
<script>
import CustomChart from '@/components/CustomChart/index.vue'
import { buildLineSeries } from '@/utils/chartHelper'
import { cloneDeep } from 'lodash'
const initialOption = {
grid: {
top: 10,
left: 60,
right: 20,
bottom: 50,
},
tooltip: {
show: true,
trigger: 'axis',
formatter: () => {},
},
xAxis: {
type: 'value',
name: 'Gamma Channel',
nameTextStyle: {
color: '#5b9cba',
fontSize: 14,
},
nameLocation: 'center',
nameGap: 30,
boundaryGap: false,
splitLine: {
show: true,
interval: 'auto',
lineStyle: {
color: 'rgba(119, 181, 213, .3)',
},
},
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: 'rgba(119, 181, 213, .3)',
},
},
axisLabel: {
fontSize: 12,
color: '#ade6ee',
},
min: 0,
max: 4096,
interval: 1024,
},
yAxis: {
type: 'log',
name: 'Count',
nameTextStyle: {
color: '#5b9cba',
fontSize: 14,
},
nameLocation: 'center',
nameGap: 40,
splitLine: {
lineStyle: {
color: 'rgba(119, 181, 213, .3)',
},
},
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: 'rgba(119, 181, 213, .3)',
},
},
axisLabel: {
fontSize: 12,
color: '#ade6ee',
formatter: (value) => {
return value.toFixed(1)
},
},
min: 1,
max: 'dataMax',
},
series: buildLineSeries('Line', [], 'yellow'),
}
const initialAxisInfo = {
channel: 0,
count: 0,
energy: 0,
}
export default {
components: {
CustomChart,
},
data() {
return {
visible: false,
option: cloneDeep(initialOption),
axisInfo: cloneDeep(initialAxisInfo),
}
},
created() {
this.option.tooltip.formatter = this.handleTooltipFormat
},
methods: {
open(seriesData, energys) {
this.option.series.data = (seriesData || []).map(({ x, y }) => [x, y])
this.energys = energys || []
this.visible = true
},
handleTooltipFormat(params) {
const [channel, count] = params[0].value
this.axisInfo = {
channel,
count,
energy: (this.energys[channel] || 0).toFixed(3),
}
},
},
}
</script>
<style lang="less" scoped>
.gamma-modal {
height: 400px;
display: flex;
flex-direction: column;
gap: 5px;
overflow: hidden;
&__header {
height: 18px;
display: flex;
justify-content: flex-end;
align-items: center;
gap: 28px;
&-count {
font-family: ArialMT;
font-size: 12px;
color: #ade6ee;
}
.energy {
color: #ff5656;
}
}
&__content {
flex: 1;
overflow: hidden;
}
}
</style>

View File

@ -54,7 +54,7 @@ const columns = [
scopedSlots: {
customRender: 'flag',
},
width: 37,
width: 40,
},
{
title: 'Isotope',
@ -68,7 +68,7 @@ const columns = [
scopedSlots: {
customRender: 'concentration',
},
width: 108,
width: 128,
},
{
title: 'Uncertainty',
@ -76,7 +76,7 @@ const columns = [
scopedSlots: {
customRender: 'uncertainty',
},
width: 108,
width: 118,
},
{
title: 'MDC[mBq/m3]',
@ -152,8 +152,7 @@ export default {
.ant-table-thead > tr th {
color: #00e9fe;
font-family: MicrosoftYaHei;
font-size: 14px;
padding: 4px 4px;
font-size: 16px;
background-color: transparent !important;
&:first-child {

View File

@ -11,7 +11,7 @@
<img :src="isMax ? normal : maximize" @click="toggleFullScreen" />
</div>
</div>
<div class="roi-limit-item-content">
<div class="roi-limit-item__content">
<custom-chart
ref="chartRef"
:option="option"
@ -44,7 +44,7 @@ const option = {
top: 10,
left: 60,
right: 20,
bottom: 25,
bottom: 50,
},
tooltip: {
show: true,
@ -189,10 +189,11 @@ export default {
methods: {
handleTooltipFormat(params) {
const [xAxis, count] = params[0].value
const channel = xAxis.toFixed() - 1
const channel = Math.round(xAxis)
const channelData = this.channelData.all && this.channelData.all.pointlist[channel]
this.axisInfo = {
channel: Math.round(xAxis),
count: this.channelData.all ? this.channelData.all.pointlist[channel].y : count,
channel,
count: channelData ? channelData.y : count,
energy: (this.energys[channel] || 0).toFixed(3),
}
},
@ -466,6 +467,12 @@ export default {
if (val && Object.keys(val).length) {
this.resetAxiosInfo()
this.handleAnalyzeResult()
} else {
this.option.series.forEach((seriesItem, index) => {
if (index !== 0) {
seriesItem.data = []
}
})
}
},
immediate: true,
@ -525,7 +532,7 @@ export default {
}
}
&-content {
&__content {
flex: 1;
overflow: hidden;
}

View File

@ -56,8 +56,6 @@ const initialOption = {
axisLabel: {
color: '#ade6ee'
},
name: '',
nameLocation: 'center',
nameTextStyle: {
fontSize: 14,
color: '#5b9cba'
@ -135,7 +133,6 @@ export default {
data() {
const option = cloneDeep(initialOption)
option.series.itemStyle.color = this.color
option.xAxis.name = this.title + ' Channel'
return {
option,
@ -301,7 +298,7 @@ export default {
display: flex;
margin-top: 7px;
margin-bottom: 8px;
height: calc(100% - 35px);
height: calc(100% - 47px);
.left-title {
writing-mode: vertical-rl;