Merge branch 'master-dev' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
a8cb864938
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<a-table
|
<a-table
|
||||||
|
ref="tableRef"
|
||||||
class="custom-table"
|
class="custom-table"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:data-source="list"
|
:data-source="list"
|
||||||
|
@ -107,6 +108,14 @@ export default {
|
||||||
handleTableChange(pagination, filters, sorter) {
|
handleTableChange(pagination, filters, sorter) {
|
||||||
this.$emit('change', pagination, filters, sorter)
|
this.$emit('change', pagination, filters, sorter)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 让第index行滚动到视野范围
|
||||||
|
scrollIntoView(index) {
|
||||||
|
const tableEle = this.$refs.tableRef.$el
|
||||||
|
const tableBodyEle = tableEle.querySelector('.ant-table-body')
|
||||||
|
const prevEle = tableBodyEle.querySelector(`.ant-table-row:nth-child(${index + 1})`)
|
||||||
|
tableBodyEle.scrollTop = prevEle.offsetTop
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectedRowKeys(val) {
|
selectedRowKeys(val) {
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
<span @click="handleChangeMarkLine('next')">></span>
|
<span @click="handleChangeMarkLine('next')">></span>
|
||||||
</p>
|
</p>
|
||||||
<custom-table
|
<custom-table
|
||||||
|
ref="tableRef"
|
||||||
size="small"
|
size="small"
|
||||||
:class="list.length ? 'has-data' : ''"
|
:class="list.length ? 'has-data' : ''"
|
||||||
:list="list"
|
:list="list"
|
||||||
|
@ -222,10 +223,9 @@ import { findNearPeak, getLineData, transformPointListData } from '@/utils/sampl
|
||||||
const initialOption = {
|
const initialOption = {
|
||||||
grid: {
|
grid: {
|
||||||
top: 40,
|
top: 40,
|
||||||
left: 40,
|
left: 80,
|
||||||
right: 30,
|
right: 30,
|
||||||
bottom: 30,
|
bottom: 30,
|
||||||
containLabel: true,
|
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
text: '',
|
text: '',
|
||||||
|
@ -372,14 +372,16 @@ const columns = [
|
||||||
const thumbnailOption = {
|
const thumbnailOption = {
|
||||||
grid: {
|
grid: {
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 5,
|
left: 0,
|
||||||
right: 5,
|
right: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: false,
|
lineStyle: {
|
||||||
|
color: '#fff',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: false,
|
show: false,
|
||||||
|
@ -387,6 +389,9 @@ const thumbnailOption = {
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
show: false,
|
show: false,
|
||||||
},
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 'dataMax',
|
max: 'dataMax',
|
||||||
},
|
},
|
||||||
|
@ -401,8 +406,12 @@ const thumbnailOption = {
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
show: false,
|
show: false,
|
||||||
},
|
},
|
||||||
min: 0.1,
|
max: (value) => {
|
||||||
max: 'dataMax',
|
return (Math.abs(value.min) < value.max ? value.max : -value.min).toFixed(2)
|
||||||
|
},
|
||||||
|
min: (value) => {
|
||||||
|
return (Math.abs(value.min) < value.max ? -value.max : value.min).toFixed(2)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
series: null,
|
series: null,
|
||||||
}
|
}
|
||||||
|
@ -507,7 +516,7 @@ export default {
|
||||||
|
|
||||||
const currSampleDetailInfo = await this.$store.dispatch('GET_SAMPLE_DATA', inputFileName)
|
const currSampleDetailInfo = await this.$store.dispatch('GET_SAMPLE_DATA', inputFileName)
|
||||||
const {
|
const {
|
||||||
data: { allData, shadowChannelChart, shapeChannelData, peak, BaseCtrls },
|
data: { allData, shadowChannelChart, shapeChannelData, peak, BaseCtrls, barChart },
|
||||||
} = currSampleDetailInfo
|
} = currSampleDetailInfo
|
||||||
|
|
||||||
const channelBaseLine = getLineData(allData, 'BaseLine', 'channel')
|
const channelBaseLine = getLineData(allData, 'BaseLine', 'channel')
|
||||||
|
@ -521,9 +530,9 @@ export default {
|
||||||
this.channelPeakChart = channelPeakGroup
|
this.channelPeakChart = channelPeakGroup
|
||||||
this.energy = allEnergy
|
this.energy = allEnergy
|
||||||
this.BaseCtrls = BaseCtrls
|
this.BaseCtrls = BaseCtrls
|
||||||
this.barChart = shadowChannelChart
|
this.barChart = barChart
|
||||||
|
|
||||||
this.setChartOption(channelBaseLine, shadowChannelChart, channelPeakGroup, shapeChannelData, shadowChannelChart)
|
this.setChartOption(channelBaseLine, shadowChannelChart, channelPeakGroup, shapeChannelData, barChart)
|
||||||
this.list = peak
|
this.list = peak
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -542,7 +551,7 @@ export default {
|
||||||
// 推入基线控制点
|
// 推入基线控制点
|
||||||
series.push(this.buildCtrlPoint(baseCP))
|
series.push(this.buildCtrlPoint(baseCP))
|
||||||
|
|
||||||
// this.thumbnailOption.series = this.buildBarChart(bar)
|
this.thumbnailOption.series = this.buildBarChart(bar)
|
||||||
|
|
||||||
this.option.series = series
|
this.option.series = series
|
||||||
},
|
},
|
||||||
|
@ -578,7 +587,7 @@ export default {
|
||||||
|
|
||||||
if (this.list.length) {
|
if (this.list.length) {
|
||||||
const selectedRow = this.list[index]
|
const selectedRow = this.list[index]
|
||||||
this.selectTableRow(selectedRow.index)
|
this.selectTableRow(selectedRow.index, index)
|
||||||
this.getSelPosNuclide(selectedRow)
|
this.getSelPosNuclide(selectedRow)
|
||||||
this.selectedTableItem = selectedRow
|
this.selectedTableItem = selectedRow
|
||||||
}
|
}
|
||||||
|
@ -638,27 +647,53 @@ export default {
|
||||||
this.setMarkLineXAxis(centroid)
|
this.setMarkLineXAxis(centroid)
|
||||||
const selectedRow = this.list[i]
|
const selectedRow = this.list[i]
|
||||||
this.selectedTableItem = selectedRow
|
this.selectedTableItem = selectedRow
|
||||||
this.selectTableRow(selectedRow.index)
|
this.selectTableRow(selectedRow.index, i)
|
||||||
this.getSelPosNuclide(selectedRow)
|
this.getSelPosNuclide(selectedRow)
|
||||||
|
this.adjustArea(i)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (direction == 'prev') {
|
} else if (direction == 'prev') {
|
||||||
for (i = size - 1; i >= 0; i--) {
|
for (i = size - 1; i >= 0; i--) {
|
||||||
if (Math.round(this.list[i].peakCentroid) < prevAxis) {
|
const centroid = Math.round(this.list[i].peakCentroid)
|
||||||
this.setMarkLineXAxis(Math.round(this.list[i].peakCentroid))
|
if (centroid < prevAxis) {
|
||||||
|
this.setMarkLineXAxis(centroid)
|
||||||
const selectedRow = this.list[i]
|
const selectedRow = this.list[i]
|
||||||
this.selectedTableItem = selectedRow
|
this.selectedTableItem = selectedRow
|
||||||
this.selectTableRow(selectedRow.index)
|
this.selectTableRow(selectedRow.index, i)
|
||||||
this.getSelPosNuclide(selectedRow)
|
this.getSelPosNuclide(selectedRow)
|
||||||
|
this.adjustArea(i)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
selectTableRow(key) {
|
/**
|
||||||
|
* 根据当前Peak调整缩放范围
|
||||||
|
*/
|
||||||
|
adjustArea(index) {
|
||||||
|
const peak = this.channelPeakChart[index]
|
||||||
|
if (peak) {
|
||||||
|
const peakCountMax = Math.max(...peak.pointlist.map(({ y }) => y))
|
||||||
|
const peakCountMin = Math.min(...peak.pointlist.map(({ y }) => y))
|
||||||
|
const {
|
||||||
|
yAxis: { max, min },
|
||||||
|
} = this.option
|
||||||
|
|
||||||
|
if (max !== 'dataMax' && peakCountMin >= max) {
|
||||||
|
this.option.yAxis.max = 'dataMax'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (peakCountMax <= min) {
|
||||||
|
this.option.yAxis.min = 0.1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
selectTableRow(key, index) {
|
||||||
this.selectedKeys = [key]
|
this.selectedKeys = [key]
|
||||||
|
this.$refs.tableRef.scrollIntoView(index)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 设置红色标记线的位置
|
// 设置红色标记线的位置
|
||||||
|
@ -713,16 +748,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取每一段 Channel 中的最大值
|
|
||||||
getPeakMaxValues() {
|
|
||||||
const maxXAxises = this.channelPeakChart.map((item) => {
|
|
||||||
const allY = item.pointlist.map((point) => point.y)
|
|
||||||
const max = item.pointlist.find((point) => point.y == Math.max(...allY))
|
|
||||||
return max.x
|
|
||||||
})
|
|
||||||
return maxXAxises
|
|
||||||
},
|
|
||||||
|
|
||||||
// 显示peak comment弹窗
|
// 显示peak comment弹窗
|
||||||
handleAddPeakComment() {
|
handleAddPeakComment() {
|
||||||
if (!this.selectedKeys.length) {
|
if (!this.selectedKeys.length) {
|
||||||
|
@ -914,7 +939,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 表格的行点击
|
// 表格的行点击
|
||||||
handleTableRowClick(row) {
|
handleTableRowClick(row, index) {
|
||||||
if (this.selectedTableItem == row) {
|
if (this.selectedTableItem == row) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -940,6 +965,8 @@ export default {
|
||||||
this.getSelPosNuclide(row)
|
this.getSelPosNuclide(row)
|
||||||
|
|
||||||
this.selectedTableItem = row
|
this.selectedTableItem = row
|
||||||
|
|
||||||
|
this.adjustArea(index)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 鼠标按下时开启可刷选状态
|
// 鼠标按下时开启可刷选状态
|
||||||
|
@ -1005,8 +1032,6 @@ export default {
|
||||||
|
|
||||||
this.thumbnailOption.xAxis.min = x1
|
this.thumbnailOption.xAxis.min = x1
|
||||||
this.thumbnailOption.xAxis.max = x2
|
this.thumbnailOption.xAxis.max = x2
|
||||||
this.thumbnailOption.yAxis.min = y1
|
|
||||||
this.thumbnailOption.yAxis.max = y2
|
|
||||||
|
|
||||||
if (this.btnGroupType == 2) {
|
if (this.btnGroupType == 2) {
|
||||||
this.buildRect()
|
this.buildRect()
|
||||||
|
@ -1023,8 +1048,6 @@ export default {
|
||||||
|
|
||||||
this.thumbnailOption.xAxis.min = 1
|
this.thumbnailOption.xAxis.min = 1
|
||||||
this.thumbnailOption.xAxis.max = 'dataMax'
|
this.thumbnailOption.xAxis.max = 'dataMax'
|
||||||
this.thumbnailOption.yAxis.min = 0.1
|
|
||||||
this.thumbnailOption.yAxis.max = 'dataMax'
|
|
||||||
|
|
||||||
if (this.btnGroupType == 2) {
|
if (this.btnGroupType == 2) {
|
||||||
this.buildRect()
|
this.buildRect()
|
||||||
|
@ -1522,14 +1545,24 @@ export default {
|
||||||
|
|
||||||
// 构建缩略图
|
// 构建缩略图
|
||||||
buildBarChart(barChart) {
|
buildBarChart(barChart) {
|
||||||
return buildLineSeries(
|
return {
|
||||||
'BarChart',
|
name: 'BarChart',
|
||||||
barChart.map(({ x, y }) => [x, y]),
|
type: 'bar',
|
||||||
'#fff',
|
data: barChart.map(({ x, y }) => [x, y]),
|
||||||
{
|
itemStyle: {
|
||||||
silent: true,
|
color: '#fff',
|
||||||
}
|
},
|
||||||
)
|
lineStyle: {
|
||||||
|
width: 1,
|
||||||
|
},
|
||||||
|
symbol: 'none',
|
||||||
|
symbolSize: 1,
|
||||||
|
emphasis: {
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
animation: false,
|
||||||
|
silent: true,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1617,7 +1650,7 @@ export default {
|
||||||
|
|
||||||
.thumbnail {
|
.thumbnail {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
margin: 10px 10px 35px 40px;
|
margin: 10px 30px 35px 80px;
|
||||||
background-color: #255369;
|
background-color: #255369;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,11 +72,15 @@ export default {
|
||||||
qcFileName,
|
qcFileName,
|
||||||
}
|
}
|
||||||
res = await postAction(url, params)
|
res = await postAction(url, params)
|
||||||
|
} else if (this.type == 2) {
|
||||||
|
res = await getAction(url, {
|
||||||
|
sampleId,
|
||||||
|
fileName,
|
||||||
|
// ...this.extraData,
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
res = await getAction(url, {
|
res = await getAction(url, {
|
||||||
sampleId,
|
sampleId,
|
||||||
// fileName,
|
|
||||||
...this.extraData,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<custom-modal v-model="visible" title="BetaGamma Analyser Log" :width="800">
|
<custom-modal v-model="visible" title="BetaGamma Analyser Log" :width="800">
|
||||||
<a-spin :spinning="isLoading">
|
<a-spin :spinning="isLoading">
|
||||||
<a-textarea class="bg-log-viewer" v-model="content"></a-textarea>
|
<a-textarea :rows="20" v-model="content"></a-textarea>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
<div slot="custom-footer">
|
<div slot="custom-footer">
|
||||||
<a-button type="primary" @click="handleClick">Save As</a-button>
|
<a-button type="primary" @click="handleClick">Save As</a-button>
|
||||||
|
@ -26,7 +26,7 @@ export default {
|
||||||
try {
|
try {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
const { dbName, sampleId, sampleFileName, gasFileName, detFileName, qcFileName } = this.newSampleData
|
const { dbName, sampleId, sampleFileName, gasFileName, detFileName, qcFileName } = this.newSampleData
|
||||||
const { success, result, message } = await getAction('/spectrumAnalysis/viewBGLogViewer', {
|
const result = await getAction('/spectrumAnalysis/viewBGLogViewer', {
|
||||||
dbName,
|
dbName,
|
||||||
sampleId,
|
sampleId,
|
||||||
sampleFileName,
|
sampleFileName,
|
||||||
|
@ -34,12 +34,7 @@ export default {
|
||||||
detFileName,
|
detFileName,
|
||||||
qcFileName,
|
qcFileName,
|
||||||
})
|
})
|
||||||
if (success) {
|
this.content = result
|
||||||
console.log('%c [ ]-21', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
|
||||||
this.content = 'test'
|
|
||||||
} else {
|
|
||||||
this.$message.error(message)
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -60,8 +55,4 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.bg-log-viewer {
|
|
||||||
height: 400px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
|
@ -545,6 +545,12 @@ const newCalibrationFuncModel = {
|
||||||
export default {
|
export default {
|
||||||
mixins: [SampleDataMixin],
|
mixins: [SampleDataMixin],
|
||||||
components: { CustomChart, TitleOverBorder },
|
components: { CustomChart, TitleOverBorder },
|
||||||
|
props: {
|
||||||
|
isFirstFitting: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
|
|
||||||
|
@ -594,7 +600,7 @@ export default {
|
||||||
recalculateROICountsFor: [],
|
recalculateROICountsFor: [],
|
||||||
|
|
||||||
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
||||||
isFirstFitting: true,
|
// isFirstFitting: true,
|
||||||
isInverse: false, // 是否需要反算
|
isInverse: false, // 是否需要反算
|
||||||
betaIsFitting: false,
|
betaIsFitting: false,
|
||||||
}
|
}
|
||||||
|
@ -608,12 +614,14 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
const { sampleId = '', qcFileName } = this.newSampleData
|
// 增加sampleFileName参数 20231101:xiao
|
||||||
|
const { sampleId = '', qcFileName, sampleFileName = inputFileName } = this.newSampleData
|
||||||
try {
|
try {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
const res = await getAction('/spectrumAnalysis/viewBetaDetectorCalibration', {
|
const res = await getAction('/spectrumAnalysis/viewBetaDetectorCalibration', {
|
||||||
sampleId,
|
sampleId,
|
||||||
qcFileName,
|
qcFileName,
|
||||||
|
sampleFileName
|
||||||
})
|
})
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const { CToE, EToC, betaEnergy, gammaEnergy, gammaGatedBetaSpectrum, histogramData, oldScatterSeries } =
|
const { CToE, EToC, betaEnergy, gammaEnergy, gammaGatedBetaSpectrum, histogramData, oldScatterSeries } =
|
||||||
|
@ -623,7 +631,7 @@ export default {
|
||||||
|
|
||||||
this.oldScatterSeries = oldScatterSeries
|
this.oldScatterSeries = oldScatterSeries
|
||||||
this.count = oldScatterSeries.length
|
this.count = oldScatterSeries.length
|
||||||
this.isFirstFitting = true
|
// this.isFirstFitting = true
|
||||||
|
|
||||||
this.betaGammaChartOption.series.data = histogramData.map(({ b, g, c }) => [b, g, c])
|
this.betaGammaChartOption.series.data = histogramData.map(({ b, g, c }) => [b, g, c])
|
||||||
this.gammaEnergy = gammaEnergy
|
this.gammaEnergy = gammaEnergy
|
||||||
|
@ -644,6 +652,13 @@ export default {
|
||||||
this.figureChartOption.series[0].markPoint.data = oldScatterSeries.map(({ x, y }) => ({ xAxis: x, yAxis: y }))
|
this.figureChartOption.series[0].markPoint.data = oldScatterSeries.map(({ x, y }) => ({ xAxis: x, yAxis: y }))
|
||||||
|
|
||||||
this.oldChartOption = cloneDeep(this.figureChartOption)
|
this.oldChartOption = cloneDeep(this.figureChartOption)
|
||||||
|
|
||||||
|
// 如果点击过reanalyze则渲染之前fitting的数据,如果没点Reanalyze,数据会在窗口关闭时删掉 20231101:xiao
|
||||||
|
// todo 现在能谱数据没有缓存,刷新页面时也会获取到fitting的数据
|
||||||
|
if(this.getCache("calibration-beta:"+this.newSampleData.inputFileName)) {
|
||||||
|
this.setFirringResult(this.getCache("calibration-beta:"+this.newSampleData.inputFileName))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
}
|
}
|
||||||
|
@ -861,6 +876,7 @@ export default {
|
||||||
|
|
||||||
// 点击Reset Button 重置
|
// 点击Reset Button 重置
|
||||||
handleReset() {
|
handleReset() {
|
||||||
|
this.removeCache("calibration-beta:"+this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
|
||||||
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
|
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
|
||||||
this.list = []
|
this.list = []
|
||||||
this.newE2C = []
|
this.newE2C = []
|
||||||
|
@ -880,7 +896,9 @@ export default {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
|
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
|
||||||
...this.newCalibrationFuncModel,
|
...this.list.length <= 0 ? this.newCalibrationFuncModel : [], // 如果list有数据则不传 C to E 表单数据 20231101:xiao
|
||||||
|
sampleFileName: this.newSampleData.inputFileName,
|
||||||
|
tabName: "beta",
|
||||||
// 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
|
// 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
|
||||||
tempPoints: this.list.length > 0
|
tempPoints: this.list.length > 0
|
||||||
? this.list.map((item) => ({ x: item.channel, y: item.energy }))
|
? this.list.map((item) => ({ x: item.channel, y: item.energy }))
|
||||||
|
@ -891,49 +909,15 @@ export default {
|
||||||
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
|
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.isFirstFitting = false
|
// this.isFirstFitting = false
|
||||||
this.betaIsFitting = true
|
this.betaIsFitting = true
|
||||||
this.$emit('isFitting', this.betaIsFitting)
|
this.$emit('isFitting', true) // 点击reAnalyze按钮,将isFirstFitting改为true 20231101:xiao
|
||||||
|
|
||||||
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
|
this.setCache("calibration-beta:"+this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||||
this.newE2C = EToC
|
|
||||||
this.newLineSeries = newLineSeries
|
|
||||||
|
|
||||||
if (tableWidgets) {
|
this.setFirringResult(result)
|
||||||
this.list = tableWidgets
|
|
||||||
}
|
|
||||||
// 反算时重新设置C to E 的值
|
|
||||||
if (CToE) {
|
|
||||||
const [paramA, paramB, paramC] = CToE
|
|
||||||
this.newCalibrationFuncModel = {
|
|
||||||
paramA: Number(paramA).toPrecision(6),
|
|
||||||
paramB: Number(paramB).toPrecision(6),
|
|
||||||
paramC: Number(paramC).toPrecision(6),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const energyValues = newLineSeries.map((item) => item.y)
|
|
||||||
|
|
||||||
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
|
||||||
|
|
||||||
const energyMax = Math.max(Math.max(...energyValues), prevMax)
|
|
||||||
const energyMin = Math.min(Math.min(...energyValues), prevMin)
|
|
||||||
|
|
||||||
const { min, max, interval } = splitAxis(energyMax, energyMin, 4)
|
|
||||||
|
|
||||||
this.figureChartOption.yAxis.max = max
|
|
||||||
this.figureChartOption.yAxis.min = min
|
|
||||||
this.figureChartOption.yAxis.interval = interval
|
|
||||||
|
|
||||||
this.figureChartOption.series[1].data = newLineSeries.map(({ x, y }) => [x, y])
|
|
||||||
if (newScatterSeriesData) {
|
|
||||||
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => {
|
|
||||||
return {
|
|
||||||
xAxis: x,
|
|
||||||
yAxis: y,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
|
@ -942,6 +926,49 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 封装 fitting后数据填充方法,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||||
|
setFirringResult(result){
|
||||||
|
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
|
||||||
|
this.newE2C = EToC
|
||||||
|
this.newLineSeries = newLineSeries
|
||||||
|
|
||||||
|
if (tableWidgets) {
|
||||||
|
this.list = tableWidgets
|
||||||
|
}
|
||||||
|
// 反算时重新设置C to E 的值
|
||||||
|
if (CToE) {
|
||||||
|
const [paramA, paramB, paramC] = CToE
|
||||||
|
this.newCalibrationFuncModel = {
|
||||||
|
paramA: Number(paramA).toPrecision(6),
|
||||||
|
paramB: Number(paramB).toPrecision(6),
|
||||||
|
paramC: Number(paramC).toPrecision(6),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const energyValues = newLineSeries.map((item) => item.y)
|
||||||
|
|
||||||
|
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
||||||
|
|
||||||
|
const energyMax = Math.max(Math.max(...energyValues), prevMax)
|
||||||
|
const energyMin = Math.min(Math.min(...energyValues), prevMin)
|
||||||
|
|
||||||
|
const { min, max, interval } = splitAxis(energyMax, energyMin, 4)
|
||||||
|
|
||||||
|
this.figureChartOption.yAxis.max = max
|
||||||
|
this.figureChartOption.yAxis.min = min
|
||||||
|
this.figureChartOption.yAxis.interval = interval
|
||||||
|
|
||||||
|
this.figureChartOption.series[1].data = newLineSeries.map(({ x, y }) => [x, y])
|
||||||
|
if (newScatterSeriesData) {
|
||||||
|
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => {
|
||||||
|
return {
|
||||||
|
xAxis: x,
|
||||||
|
yAxis: y,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 获取Figure Chart 最大值 和 最小值
|
// 获取Figure Chart 最大值 和 最小值
|
||||||
getFigureChartMaxAndMin() {
|
getFigureChartMaxAndMin() {
|
||||||
const [series0, series1] = this.figureChartOption.series
|
const [series0, series1] = this.figureChartOption.series
|
||||||
|
@ -985,6 +1012,15 @@ export default {
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
},
|
},
|
||||||
|
getCache(name){
|
||||||
|
return this.$ls.get(name)
|
||||||
|
},
|
||||||
|
setCache(name, data){
|
||||||
|
this.$ls.set(name, data)
|
||||||
|
},
|
||||||
|
removeCache(name){
|
||||||
|
this.$ls.remove(name) // 删除fitting之后缓存的数据 20231101:xiao
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rectHeight() {
|
rectHeight() {
|
||||||
|
|
|
@ -435,6 +435,12 @@ const newCalibrationFuncModel = {
|
||||||
export default {
|
export default {
|
||||||
mixins: [SampleDataMixin],
|
mixins: [SampleDataMixin],
|
||||||
components: { CustomChart, TitleOverBorder },
|
components: { CustomChart, TitleOverBorder },
|
||||||
|
props: {
|
||||||
|
isFirstFitting: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
|
|
||||||
|
@ -466,7 +472,7 @@ export default {
|
||||||
recalculateROICountsFor: [],
|
recalculateROICountsFor: [],
|
||||||
|
|
||||||
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
||||||
isFirstFitting: true,
|
// isFirstFitting: true,
|
||||||
isInverse: false, // 是否需要反算
|
isInverse: false, // 是否需要反算
|
||||||
gammaIsFitting: false,
|
gammaIsFitting: false,
|
||||||
}
|
}
|
||||||
|
@ -480,12 +486,16 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
const { sampleId = '', qcFileName } = this.newSampleData
|
console.log("isFirstFitting>>>"+this.isFirstFitting);
|
||||||
|
// 增加sampleFileName参数 20231101:xiao
|
||||||
|
const { sampleId = '', qcFileName, sampleFileName = inputFileName } = this.newSampleData
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
const res = await getAction('/spectrumAnalysis/viewGammaDetectorCalibration', {
|
const res = await getAction('/spectrumAnalysis/viewGammaDetectorCalibration', {
|
||||||
sampleId,
|
sampleId,
|
||||||
qcFileName,
|
qcFileName,
|
||||||
|
sampleFileName
|
||||||
})
|
})
|
||||||
|
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
@ -495,7 +505,7 @@ export default {
|
||||||
this.e2c = EToC
|
this.e2c = EToC
|
||||||
this.oldScatterSeries = oldScatterSeries
|
this.oldScatterSeries = oldScatterSeries
|
||||||
this.count = oldScatterSeries.length
|
this.count = oldScatterSeries.length
|
||||||
this.isFirstFitting = true
|
// this.isFirstFitting = true
|
||||||
|
|
||||||
const { max: _max, min: _min, interval: _interval } = splitAxis(max, min, 4)
|
const { max: _max, min: _min, interval: _interval } = splitAxis(max, min, 4)
|
||||||
|
|
||||||
|
@ -519,6 +529,13 @@ export default {
|
||||||
this.figureChartOption.series[0].markPoint.data = oldScatterSeries.map(({ x, y }) => ({ xAxis: x, yAxis: y }))
|
this.figureChartOption.series[0].markPoint.data = oldScatterSeries.map(({ x, y }) => ({ xAxis: x, yAxis: y }))
|
||||||
|
|
||||||
this.oldChartOption = cloneDeep(this.figureChartOption)
|
this.oldChartOption = cloneDeep(this.figureChartOption)
|
||||||
|
|
||||||
|
// 如果点击过reanalyze则渲染之前fitting的数据,如果没点Reanalyze,数据会在窗口关闭时删掉 20231101:xiao
|
||||||
|
// todo 现在能谱数据没有缓存,刷新页面时也会获取到fitting的数据
|
||||||
|
if(this.getCache("calibration-gamma:"+this.newSampleData.inputFileName)) {
|
||||||
|
this.setFirringResult(this.getCache("calibration-gamma:"+this.newSampleData.inputFileName))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
}
|
}
|
||||||
|
@ -640,12 +657,13 @@ export default {
|
||||||
|
|
||||||
// 点击Reset Button 重置
|
// 点击Reset Button 重置
|
||||||
handleReset() {
|
handleReset() {
|
||||||
|
this.$ls.remove("calibration-gamma:"+this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao
|
||||||
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
|
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
|
||||||
this.list = []
|
this.list = []
|
||||||
this.newE2C = []
|
this.newE2C = []
|
||||||
|
|
||||||
this.figureChartOption = cloneDeep(this.oldChartOption)
|
this.figureChartOption = cloneDeep(this.oldChartOption)
|
||||||
this.isFirstFitting = true
|
this.isFirstFitting = false
|
||||||
this.isInverse = false
|
this.isInverse = false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -657,8 +675,10 @@ export default {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
|
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
|
||||||
...this.newCalibrationFuncModel,
|
...this.list.length <= 0 ? this.newCalibrationFuncModel : [], // 如果list有数据则不传 C to E 表单数据 20231101:xiao
|
||||||
// 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
|
sampleFileName: this.newSampleData.inputFileName,
|
||||||
|
tabName: "gamma",
|
||||||
|
// 如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao
|
||||||
tempPoints: this.list.length > 0
|
tempPoints: this.list.length > 0
|
||||||
? this.list.map((item) => ({ x: item.channel, y: item.energy }))
|
? this.list.map((item) => ({ x: item.channel, y: item.energy }))
|
||||||
: this.oldScatterSeries,
|
: this.oldScatterSeries,
|
||||||
|
@ -669,47 +689,14 @@ export default {
|
||||||
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
|
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.isFirstFitting = false
|
// this.isFirstFitting = true
|
||||||
this.gammaIsFitting = false
|
this.gammaIsFitting = false
|
||||||
this.$emit('isFitting', this.gammaIsFitting)
|
this.$emit('isFitting', true) // 点击reAnalyze按钮,将isFirstFitting改为true 20231101:xiao
|
||||||
|
|
||||||
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
|
this.setCache("calibration-gamma:"+this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||||
this.newE2C = EToC
|
|
||||||
this.newLineSeries = newLineSeries
|
|
||||||
|
|
||||||
if (tableWidgets) {
|
this.setFirringResult(result)
|
||||||
this.list = tableWidgets
|
|
||||||
}
|
|
||||||
// 反算时重新设置C to E 的值
|
|
||||||
if (CToE) {
|
|
||||||
const [paramA, paramB, paramC] = CToE
|
|
||||||
this.newCalibrationFuncModel = {
|
|
||||||
paramA: Number(paramA).toPrecision(6),
|
|
||||||
paramB: Number(paramB).toPrecision(6),
|
|
||||||
paramC: Number(paramC).toPrecision(6),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const energyValues = newLineSeries.map((item) => item.y)
|
|
||||||
|
|
||||||
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
|
||||||
|
|
||||||
const energyMax = Math.max(Math.max(...energyValues), prevMax)
|
|
||||||
const energyMin = Math.min(Math.min(...energyValues), prevMin)
|
|
||||||
|
|
||||||
const { min, max, interval } = splitAxis(energyMax, energyMin, 4)
|
|
||||||
|
|
||||||
this.figureChartOption.yAxis.max = max
|
|
||||||
this.figureChartOption.yAxis.min = min
|
|
||||||
this.figureChartOption.yAxis.interval = interval
|
|
||||||
|
|
||||||
this.figureChartOption.series[1].data = newLineSeries.map(({ x, y }) => [x, y])
|
|
||||||
if (newScatterSeriesData) {
|
|
||||||
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => ({
|
|
||||||
xAxis: x,
|
|
||||||
yAxis: y,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
|
@ -718,6 +705,46 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 封装 fitting后数据填充方法,如果点击ReAnalyze需要回显数据 20231101:xiao
|
||||||
|
setFirringResult(result){
|
||||||
|
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
|
||||||
|
this.newE2C = EToC
|
||||||
|
this.newLineSeries = newLineSeries
|
||||||
|
|
||||||
|
if (tableWidgets) {
|
||||||
|
this.list = tableWidgets
|
||||||
|
}
|
||||||
|
// 反算时重新设置C to E 的值
|
||||||
|
if (CToE) {
|
||||||
|
const [paramA, paramB, paramC] = CToE
|
||||||
|
this.newCalibrationFuncModel = {
|
||||||
|
paramA: Number(paramA).toPrecision(6),
|
||||||
|
paramB: Number(paramB).toPrecision(6),
|
||||||
|
paramC: Number(paramC).toPrecision(6),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const energyValues = newLineSeries.map((item) => item.y)
|
||||||
|
|
||||||
|
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
||||||
|
|
||||||
|
const energyMax = Math.max(Math.max(...energyValues), prevMax)
|
||||||
|
const energyMin = Math.min(Math.min(...energyValues), prevMin)
|
||||||
|
|
||||||
|
const { min, max, interval } = splitAxis(energyMax, energyMin, 4)
|
||||||
|
|
||||||
|
this.figureChartOption.yAxis.max = max
|
||||||
|
this.figureChartOption.yAxis.min = min
|
||||||
|
this.figureChartOption.yAxis.interval = interval
|
||||||
|
|
||||||
|
this.figureChartOption.series[1].data = newLineSeries.map(({ x, y }) => [x, y])
|
||||||
|
if (newScatterSeriesData) {
|
||||||
|
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => ({
|
||||||
|
xAxis: x,
|
||||||
|
yAxis: y,
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 获取Figure Chart 最大值 和 最小值
|
// 获取Figure Chart 最大值 和 最小值
|
||||||
getFigureChartMaxAndMin() {
|
getFigureChartMaxAndMin() {
|
||||||
const [series0, series1] = this.figureChartOption.series
|
const [series0, series1] = this.figureChartOption.series
|
||||||
|
@ -761,6 +788,15 @@ export default {
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
},
|
},
|
||||||
|
getCache(name){
|
||||||
|
return this.$ls.get(name)
|
||||||
|
},
|
||||||
|
setCache(name, data){
|
||||||
|
this.$ls.set(name, data)
|
||||||
|
},
|
||||||
|
removeCache(name){
|
||||||
|
this.$ls.remove(name) // 删除fitting之后缓存的数据 20231101:xiao
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,10 +6,11 @@
|
||||||
class="beta-gamma-tool-of-calibration"
|
class="beta-gamma-tool-of-calibration"
|
||||||
:footer="null"
|
:footer="null"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
|
@cancel="handleExit"
|
||||||
>
|
>
|
||||||
<a-tabs :animated="false" v-model="currTab">
|
<a-tabs :animated="false" v-model="currTab">
|
||||||
<a-tab-pane tab="Gamma Detector Calibration" key="gamma">
|
<a-tab-pane tab="Gamma Detector Calibration" key="gamma">
|
||||||
<gamma-detector-calibration @isFitting="getFittingFlag_gamma" />
|
<gamma-detector-calibration @isFitting="getFittingFlag_gamma" :isFirstFitting="gammaEnergyValid"/>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane tab="Beta Detector Calibration" key="beta">
|
<a-tab-pane tab="Beta Detector Calibration" key="beta">
|
||||||
<beta-detector-calibration @isFitting="getFittingFlag_beta" />
|
<beta-detector-calibration @isFitting="getFittingFlag_beta" />
|
||||||
|
@ -69,7 +70,8 @@ export default {
|
||||||
checkDet: false,
|
checkDet: false,
|
||||||
},
|
},
|
||||||
betaEnergyValid: false,
|
betaEnergyValid: false,
|
||||||
gammaEnergyValid: true,
|
gammaEnergyValid: false,
|
||||||
|
isReanlyze: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -88,9 +90,15 @@ export default {
|
||||||
this.betaEnergyValid = val
|
this.betaEnergyValid = val
|
||||||
},
|
},
|
||||||
getFittingFlag_gamma(val) {
|
getFittingFlag_gamma(val) {
|
||||||
|
console.log("zhiqian>>>"+this.gammaEnergyValid);
|
||||||
this.gammaEnergyValid = val
|
this.gammaEnergyValid = val
|
||||||
|
console.log("zhihou>>>"+this.gammaEnergyValid);
|
||||||
},
|
},
|
||||||
handleReAnalyse() {
|
handleReAnalyse() {
|
||||||
|
// todo 1.fitting之后才能点击; 2.isReAnalyze需要缓存
|
||||||
|
if(!this.gammaEnergyValid){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const regExp = /^([A-Z]{1,}\d{1,})_/
|
const regExp = /^([A-Z]{1,}\d{1,})_/
|
||||||
const regMatched = this.newSampleData.inputFileName.match(regExp)
|
const regMatched = this.newSampleData.inputFileName.match(regExp)
|
||||||
const currStationName = regMatched[1]
|
const currStationName = regMatched[1]
|
||||||
|
@ -140,13 +148,19 @@ export default {
|
||||||
})
|
})
|
||||||
this.$emit('sendXeData', res.result.XeData)
|
this.$emit('sendXeData', res.result.XeData)
|
||||||
this.$message.success('Analyse Success!')
|
this.$message.success('Analyse Success!')
|
||||||
this.visible = false
|
this.isReanlyze = true
|
||||||
|
this.handleExit()
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleExit() {
|
handleExit() {
|
||||||
|
this.gammaEnergyValid = this.isReanlyze
|
||||||
|
console.log("exit>>>this.isReanlyze>>>"+this.isReanlyze);
|
||||||
|
if(!this.isReanlyze && this.$ls.get("calibration-gamma:"+this.newSampleData.inputFileName)){
|
||||||
|
this.$ls.remove("calibration-gamma:"+this.newSampleData.inputFileName) // 如果没有点击ReANalyze,删除fitting之后缓存的数据 20231101:xiao
|
||||||
|
}
|
||||||
this.visible = false
|
this.visible = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -110,15 +110,15 @@ export default {
|
||||||
|
|
||||||
this.list.push({
|
this.list.push({
|
||||||
qcFlags: 'Gas Bg',
|
qcFlags: 'Gas Bg',
|
||||||
evaluationMetrics: result.gasBgValueAndStatus,
|
evaluationMetrics: result.gasBgEvaluationMetrics,
|
||||||
value: result.gasBgValueAndStatus ? 'Match' : 'UnMatch',
|
value: result.gasBgValue,
|
||||||
status: result.gasBgValueAndStatus ? 'Pass' : 'Failed',
|
status: result.gasBgValueAndStatus ? 'Pass' : 'Failed',
|
||||||
})
|
})
|
||||||
|
|
||||||
this.list.push({
|
this.list.push({
|
||||||
qcFlags: 'Det Bg',
|
qcFlags: 'Det Bg',
|
||||||
evaluationMetrics: result.detBgValueAndStatus,
|
evaluationMetrics: result.detBgEvaluationMetrics,
|
||||||
value: result.detBgValueAndStatus ? 'Match' : 'UnMatch',
|
value: result.detBgValue,
|
||||||
status: result.detBgValueAndStatus ? 'Pass' : 'Failed',
|
status: result.detBgValueAndStatus ? 'Pass' : 'Failed',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
queryParam: {
|
queryParam: {
|
||||||
menuTypes: 'G,B',
|
menuTypes: 'G,B',
|
||||||
|
sampleType: 'P',
|
||||||
startDate: moment().add(-7, 'd').format('YYYY-MM-DD'),
|
startDate: moment().add(-7, 'd').format('YYYY-MM-DD'),
|
||||||
endDate: moment().format('YYYY-MM-DD'),
|
endDate: moment().format('YYYY-MM-DD'),
|
||||||
dbName: 'auto',
|
dbName: 'auto',
|
||||||
|
@ -323,7 +324,16 @@ export default {
|
||||||
value: 'G',
|
value: 'G',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
this.sampleTypeOption = event == 'B' ? arr_B : event == 'G' ? arr_G : arr_A
|
if (event == 'B') {
|
||||||
|
this.sampleTypeOption = arr_B
|
||||||
|
this.queryParam.sampleType = 'B'
|
||||||
|
} else if (event == 'G') {
|
||||||
|
this.sampleTypeOption = arr_G
|
||||||
|
this.queryParam.sampleType = 'P'
|
||||||
|
} else {
|
||||||
|
this.sampleTypeOption = arr_A
|
||||||
|
this.queryParam.sampleType = 'P'
|
||||||
|
}
|
||||||
this.getStationAndDetectorList(event)
|
this.getStationAndDetectorList(event)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -421,6 +421,7 @@ export default {
|
||||||
m_vCurReso: this.list.map((item) => item.fwhm),
|
m_vCurReso: this.list.map((item) => item.fwhm),
|
||||||
m_vCurUncert: this.uncert,
|
m_vCurUncert: this.uncert,
|
||||||
m_curParam: this.param,
|
m_curParam: this.param,
|
||||||
|
width: 922,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.handleResult(result)
|
this.handleResult(result)
|
||||||
|
|
|
@ -86,6 +86,7 @@ const columns = [
|
||||||
{
|
{
|
||||||
title: 'Indentify',
|
title: 'Indentify',
|
||||||
dataIndex: 'indentify',
|
dataIndex: 'indentify',
|
||||||
|
ellipsis: true,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<!-- 二级交互栏结束 -->
|
<!-- 二级交互栏结束 -->
|
||||||
<!-- 主体部分 -->
|
<!-- 主体部分 -->
|
||||||
<div class="gamma-analysis-main">
|
<div class="gamma-analysis-main">
|
||||||
<div class="gamma-analysis-chart" ref="chartContainerRef" tabindex="0" @keydown="handleKeyboardEvent">
|
<div class="gamma-analysis-chart" ref="chartContainerRef" tabindex="0" @keydown="handleKeyboardEvent">
|
||||||
<CustomChart
|
<CustomChart
|
||||||
ref="chartRef"
|
ref="chartRef"
|
||||||
:option="option"
|
:option="option"
|
||||||
|
@ -141,7 +141,7 @@ import StripModal from './components/Modals/StripModal.vue'
|
||||||
import { FilePicker } from '@/utils/FilePicker'
|
import { FilePicker } from '@/utils/FilePicker'
|
||||||
import { zipFile } from '@/utils/file'
|
import { zipFile } from '@/utils/file'
|
||||||
import { findNearPeak } from '@/utils/sampleHelper'
|
import { findNearPeak } from '@/utils/sampleHelper'
|
||||||
import baseCtrlJson from './baseCtrlJson.json'
|
import { add, subtract } from 'xe-utils/methods'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
@ -303,8 +303,8 @@ export default {
|
||||||
case '=': // 在x轴扩大范围
|
case '=': // 在x轴扩大范围
|
||||||
nextMinX = currMinX - xStep
|
nextMinX = currMinX - xStep
|
||||||
nextMaxX = currMaxX + xStep
|
nextMaxX = currMaxX + xStep
|
||||||
if (nextMinX < 1) {
|
if (nextMinX < this.xAxisMin) {
|
||||||
nextMinX = 1
|
nextMinX = this.xAxisMin
|
||||||
}
|
}
|
||||||
if (nextMaxX > maxX) {
|
if (nextMaxX > maxX) {
|
||||||
nextMaxX = maxX
|
nextMaxX = maxX
|
||||||
|
@ -351,30 +351,45 @@ export default {
|
||||||
if (markLineXAxis == maxX) {
|
if (markLineXAxis == maxX) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const nextAxis = markLineXAxis == -1 ? 1 : markLineXAxis + 1
|
let rightAxis = -1
|
||||||
markLineData.xAxis = nextAxis
|
if (markLineXAxis == -1) {
|
||||||
|
rightAxis = this.xAxisMin
|
||||||
|
} else {
|
||||||
|
if (this.isEnergy) {
|
||||||
|
const channel = this.getChannelByEnergy(markLineXAxis)
|
||||||
|
rightAxis = this.getEnergyByChannel(channel + 1)
|
||||||
|
} else {
|
||||||
|
rightAxis = markLineXAxis + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
markLineData.xAxis = rightAxis
|
||||||
const {
|
const {
|
||||||
channel: nextChannel,
|
channel: rightChannel,
|
||||||
energy: nextEnergy,
|
energy: rightEnergy,
|
||||||
counts: nextCounts,
|
counts: rightCounts,
|
||||||
} = this.getEnergyAndCountsByXAxis(nextAxis)
|
} = this.getEnergyAndCountsByXAxis(rightAxis)
|
||||||
this.setChartBottomTitle(nextChannel, nextEnergy, nextCounts)
|
this.setChartBottomTitle(rightChannel, rightEnergy, rightCounts)
|
||||||
|
this.getSelPosNuclide(rightChannel)
|
||||||
this.getSelPosNuclide(nextChannel)
|
|
||||||
break
|
break
|
||||||
case 'ArrowLeft':
|
case 'ArrowLeft':
|
||||||
if (markLineXAxis <= 1) {
|
if (markLineXAxis <= this.xAxisMin) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
markLineData.xAxis = markLineXAxis - 1
|
let leftAxis = 0
|
||||||
|
if (this.isEnergy) {
|
||||||
|
const channel = this.getChannelByEnergy(markLineXAxis)
|
||||||
|
leftAxis = this.getEnergyByChannel(channel - 1)
|
||||||
|
} else {
|
||||||
|
leftAxis = markLineXAxis - 1
|
||||||
|
}
|
||||||
|
markLineData.xAxis = leftAxis
|
||||||
const {
|
const {
|
||||||
channel: prevChannel,
|
channel: leftChannel,
|
||||||
energy: prevEnergy,
|
energy: leftEnergy,
|
||||||
counts: prevCounts,
|
counts: leftCounts,
|
||||||
} = this.getEnergyAndCountsByXAxis(markLineXAxis - 1)
|
} = this.getEnergyAndCountsByXAxis(leftAxis)
|
||||||
this.setChartBottomTitle(prevChannel, prevEnergy, prevCounts)
|
this.setChartBottomTitle(leftChannel, leftEnergy, leftCounts)
|
||||||
|
this.getSelPosNuclide(leftChannel)
|
||||||
this.getSelPosNuclide(prevChannel)
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -394,13 +409,7 @@ export default {
|
||||||
this.option.xAxis.max = maxX
|
this.option.xAxis.max = maxX
|
||||||
this.option.yAxis.min = minY
|
this.option.yAxis.min = minY
|
||||||
this.option.yAxis.max = maxY
|
this.option.yAxis.max = maxY
|
||||||
if (this.isEnergy()) {
|
this.setThumbnailChartRect(minX, maxY, maxX, minY)
|
||||||
const channel1 = this.getChannelByEnergy(minX)
|
|
||||||
const channel2 = this.getChannelByEnergy(maxX)
|
|
||||||
this.setThumbnailChartRect(channel1, maxY, channel2, minY)
|
|
||||||
} else {
|
|
||||||
this.setThumbnailChartRect(minX, maxY, maxX, minY)
|
|
||||||
}
|
|
||||||
|
|
||||||
const thumbnailChart = this.getThumbnailChart()
|
const thumbnailChart = this.getThumbnailChart()
|
||||||
const [, maxYPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [0, minY]) // 方框的上下两条边的yAxis转为pix
|
const [, maxYPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [0, minY]) // 方框的上下两条边的yAxis转为pix
|
||||||
|
@ -556,7 +565,7 @@ export default {
|
||||||
peak,
|
peak,
|
||||||
BaseCtrls,
|
BaseCtrls,
|
||||||
} = result
|
} = result
|
||||||
if (flag && (flag == 'dab' || flag == 'file')) {
|
if (flag && (flag == 'db' || flag == 'file')) {
|
||||||
this.bAnalyed = result.bAnalyed
|
this.bAnalyed = result.bAnalyed
|
||||||
this.$emit('reAnalyed', this.bAnalyed)
|
this.$emit('reAnalyed', this.bAnalyed)
|
||||||
this.checkBox_updateCal = result.checkBox_updateCal
|
this.checkBox_updateCal = result.checkBox_updateCal
|
||||||
|
@ -570,7 +579,7 @@ export default {
|
||||||
this.peakList = peak
|
this.peakList = peak
|
||||||
}
|
}
|
||||||
|
|
||||||
if(BaseCtrls) {
|
if (BaseCtrls) {
|
||||||
this.baseCtrls = BaseCtrls
|
this.baseCtrls = BaseCtrls
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -664,14 +673,13 @@ export default {
|
||||||
let energy = 0
|
let energy = 0
|
||||||
const value = params[0].value[0]
|
const value = params[0].value[0]
|
||||||
|
|
||||||
if (this.isEnergy()) {
|
if (this.isEnergy) {
|
||||||
energy = value.toFixed(2)
|
energy = value.toFixed(2)
|
||||||
channel = this.getChannelByEnergy(energy)
|
channel = this.getChannelByEnergy(value)
|
||||||
} else {
|
} else {
|
||||||
const allPointList = this.energyData.all.pointlist
|
|
||||||
channel = parseInt(value.toFixed())
|
channel = parseInt(value.toFixed())
|
||||||
energy = allPointList && allPointList[channel - 1]
|
energy = this.getEnergyByChannel(channel)
|
||||||
energy = energy ? energy.x.toFixed(2) : undefined
|
energy = energy ? energy.toFixed(2) : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
return `<div class="channel">Channel: ${channel}</div>
|
return `<div class="channel">Channel: ${channel}</div>
|
||||||
|
@ -729,8 +737,18 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.option.xAxis.name = value
|
this.option.xAxis.name = value
|
||||||
|
if (this.isEnergy) {
|
||||||
|
this.option.xAxis.axisLabel.formatter = (value) => {
|
||||||
|
return value.toFixed(2)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.option.xAxis.axisLabel.formatter = (value) => {
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.handleResetChart()
|
this.handleResetChart()
|
||||||
|
this.thumbnailOption.xAxis.min = this.xAxisMin
|
||||||
|
|
||||||
this.redrawLineBySeriesName(
|
this.redrawLineBySeriesName(
|
||||||
'BaseLine',
|
'BaseLine',
|
||||||
|
@ -812,7 +830,7 @@ export default {
|
||||||
// 根据seriesName重绘线
|
// 根据seriesName重绘线
|
||||||
redrawLineBySeriesName(seriesName, energyData, channelData, isShow = true, color) {
|
redrawLineBySeriesName(seriesName, energyData, channelData, isShow = true, color) {
|
||||||
if (isShow) {
|
if (isShow) {
|
||||||
const data = this.isEnergy() ? energyData : channelData
|
const data = this.isEnergy ? energyData : channelData
|
||||||
this.setSeriesData(this.option.series, seriesName, this.transformPointListData(data.pointlist), color)
|
this.setSeriesData(this.option.series, seriesName, this.transformPointListData(data.pointlist), color)
|
||||||
} else {
|
} else {
|
||||||
this.setSeriesData(this.option.series, seriesName, [])
|
this.setSeriesData(this.option.series, seriesName, [])
|
||||||
|
@ -822,7 +840,7 @@ export default {
|
||||||
// 重绘控制点
|
// 重绘控制点
|
||||||
redrawCtrlPointBySeriesName() {
|
redrawCtrlPointBySeriesName() {
|
||||||
const series = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point')
|
const series = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point')
|
||||||
const data = this.isEnergy() ? this.energyData.baseLineCP : this.channelData.baseLineCP
|
const data = this.isEnergy ? this.energyData.baseLineCP : this.channelData.baseLineCP
|
||||||
series.data = data.map(({ size, color, point: { x, y } }) => {
|
series.data = data.map(({ size, color, point: { x, y } }) => {
|
||||||
return {
|
return {
|
||||||
value: [x, y],
|
value: [x, y],
|
||||||
|
@ -847,7 +865,7 @@ export default {
|
||||||
redrawPeakLine() {
|
redrawPeakLine() {
|
||||||
this.clearPeakLine()
|
this.clearPeakLine()
|
||||||
|
|
||||||
const data = this.isEnergy() ? this.energyData.peakGroup : this.channelData.peakGroup
|
const data = this.isEnergy ? this.energyData.peakGroup : this.channelData.peakGroup
|
||||||
const peakLines = []
|
const peakLines = []
|
||||||
data.forEach((item, index) => {
|
data.forEach((item, index) => {
|
||||||
peakLines.push(
|
peakLines.push(
|
||||||
|
@ -863,7 +881,7 @@ export default {
|
||||||
// 重绘右上角的缩略图
|
// 重绘右上角的缩略图
|
||||||
redrawThumbnailChart() {
|
redrawThumbnailChart() {
|
||||||
const series = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
|
const series = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
|
||||||
const data = this.isEnergy() ? this.energyData.spectrumLine : this.channelData.spectrumLine
|
const data = this.isEnergy ? this.energyData.spectrumLine : this.channelData.spectrumLine
|
||||||
series.data = this.transformPointListData(data.pointlist)
|
series.data = this.transformPointListData(data.pointlist)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -875,7 +893,7 @@ export default {
|
||||||
if (point) {
|
if (point) {
|
||||||
const xAxis = point[0]
|
const xAxis = point[0]
|
||||||
const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
|
const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
|
||||||
spectrumLineSeries.markLine.data[0].xAxis = parseInt(xAxis.toFixed())
|
spectrumLineSeries.markLine.data[0].xAxis = xAxis
|
||||||
|
|
||||||
const { channel, energy, counts } = this.getEnergyAndCountsByXAxis(xAxis)
|
const { channel, energy, counts } = this.getEnergyAndCountsByXAxis(xAxis)
|
||||||
this.setChartBottomTitle(channel, energy, counts)
|
this.setChartBottomTitle(channel, energy, counts)
|
||||||
|
@ -888,7 +906,7 @@ export default {
|
||||||
setChartBottomTitle(channel, energy, counts) {
|
setChartBottomTitle(channel, energy, counts) {
|
||||||
const { index, find } = findNearPeak(channel, this.peakList)
|
const { index, find } = findNearPeak(channel, this.peakList)
|
||||||
|
|
||||||
this.option.title.text = `{a|Channel:${channel}} {a|Energy:${energy || '0.00'}} {a|Counts:${
|
this.option.title.text = `{a|Channel:${channel}} {a|Energy:${energy.toFixed(2) || '0.00'}} {a|Counts:${
|
||||||
counts || '0.0'
|
counts || '0.0'
|
||||||
}} {a|Significance:${find ? this.peakList[index].significance.toFixed(2) : '0.00'}}`
|
}} {a|Significance:${find ? this.peakList[index].significance.toFixed(2) : '0.00'}}`
|
||||||
},
|
},
|
||||||
|
@ -896,19 +914,19 @@ export default {
|
||||||
// 根据xAixs值找channel、energy和counts
|
// 根据xAixs值找channel、energy和counts
|
||||||
getEnergyAndCountsByXAxis(xAxis) {
|
getEnergyAndCountsByXAxis(xAxis) {
|
||||||
let channel, energy, counts
|
let channel, energy, counts
|
||||||
if (this.isEnergy()) {
|
if (this.isEnergy) {
|
||||||
channel = this.getChannelByEnergy(xAxis)
|
channel = this.getChannelByEnergy(xAxis)
|
||||||
energy = xAxis.toFixed(2)
|
energy = xAxis
|
||||||
counts = this.energyData.all.pointlist[channel - 1]
|
counts = this.energyData.all.pointlist[channel - 1].y
|
||||||
} else {
|
} else {
|
||||||
channel = parseInt(xAxis.toFixed())
|
channel = Math.round(xAxis)
|
||||||
energy = this.energyData.all.pointlist && this.energyData.all.pointlist[channel - 1].x.toFixed(2)
|
energy = this.getEnergyByChannel(channel)
|
||||||
counts = this.channelData.all.pointlist[channel - 1]
|
counts = this.channelData.all.pointlist[channel - 1].y
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
channel,
|
channel,
|
||||||
energy,
|
energy,
|
||||||
counts: counts.y,
|
counts,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -961,7 +979,7 @@ export default {
|
||||||
handleTogglePeak() {
|
handleTogglePeak() {
|
||||||
const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
|
const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
|
||||||
const xAxis = spectrumLineSeries.markLine.data[0].xAxis
|
const xAxis = spectrumLineSeries.markLine.data[0].xAxis
|
||||||
const channel = this.isEnergy() ? this.getChannelByEnergy(xAxis) : parseInt(xAxis.toFixed())
|
const channel = this.isEnergy ? this.getChannelByEnergy(xAxis) : parseInt(xAxis.toFixed())
|
||||||
const index = this.channelData.peakGroup.findIndex((peakItem) => {
|
const index = this.channelData.peakGroup.findIndex((peakItem) => {
|
||||||
const allX = peakItem.pointlist.map((item) => item.x)
|
const allX = peakItem.pointlist.map((item) => item.x)
|
||||||
const max = Math.max(...allX)
|
const max = Math.max(...allX)
|
||||||
|
@ -1016,32 +1034,83 @@ export default {
|
||||||
const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
|
const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
|
||||||
const prevAxis = spectrumLineSeries.markLine.data[0].xAxis
|
const prevAxis = spectrumLineSeries.markLine.data[0].xAxis
|
||||||
|
|
||||||
// 获取每一段 Channel 中的最大值
|
const { channel: prevChannel } = this.getEnergyAndCountsByXAxis(prevAxis)
|
||||||
const maxXAxises = this.channelData.peakGroup.map((item) => {
|
|
||||||
const allY = item.pointlist.map((item) => item.y)
|
let i,
|
||||||
const max = item.pointlist.find((point) => point.y == Math.max(...allY))
|
size = this.peakList.length
|
||||||
return max.x
|
|
||||||
})
|
|
||||||
|
|
||||||
let find = null
|
|
||||||
if (direction == 'right') {
|
if (direction == 'right') {
|
||||||
// 找到第一个比prevAxis大的xAxis
|
for (i = 0; i < size; i++) {
|
||||||
find = maxXAxises.find((xAxis) => xAxis > prevAxis)
|
const centroid = Math.round(this.peakList[i].peakCentroid)
|
||||||
if (find) {
|
if (centroid > prevChannel) {
|
||||||
spectrumLineSeries.markLine.data[0].xAxis = find
|
const energy = this.getEnergyByChannel(centroid)
|
||||||
|
this.setMarkLineXAxis(this.isEnergy ? energy : centroid, i)
|
||||||
|
this.getSelPosNuclide(centroid)
|
||||||
|
const { counts } = this.getEnergyAndCountsByXAxis(this.isEnergy ? energy : centroid)
|
||||||
|
this.setChartBottomTitle(centroid, energy, counts)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (direction == 'left') {
|
} else if (direction == 'left') {
|
||||||
// 找到第一个比prevAxis小的xAxis
|
for (i = size - 1; i >= 0; i--) {
|
||||||
find = maxXAxises.reverse().find((xAxis) => xAxis < prevAxis)
|
const centroid = Math.round(this.peakList[i].peakCentroid)
|
||||||
if (find) {
|
if (Math.round(centroid) < prevChannel) {
|
||||||
spectrumLineSeries.markLine.data[0].xAxis = find
|
const energy = this.getEnergyByChannel(centroid)
|
||||||
|
this.setMarkLineXAxis(this.isEnergy ? energy : centroid, i)
|
||||||
|
this.getSelPosNuclide(centroid)
|
||||||
|
const { counts } = this.getEnergyAndCountsByXAxis(this.isEnergy ? energy : centroid)
|
||||||
|
this.setChartBottomTitle(centroid, energy, counts)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
if (find) {
|
// 设置红色标记线的位置
|
||||||
this.getSelPosNuclide(find)
|
setMarkLineXAxis(xAxis, index) {
|
||||||
const { channel, energy, counts } = this.getEnergyAndCountsByXAxis(find)
|
const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
|
||||||
this.setChartBottomTitle(channel, energy, counts)
|
const markLineOption = spectrumLineSeries.markLine.data[0]
|
||||||
|
markLineOption.xAxis = xAxis
|
||||||
|
|
||||||
|
const {
|
||||||
|
xAxis: { max: xAxisMax, min: xAxisMin },
|
||||||
|
yAxis: { max: yAxisMax, min: yAxisMin },
|
||||||
|
} = this.option
|
||||||
|
|
||||||
|
// 如果不在范围内
|
||||||
|
if (xAxis >= xAxisMax || xAxis <= xAxisMin) {
|
||||||
|
let nextMaxX = xAxisMax,
|
||||||
|
nextMinX = xAxisMin,
|
||||||
|
nextMaxY = yAxisMax,
|
||||||
|
nextMinY = yAxisMin
|
||||||
|
|
||||||
|
const halfDiff = (xAxisMax - xAxisMin) / 2
|
||||||
|
|
||||||
|
const dataSource = this.isEnergy ? this.energyData : this.channelData
|
||||||
|
const lastChannel = dataSource.spectrumLine.pointlist[dataSource.spectrumLine.pointlist.length - 1].x
|
||||||
|
|
||||||
|
const tmpNextMaxX = xAxis + halfDiff
|
||||||
|
const tmpNextMinX = xAxis - halfDiff
|
||||||
|
|
||||||
|
nextMaxX = tmpNextMaxX > lastChannel ? lastChannel : tmpNextMaxX
|
||||||
|
nextMinX = tmpNextMinX < this.xAxisMin ? this.xAxisMin : tmpNextMinX
|
||||||
|
|
||||||
|
const peak = this.channelData.peakGroup[index]
|
||||||
|
const peakCountMax = Math.max(...peak.pointlist.map(({ y }) => y))
|
||||||
|
const peakCountMin = Math.min(...peak.pointlist.map(({ y }) => y))
|
||||||
|
|
||||||
|
const chart = this.$refs.thumbnailChartRef.getChartInstance()
|
||||||
|
const yDataMax = getAxisMax(chart, 'yAxis')
|
||||||
|
|
||||||
|
if (yAxisMax !== 'dataMax' && peakCountMin >= yAxisMax) {
|
||||||
|
nextMaxY = yDataMax
|
||||||
|
}
|
||||||
|
|
||||||
|
if (peakCountMax <= yAxisMin) {
|
||||||
|
nextMinY = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setRectRange(nextMinX, nextMaxX, nextMinY, nextMaxY)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1118,13 +1187,7 @@ export default {
|
||||||
this.option.yAxis.min = y1
|
this.option.yAxis.min = y1
|
||||||
this.option.yAxis.max = y2
|
this.option.yAxis.max = y2
|
||||||
|
|
||||||
if (this.isEnergy()) {
|
this.setThumbnailChartRect(x1, y2, x2, y1)
|
||||||
const channel1 = this.getChannelByEnergy(x1)
|
|
||||||
const channel2 = this.getChannelByEnergy(x2)
|
|
||||||
this.setThumbnailChartRect(channel1, y2, channel2, y1)
|
|
||||||
} else {
|
|
||||||
this.setThumbnailChartRect(x1, y2, x2, y1)
|
|
||||||
}
|
|
||||||
|
|
||||||
const thumbnailChart = this.getThumbnailChart()
|
const thumbnailChart = this.getThumbnailChart()
|
||||||
const [, maxYPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [0, y1]) // 方框的上下两条边的yAxis转为pix
|
const [, maxYPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [0, y1]) // 方框的上下两条边的yAxis转为pix
|
||||||
|
@ -1251,31 +1314,29 @@ export default {
|
||||||
|
|
||||||
const xAxisMax = getAxisMax(thumbnailChart, 'xAxis')
|
const xAxisMax = getAxisMax(thumbnailChart, 'xAxis')
|
||||||
|
|
||||||
const xAxisLimit = rangeNumber(1 + halfWidth, xAxisMax - halfWidth)
|
const xAxisLimit = rangeNumber(add(this.xAxisMin, halfWidth), subtract(xAxisMax, halfWidth))
|
||||||
|
|
||||||
const halfHeightPixel = this.halfHeightPixel
|
const halfHeightPixel = this.halfHeightPixel
|
||||||
const yAxisLimit = rangeNumber(maxYAxisPixel + halfHeightPixel, minYAxisPixel - halfHeightPixel)
|
const yAxisLimit = rangeNumber(add(maxYAxisPixel, halfHeightPixel), subtract(minYAxisPixel, halfHeightPixel))
|
||||||
|
|
||||||
xAxis = xAxisLimit(xAxis)
|
xAxis = xAxisLimit(xAxis)
|
||||||
|
|
||||||
let { pixY: yAxisPixel } = this.convertToPixel(thumbnailChart, 0, yAxis)
|
let { pixY: yAxisPixel } = this.convertToPixel(thumbnailChart, 0, yAxis)
|
||||||
yAxisPixel = yAxisLimit(yAxisPixel)
|
yAxisPixel = yAxisLimit(yAxisPixel)
|
||||||
|
|
||||||
const minYAxis = thumbnailChart.convertFromPixel({ seriesIndex: 0 }, [0, yAxisPixel + halfHeightPixel])[1] // 再把y轴最小值从pix转为yAxis
|
const minYAxis = thumbnailChart.convertFromPixel({ seriesIndex: 0 }, [0, add(yAxisPixel, halfHeightPixel)])[1] // 再把y轴最小值从pix转为yAxis
|
||||||
const maxYAxis = thumbnailChart.convertFromPixel({ seriesIndex: 0 }, [0, yAxisPixel - halfHeightPixel])[1]
|
const maxYAxis = thumbnailChart.convertFromPixel({ seriesIndex: 0 }, [
|
||||||
|
0,
|
||||||
|
subtract(yAxisPixel, halfHeightPixel),
|
||||||
|
])[1]
|
||||||
|
|
||||||
this.setThumbnailChartRect(xAxis - halfWidth, maxYAxis, xAxis + halfWidth, minYAxis)
|
const nextXAxisMin = subtract(xAxis, halfWidth)
|
||||||
|
const nextXAxisMax = add(xAxis, halfWidth)
|
||||||
|
|
||||||
if (this.isEnergy()) {
|
this.setThumbnailChartRect(nextXAxisMin, maxYAxis, nextXAxisMax, minYAxis)
|
||||||
const x1 = parseInt(this.energyData.spectrumLine.pointlist[xAxis - halfWidth].x)
|
|
||||||
const x2 = parseInt(this.energyData.spectrumLine.pointlist[xAxis + halfWidth].x)
|
|
||||||
|
|
||||||
this.option.xAxis.min = x1
|
this.option.xAxis.min = nextXAxisMin
|
||||||
this.option.xAxis.max = x2
|
this.option.xAxis.max = nextXAxisMax
|
||||||
} else {
|
|
||||||
this.option.xAxis.min = xAxis - halfWidth
|
|
||||||
this.option.xAxis.max = xAxis + halfWidth
|
|
||||||
}
|
|
||||||
|
|
||||||
this.option.yAxis.min = minYAxis
|
this.option.yAxis.min = minYAxis
|
||||||
this.option.yAxis.max = maxYAxis
|
this.option.yAxis.max = maxYAxis
|
||||||
|
@ -1290,7 +1351,7 @@ export default {
|
||||||
* 重置图表
|
* 重置图表
|
||||||
*/
|
*/
|
||||||
handleResetChart() {
|
handleResetChart() {
|
||||||
this.option.xAxis.min = 1
|
this.option.xAxis.min = this.xAxisMin
|
||||||
this.option.xAxis.max = 'dataMax'
|
this.option.xAxis.max = 'dataMax'
|
||||||
this.option.yAxis.min = 1
|
this.option.yAxis.min = 1
|
||||||
this.option.yAxis.max = 'dataMax'
|
this.option.yAxis.max = 'dataMax'
|
||||||
|
@ -1317,14 +1378,7 @@ export default {
|
||||||
|
|
||||||
// 分析工具Accept时刷新部分数据
|
// 分析工具Accept时刷新部分数据
|
||||||
handleAccept(data) {
|
handleAccept(data) {
|
||||||
const {
|
const { allData, peakSet, shadowChannelChart, shadowEnergyChart, shapeChannelData, shapeEnergyData } = data
|
||||||
allData,
|
|
||||||
peakSet,
|
|
||||||
shadowChannelChart,
|
|
||||||
shadowEnergyChart,
|
|
||||||
shapeChannelData,
|
|
||||||
shapeEnergyData,
|
|
||||||
} = data
|
|
||||||
|
|
||||||
const result = {
|
const result = {
|
||||||
DetailedInformation: this.detailedInfomation,
|
DetailedInformation: this.detailedInfomation,
|
||||||
|
@ -1531,6 +1585,15 @@ export default {
|
||||||
return channel
|
return channel
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据channel获取energy
|
||||||
|
* @param {number} channel
|
||||||
|
*/
|
||||||
|
getEnergyByChannel(channel) {
|
||||||
|
const energyItem = this.energyData.all.pointlist ? this.energyData.all.pointlist[channel - 1] : {}
|
||||||
|
return energyItem ? energyItem.x : 0
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置页面信息
|
* 重置页面信息
|
||||||
*/
|
*/
|
||||||
|
@ -1621,10 +1684,6 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
isEnergy() {
|
|
||||||
return this.graphAssistance.axisType == 'Energy'
|
|
||||||
},
|
|
||||||
|
|
||||||
isScatter() {
|
isScatter() {
|
||||||
return this.graphAssistance.spectrumType == 'Scatter'
|
return this.graphAssistance.spectrumType == 'Scatter'
|
||||||
},
|
},
|
||||||
|
@ -1704,6 +1763,17 @@ export default {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 是不是Energy
|
||||||
|
isEnergy() {
|
||||||
|
return this.graphAssistance.axisType == 'Energy'
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取x轴最小值
|
||||||
|
xAxisMin() {
|
||||||
|
return this.isEnergy ? 0.01 : 1
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -63,16 +63,14 @@ export const GammaOptions = {
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee'
|
||||||
|
},
|
||||||
|
formatter: value => {
|
||||||
|
return parseInt(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 'dataMax',
|
max: 'dataMax',
|
||||||
animation: false,
|
animation: false
|
||||||
axisLabel: {
|
|
||||||
formatter: value => {
|
|
||||||
return parseInt(value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: 'Counts',
|
name: 'Counts',
|
||||||
|
@ -96,16 +94,14 @@ export const GammaOptions = {
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee'
|
||||||
|
},
|
||||||
|
formatter: value => {
|
||||||
|
return value.toFixed(1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 'dataMax',
|
max: 'dataMax',
|
||||||
animation: false,
|
animation: false
|
||||||
axisLabel: {
|
|
||||||
formatter: value => {
|
|
||||||
return value.toFixed(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
series: [spectrumSeries, baseLineSeries, lcLineSeries, scacLineSeries, baseLineCtrlPoint, compareLineSeries],
|
series: [spectrumSeries, baseLineSeries, lcLineSeries, scacLineSeries, baseLineCtrlPoint, compareLineSeries],
|
||||||
brush: {}
|
brush: {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user