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