处理formDb来源的beta模块 Energy Calibration 弹窗接口不显示数据的问题,及接口参数调整
This commit is contained in:
parent
8fa955e4f4
commit
a3187a5975
|
@ -1,8 +1,11 @@
|
||||||
export default {
|
export default {
|
||||||
inject: ['sample'],
|
inject: ['sample', 'newSample'],
|
||||||
computed: {
|
computed: {
|
||||||
sampleData() {
|
sampleData() {
|
||||||
return this.sample()
|
return this.sample()
|
||||||
|
},
|
||||||
|
newSampleData() {
|
||||||
|
return this.newSample()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,13 +222,6 @@ export default {
|
||||||
currSample: {},
|
currSample: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
if (this.currSample.sampleId) {
|
|
||||||
this.getSampleDetail()
|
|
||||||
} else {
|
|
||||||
this.getSampleDetail_file()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
async getSampleDetail() {
|
async getSampleDetail() {
|
||||||
this.spectraType = this.SampleType[0].value
|
this.spectraType = this.SampleType[0].value
|
||||||
|
@ -244,7 +237,11 @@ export default {
|
||||||
this.sampleDetail = result
|
this.sampleDetail = result
|
||||||
this.changeChartByType('sample')
|
this.changeChartByType('sample')
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
this.$emit('getFiles', { detFileName: result.detBg.fileName, gasFileName: result.gasBg.fileName })
|
this.$emit('getFiles', {
|
||||||
|
detFileName: result.detBg.fileName,
|
||||||
|
gasFileName: result.gasBg.fileName,
|
||||||
|
qcFileName: result.qc.fileName || '',
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
|
@ -400,7 +397,9 @@ export default {
|
||||||
sample: {
|
sample: {
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
if (newVal.sampleId) {
|
if (newVal.sampleId) {
|
||||||
this.currSample = newVal
|
this.getSampleDetail()
|
||||||
|
} else {
|
||||||
|
this.getSampleDetail_file()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
class="custom-tool-tip"
|
class="custom-tool-tip"
|
||||||
:style="{
|
:style="{
|
||||||
top: tooltipPosition.top + 'px',
|
top: tooltipPosition.top + 'px',
|
||||||
left: tooltipPosition.left + 'px'
|
left: tooltipPosition.left + 'px',
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div class="channel">Channel: {{ tooltipChannel }}</div>
|
<div class="channel">Channel: {{ tooltipChannel }}</div>
|
||||||
|
@ -82,7 +82,7 @@
|
||||||
:scroll="{ y: 99 }"
|
:scroll="{ y: 99 }"
|
||||||
>
|
>
|
||||||
<template slot="operation" slot-scope="text, record, index">
|
<template slot="operation" slot-scope="text, record, index">
|
||||||
<a-icon type="delete" style="color: #f00;" @click="handleDel(index)"></a-icon>
|
<a-icon type="delete" style="color: #f00" @click="handleDel(index)"></a-icon>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
<!-- 表格结束 -->
|
<!-- 表格结束 -->
|
||||||
|
@ -179,103 +179,104 @@ import { cloneDeep } from 'lodash'
|
||||||
import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/chartHelper'
|
import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/chartHelper'
|
||||||
import { graphic } from 'echarts'
|
import { graphic } from 'echarts'
|
||||||
import { isNullOrUndefined } from '@/utils/util'
|
import { isNullOrUndefined } from '@/utils/util'
|
||||||
|
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||||
|
|
||||||
const initialBetaGammaChartOption = {
|
const initialBetaGammaChartOption = {
|
||||||
grid: {
|
grid: {
|
||||||
top: 15,
|
top: 15,
|
||||||
left: 55,
|
left: 55,
|
||||||
right: 10,
|
right: 10,
|
||||||
bottom: 45
|
bottom: 45,
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
name: 'Beta Channel',
|
name: 'Beta Channel',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
color: '#5b9cba',
|
color: '#5b9cba',
|
||||||
fontSize: 16
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameGap: 30,
|
nameGap: 30,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .3)'
|
color: 'rgba(119, 181, 213, .3)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#ade6ee',
|
color: '#ade6ee',
|
||||||
fontSize: 12
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .3)'
|
color: 'rgba(119, 181, 213, .3)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 256,
|
max: 256,
|
||||||
interval: 64
|
interval: 64,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: 'Gamma Channel',
|
name: 'Gamma Channel',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
color: '#5b9cba',
|
color: '#5b9cba',
|
||||||
fontSize: 16
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameGap: 35,
|
nameGap: 35,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .3)'
|
color: 'rgba(119, 181, 213, .3)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#ade6ee',
|
color: '#ade6ee',
|
||||||
fontSize: 12
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .3)'
|
color: 'rgba(119, 181, 213, .3)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 256,
|
max: 256,
|
||||||
interval: 64
|
interval: 64,
|
||||||
},
|
},
|
||||||
series: {
|
series: {
|
||||||
type: 'scatterGL',
|
type: 'scatterGL',
|
||||||
symbolSize: 2,
|
symbolSize: 2,
|
||||||
data: [],
|
data: [],
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#fff'
|
color: '#fff',
|
||||||
},
|
},
|
||||||
cursor: 'default'
|
cursor: 'default',
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialGammaGatedChartOption = {
|
const initialGammaGatedChartOption = {
|
||||||
grid: {
|
grid: {
|
||||||
top: 10,
|
top: 10,
|
||||||
right: 15,
|
right: 15,
|
||||||
bottom: 50
|
bottom: 50,
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#099D24'
|
color: '#099D24',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
formatter: params => {
|
formatter: (params) => {
|
||||||
const [channel] = params[0].value
|
const [channel] = params[0].value
|
||||||
return `<div class="channel">Channel: ${channel}</div>`
|
return `<div class="channel">Channel: ${channel}</div>`
|
||||||
},
|
},
|
||||||
className: 'figure-chart-option-tooltip'
|
className: 'figure-chart-option-tooltip',
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
min: 0,
|
min: 0,
|
||||||
|
@ -283,28 +284,28 @@ const initialGammaGatedChartOption = {
|
||||||
interval: 64,
|
interval: 64,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgb(119, 181, 213, 0.5)'
|
color: 'rgb(119, 181, 213, 0.5)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .2)'
|
color: 'rgba(119, 181, 213, .2)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
},
|
},
|
||||||
name: 'Channel',
|
name: 'Channel',
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: '#5b9cba'
|
color: '#5b9cba',
|
||||||
},
|
},
|
||||||
nameGap: 35
|
nameGap: 35,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
min: 0,
|
min: 0,
|
||||||
|
@ -313,79 +314,79 @@ const initialGammaGatedChartOption = {
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgb(119, 181, 213, 0.5)'
|
color: 'rgb(119, 181, 213, 0.5)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .2)'
|
color: 'rgba(119, 181, 213, .2)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
},
|
},
|
||||||
name: 'Count',
|
name: 'Count',
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: '#5b9cba'
|
color: '#5b9cba',
|
||||||
},
|
},
|
||||||
nameGap: 25
|
nameGap: 25,
|
||||||
},
|
},
|
||||||
series: {
|
series: {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#04ADD9'
|
color: '#04ADD9',
|
||||||
},
|
},
|
||||||
areaStyle: {
|
areaStyle: {
|
||||||
color: new graphic.LinearGradient(0, 0, 0, 1, [
|
color: new graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{
|
{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: 'rgba(4, 173, 217, 0.87)'
|
color: 'rgba(4, 173, 217, 0.87)',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: 'rgba(4, 173, 217, 0.05)'
|
color: 'rgba(4, 173, 217, 0.05)',
|
||||||
}
|
},
|
||||||
])
|
]),
|
||||||
},
|
},
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
data: [],
|
data: [],
|
||||||
markLine: {
|
markLine: {
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
label: {
|
label: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
animation: false,
|
animation: false,
|
||||||
emphasis: {
|
emphasis: {
|
||||||
disabled: true
|
disabled: true,
|
||||||
},
|
},
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#f00'
|
color: '#f00',
|
||||||
},
|
},
|
||||||
data: []
|
data: [],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialFigureChartOption = {
|
const initialFigureChartOption = {
|
||||||
grid: {
|
grid: {
|
||||||
top: 10,
|
top: 10,
|
||||||
right: 15,
|
right: 15,
|
||||||
bottom: 50
|
bottom: 50,
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#099D24'
|
color: '#099D24',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
formatter: params => {
|
formatter: (params) => {
|
||||||
const [series1, series2] = params
|
const [series1, series2] = params
|
||||||
const [channel, energy1] = series1.value
|
const [channel, energy1] = series1.value
|
||||||
|
|
||||||
|
@ -399,7 +400,7 @@ const initialFigureChartOption = {
|
||||||
|
|
||||||
return html
|
return html
|
||||||
},
|
},
|
||||||
className: 'figure-chart-option-tooltip'
|
className: 'figure-chart-option-tooltip',
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
min: 0,
|
min: 0,
|
||||||
|
@ -407,28 +408,28 @@ const initialFigureChartOption = {
|
||||||
interval: 64,
|
interval: 64,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgb(119, 181, 213, 0.5)'
|
color: 'rgb(119, 181, 213, 0.5)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .2)'
|
color: 'rgba(119, 181, 213, .2)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
},
|
},
|
||||||
name: 'Channel',
|
name: 'Channel',
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: '#5b9cba'
|
color: '#5b9cba',
|
||||||
},
|
},
|
||||||
nameGap: 35
|
nameGap: 35,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
min: 0,
|
min: 0,
|
||||||
|
@ -437,109 +438,110 @@ const initialFigureChartOption = {
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgb(119, 181, 213, 0.5)'
|
color: 'rgb(119, 181, 213, 0.5)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .2)'
|
color: 'rgba(119, 181, 213, .2)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
},
|
},
|
||||||
name: 'Energy[E/kev]',
|
name: 'Energy[E/kev]',
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: '#5b9cba'
|
color: '#5b9cba',
|
||||||
},
|
},
|
||||||
nameGap: 80
|
nameGap: 80,
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
type: 'line',
|
type: 'line',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#04ADD9'
|
color: '#04ADD9',
|
||||||
},
|
},
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
data: [],
|
data: [],
|
||||||
markPoint: {
|
markPoint: {
|
||||||
symbol: 'circle',
|
symbol: 'circle',
|
||||||
symbolSize: 8,
|
symbolSize: 8,
|
||||||
data: []
|
data: [],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'line',
|
type: 'line',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: 'yellow'
|
color: 'yellow',
|
||||||
},
|
},
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
data: [],
|
data: [],
|
||||||
markPoint: {
|
markPoint: {
|
||||||
symbol: 'circle',
|
symbol: 'circle',
|
||||||
symbolSize: 8,
|
symbolSize: 8,
|
||||||
data: []
|
data: [],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: 'Index',
|
title: 'Index',
|
||||||
dataIndex: 'rowCount',
|
dataIndex: 'rowCount',
|
||||||
align: 'center'
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Channel',
|
title: 'Channel',
|
||||||
dataIndex: 'channel',
|
dataIndex: 'channel',
|
||||||
align: 'center'
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Energy/keV',
|
title: 'Energy/keV',
|
||||||
dataIndex: 'energy',
|
dataIndex: 'energy',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
customRender: text => {
|
customRender: (text) => {
|
||||||
return text.toPrecision(6)
|
return text.toPrecision(6)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'FWHM/C',
|
title: 'FWHM/C',
|
||||||
dataIndex: 'c',
|
dataIndex: 'c',
|
||||||
align: 'center'
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'FWHM/keV',
|
title: 'FWHM/keV',
|
||||||
dataIndex: 'keV',
|
dataIndex: 'keV',
|
||||||
align: 'center'
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'S',
|
title: 'S',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
scopedSlots: {
|
scopedSlots: {
|
||||||
customRender: 'operation'
|
customRender: 'operation',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const newCalibrationFuncModel = {
|
const newCalibrationFuncModel = {
|
||||||
paramA: undefined,
|
paramA: undefined,
|
||||||
paramB: undefined,
|
paramB: undefined,
|
||||||
paramC: undefined
|
paramC: undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [SampleDataMixin],
|
||||||
components: { CustomChart, TitleOverBorder },
|
components: { CustomChart, TitleOverBorder },
|
||||||
props: {
|
props: {
|
||||||
sampleId: {
|
sampleId: {
|
||||||
type: Number
|
type: Number,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
|
@ -559,23 +561,23 @@ export default {
|
||||||
|
|
||||||
markLineVisible: false,
|
markLineVisible: false,
|
||||||
markLinePosition: {
|
markLinePosition: {
|
||||||
top: 0
|
top: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
rectVisible: false,
|
rectVisible: false,
|
||||||
rectPosition: {
|
rectPosition: {
|
||||||
top: 0
|
top: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
tooltipVisible: false,
|
tooltipVisible: false,
|
||||||
tooltipPosition: {
|
tooltipPosition: {
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0
|
left: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
channelAndEnergyModel: {
|
channelAndEnergyModel: {
|
||||||
channel: undefined,
|
channel: undefined,
|
||||||
energy: undefined
|
energy: undefined,
|
||||||
},
|
},
|
||||||
|
|
||||||
c2e: {},
|
c2e: {},
|
||||||
|
@ -590,7 +592,7 @@ export default {
|
||||||
|
|
||||||
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
||||||
isFirstFitting: true,
|
isFirstFitting: true,
|
||||||
isInverse: false // 是否需要反算
|
isInverse: false, // 是否需要反算
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -604,21 +606,16 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
|
const { sampleId, qcFileName } = this.newSampleData
|
||||||
try {
|
try {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
const res = await getAction('/spectrumAnalysis/viewBetaDetectorCalibration', {
|
const res = await getAction('/spectrumAnalysis/viewBetaDetectorCalibration', {
|
||||||
sampleId: this.sampleId
|
sampleId,
|
||||||
|
qcFileName,
|
||||||
})
|
})
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const {
|
const { CToE, EToC, betaEnergy, gammaEnergy, gammaGatedBetaSpectrum, histogramData, oldScatterSeries } =
|
||||||
CToE,
|
res.result
|
||||||
EToC,
|
|
||||||
betaEnergy,
|
|
||||||
gammaEnergy,
|
|
||||||
gammaGatedBetaSpectrum,
|
|
||||||
histogramData,
|
|
||||||
oldScatterSeries
|
|
||||||
} = res.result
|
|
||||||
this.c2e = CToE
|
this.c2e = CToE
|
||||||
this.e2c = EToC
|
this.e2c = EToC
|
||||||
|
|
||||||
|
@ -631,7 +628,7 @@ export default {
|
||||||
this.gammaGatedBetaSpectrum = gammaGatedBetaSpectrum
|
this.gammaGatedBetaSpectrum = gammaGatedBetaSpectrum
|
||||||
this.oldScatterSeries = oldScatterSeries
|
this.oldScatterSeries = oldScatterSeries
|
||||||
|
|
||||||
const gammaEnergyValue = betaEnergy.map(item => item[0])
|
const gammaEnergyValue = betaEnergy.map((item) => item[0])
|
||||||
const gammaEnergyMax = Math.max(...gammaEnergyValue)
|
const gammaEnergyMax = Math.max(...gammaEnergyValue)
|
||||||
const gammaEnergyMin = Math.min(...gammaEnergyValue)
|
const gammaEnergyMin = Math.min(...gammaEnergyValue)
|
||||||
|
|
||||||
|
@ -669,7 +666,7 @@ export default {
|
||||||
this.currEnergy = parseFloat(this.gammaEnergy[yAxis][0].toFixed(2)) // 设置当前选中位置的Energy
|
this.currEnergy = parseFloat(this.gammaEnergy[yAxis][0].toFixed(2)) // 设置当前选中位置的Energy
|
||||||
this.channelAndEnergyModel = {
|
this.channelAndEnergyModel = {
|
||||||
channel: undefined,
|
channel: undefined,
|
||||||
energy: undefined
|
energy: undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getGammaGated(yAxis)
|
this.getGammaGated(yAxis)
|
||||||
|
@ -682,12 +679,12 @@ export default {
|
||||||
const {
|
const {
|
||||||
success,
|
success,
|
||||||
result: { data },
|
result: { data },
|
||||||
message
|
message,
|
||||||
} = await getAction('/spectrumAnalysis/getGammaGated', {
|
} = await getAction('/spectrumAnalysis/getGammaGated', {
|
||||||
gammaChannel,
|
gammaChannel,
|
||||||
sampleId: this.sampleId,
|
sampleId: this.sampleId,
|
||||||
chartHeight: this.gammaEnergy.length,
|
chartHeight: this.gammaEnergy.length,
|
||||||
channelWidth: this.gammaChannelWidth
|
channelWidth: this.gammaChannelWidth,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
const max = Math.max(...data.map(({ y }) => y))
|
const max = Math.max(...data.map(({ y }) => y))
|
||||||
|
@ -721,7 +718,7 @@ export default {
|
||||||
const energy = gammaEnergy[0].toPrecision(6)
|
const energy = gammaEnergy[0].toPrecision(6)
|
||||||
this.betaGammaInfo = {
|
this.betaGammaInfo = {
|
||||||
channel: yAxis,
|
channel: yAxis,
|
||||||
energy
|
energy,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -760,7 +757,7 @@ export default {
|
||||||
this.list.push({
|
this.list.push({
|
||||||
rowCount: this.list.length + 1,
|
rowCount: this.list.length + 1,
|
||||||
channel,
|
channel,
|
||||||
energy
|
energy,
|
||||||
})
|
})
|
||||||
|
|
||||||
this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy })
|
this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy })
|
||||||
|
@ -780,7 +777,7 @@ export default {
|
||||||
|
|
||||||
this.channelAndEnergyModel = {
|
this.channelAndEnergyModel = {
|
||||||
channel: undefined,
|
channel: undefined,
|
||||||
energy: undefined
|
energy: undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isInverse = true
|
this.isInverse = true
|
||||||
|
@ -791,7 +788,7 @@ export default {
|
||||||
const willDelItem = this.list.splice(index, 1)[0]
|
const willDelItem = this.list.splice(index, 1)[0]
|
||||||
|
|
||||||
const findIndex = this.figureChartOption.series[1].markPoint.data.findIndex(
|
const findIndex = this.figureChartOption.series[1].markPoint.data.findIndex(
|
||||||
item => item.xAxis == willDelItem.channel && item.yAxis == willDelItem.energy
|
(item) => item.xAxis == willDelItem.channel && item.yAxis == willDelItem.energy
|
||||||
)
|
)
|
||||||
|
|
||||||
if (-1 !== findIndex) {
|
if (-1 !== findIndex) {
|
||||||
|
@ -843,8 +840,8 @@ export default {
|
||||||
...this.newCalibrationFuncModel,
|
...this.newCalibrationFuncModel,
|
||||||
tempPoints: this.isFirstFitting
|
tempPoints: this.isFirstFitting
|
||||||
? this.oldScatterSeries
|
? this.oldScatterSeries
|
||||||
: this.list.map(item => ({ x: item.channel, y: item.energy })),
|
: this.list.map((item) => ({ x: item.channel, y: item.energy })),
|
||||||
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
|
||||||
|
@ -862,11 +859,11 @@ export default {
|
||||||
this.newCalibrationFuncModel = {
|
this.newCalibrationFuncModel = {
|
||||||
paramA: Number(paramA).toPrecision(6),
|
paramA: Number(paramA).toPrecision(6),
|
||||||
paramB: Number(paramB).toPrecision(6),
|
paramB: Number(paramB).toPrecision(6),
|
||||||
paramC: Number(paramC).toPrecision(6)
|
paramC: Number(paramC).toPrecision(6),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const energyValues = newLineSeries.map(item => item.y)
|
const energyValues = newLineSeries.map((item) => item.y)
|
||||||
|
|
||||||
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
||||||
|
|
||||||
|
@ -884,7 +881,7 @@ export default {
|
||||||
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => {
|
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => {
|
||||||
return {
|
return {
|
||||||
xAxis: x,
|
xAxis: x,
|
||||||
yAxis: y
|
yAxis: y,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -901,22 +898,22 @@ export default {
|
||||||
const [series0, series1] = this.figureChartOption.series
|
const [series0, series1] = this.figureChartOption.series
|
||||||
const {
|
const {
|
||||||
data: data0,
|
data: data0,
|
||||||
markPoint: { data: markPointData0 }
|
markPoint: { data: markPointData0 },
|
||||||
} = series0
|
} = series0
|
||||||
const {
|
const {
|
||||||
data: data1,
|
data: data1,
|
||||||
markPoint: { data: markPointData1 }
|
markPoint: { data: markPointData1 },
|
||||||
} = series1
|
} = series1
|
||||||
const newArr = [
|
const newArr = [
|
||||||
...data0.map(item => item[1]),
|
...data0.map((item) => item[1]),
|
||||||
...markPointData0.map(item => item.yAxis),
|
...markPointData0.map((item) => item.yAxis),
|
||||||
...data1.map(item => item[1]),
|
...data1.map((item) => item[1]),
|
||||||
...markPointData1.map(item => item.yAxis)
|
...markPointData1.map((item) => item.yAxis),
|
||||||
]
|
]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
max: Math.max(...newArr),
|
max: Math.max(...newArr),
|
||||||
min: Math.min(...newArr)
|
min: Math.min(...newArr),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -938,15 +935,15 @@ export default {
|
||||||
return `${Number(start).toPrecision(6)}${end ? 'e' + end : ''}`
|
return `${Number(start).toPrecision(6)}${end ? 'e' + end : ''}`
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rectHeight() {
|
rectHeight() {
|
||||||
const { top, bottom } = initialBetaGammaChartOption.grid
|
const { top, bottom } = initialBetaGammaChartOption.grid
|
||||||
const totalHeight = 427 - top - bottom
|
const totalHeight = 427 - top - bottom
|
||||||
return (totalHeight / 256) * this.gammaChannelWidth
|
return (totalHeight / 256) * this.gammaChannelWidth
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
class="custom-tool-tip"
|
class="custom-tool-tip"
|
||||||
:style="{
|
:style="{
|
||||||
top: tooltipPosition.top + 'px',
|
top: tooltipPosition.top + 'px',
|
||||||
left: tooltipPosition.left + 'px'
|
left: tooltipPosition.left + 'px',
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div class="channel">Channel: {{ tooltipChannel }}</div>
|
<div class="channel">Channel: {{ tooltipChannel }}</div>
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
:scroll="{ y: 99 }"
|
:scroll="{ y: 99 }"
|
||||||
>
|
>
|
||||||
<template slot="operation" slot-scope="text, record, index">
|
<template slot="operation" slot-scope="text, record, index">
|
||||||
<a-icon type="delete" style="color: #f00;" @click="handleDel(index)"></a-icon>
|
<a-icon type="delete" style="color: #f00" @click="handleDel(index)"></a-icon>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
<!-- 表格结束 -->
|
<!-- 表格结束 -->
|
||||||
|
@ -153,25 +153,26 @@ import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/
|
||||||
|
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { isNullOrUndefined } from '@/utils/util'
|
import { isNullOrUndefined } from '@/utils/util'
|
||||||
|
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||||
|
|
||||||
const initialGammaSpectrumChartOption = {
|
const initialGammaSpectrumChartOption = {
|
||||||
grid: {
|
grid: {
|
||||||
top: 10,
|
top: 10,
|
||||||
right: 15,
|
right: 15,
|
||||||
bottom: 50
|
bottom: 50,
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#099D24'
|
color: '#099D24',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
formatter: params => {
|
formatter: (params) => {
|
||||||
const [channel] = params[0].value
|
const [channel] = params[0].value
|
||||||
return `<div class="channel">Channel: ${channel}</div>`
|
return `<div class="channel">Channel: ${channel}</div>`
|
||||||
},
|
},
|
||||||
className: 'figure-chart-option-tooltip'
|
className: 'figure-chart-option-tooltip',
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
min: 0,
|
min: 0,
|
||||||
|
@ -179,28 +180,28 @@ const initialGammaSpectrumChartOption = {
|
||||||
interval: 64,
|
interval: 64,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgb(119, 181, 213, 0.5)'
|
color: 'rgb(119, 181, 213, 0.5)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .2)'
|
color: 'rgba(119, 181, 213, .2)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
},
|
},
|
||||||
name: 'Channel',
|
name: 'Channel',
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: '#5b9cba'
|
color: '#5b9cba',
|
||||||
},
|
},
|
||||||
nameGap: 35
|
nameGap: 35,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
min: 0,
|
min: 0,
|
||||||
|
@ -209,79 +210,79 @@ const initialGammaSpectrumChartOption = {
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgb(119, 181, 213, 0.5)'
|
color: 'rgb(119, 181, 213, 0.5)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .2)'
|
color: 'rgba(119, 181, 213, .2)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
},
|
},
|
||||||
name: 'Count',
|
name: 'Count',
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: '#5b9cba'
|
color: '#5b9cba',
|
||||||
},
|
},
|
||||||
nameGap: 60
|
nameGap: 60,
|
||||||
},
|
},
|
||||||
series: {
|
series: {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#04ADD9'
|
color: '#04ADD9',
|
||||||
},
|
},
|
||||||
areaStyle: {
|
areaStyle: {
|
||||||
color: new graphic.LinearGradient(0, 0, 0, 1, [
|
color: new graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{
|
{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: 'rgba(4, 173, 217, 0.87)'
|
color: 'rgba(4, 173, 217, 0.87)',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: 'rgba(4, 173, 217, 0.05)'
|
color: 'rgba(4, 173, 217, 0.05)',
|
||||||
}
|
},
|
||||||
])
|
]),
|
||||||
},
|
},
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
data: [],
|
data: [],
|
||||||
markLine: {
|
markLine: {
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
label: {
|
label: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
animation: false,
|
animation: false,
|
||||||
emphasis: {
|
emphasis: {
|
||||||
disabled: true
|
disabled: true,
|
||||||
},
|
},
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#f00'
|
color: '#f00',
|
||||||
},
|
},
|
||||||
data: []
|
data: [],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialFigureChartOption = {
|
const initialFigureChartOption = {
|
||||||
grid: {
|
grid: {
|
||||||
top: 10,
|
top: 10,
|
||||||
right: 15,
|
right: 15,
|
||||||
bottom: 50
|
bottom: 50,
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#099D24'
|
color: '#099D24',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
formatter: params => {
|
formatter: (params) => {
|
||||||
const [series1, series2] = params
|
const [series1, series2] = params
|
||||||
const [channel, energy1] = series1.value
|
const [channel, energy1] = series1.value
|
||||||
|
|
||||||
|
@ -295,7 +296,7 @@ const initialFigureChartOption = {
|
||||||
|
|
||||||
return html
|
return html
|
||||||
},
|
},
|
||||||
className: 'figure-chart-option-tooltip'
|
className: 'figure-chart-option-tooltip',
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
min: 0,
|
min: 0,
|
||||||
|
@ -303,28 +304,28 @@ const initialFigureChartOption = {
|
||||||
interval: 64,
|
interval: 64,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgb(119, 181, 213, 0.5)'
|
color: 'rgb(119, 181, 213, 0.5)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .2)'
|
color: 'rgba(119, 181, 213, .2)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
},
|
},
|
||||||
name: 'Channel',
|
name: 'Channel',
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: '#5b9cba'
|
color: '#5b9cba',
|
||||||
},
|
},
|
||||||
nameGap: 35
|
nameGap: 35,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
min: 0,
|
min: 0,
|
||||||
|
@ -333,109 +334,110 @@ const initialFigureChartOption = {
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgb(119, 181, 213, 0.5)'
|
color: 'rgb(119, 181, 213, 0.5)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(119, 181, 213, .2)'
|
color: 'rgba(119, 181, 213, .2)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
},
|
},
|
||||||
name: 'Energy[E/kev]',
|
name: 'Energy[E/kev]',
|
||||||
nameLocation: 'center',
|
nameLocation: 'center',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: '#5b9cba'
|
color: '#5b9cba',
|
||||||
},
|
},
|
||||||
nameGap: 80
|
nameGap: 80,
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
type: 'line',
|
type: 'line',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#04ADD9'
|
color: '#04ADD9',
|
||||||
},
|
},
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
data: [],
|
data: [],
|
||||||
markPoint: {
|
markPoint: {
|
||||||
symbol: 'circle',
|
symbol: 'circle',
|
||||||
symbolSize: 8,
|
symbolSize: 8,
|
||||||
data: []
|
data: [],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'line',
|
type: 'line',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: 'yellow'
|
color: 'yellow',
|
||||||
},
|
},
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
data: [],
|
data: [],
|
||||||
markPoint: {
|
markPoint: {
|
||||||
symbol: 'circle',
|
symbol: 'circle',
|
||||||
symbolSize: 8,
|
symbolSize: 8,
|
||||||
data: []
|
data: [],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: 'Index',
|
title: 'Index',
|
||||||
dataIndex: 'rowCount',
|
dataIndex: 'rowCount',
|
||||||
align: 'center'
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Channel',
|
title: 'Channel',
|
||||||
dataIndex: 'channel',
|
dataIndex: 'channel',
|
||||||
align: 'center'
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Energy/keV',
|
title: 'Energy/keV',
|
||||||
dataIndex: 'energy',
|
dataIndex: 'energy',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
customRender: text => {
|
customRender: (text) => {
|
||||||
return text.toPrecision(6)
|
return text.toPrecision(6)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'FWHM/C',
|
title: 'FWHM/C',
|
||||||
dataIndex: 'c',
|
dataIndex: 'c',
|
||||||
align: 'center'
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'FWHM/keV',
|
title: 'FWHM/keV',
|
||||||
dataIndex: 'keV',
|
dataIndex: 'keV',
|
||||||
align: 'center'
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'S',
|
title: 'S',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
scopedSlots: {
|
scopedSlots: {
|
||||||
customRender: 'operation'
|
customRender: 'operation',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const newCalibrationFuncModel = {
|
const newCalibrationFuncModel = {
|
||||||
paramA: undefined,
|
paramA: undefined,
|
||||||
paramB: undefined,
|
paramB: undefined,
|
||||||
paramC: undefined
|
paramC: undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [SampleDataMixin],
|
||||||
components: { CustomChart, TitleOverBorder },
|
components: { CustomChart, TitleOverBorder },
|
||||||
props: {
|
props: {
|
||||||
sampleId: {
|
sampleId: {
|
||||||
type: Number
|
type: Number,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
|
@ -453,13 +455,13 @@ export default {
|
||||||
tooltipVisible: false,
|
tooltipVisible: false,
|
||||||
tooltipPosition: {
|
tooltipPosition: {
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0
|
left: 0,
|
||||||
},
|
},
|
||||||
tooltipChannel: '',
|
tooltipChannel: '',
|
||||||
|
|
||||||
channelAndEnergyModel: {
|
channelAndEnergyModel: {
|
||||||
channel: undefined,
|
channel: undefined,
|
||||||
energy: undefined
|
energy: undefined,
|
||||||
},
|
},
|
||||||
|
|
||||||
newCalibrationFuncModel: cloneDeep(newCalibrationFuncModel),
|
newCalibrationFuncModel: cloneDeep(newCalibrationFuncModel),
|
||||||
|
@ -469,7 +471,7 @@ export default {
|
||||||
|
|
||||||
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
|
||||||
isFirstFitting: true,
|
isFirstFitting: true,
|
||||||
isInverse: false // 是否需要反算
|
isInverse: false, // 是否需要反算
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -483,10 +485,12 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
|
const { sampleId, qcFileName } = this.newSampleData
|
||||||
try {
|
try {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
const res = await getAction('/spectrumAnalysis/viewGammaDetectorCalibration', {
|
const res = await getAction('/spectrumAnalysis/viewGammaDetectorCalibration', {
|
||||||
sampleId: this.sampleId
|
sampleId,
|
||||||
|
qcFileName,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
@ -505,13 +509,13 @@ export default {
|
||||||
this.gammaSpectrumChartOption.yAxis.interval = _interval
|
this.gammaSpectrumChartOption.yAxis.interval = _interval
|
||||||
this.gammaSpectrumChartOption.series.data = gammaSpectrum.map(({ x, y }) => [x, y])
|
this.gammaSpectrumChartOption.series.data = gammaSpectrum.map(({ x, y }) => [x, y])
|
||||||
|
|
||||||
const gammaEnergyValue = gammaEnergy.map(item => item[0])
|
const gammaEnergyValue = gammaEnergy.map((item) => item[0])
|
||||||
|
|
||||||
const { max: __max, min: __min, interval: __interval } = splitAxis(
|
const {
|
||||||
Math.max(...gammaEnergyValue),
|
max: __max,
|
||||||
Math.min(...gammaEnergyValue),
|
min: __min,
|
||||||
4
|
interval: __interval,
|
||||||
)
|
} = splitAxis(Math.max(...gammaEnergyValue), Math.min(...gammaEnergyValue), 4)
|
||||||
|
|
||||||
this.figureChartOption.yAxis.max = __max
|
this.figureChartOption.yAxis.max = __max
|
||||||
this.figureChartOption.yAxis.min = __min
|
this.figureChartOption.yAxis.min = __min
|
||||||
|
@ -570,7 +574,7 @@ export default {
|
||||||
this.list.push({
|
this.list.push({
|
||||||
rowCount: this.list.length + 1,
|
rowCount: this.list.length + 1,
|
||||||
channel,
|
channel,
|
||||||
energy
|
energy,
|
||||||
})
|
})
|
||||||
|
|
||||||
this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy })
|
this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy })
|
||||||
|
@ -590,7 +594,7 @@ export default {
|
||||||
|
|
||||||
this.channelAndEnergyModel = {
|
this.channelAndEnergyModel = {
|
||||||
channel: undefined,
|
channel: undefined,
|
||||||
energy: undefined
|
energy: undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isInverse = true
|
this.isInverse = true
|
||||||
|
@ -601,7 +605,7 @@ export default {
|
||||||
const willDelItem = this.list.splice(index, 1)[0]
|
const willDelItem = this.list.splice(index, 1)[0]
|
||||||
|
|
||||||
const findIndex = this.figureChartOption.series[1].markPoint.data.findIndex(
|
const findIndex = this.figureChartOption.series[1].markPoint.data.findIndex(
|
||||||
item => item.xAxis == willDelItem.channel && item.yAxis == willDelItem.energy
|
(item) => item.xAxis == willDelItem.channel && item.yAxis == willDelItem.energy
|
||||||
)
|
)
|
||||||
if (-1 !== findIndex) {
|
if (-1 !== findIndex) {
|
||||||
const markPointData = this.figureChartOption.series[1].markPoint.data
|
const markPointData = this.figureChartOption.series[1].markPoint.data
|
||||||
|
@ -644,8 +648,8 @@ export default {
|
||||||
...this.newCalibrationFuncModel,
|
...this.newCalibrationFuncModel,
|
||||||
tempPoints: this.isFirstFitting
|
tempPoints: this.isFirstFitting
|
||||||
? this.oldScatterSeries
|
? this.oldScatterSeries
|
||||||
: this.list.map(item => ({ x: item.channel, y: item.energy })),
|
: this.list.map((item) => ({ x: item.channel, y: item.energy })),
|
||||||
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
|
||||||
|
@ -663,11 +667,11 @@ export default {
|
||||||
this.newCalibrationFuncModel = {
|
this.newCalibrationFuncModel = {
|
||||||
paramA: Number(paramA).toPrecision(6),
|
paramA: Number(paramA).toPrecision(6),
|
||||||
paramB: Number(paramB).toPrecision(6),
|
paramB: Number(paramB).toPrecision(6),
|
||||||
paramC: Number(paramC).toPrecision(6)
|
paramC: Number(paramC).toPrecision(6),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const energyValues = newLineSeries.map(item => item.y)
|
const energyValues = newLineSeries.map((item) => item.y)
|
||||||
|
|
||||||
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
const { max: prevMax, min: prevMin } = this.oldChartOption.yAxis
|
||||||
|
|
||||||
|
@ -684,7 +688,7 @@ export default {
|
||||||
if (newScatterSeriesData) {
|
if (newScatterSeriesData) {
|
||||||
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => ({
|
this.figureChartOption.series[1].markPoint.data = newScatterSeriesData.map(({ x, y }) => ({
|
||||||
xAxis: x,
|
xAxis: x,
|
||||||
yAxis: y
|
yAxis: y,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -700,22 +704,22 @@ export default {
|
||||||
const [series0, series1] = this.figureChartOption.series
|
const [series0, series1] = this.figureChartOption.series
|
||||||
const {
|
const {
|
||||||
data: data0,
|
data: data0,
|
||||||
markPoint: { data: markPointData0 }
|
markPoint: { data: markPointData0 },
|
||||||
} = series0
|
} = series0
|
||||||
const {
|
const {
|
||||||
data: data1,
|
data: data1,
|
||||||
markPoint: { data: markPointData1 }
|
markPoint: { data: markPointData1 },
|
||||||
} = series1
|
} = series1
|
||||||
const newArr = [
|
const newArr = [
|
||||||
...data0.map(item => item[1]),
|
...data0.map((item) => item[1]),
|
||||||
...markPointData0.map(item => item.yAxis),
|
...markPointData0.map((item) => item.yAxis),
|
||||||
...data1.map(item => item[1]),
|
...data1.map((item) => item[1]),
|
||||||
...markPointData1.map(item => item.yAxis)
|
...markPointData1.map((item) => item.yAxis),
|
||||||
]
|
]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
max: Math.max(...newArr),
|
max: Math.max(...newArr),
|
||||||
min: Math.min(...newArr)
|
min: Math.min(...newArr),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -737,8 +741,8 @@ export default {
|
||||||
return `${Number(start).toPrecision(6)}${end ? 'e' + end : ''}`
|
return `${Number(start).toPrecision(6)}${end ? 'e' + end : ''}`
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -285,6 +285,9 @@ export default {
|
||||||
sample: () => {
|
sample: () => {
|
||||||
return this.sampleData
|
return this.sampleData
|
||||||
},
|
},
|
||||||
|
newSample: () => {
|
||||||
|
return this.newSampleData
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -302,6 +305,7 @@ export default {
|
||||||
ftransltModalVisible: false, // Ftransit 弹窗
|
ftransltModalVisible: false, // Ftransit 弹窗
|
||||||
|
|
||||||
sampleData: {}, // 要分析的谱数据
|
sampleData: {}, // 要分析的谱数据
|
||||||
|
newSampleData: {}, // 要分析的谱数据
|
||||||
|
|
||||||
saveSettingModalVisible: false, // 保存设置弹窗
|
saveSettingModalVisible: false, // 保存设置弹窗
|
||||||
|
|
||||||
|
@ -372,7 +376,7 @@ export default {
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
getFiles(val) {
|
getFiles(val) {
|
||||||
this.sampleData = { ...this.sampleData, ...val }
|
this.newSampleData = { ...this.sampleData, ...val }
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 从数据库加载-选择完成
|
* 从数据库加载-选择完成
|
||||||
|
@ -519,6 +523,11 @@ export default {
|
||||||
saveToDb() {
|
saveToDb() {
|
||||||
console.log('savetodb')
|
console.log('savetodb')
|
||||||
},
|
},
|
||||||
|
handleEnergyCalib() {
|
||||||
|
if (this.newSampleData.qcFileName) {
|
||||||
|
this.betaGammaEnergyCalibrationModalVisible = true
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 顶部菜单栏配置
|
// 顶部菜单栏配置
|
||||||
|
@ -729,7 +738,7 @@ export default {
|
||||||
type: 'a-menu-item',
|
type: 'a-menu-item',
|
||||||
title: 'Energy Calibration',
|
title: 'Energy Calibration',
|
||||||
show: this.isBetaGamma,
|
show: this.isBetaGamma,
|
||||||
handler: () => (this.betaGammaEnergyCalibrationModalVisible = true),
|
handler: () => this.handleEnergyCalib(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'a-menu-item',
|
type: 'a-menu-item',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user