fix: 修复自建台站交互分析弹窗peak未充值问题,左侧二维图表增加count和交叉轴上的energy
This commit is contained in:
parent
544f44066a
commit
b7972ecd56
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="beta-gamma-spectrum-chart">
|
<div class="beta-gamma-spectrum-chart">
|
||||||
<div class="beta-gamma-spectrum-chart-operators">
|
<div class="beta-gamma-spectrum-chart-operators">
|
||||||
|
<span class="cnt">count: {{ axisInfo.c }}</span>
|
||||||
<span v-for="(item, index) in buttons" :key="item" @click="handleChange(index)">
|
<span v-for="(item, index) in buttons" :key="item" @click="handleChange(index)">
|
||||||
{{ item }}
|
{{ item }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -74,16 +75,12 @@ const buttons = ['Gamma', 'Beta']
|
||||||
const TwoDOption = {
|
const TwoDOption = {
|
||||||
grid: {
|
grid: {
|
||||||
top: 10,
|
top: 10,
|
||||||
left: 60,
|
left: 80,
|
||||||
right: 10,
|
right: 10,
|
||||||
bottom: 45,
|
bottom: 45,
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item',
|
trigger: 'item',
|
||||||
formatter: (params) => {
|
|
||||||
const [b, g, c] = params.value
|
|
||||||
return `Beta: ${b}<br>Gamma: ${g}<br>Count: ${c}`
|
|
||||||
},
|
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
animation: false,
|
animation: false,
|
||||||
type: 'cross',
|
type: 'cross',
|
||||||
|
@ -92,6 +89,7 @@ const TwoDOption = {
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
backgroundColor: 'rgba(119, 181, 213, 1)',
|
backgroundColor: 'rgba(119, 181, 213, 1)',
|
||||||
|
formatter: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -134,7 +132,7 @@ const TwoDOption = {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameGap: 40,
|
nameGap: 45,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .3)',
|
color: 'rgba(119, 181, 213, .3)',
|
||||||
|
@ -223,6 +221,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
this.buttons = buttons
|
this.buttons = buttons
|
||||||
|
|
||||||
return {
|
return {
|
||||||
showROI: true,
|
showROI: true,
|
||||||
myChart: null,
|
myChart: null,
|
||||||
|
@ -237,6 +236,13 @@ export default {
|
||||||
|
|
||||||
chartAxis: cloneDeep(ChartAxis),
|
chartAxis: cloneDeep(ChartAxis),
|
||||||
boundary: [],
|
boundary: [],
|
||||||
|
|
||||||
|
axisInfo: {
|
||||||
|
// 轴对应的信息
|
||||||
|
b: 0,
|
||||||
|
g: 0,
|
||||||
|
c: 0,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -248,10 +254,40 @@ export default {
|
||||||
this.$bus.$off('roiLimitItemChange', this.handleLimitItemChange)
|
this.$bus.$off('roiLimitItemChange', this.handleLimitItemChange)
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setOption(cloneDeep(TwoDOption))
|
const newOption = cloneDeep(TwoDOption)
|
||||||
|
newOption.tooltip.axisPointer.label.formatter = this.axiosPointerFormatter
|
||||||
|
this.setOption(newOption)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getAxiosCount(isBetaChannel, value) {
|
||||||
|
this.axisInfo[isBetaChannel ? 'b' : 'g'] = value
|
||||||
|
const { b, g } = this.axisInfo
|
||||||
|
if (this.histogramDataListMap) {
|
||||||
|
const find = this.histogramDataListMap.get(`${b}_${g}`)
|
||||||
|
if (find) {
|
||||||
|
this.axisInfo.c = find
|
||||||
|
} else {
|
||||||
|
this.axisInfo.c = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axiosPointerFormatter(params) {
|
||||||
|
const { axisDimension, value } = params
|
||||||
|
const isBetaChannel = axisDimension == 'x'
|
||||||
|
|
||||||
|
const fixedValue = value.toFixed()
|
||||||
|
this.getAxiosCount(isBetaChannel, fixedValue)
|
||||||
|
const energy = (isBetaChannel ? this.betaEnergyData : this.gammaEnergyData)[fixedValue]
|
||||||
|
return `c: ${fixedValue}\ne: ${energy ? energy.toFixed(3) : 0}`
|
||||||
|
},
|
||||||
|
|
||||||
setData(histogramDataList) {
|
setData(histogramDataList) {
|
||||||
|
const map = new Map()
|
||||||
|
histogramDataList.forEach(({ b, g, c }) => {
|
||||||
|
map.set(`${b}_${g}`, c)
|
||||||
|
})
|
||||||
|
this.histogramDataListMap = map
|
||||||
|
|
||||||
this.histogramDataList = histogramDataList
|
this.histogramDataList = histogramDataList
|
||||||
this.setVisialMapParams()
|
this.setVisialMapParams()
|
||||||
this.buildScatterList()
|
this.buildScatterList()
|
||||||
|
@ -620,6 +656,12 @@ export default {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
gap: 9px;
|
gap: 9px;
|
||||||
|
|
||||||
|
.cnt {
|
||||||
|
color: #ade6ee;
|
||||||
|
background: transparent;
|
||||||
|
cursor: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.ant-space-item:first-child {
|
.ant-space-item:first-child {
|
||||||
span {
|
span {
|
||||||
width: 70px;
|
width: 70px;
|
||||||
|
|
|
@ -555,8 +555,12 @@ export default {
|
||||||
|
|
||||||
// 根据类型设置弹窗里的各数据
|
// 根据类型设置弹窗里的各数据
|
||||||
setInfoByType() {
|
setInfoByType() {
|
||||||
|
this.opts.notMerge = true
|
||||||
const currROIItem = this.ROILists[this.currROIIndex] // 四个ROI中要看的那个的基础数据
|
const currROIItem = this.ROILists[this.currROIIndex] // 四个ROI中要看的那个的基础数据
|
||||||
const currRPIAnalyzeItem = this.ROIAnalyzeLists[this.currROIIndex] // 四个ROI中要看的那个的已处理的数据
|
const currRPIAnalyzeItem = this.ROIAnalyzeLists[this.currROIIndex] // 四个ROI中要看的那个的已处理的数据
|
||||||
|
this.selectedKeys = []
|
||||||
|
this.selectedTableItem = null
|
||||||
|
|
||||||
// 如果是已处理的
|
// 如果是已处理的
|
||||||
if (currRPIAnalyzeItem) {
|
if (currRPIAnalyzeItem) {
|
||||||
const { allData, shadowChannelChart, shapeChannelData, peak, BaseCtrls, barChart } = currRPIAnalyzeItem
|
const { allData, shadowChannelChart, shapeChannelData, peak, BaseCtrls, barChart } = currRPIAnalyzeItem
|
||||||
|
@ -600,6 +604,10 @@ export default {
|
||||||
|
|
||||||
this.list = []
|
this.list = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.resetChartOpts()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
setChartOption(baseLine, count, peaks, baseCP, bar) {
|
setChartOption(baseLine, count, peaks, baseCP, bar) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user