Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev

This commit is contained in:
orgin 2023-11-01 08:52:29 +08:00
commit 6f441b3b35
20 changed files with 17656 additions and 592 deletions

View File

@ -9,19 +9,26 @@ const sample = {
ADD_SAMPLE_DATA: (state, sampleData) => {
const find = state.sampleList.find(item => item.inputFileName == sampleData.inputFileName)
if(find) {
if (find) {
find.data = sampleData.data
} else {
state.sampleList.push(sampleData)
}
},
UPDATE_SAMPLE_DATA: (state, { inputFileName, key, data }) => {
const find = state.sampleList.find(item => item.inputFileName == inputFileName)
if (find) {
find.data[key] = data
}
},
REMOVE_SAMPLE_DATA: (state, inputFileName) => {
const findIndex = state.sampleList.findIndex(item => item.inputFileName == inputFileName)
state.sampleList.splice(findIndex, 1)
},
CLEAR_SAMPLE_DATA: () => {
CLEAR_SAMPLE_DATA: (state) => {
state.sampleList = []
}
},

57
src/utils/sampleHelper.js Normal file
View File

@ -0,0 +1,57 @@
/**
* 在返回的allData中查找指定的数据
* @param {Array} allData
* @param {*} name
* @param {*} group
*/
export const getLineData = (allData, name, group, isList = false) => {
const arrFunc = isList ? Array.prototype.filter : Array.prototype.find
return arrFunc.call(allData, item => item.name == name && item.group == group) || {}
}
/**
* 转换pointlist类型数据到series的data可用的数据
*/
export const transformPointListData = pointlist => {
if (!pointlist) {
return []
}
return pointlist.map(({ x, y }) => [x, y])
}
// 查找最近的峰(C++相关)
export const findNearPeak = (channel, peakList) => {
let t_bFind = false, // 是否在峰内
i = 0,
peakNum = peakList.length
for (; i < peakNum; ++i) {
const peak = peakList[i]
if (channel >= peak.left && channel <= peak.right) {
// 如果 channel 在峰的左右边界内
if (peak.multiIndex > 0 && channel > peak.peakCentroid) {
// 如果是重峰,且 channel 在重峰的第一个峰的中心道右侧
let j = i
let temp = channel - peak.peakCentroid
while (++j < peakNum && peakList[j].multiIndex == peak.multiIndex) {
if (Math.abs(peakList[j].peakCentroid - channel) < temp) {
// 找出重峰中峰中心道离 channel 最近的峰
temp = Math.abs(peakList[j].peakCentroid - channel)
i = j
}
}
}
// channel 在索引(i)对应的峰内
t_bFind = true
break
} else if (peak.left > channel) {
// channel 不在任何峰内,找离它最近的峰
if (i > 0 && channel - peakList[i - 1].peakCentroid < peak.peakCentroid - channel) i -= 1
break
}
}
if (i >= peakNum) i -= 1
return {
index: i,
find: t_bFind
}
}

File diff suppressed because it is too large Load Diff

View File

@ -478,6 +478,12 @@ export default {
handler(newVal, oldVal) {
// this.currResultDisplay = newVal.XeData
this.resultDisplay = newVal.XeData || []
this.$store.commit('UPDATE_SAMPLE_DATA', {
inputFileName: this.sample.inputFileName,
key: 'XeData',
data: newVal.XeData
})
},
immediate: true,
deep: true,

View File

@ -36,6 +36,7 @@
<span @click="handleChangeMarkLine('next')">&gt;</span>
</p>
<custom-table
size="small"
:class="list.length ? 'has-data' : ''"
:list="list"
:columns="columns"
@ -215,6 +216,7 @@ import Response from './Response.json'
import { updateBaseLine } from '@/utils/WasmHelper'
import RectList from './components/RectList.vue'
import { isNullOrUndefined } from '@/utils/util'
import { findNearPeak, getLineData, transformPointListData } from '@/utils/sampleHelper'
//
const initialOption = {
@ -223,7 +225,7 @@ const initialOption = {
left: 40,
right: 30,
bottom: 30,
containLabel: true
containLabel: true,
},
title: {
text: '',
@ -234,39 +236,39 @@ const initialOption = {
rich: {
a: {
padding: [0, 20, 0, 0],
fontSize: 16
}
}
}
fontSize: 16,
},
},
},
},
tooltip: {
trigger: 'axis',
axisPointer: {
lineStyle: {
color: '#3CAEBB',
width: 1
}
width: 1,
},
},
formatter: undefined,
className: 'figure-chart-option-tooltip'
className: 'figure-chart-option-tooltip',
},
xAxis: {
axisLine: {
lineStyle: {
color: '#ade6ee'
}
color: '#ade6ee',
},
},
splitLine: {
show: false
show: false,
},
axisLabel: {
textStyle: {
color: '#ade6ee'
}
color: '#ade6ee',
},
},
min: 1,
max: 'dataMax',
animation: false
animation: false,
},
yAxis: {
type: 'log',
@ -275,31 +277,31 @@ const initialOption = {
nameGap: 40,
nameTextStyle: {
color: '#8FD4F8',
fontSize: 16
fontSize: 16,
},
axisLine: {
show: true,
lineStyle: {
color: '#ade6ee'
}
color: '#ade6ee',
},
},
splitLine: {
show: true,
lineStyle: {
color: 'rgba(173, 230, 238, .2)'
}
color: 'rgba(173, 230, 238, .2)',
},
},
axisLabel: {
textStyle: {
color: '#ade6ee'
}
color: '#ade6ee',
},
},
min: 0.1,
max: 'dataMax',
animation: false
animation: false,
},
series: [],
brush: {}
brush: {},
}
const columns = [
@ -308,61 +310,62 @@ const columns = [
customRender: (_, __, index) => {
return index + 1
},
width: 60
width: 60,
},
{
title: 'Energy (keV)',
dataIndex: 'energy',
width: 120,
customRender: text => {
customRender: (text) => {
return text.toFixed(3)
}
},
},
{
title: 'Centroid (C)',
dataIndex: 'peakCentroid',
width: 120,
customRender: text => {
customRender: (text) => {
return text.toFixed(3)
}
},
},
{
title: 'FWHM (keV)',
dataIndex: 'fwhm',
width: 120,
customRender: text => {
customRender: (text) => {
return text.toFixed(3)
}
},
},
{
title: 'Area',
dataIndex: 'area',
width: 120,
customRender: text => {
customRender: (text) => {
return text.toFixed(3)
}
},
},
{
title: 'Detectability',
dataIndex: 'significance',
width: 120,
customRender: text => {
customRender: (text) => {
return text.toFixed(3)
}
},
},
{
title: '#Cmnt',
dataIndex: 'comments',
width: 120
width: 120,
},
{
title: 'Nuclides',
dataIndex: 'nuclides',
width: 120,
customRender: text => {
ellipsis: true,
customRender: (text) => {
return text && text.join(';')
}
}
},
},
]
//
@ -371,43 +374,43 @@ const thumbnailOption = {
top: 0,
left: 5,
right: 5,
bottom: 0
bottom: 0,
},
xAxis: {
type: 'category',
axisLine: {
show: false
show: false,
},
splitLine: {
show: false
show: false,
},
axisLabel: {
show: false
show: false,
},
min: 1,
max: 'dataMax'
max: 'dataMax',
},
yAxis: {
type: 'value',
axisLine: {
show: false
show: false,
},
splitLine: {
show: false
show: false,
},
axisLabel: {
show: false
show: false,
},
min: 0.1,
max: 'dataMax'
max: 'dataMax',
},
series: null
series: null,
}
const nuclideIdentifyModal = {
possibleNuclide: '',
tolerance: 0.5,
identifiedNuclide: ''
identifiedNuclide: '',
}
//
@ -415,7 +418,7 @@ const Operators = {
ADD: 1, //
REMOVE: 2, //
MODIFY: 3, //
SLOPE_CHANGE: 4 // slope
SLOPE_CHANGE: 4, // slope
}
export default {
@ -428,7 +431,13 @@ export default {
NuclideReviewModal,
GeneralCommentModal,
EditSlopeModal,
RectList
RectList,
},
props: {
colorConfig: {
type: Object,
default: () => ({}),
},
},
data() {
this.columns = columns
@ -447,7 +456,6 @@ export default {
list: [],
BaseCtrls: {},
baseCtrls_Copy: {},
FitBaseLine: '#fff',
sampleId: -1,
peakCommentModalVisible: false, // Comment
@ -477,66 +485,46 @@ export default {
isReploting: false,
operationStack: [], //
replotNeeded: false
replotNeeded: false,
}
},
created() {
this.option.tooltip.formatter = params => {
this.option.tooltip.formatter = (params) => {
const channel = parseInt(params[0].value[0])
const energy = this.energy[channel - 1]
const energy = this.energy.pointlist ? this.energy.pointlist[channel - 1].x : 0
return `<div class="channel">Channel: ${channel}</div>
<div class="energy">${isNullOrUndefined(energy) ? '' : `Energy: ${energy.toFixed(2)}`}</div>`
}
},
methods: {
async getInfo() {
try {
this.isLoading = true
this.option.series = []
this.thumbnailOption.series = []
this.list = []
this.model = cloneDeep(nuclideIdentifyModal)
this.option.series = []
this.thumbnailOption.series = []
this.list = []
this.model = cloneDeep(nuclideIdentifyModal)
const { success, result, message } = await getAction('/gamma/InteractiveTool', {
sampleId: this.sampleId,
fileName: this.fileName
})
const { inputFileName } = this.sampleData
// const { success, result, message } = cloneDeep(Response)
const currSampleDetailInfo = await this.$store.dispatch('GET_SAMPLE_DATA', inputFileName)
const {
data: { allData, shadowChannelChart, shapeChannelData, peak, BaseCtrls },
} = currSampleDetailInfo
if (success) {
this.isLoading = false
const {
barChart,
channelBaseCPChart,
channelBaseLineChart,
channelCountChart,
channelPeakChart,
energy,
table,
BaseCtrls,
FitBaseLine
} = result
const channelBaseLine = getLineData(allData, 'BaseLine', 'channel')
const channelPeakGroup = getLineData(allData, 'Peak', 'channel', true)
console.log('%c [ ]-374', 'font-size:13px; background:pink; color:#bf2c9f;', result)
const allEnergy = getLineData(allData, 'Energy', 'energy')
this.channelBaseCPChart = channelBaseCPChart
this.channelBaseLineChart = channelBaseLineChart
this.channelCountChart = channelCountChart
this.channelPeakChart = channelPeakChart
this.energy = energy
this.BaseCtrls = BaseCtrls
this.FitBaseLine = FitBaseLine
this.barChart = barChart
this.channelBaseCPChart = shapeChannelData
this.channelBaseLineChart = channelBaseLine
this.channelCountChart = shadowChannelChart
this.channelPeakChart = channelPeakGroup
this.energy = allEnergy
this.BaseCtrls = BaseCtrls
this.barChart = shadowChannelChart
this.setChartOption(channelBaseLineChart, channelCountChart, channelPeakChart, channelBaseCPChart, barChart)
this.list = table
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
this.setChartOption(channelBaseLine, shadowChannelChart, channelPeakGroup, shapeChannelData, shadowChannelChart)
this.list = peak
},
setChartOption(baseLine, count, peaks, baseCP, bar) {
@ -554,7 +542,7 @@ export default {
// 线
series.push(this.buildCtrlPoint(baseCP))
this.thumbnailOption.series = this.buildBarChart(bar)
// this.thumbnailOption.series = this.buildBarChart(bar)
this.option.series = series
},
@ -573,10 +561,6 @@ export default {
},
beforeModalOpen() {
const { sampleId, inputFileName } = this.sampleData
this.sampleId = sampleId
this.fileName = inputFileName
this.getInfo()
this.reset()
},
@ -586,36 +570,15 @@ export default {
const { offsetX, offsetY } = param
const point = getXAxisAndYAxisByPosition(this.$refs.chartRef.getChartInstance(), offsetX, offsetY)
if (point) {
const xAxis = parseInt(point[0].toFixed())
this.option.series[0].markLine.data[0].xAxis = xAxis
const xAxis = Math.round(point[0])
this.setMarkLineXAxis(xAxis)
this.currChannel = xAxis
// Channel
const maxXAxises = this.getPeakMaxValues()
let index = 0
// xAxis peak
if (xAxis >= maxXAxises[maxXAxises.length - 1]) {
index = maxXAxises.length - 1
} else if (xAxis <= maxXAxises[0]) {
index = 0
} else {
for (let i = 1; i < maxXAxises.length; i++) {
const prev = maxXAxises[i - 1]
const curr = maxXAxises[i]
if (xAxis >= prev && xAxis <= curr) {
index = xAxis - prev < curr - xAxis ? i - 1 : i
break
}
continue
}
}
const { index } = findNearPeak(xAxis, this.list)
if (this.list.length) {
const selectedRow = this.list[index]
this.selectedKeys = [selectedRow.index]
this.selectTableRow(selectedRow.index)
this.getSelPosNuclide(selectedRow)
this.selectedTableItem = selectedRow
}
@ -640,7 +603,7 @@ export default {
left = channel
}
const peaksBetweenChannel = this.list.filter(peak => {
const peaksBetweenChannel = this.list.filter((peak) => {
const centroidId = peak.peakCentroid
return centroidId >= left && centroidId <= right
})
@ -665,36 +628,63 @@ export default {
// 线
handleChangeMarkLine(direction) {
const markLineOption = this.option.series[0].markLine.data[0]
const prevAxis = markLineOption.xAxis
// Channel
const maxXAxises = this.getPeakMaxValues()
const prevAxis = this.getMarkLineXAxis()
let i,
size = this.list.length
if (direction == 'next') {
// prevAxisxAxis
const find = maxXAxises.find(xAxis => xAxis > prevAxis)
if (find) {
markLineOption.xAxis = find
for (i = 0; i < size; i++) {
const centroid = Math.round(this.list[i].peakCentroid)
if (centroid > prevAxis) {
this.setMarkLineXAxis(centroid)
const selectedRow = this.list[i]
this.selectedTableItem = selectedRow
this.selectTableRow(selectedRow.index)
this.getSelPosNuclide(selectedRow)
return
}
}
} else if (direction == 'prev') {
// prevAxisxAxis
const find = cloneDeep(maxXAxises)
.reverse()
.find(xAxis => xAxis < prevAxis)
if (find) {
markLineOption.xAxis = find
for (i = size - 1; i >= 0; i--) {
if (Math.round(this.list[i].peakCentroid) < prevAxis) {
this.setMarkLineXAxis(Math.round(this.list[i].peakCentroid))
const selectedRow = this.list[i]
this.selectedTableItem = selectedRow
this.selectTableRow(selectedRow.index)
this.getSelPosNuclide(selectedRow)
return
}
}
}
},
const xAxis = markLineOption.xAxis
if (xAxis >= 0) {
const index = maxXAxises.findIndex(item => item == xAxis)
if (index !== -1) {
this.selectedKeys = [this.list[index].index]
}
selectTableRow(key) {
this.selectedKeys = [key]
},
// 线
setMarkLineXAxis(xAxis) {
const markLineOption = this.option.series[0].markLine.data[0]
markLineOption.xAxis = xAxis
const { xAxis: chartXAxisOption } = this.option
const { max, min } = chartXAxisOption
//
if (xAxis >= max || xAxis <= min) {
const halfDiff = (max - min) / 2
const lastChannel = this.channelCountChart.pointlist[this.channelCountChart.pointlist.length - 1].x
let nextMax = xAxis + halfDiff
let nextMin = xAxis - halfDiff
chartXAxisOption.max = nextMax > lastChannel ? lastChannel : nextMax
chartXAxisOption.min = nextMin < 1 ? 1 : nextMin
}
},
getMarkLineXAxis() {
const markLineOption = this.option.series[0].markLine.data[0]
return markLineOption.xAxis
},
// possible nuclide identified nuclide
async getSelPosNuclide(row) {
this.model.possibleNuclide = ''
@ -703,10 +693,11 @@ export default {
if (!row._possible) {
this.$set(row, '_loading', true)
try {
const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/getSelPosNuclide', {
sampleId: this.sampleId,
channel: parseInt(row.peakCentroid),
fileName: this.fileName
sampleId,
channel: Math.round(row.peakCentroid),
fileName,
})
if (success) {
const { possible } = result
@ -724,9 +715,9 @@ 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))
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
@ -772,7 +763,7 @@ export default {
shadowEnergyChart,
shapeChannelData,
shapeEnergyData,
table
table,
} = result
this.$bus.$emit('gammaRefresh', {
@ -781,7 +772,8 @@ export default {
shadowChannelChart,
shadowEnergyChart,
shapeChannelData,
shapeEnergyData
shapeEnergyData,
peak: table,
})
this.channelPeakChart = channelPeakChart
@ -828,8 +820,8 @@ export default {
content: 'Are you sure to delete this peak?',
cancelButtonProps: {
props: {
type: 'warn'
}
type: 'warn',
},
},
onOk: async () => {
// this.list.splice(findIndex, 1)
@ -850,7 +842,7 @@ export default {
const { inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/deletePeak', {
fileName,
curRow: this.curRow
curRow: this.curRow,
})
if (success) {
const {
@ -860,7 +852,7 @@ export default {
shadowEnergyChart,
shapeChannelData,
shapeEnergyData,
table
table,
} = result
this.$bus.$emit('gammaRefresh', {
@ -869,7 +861,8 @@ export default {
shadowChannelChart,
shadowEnergyChart,
shapeChannelData,
shapeEnergyData
shapeEnergyData,
peak: table,
})
this.channelPeakChart = channelPeakChart
@ -887,7 +880,10 @@ export default {
series.push(this.buildCtrlPoint(this.channelBaseCPChart))
this.list = table
this.opts.notMerge = true
this.option.series = series
this.resetChartOpts()
this.selectedKeys = []
} else {
@ -896,7 +892,7 @@ export default {
} catch (error) {
console.error(error)
}
}
},
})
},
@ -923,11 +919,24 @@ export default {
return
}
const channel = row.peakCentroid
const channel = Math.round(row.peakCentroid)
this.currChannel = channel
this.option.series[0].markLine.data[0].xAxis = channel
const { xAxis: chartXAxisOption } = this.option
const { max, min } = chartXAxisOption
//
if (channel >= max || channel <= min) {
const halfDiff = (max - min) / 2
const lastChannel = this.channelCountChart.pointlist[this.channelCountChart.pointlist.length - 1].x
let nextMax = channel + halfDiff
let nextMin = channel - halfDiff
chartXAxisOption.max = nextMax > lastChannel ? lastChannel : nextMax
chartXAxisOption.min = nextMin < 1 ? 1 : nextMin
}
this.getSelPosNuclide(row)
this.selectedTableItem = row
@ -946,8 +955,8 @@ export default {
key: 'brush',
brushOption: {
// brush brushType false
brushType: 'rect'
}
brushType: 'rect',
},
})
},
@ -962,12 +971,12 @@ export default {
//
chart.dispatchAction({
type: 'brush',
areas: []
areas: [],
})
//
chart.dispatchAction({
type: 'takeGlobalCursor'
type: 'takeGlobalCursor',
})
},
@ -978,8 +987,8 @@ export default {
if (areas) {
const range = areas.range
const [[minX, maxX], [minY, maxY]] = range
const point1 = chart.convertFromPixel({ seriesIndex: 0 }, [minX, minY]).map(num => parseInt(num.toFixed()))
const point2 = chart.convertFromPixel({ seriesIndex: 0 }, [maxX, maxY]).map(num => parseInt(num.toFixed()))
const point1 = chart.convertFromPixel({ seriesIndex: 0 }, [minX, minY]).map((num) => parseInt(num.toFixed()))
const point2 = chart.convertFromPixel({ seriesIndex: 0 }, [maxX, maxY]).map((num) => parseInt(num.toFixed()))
const xAxisMax = chart.getModel().getComponent('xAxis').axis.scale._extent[1]
const yAxisMax = this.option.yAxis.max
let [x1, y2, x2, y1] = [...point1, ...point2] //
@ -1034,9 +1043,9 @@ export default {
const baseLineEditSeries = buildLineSeries(
'BaseLine_Edit',
this.baseCtrls_Copy.baseline.map((val, index) => [index + 1, val]),
this.FitBaseLine,
this.colorConfig.Color_Fitbase || '#fff',
{
zlevel: 21
zlevel: 21,
}
)
this.option.series.push(baseLineEditSeries)
@ -1050,13 +1059,13 @@ export default {
this.btnGroupType = 1
this.opts.notMerge = true
const baseLineEditSeries = findSeriesByName(this.option.series, 'BaseLine_Edit')
const index = this.option.series.findIndex(item => item == baseLineEditSeries)
const index = this.option.series.findIndex((item) => item == baseLineEditSeries)
this.option.series.splice(index, 1)
this.clearRect()
const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine')
baseLineSeries.data = this.channelBaseLineChart.pointlist.map(({ x, y }) => [x, y]) // 线
baseLineSeries.data = transformPointListData(this.channelBaseLineChart.pointlist) // 线
const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point')
baseLineCP.data = this.buildCPPointData(this.channelBaseCPChart)
@ -1096,7 +1105,7 @@ export default {
this.isModifying = false
this.pushOperationStack(Operators.MODIFY, {
index,
prevYAxis
prevYAxis,
})
},
@ -1120,7 +1129,7 @@ export default {
// Peaks
redrawPeaks(peakList) {
this.option.series = this.option.series.filter(item => {
this.option.series = this.option.series.filter((item) => {
return !item.name.includes('Peak_')
})
this.option.series.push(...this.buildPeaks(peakList))
@ -1196,7 +1205,7 @@ export default {
index: i,
removeXAxis,
removeYAxis,
removeYSlope
removeYSlope,
})
},
@ -1232,7 +1241,7 @@ export default {
this.$refs.editSlopeModal.open({
index: i,
value: yslope[i],
allowNaN: !(i == 0 || i == n - 1)
allowNaN: !(i == 0 || i == n - 1),
})
},
@ -1246,7 +1255,7 @@ export default {
yslope[index] = slope
this.pushOperationStack(Operators.SLOPE_CHANGE, {
index,
slope: prevSlope
slope: prevSlope,
})
this.redrawBaseLine()
this.buildRect()
@ -1269,7 +1278,7 @@ export default {
const { success, result, message } = await postAction('/gamma/replotBaseLine', {
...this.baseCtrls_Copy,
fileName,
replotNeeded: this.replotNeeded
replotNeeded: this.replotNeeded,
})
if (success) {
const { chartData, peakSet, shapeData } = result
@ -1288,8 +1297,8 @@ export default {
color,
point: {
x: xAxis,
y: yctrl[index]
}
y: yctrl[index],
},
}
})
baseLineCP.data = this.buildCPPointData(baseCPPoints)
@ -1323,8 +1332,8 @@ export default {
itemStyle: {
color: 'transparent',
borderColor: color,
borderWidth: size / 2
}
borderWidth: size / 2,
},
}
})
},
@ -1358,7 +1367,7 @@ export default {
this.isAccepting = true
const { success, result, message } = await postAction('/gamma/acceptBaseLine', {
...this.baseCtrls_Copy,
fileName
fileName,
})
if (success) {
this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
@ -1372,7 +1381,7 @@ export default {
shadowEnergyChart,
shapeChannelData,
shapeData,
shapeEnergyData
shapeEnergyData,
} = result
this.channelBaseLineChart = channelBaseLineChart
@ -1416,7 +1425,7 @@ export default {
curRow: this.curRow,
nuclideName: possibleNuclide,
fileName,
list_identify: nuclides
list_identify: nuclides,
})
if (success) {
nuclides.push(possibleNuclide)
@ -1439,7 +1448,7 @@ export default {
if (this.selectedTableItem._deleting) {
return
}
const findIndex = nuclides.findIndex(nuclide => nuclide == this.model.identifiedNuclide)
const findIndex = nuclides.findIndex((nuclide) => nuclide == this.model.identifiedNuclide)
if (-1 !== findIndex) {
try {
this.$set(this.selectedTableItem, '_deleting', true)
@ -1448,7 +1457,7 @@ export default {
curRow: this.curRow,
nuclideName: this.model.identifiedNuclide,
fileName,
list_identify: nuclides
list_identify: nuclides,
})
if (success) {
nuclides.splice(findIndex, 1)
@ -1467,43 +1476,35 @@ export default {
buildBaseLine(channelBaseLineChart) {
return buildLineSeries(
'BaseLine',
channelBaseLineChart.pointlist.map(({ x, y }) => [x, y]),
transformPointListData(channelBaseLineChart.pointlist),
channelBaseLineChart.color,
{
markLine: {
silent: true,
symbol: 'none',
label: {
show: false
show: false,
},
lineStyle: {
color: 'red',
width: 1
width: 1,
},
data: [{ xAxis: -1 }]
data: [{ xAxis: -1 }],
},
zlevel: 10
zlevel: 10,
}
)
},
// count
buildCountLine(channelCountChart) {
return buildLineSeries(
'CountChart',
channelCountChart.pointlist.map(({ x, y }) => [x, y]),
channelCountChart.color
)
return buildLineSeries('CountChart', transformPointListData(channelCountChart.pointlist), channelCountChart.color)
},
// Peaks
buildPeaks(channelPeakChart) {
return channelPeakChart.map((item, index) => {
return buildLineSeries(
'Peak_' + (index + 1),
item.pointlist.map(({ x, y }) => [x, y]),
item.color
)
return buildLineSeries('Peak_' + (index + 1), transformPointListData(item.pointlist), item.color)
})
},
@ -1515,7 +1516,7 @@ export default {
data: this.buildCPPointData(channelBaseCPChart),
silent: true,
animation: false,
zlevel: 20
zlevel: 20,
}
},
@ -1526,7 +1527,7 @@ export default {
barChart.map(({ x, y }) => [x, y]),
'#fff',
{
silent: true
silent: true,
}
)
},
@ -1539,7 +1540,7 @@ export default {
pushOperationStack(operator, operand) {
this.operationStack.push({
operator,
operand
operand,
})
},
@ -1584,19 +1585,19 @@ export default {
*/
clearOperationStack() {
this.operationStack = []
}
},
},
computed: {
curRow() {
const [selectedKey] = this.selectedKeys
const findIndex = this.list.findIndex(item => item.index == selectedKey)
const findIndex = this.list.findIndex((item) => item.index == selectedKey)
return findIndex
},
isOperationStackEmpty() {
return this.operationStack.length == 0
}
}
},
},
}
</script>

View File

@ -0,0 +1,67 @@
<template>
<custom-modal v-model="visible" title="BetaGamma Analyser Log" :width="800">
<a-spin :spinning="isLoading">
<a-textarea class="bg-log-viewer" v-model="content"></a-textarea>
</a-spin>
<div slot="custom-footer">
<a-button type="primary" @click="handleClick">Save As</a-button>
</div>
</custom-modal>
</template>
<script>
import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '@/api/manage'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import { showSaveFileModal } from '@/utils/file'
export default {
mixins: [ModalMixin, SampleDataMixin],
data() {
return {
content: '',
}
},
methods: {
async getDetail() {
try {
this.isLoading = true
const { dbName, sampleId, sampleFileName, gasFileName, detFileName, qcFileName } = this.newSampleData
const { success, result, message } = await getAction('/spectrumAnalysis/viewBGLogViewer', {
dbName,
sampleId,
sampleFileName,
gasFileName,
detFileName,
qcFileName,
})
if (success) {
console.log('%c [ ]-21', 'font-size:13px; background:pink; color:#bf2c9f;', result)
this.content = 'test'
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
beforeModalOpen() {
this.getDetail()
},
handleClick() {
const blob = new Blob([this.content], { type: 'text/plain' })
showSaveFileModal(blob, 'txt')
},
},
}
</script>
<style lang="less" scoped>
.bg-log-viewer {
height: 400px;
overflow: auto;
}
</style>

View File

@ -52,6 +52,12 @@ import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder
export default {
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
mixins: [ModalMixin, SampleDataMixin],
props: {
sampleList: {
type: Array,
required: true,
},
},
data() {
return {
currTab: 'gamma',
@ -85,6 +91,28 @@ export default {
this.gammaEnergyValid = val
},
handleReAnalyse() {
const regExp = /^([A-Z]{1,}\d{1,})_/
const regMatched = this.newSampleData.inputFileName.match(regExp)
const currStationName = regMatched[1]
const dbNames = [],
sampleIds = [],
sampleFileNames = [],
gasFileNames = [],
detFileNames = [],
qcFileNames = []
const matchedSampleList = this.sampleList.filter((item) => item.inputFileName.includes(currStationName))
matchedSampleList.forEach(
({ dbName, sampleId, sampleFileName, gasFileName, detFileName, qcFileName, qcFileStatus }) => {
dbNames.push(dbName || '')
sampleIds.push(sampleId || '')
sampleFileNames.push(sampleFileName)
gasFileNames.push(gasFileName)
detFileNames.push(detFileName)
qcFileNames.push(qcFileStatus ? qcFileName : '')
}
)
let params = {
applyType: this.newCalibrationIsAppliedTo,
sampleData: this.recalculateROICountsFor.includes('sample') ? true : false,
@ -93,13 +121,14 @@ export default {
qcData: this.recalculateROICountsFor.includes('qc') ? true : false,
betaEnergyValid: this.betaEnergyValid,
gammaEnergyValid: this.gammaEnergyValid,
dbNames: [this.newSampleData.dbName],
sampleIds: [this.newSampleData.sampleId ? this.newSampleData.sampleId : ''],
sampleFileNames: [this.newSampleData.inputFileName],
gasFileNames: [this.newSampleData.gasFileName],
detFileNames: [this.newSampleData.detFileName],
qcFileNames: [this.newSampleData.qcFileName],
dbNames,
sampleIds,
sampleFileNames,
gasFileNames,
detFileNames,
qcFileNames,
currentFileName: this.newSampleData.inputFileName,
currentQCFileName: this.newSampleData.qcFileName,
}
postAction('/spectrumAnalysis/ReAnalyse', params).then((res) => {
if (res.success) {

View File

@ -30,6 +30,13 @@ const columns = [
title: 'Value',
dataIndex: 'value',
align: 'center',
customRender: (text) => {
if (text !== 'Match' && text !== 'UnMatch') {
return parseFloat(Number(text).toPrecision(6))
} else {
return text
}
},
},
{
title: 'Status',

View File

@ -116,11 +116,6 @@ export default {
AdditionalInfo,
Notes,
},
props: {
sampleData: {
type: Object,
},
},
data() {
this.tabs = tabs
return {

View File

@ -24,53 +24,59 @@ const configList = [
{
title: 'Spectrum Line',
key: 'Color_Spec',
desc: 'Color of the original spectrum line'
desc: 'Color of the original spectrum line',
},
{
title: 'Baseline',
key: 'Color_Base',
desc: 'Color of baseline'
desc: 'Color of baseline',
},
{
title: 'Lc Line',
key: 'Color_Lc',
desc: 'Color of lc line'
desc: 'Color of lc line',
},
{
title: 'Scac Line',
key: 'Color_Scac',
desc: 'Color of scac line'
desc: 'Color of scac line',
},
{
title: 'Peak Line',
key: 'Color_Peak',
desc: "Color of all peaks' curve"
desc: "Color of all peaks' curve",
},
{
title: 'Compare Line',
key: 'Color_Compare',
desc: 'Color of another spectrum line which is used to compare with current spectrum'
desc: 'Color of another spectrum line which is used to compare with current spectrum',
},
{
title: 'Spec Sum Line',
key: 'Color_Strip',
desc: 'Color of the line which is the sum of current spectrum and other spectrum Multiplied by a ratio'
desc: 'Color of the line which is the sum of current spectrum and other spectrum Multiplied by a ratio',
},
{
title: 'Spec Cut Line',
key: 'spectCutLine',
desc: 'Color of the line which is the difference of current spectrum and other spectrum Multiplied by a ratio'
desc: 'Color of the line which is the difference of current spectrum and other spectrum Multiplied by a ratio',
},
{
title: 'FitBase Line',
key: 'Color_Fitbase',
desc: 'Color of the base line in edit state'
}
desc: 'Color of the base line in edit state',
},
]
export default {
mixins: [ModalMixin],
components: {
ColorPicker
ColorPicker,
},
props: {
colorConfig: {
type: Object,
default: () => ({}),
},
},
data() {
this.configList = configList
@ -84,8 +90,8 @@ export default {
Color_Compare: 'green', // Sample -> Compare
Color_Strip: 'rgb(0, 0, 255)', // Sample -> Compare
spectCutLine: 'rgb(33, 90, 104)', //
Color_Fitbase: 'white' // Interactive Tool BaseLine线
}
Color_Fitbase: 'white', // Interactive Tool BaseLine线
},
}
},
methods: {
@ -93,40 +99,16 @@ export default {
return color
},
async getData() {
try {
this.isLoading = true
const { success, result, message } = await getAction('/gamma/viewColorConfig')
if (success) {
Object.entries(result).forEach(([k, v]) => {
this.config[k] = v
})
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
beforeModalOpen() {
this.getData()
Object.entries(this.colorConfig).forEach(([k, v]) => {
this.config[k] = v
})
},
//
async handleApply() {
const {
Color_Spec,
Color_Peak,
Color_Lc,
Color_Base,
Color_Scac,
Color_Compare,
Color_Strip,
Color_Fitbase
} = this.config
const { Color_Spec, Color_Peak, Color_Lc, Color_Base, Color_Scac, Color_Compare, Color_Strip, Color_Fitbase } =
this.config
const { success, message } = await putAction('/gamma/updateColorConfig', {
colorSpec: Color_Spec,
colorPeak: Color_Peak,
@ -135,22 +117,16 @@ export default {
colorScac: Color_Scac,
colorCompare: Color_Compare,
colorFitbase: Color_Fitbase,
colorStrip: Color_Strip
colorStrip: Color_Strip,
})
if (success) {
this.$bus.$emit(
'colorChange',
Object.entries(this.config).reduce((prev, [key, value]) => {
prev[key] = value
return prev
}, {})
)
this.$emit('colorChange', this.config)
} else {
this.$message.error(message)
throw new Error(message)
}
}
}
},
},
}
</script>

View File

@ -12,13 +12,13 @@
style: {
width: '70px',
textAlign: 'left',
flexShrink: 0
}
flexShrink: 0,
},
}"
:wrapperCol="{
style: {
flex: 1
}
flex: 1,
},
}"
>
<a-form-model-item label="Energy">
@ -54,13 +54,7 @@
<div>
<label>
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
<input
ref="fileInput"
type="file"
accept=".ent"
style="display: none;"
@change="handleFileChange"
/>
<input ref="fileInput" type="file" accept=".ent" style="display: none" @change="handleFileChange" />
</label>
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
</div>
@ -126,23 +120,23 @@ const columns = [
{
title: 'Energy(keV)',
dataIndex: 'energy',
customRender: (text) => Number(text).toFixed(3)
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Efficiency',
dataIndex: 'efficiency',
customRender: (text) => Number(text).toFixed(3)
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Fit(keV)',
dataIndex: 'fit',
customRender: (text) => Number(text).toFixed(3)
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Delta(%)',
dataIndex: 'delta',
customRender: (text) => Number(text).toFixed(3)
}
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
]
const initialOption = {
@ -150,99 +144,99 @@ const initialOption = {
top: 20,
right: 20,
bottom: 50,
left: 70
left: 70,
},
title: {
text: 'Channel',
textStyle: {
color: '#8FD4F8',
fontSize: 14,
fontWeight: 'normal'
fontWeight: 'normal',
},
right: 10,
bottom: 0
bottom: 0,
},
tooltip: {
trigger: 'axis',
formatter: params => {
formatter: (params) => {
const [x, y] = params[0].value
const energy = parseInt(x)
const efficiency = y.toFixed(3)
return `<div class="channel">Energy: ${energy}</div>
<div class="energy">Efficiency: ${efficiency}</div>`
},
className: 'figure-chart-option-tooltip'
className: 'figure-chart-option-tooltip',
},
xAxis: {
min: 1,
max: 'dataMax',
axisLabel: {
color: '#fff'
color: '#fff',
},
axisLine: {
lineStyle: {
color: '#fff'
}
color: '#fff',
},
},
splitLine: {
show: false
}
show: false,
},
},
yAxis: {
axisLabel: {
color: '#fff'
color: '#fff',
},
axisTick: {
show: false
show: false,
},
axisLine: {
lineStyle: {
color: '#fff'
}
color: '#fff',
},
},
splitLine: {
show: false
show: false,
},
name: 'keV',
nameLocation: 'center',
nameGap: 50,
nameTextStyle: {
color: '#8FD4F8',
fontSize: 14
}
fontSize: 14,
},
},
series: []
series: [],
}
const functions = [
{
label: 'Interpolation',
value: 1
value: 1,
},
{
label: 'HT Efficiency',
value: 5
value: 5,
},
{
label: 'Log Polynomial',
value: 6
value: 6,
},
{
label: 'Invlog Polynomial',
value: 8
value: 8,
},
{
label: 'HAE Efficiency(1-3)',
value: 93
value: 93,
},
{
label: 'HAE Efficiency(1-2)',
value: 94
value: 94,
},
{
label: 'HAE Efficiency(1-2-3)',
value: 95
}
value: 95,
},
]
export default {
@ -266,11 +260,11 @@ export default {
currSelectedDataSource: '',
appliedDataSource: '',
opts: {
notMerge: true
notMerge: true,
},
ECutAnalysis_Low: -1,
G_energy_span: -1,
funcId: 1
funcId: 1,
}
},
methods: {
@ -282,7 +276,7 @@ export default {
sampleId,
fileName,
currentText,
width: 922
width: 922,
})
this.isLoading = false
if (success) {
@ -332,15 +326,15 @@ export default {
value: [x, y],
itemStyle: {
color: scatterPoint.color,
borderWidth: 0
}
borderWidth: 0,
},
}
}),
emphasis: {
disabled: true
disabled: true,
},
animation: false,
zlevel: 20
zlevel: 20,
})
this.option.series = series
}
@ -390,7 +384,7 @@ export default {
this.list.splice(i, 0, {
energy: energy,
efficiency
efficiency,
})
this.uncert.splice(i, 0, 0.5)
@ -463,12 +457,12 @@ export default {
const { success, result, message } = await postAction('/gamma/changeDataEfficiency', {
sampleId,
fileName,
m_vCurEnergy: this.list.map(item => item.energy),
m_vCurEffi: this.list.map(item => item.efficiency),
m_vCurEnergy: this.list.map((item) => item.energy),
m_vCurEffi: this.list.map((item) => item.efficiency),
m_vCurUncert: this.uncert,
m_curParam: this.param,
funcId: this.funcId,
width: 922
width: 922,
})
if (success) {
this.handleResult(result)
@ -487,10 +481,10 @@ export default {
try {
this.isSaving = true
const res = await postAction('/gamma/saveDataEfficiency', {
m_vCurEnergy: this.list.map(item => item.energy),
m_vCurEffi: this.list.map(item => item.efficiency),
m_vCurEnergy: this.list.map((item) => item.energy),
m_vCurEffi: this.list.map((item) => item.efficiency),
m_vCurUncert: this.uncert,
funcId: this.funcId
funcId: this.funcId,
})
if (typeof res == 'string') {
const blob = new Blob([res], { type: 'text/plain' })
@ -548,18 +542,18 @@ export default {
let curCalName = this.currSelectedDataSource
// InputPHD
if (!curCalName.includes('Input')) {
curCalName = `Input ${this.dataSourceList.filter(item => item.includes('Input')).length + 1}`
curCalName = `Input ${this.dataSourceList.filter((item) => item.includes('Input')).length + 1}`
}
const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await postAction('/gamma/applyDataEfficiency', {
m_vCurEnergy: this.list.map(item => item.energy),
m_vCurEffi: this.list.map(item => item.efficiency),
m_vCurEnergy: this.list.map((item) => item.energy),
m_vCurEffi: this.list.map((item) => item.efficiency),
m_vCurUncert: this.uncert,
m_curParam: this.param,
curCalName,
sampleId,
fileName
fileName,
})
if (success) {
this.handleDataSourceClick(curCalName)
@ -591,8 +585,8 @@ export default {
} catch (error) {
console.error(error)
}
}
}
},
},
}
</script>

View File

@ -12,13 +12,13 @@
style: {
width: '70px',
textAlign: 'left',
flexShrink: 0
}
flexShrink: 0,
},
}"
:wrapperCol="{
style: {
flex: 1
}
flex: 1,
},
}"
>
<a-form-model-item label="Channel">
@ -54,13 +54,7 @@
<div>
<label>
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
<input
ref="fileInput"
type="file"
accept=".ent"
style="display: none;"
@change="handleFileChange"
/>
<input ref="fileInput" type="file" accept=".ent" style="display: none" @change="handleFileChange" />
</label>
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
</div>
@ -121,23 +115,23 @@ const columns = [
{
title: 'Channel',
dataIndex: 'channel',
customRender: (text) => Number(text).toFixed(3)
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Energy(keV)',
dataIndex: 'energy',
customRender: (text) => Number(text).toFixed(3)
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Fit(keV)',
dataIndex: 'fit',
customRender: (text) => Number(text).toFixed(3)
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Delta(%)',
dataIndex: 'delta',
customRender: (text) => Number(text).toFixed(3)
}
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
]
const initialOption = {
@ -145,68 +139,68 @@ const initialOption = {
top: 20,
right: 20,
bottom: 50,
left: 70
left: 70,
},
title: {
text: 'Channel',
textStyle: {
color: '#8FD4F8',
fontSize: 14,
fontWeight: 'normal'
fontWeight: 'normal',
},
right: 10,
bottom: 0
bottom: 0,
},
tooltip: {
trigger: 'axis',
formatter: params => {
formatter: (params) => {
const [x, y] = params[0].value
const channel = parseInt(x)
const energy = y.toFixed(3)
return `<div class="channel">Channel: ${channel}</div>
<div class="energy">Energy: ${energy}</div>`
},
className: 'figure-chart-option-tooltip'
className: 'figure-chart-option-tooltip',
},
xAxis: {
min: 1,
max: 'dataMax',
axisLabel: {
color: '#fff'
color: '#fff',
},
axisLine: {
lineStyle: {
color: '#fff'
}
color: '#fff',
},
},
splitLine: {
show: false
}
show: false,
},
},
yAxis: {
axisLabel: {
color: '#fff'
color: '#fff',
},
axisTick: {
show: false
show: false,
},
axisLine: {
lineStyle: {
color: '#fff'
}
color: '#fff',
},
},
splitLine: {
show: false
show: false,
},
name: 'keV',
nameLocation: 'center',
nameGap: 50,
nameTextStyle: {
color: '#8FD4F8',
fontSize: 14
}
fontSize: 14,
},
},
series: []
series: [],
}
export default {
@ -228,11 +222,11 @@ export default {
currSelectedDataSource: '',
appliedDataSource: '',
opts: {
notMerge: true
notMerge: true,
},
rg_high: -1,
rg_low: -1
rg_low: -1,
}
},
methods: {
@ -244,7 +238,7 @@ export default {
sampleId,
fileName,
currentText,
width: 922
width: 922,
})
this.isLoading = false
if (success) {
@ -294,15 +288,15 @@ export default {
value: [x, y],
itemStyle: {
color: scatterPoint.color,
borderWidth: 0
}
borderWidth: 0,
},
}
}),
emphasis: {
disabled: true
disabled: true,
},
animation: false,
zlevel: 20
zlevel: 20,
})
this.option.series = series
}
@ -351,7 +345,7 @@ export default {
this.list.splice(i, 0, {
channel: centroid,
energy
energy,
})
this.uncert.splice(i, 0, 0.5)
@ -424,11 +418,11 @@ export default {
const { success, result, message } = await postAction('/gamma/changeDataEnergy', {
sampleId,
fileName,
m_vCurCentroid: this.list.map(item => item.channel),
m_vCurEnergy: this.list.map(item => item.energy),
m_vCurCentroid: this.list.map((item) => item.channel),
m_vCurEnergy: this.list.map((item) => item.energy),
m_vCurUncert: this.uncert,
m_curParam: this.param,
width: 922
width: 922,
})
if (success) {
this.handleResult(result)
@ -447,9 +441,9 @@ export default {
try {
this.isSaving = true
const res = await postAction('/gamma/saveDataEnergy', {
m_vCurCentroid: this.list.map(item => item.channel),
m_vCurEnergy: this.list.map(item => item.energy),
m_vCurUncert: this.uncert
m_vCurCentroid: this.list.map((item) => item.channel),
m_vCurEnergy: this.list.map((item) => item.energy),
m_vCurUncert: this.uncert,
})
if (typeof res == 'string') {
const blob = new Blob([res], { type: 'text/plain' })
@ -507,18 +501,18 @@ export default {
let curCalName = this.currSelectedDataSource
// InputPHD
if (!curCalName.includes('Input')) {
curCalName = `Input ${this.dataSourceList.filter(item => item.includes('Input')).length + 1}`
curCalName = `Input ${this.dataSourceList.filter((item) => item.includes('Input')).length + 1}`
}
const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await postAction('/gamma/applyDataEnergy', {
m_vCurCentroid: this.list.map(item => item.channel),
m_vCurEnergy: this.list.map(item => item.energy),
m_vCurCentroid: this.list.map((item) => item.channel),
m_vCurEnergy: this.list.map((item) => item.energy),
m_vCurUncert: this.uncert,
m_curParam: this.param,
curCalName,
sampleId,
fileName
fileName,
})
if (success) {
this.handleDataSourceClick(curCalName)
@ -550,8 +544,8 @@ export default {
} catch (error) {
console.error(error)
}
}
}
},
},
}
</script>

View File

@ -64,53 +64,56 @@ const columns = [
title: 'Energy (keV)',
dataIndex: 'energy',
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
},
{
title: 'Yield (%)',
dataIndex: 'yield',
customRender: (text) => {
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
},
{
title: 'Efficiency',
dataIndex: 'efficiency',
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
},
{
title: 'Activity (Bq)',
dataIndex: 'activity',
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
},
{
title: 'Act Err (%)',
dataIndex: 'actErr',
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
},
{
title: 'MDA (Bq)',
dataIndex: 'mda',
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
},
{
title: 'Conc (uBq/m3)',
dataIndex: 'conc',
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
},
{
title: 'MDC (uBq/m3)',
dataIndex: 'mdc',
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(5) : text
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
},
]

View File

@ -47,7 +47,7 @@
:columns="daughterColumns"
:list="daughterList"
:pagination="false"
:scroll="{ y: 84 }"
:scroll="{ y: 84 }"
rowKey="daughters"
@rowDblClick="handleParentDBClick($event.daughters)"
></custom-table>
@ -86,9 +86,7 @@
</div>
<div class="nuclide-library-settings-operation">
<a-space :size="10">
<span>
Energy:
</span>
<span> Energy: </span>
<a-input v-model="model.editEnergy"></a-input>
<a-input-number
v-model="model.err"
@ -122,18 +120,18 @@ const daughterColumns = [
{
title: 'Name',
dataIndex: 'daughters',
align: 'center'
align: 'center',
},
{
title: 'Ratio',
dataIndex: 'branchingratios',
align: 'center'
align: 'center',
},
{
title: 'Status',
dataIndex: 'daughtersstable',
align: 'center'
}
align: 'center',
},
]
//
@ -143,43 +141,35 @@ const mainColumns = [
width: 80,
customRender: (_, __, index) => {
return index + 1
}
},
},
{
title: 'Full Name',
dataIndex: 'fullName'
dataIndex: 'fullName',
},
{
title: 'Energy(keV)',
dataIndex: 'energy',
width: 100,
customRender: text => {
return toFixed(text, 3)
}
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Energy Uncert(%)',
dataIndex: 'energyUncert',
width: 120,
customRender: text => {
return text ? toFixed(text * 100, 6) : ''
}
customRender: (text) => parseFloat(Number(text * 100).toPrecision(6)),
},
{
title: 'Yield',
dataIndex: 'yield',
width: 80,
customRender: text => {
return toFixed(text, 3)
}
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Yield Uncert(%)',
dataIndex: 'yieldUncert',
width: 120,
customRender: text => {
return toFixed(text, 3)
}
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'KeyLine',
@ -187,15 +177,15 @@ const mainColumns = [
width: 100,
align: 'center',
scopedSlots: {
customRender: 'keyLine'
}
}
customRender: 'keyLine',
},
},
]
export default {
mixins: [ModalMixin, SampleDataMixin],
components: {
TitleOverBorder
TitleOverBorder,
},
data() {
this.daughterColumns = daughterColumns
@ -210,7 +200,7 @@ export default {
model: {},
selectedNuclide: {}, // Nuclide
selectedParent: {} // Parent
selectedParent: {}, // Parent
}
},
methods: {
@ -224,19 +214,19 @@ export default {
const { success, result, message } = await getAction('/gamma/NuclideLibrary', {
sampleId,
fileName,
...this.model
...this.model,
})
if (success) {
const {
daughter: { list_parent, table_daughter },
nuclLinesLibs,
nuclideInfo,
nuclides
nuclides,
} = result
this.nuclideList = nuclides
this.parentList = list_parent ? list_parent.filter(item => item) : []
this.daughterList = table_daughter ? table_daughter.filter(item => item.daughters) : []
this.parentList = list_parent ? list_parent.filter((item) => item) : []
this.daughterList = table_daughter ? table_daughter.filter((item) => item.daughters) : []
this.nuclideInfo = nuclideInfo
this.nuclLinesLibs = nuclLinesLibs
@ -259,7 +249,7 @@ export default {
libraryName: 'UserLibrary',
err: 0.5,
editEnergy: '',
nuclideName: ''
nuclideName: '',
}
this.getInfo(true)
},
@ -300,8 +290,8 @@ export default {
handleParentDBClick(item) {
this.model.nuclideName = item
this.getInfo()
}
}
},
},
}
</script>

View File

@ -12,13 +12,13 @@
style: {
width: '70px',
textAlign: 'left',
flexShrink: 0
}
flexShrink: 0,
},
}"
:wrapperCol="{
style: {
flex: 1
}
flex: 1,
},
}"
>
<a-form-model-item label="Energy">
@ -54,13 +54,7 @@
<div>
<label>
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
<input
ref="fileInput"
type="file"
accept=".ent"
style="display: none;"
@change="handleFileChange"
/>
<input ref="fileInput" type="file" accept=".ent" style="display: none" @change="handleFileChange" />
</label>
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
</div>
@ -121,23 +115,23 @@ const columns = [
{
title: 'Energy(keV)',
dataIndex: 'energy',
customRender: (text) => Number(text).toFixed(3)
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'FWHM(keV)',
dataIndex: 'fwhm',
customRender: (text) => Number(text).toFixed(3)
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Fit(keV)',
dataIndex: 'fit',
customRender: (text) => Number(text).toFixed(3)
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Delta(%)',
dataIndex: 'delta',
customRender: (text) => Number(text).toFixed(3)
}
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
]
const initialOption = {
@ -145,68 +139,68 @@ const initialOption = {
top: 20,
right: 20,
bottom: 50,
left: 70
left: 70,
},
title: {
text: 'Channel',
textStyle: {
color: '#8FD4F8',
fontSize: 14,
fontWeight: 'normal'
fontWeight: 'normal',
},
right: 10,
bottom: 0
bottom: 0,
},
tooltip: {
trigger: 'axis',
formatter: params => {
formatter: (params) => {
const [x, y] = params[0].value
const energy = parseInt(x)
const fwhm = y.toFixed(3)
return `<div class="channel">Energy: ${energy}</div>
<div class="energy">Fwhm: ${fwhm}</div>`
},
className: 'figure-chart-option-tooltip'
className: 'figure-chart-option-tooltip',
},
xAxis: {
min: 1,
max: 'dataMax',
axisLabel: {
color: '#fff'
color: '#fff',
},
axisLine: {
lineStyle: {
color: '#fff'
}
color: '#fff',
},
},
splitLine: {
show: false
}
show: false,
},
},
yAxis: {
axisLabel: {
color: '#fff'
color: '#fff',
},
axisTick: {
show: false
show: false,
},
axisLine: {
lineStyle: {
color: '#fff'
}
color: '#fff',
},
},
splitLine: {
show: false
show: false,
},
name: 'keV',
nameLocation: 'center',
nameGap: 50,
nameTextStyle: {
color: '#8FD4F8',
fontSize: 14
}
fontSize: 14,
},
},
series: []
series: [],
}
export default {
@ -228,10 +222,10 @@ export default {
currSelectedDataSource: '',
appliedDataSource: '',
opts: {
notMerge: true
notMerge: true,
},
ECutAnalysis_Low: -1,
G_energy_span: -1
G_energy_span: -1,
}
},
methods: {
@ -243,7 +237,7 @@ export default {
sampleId,
fileName,
currentText,
width: 922
width: 922,
})
this.isLoading = false
if (success) {
@ -293,15 +287,15 @@ export default {
value: [x, y],
itemStyle: {
color: scatterPoint.color,
borderWidth: 0
}
borderWidth: 0,
},
}
}),
emphasis: {
disabled: true
disabled: true,
},
animation: false,
zlevel: 20
zlevel: 20,
})
this.option.series = series
}
@ -350,7 +344,7 @@ export default {
this.list.splice(i, 0, {
energy: energy,
fwhm
fwhm,
})
this.uncert.splice(i, 0, 0.5)
@ -423,10 +417,10 @@ export default {
const { success, result, message } = await postAction('/gamma/changeDataResolution', {
sampleId,
fileName,
m_vCurEnergy: this.list.map(item => item.energy),
m_vCurReso: this.list.map(item => item.fwhm),
m_vCurEnergy: this.list.map((item) => item.energy),
m_vCurReso: this.list.map((item) => item.fwhm),
m_vCurUncert: this.uncert,
m_curParam: this.param
m_curParam: this.param,
})
if (success) {
this.handleResult(result)
@ -445,9 +439,9 @@ export default {
try {
this.isSaving = true
const res = await postAction('/gamma/saveDataResolution', {
m_vCurEnergy: this.list.map(item => item.energy),
m_vCurReso: this.list.map(item => item.fwhm),
m_vCurUncert: this.uncert
m_vCurEnergy: this.list.map((item) => item.energy),
m_vCurReso: this.list.map((item) => item.fwhm),
m_vCurUncert: this.uncert,
})
if (typeof res == 'string') {
const blob = new Blob([res], { type: 'text/plain' })
@ -505,18 +499,18 @@ export default {
let curCalName = this.currSelectedDataSource
// InputPHD
if (!curCalName.includes('Input')) {
curCalName = `Input ${this.dataSourceList.filter(item => item.includes('Input')).length + 1}`
curCalName = `Input ${this.dataSourceList.filter((item) => item.includes('Input')).length + 1}`
}
const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await postAction('/gamma/applyDataResolution', {
m_vCurEnergy: this.list.map(item => item.energy),
m_vCurReso: this.list.map(item => item.fwhm),
m_vCurEnergy: this.list.map((item) => item.energy),
m_vCurReso: this.list.map((item) => item.fwhm),
m_vCurUncert: this.uncert,
m_curParam: this.param,
curCalName,
sampleId,
fileName
fileName,
})
if (success) {
this.handleDataSourceClick(curCalName)
@ -548,8 +542,8 @@ export default {
} catch (error) {
console.error(error)
}
}
}
},
},
}
</script>

View File

@ -39,7 +39,7 @@ export default {
},
handleOk() {
this.$emit('save', this.saveFormat)
this.$emit('save', this.saveFormat, this.saveAll)
},
},
computed: {

View File

@ -6,7 +6,7 @@
<div v-if="item.children" :key="index">
<a-menu class="multi-level-menu-sub-menu">
<template v-for="child in item.children">
<a-menu-item v-if="child.show !== false" :key="child.key" @click="handleSubMenuClick(item, child)">
<a-menu-item v-if="child.show !== false" :key="child.key" @click="handleSubMenuClick(item, child)">
{{ child.title }}
</a-menu-item>
</template>
@ -22,23 +22,23 @@ export default {
props: {
children: {
type: Array,
default: () => []
default: () => [],
},
width: {
type: String,
default: 'auto'
}
default: 'auto',
},
},
methods: {
handleMenuClick(item) {
if (!item.children) {
this.$emit('menuClick', item)
}
// if (!item.children) {
this.$emit('menuClick', item)
// }
},
handleSubMenuClick(item, child) {
this.$emit('submenuClick', { item, child })
}
}
},
},
}
</script>

View File

@ -47,10 +47,12 @@ const columns = [
{
title: 'Energy(keV)',
dataIndex: 'energy',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Centroid',
dataIndex: 'centroid',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Multiplet',
@ -59,22 +61,27 @@ const columns = [
{
title: 'Fwhm(keV)',
dataIndex: 'fwhm',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'NetArea',
dataIndex: 'netArea',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'AreaErr(%)',
dataIndex: 'areaErr',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Significant',
dataIndex: 'significant',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Sensitivity',
dataIndex: 'sensitivity',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
},
{
title: 'Indentify',

View File

@ -42,7 +42,7 @@
<!-- 二级交互栏结束 -->
<!-- 主体部分 -->
<div class="gamma-analysis-main">
<div class="gamma-analysis-chart">
<div class="gamma-analysis-chart" ref="chartContainerRef" tabindex="0" @keydown="handleKeyboardEvent">
<CustomChart
ref="chartRef"
:option="option"
@ -140,6 +140,8 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
import StripModal from './components/Modals/StripModal.vue'
import { FilePicker } from '@/utils/FilePicker'
import { zipFile } from '@/utils/file'
import { findNearPeak } from '@/utils/sampleHelper'
import baseCtrlJson from './baseCtrlJson.json'
export default {
props: {
@ -232,20 +234,14 @@ export default {
this.setChartBottomTitle(0, 0, 0)
this.option.tooltip.formatter = this.tooltipFormatter
this.$bus.$on('colorChange', this.handleColorChange)
this.$bus.$on('gammaRefresh', this.handleRefresh)
this.$bus.$on('accept', this.handleAccept)
document.addEventListener('keydown', this.handleKeyboardEvent)
},
destroyed() {
this.cancelLastRequest()
this.$bus.$off('colorChange', this.handleColorChange)
this.$bus.$off('gammaRefresh', this.handleRefresh)
this.$bus.$off('accept', this.handleAccept)
document.removeEventListener('keydown', this.handleKeyboardEvent)
},
mounted() {
this.option.brush = { toolbox: [] }
@ -413,7 +409,6 @@ export default {
},
initWebSocket: function () {
console.log('qweqwerq')
// WebSocketwshttpwsshttps
var userId = store.getters.userInfo.id
var url =
@ -535,7 +530,7 @@ export default {
this.$store.commit('ADD_SAMPLE_DATA', {
inputFileName,
data: result,
data: Object.assign(result, { BaseCtrls: baseCtrlJson }),
from: flag,
})
@ -868,6 +863,7 @@ export default {
// 线
handleChartClick(param) {
this.$refs.chartContainerRef.focus()
const { offsetX, offsetY } = param
const point = getXAxisAndYAxisByPosition(this.getChart(), offsetX, offsetY)
if (point) {
@ -884,50 +880,13 @@ export default {
//
setChartBottomTitle(channel, energy, counts) {
const { index, find } = this.findNearPeak(channel)
const { index, find } = findNearPeak(channel, this.peakList)
this.option.title.text = `{a|Channel:${channel}} {a|Energy:${energy || '0.00'}} {a|Counts:${
counts || '0.0'
}} {a|Significance:${find ? this.peakList[index].significance.toFixed(2) : '0.00'}}`
},
// (C++)
findNearPeak(channel) {
let t_bFind = false,
i = 0,
peakNum = this.peakList.length
for (; i < peakNum; ++i) {
const peak = this.peakList[i]
if (channel >= peak.left && channel <= peak.right) {
// channel
if (peak.multiIndex > 0 && channel > peak.peakCentroid) {
// channel
let j = i
let temp = channel - peak.peakCentroid
while (++j < peakNum && this.peakList[j].multiIndex == peak.multiIndex) {
if (Math.abs(this.peakList[j].peakCentroid - channel) < temp) {
// channel
temp = Math.abs(this.peakList[j].peakCentroid - channel)
i = j
}
}
}
// channel (i)
t_bFind = true
break
} else if (peak.left > channel) {
// channel
if (i > 0 && channel - this.peakList[i - 1].peakCentroid < peak.peakCentroid - channel) i -= 1
break
}
}
if (i >= peakNum) i -= 1
return {
index: i,
find: t_bFind,
}
},
// xAixschannelenergycounts
getEnergyAndCountsByXAxis(xAxis) {
let channel, energy, counts
@ -1343,6 +1302,7 @@ export default {
//
handleRefresh(data) {
data.DetailedInformation = this.detailedInfomation
data.QCFlag = this.qcFlags
this.clearCompareLine()
this.redrawPeakLine()
this.dataProcess(data)
@ -1350,36 +1310,29 @@ export default {
// Accept
handleAccept(data) {
console.log('%c [ data ]-1166', 'font-size:13px; background:pink; color:#bf2c9f;', data)
const {
allData,
barChart,
channelBaseLineChart,
peakSet,
shadowChannelChart,
shadowEnergyChart,
shapeChannelData,
shapeData,
shapeEnergyData,
} = data
const result = {
DetailedInformation: this.detailedInfomation,
QCFlag: this.qcFlags,
allData,
shadowChannelChart,
shadowEnergyChart,
shapeChannelData,
shapeEnergyData,
peak: peakSet,
}
this.clearCompareLine()
this.channelData.peakGroup = this.getLineData(allData, 'Peak', 'channel', true)
this.energyData.peakGroup = this.getLineData(allData, 'Peak', 'energy', true)
this.redrawPeakLine()
this.channelData.baseLine = this.getLineData(allData, 'BaseLine', 'channel')
this.energyData.baseLine = this.getLineData(allData, 'BaseLine', 'energy')
this.redrawLineBySeriesName(
'BaseLine',
this.energyData.baseLine,
this.channelData.baseLine,
this.graphAssistance.Baseline
)
this.channelData.baseLineCP = shapeChannelData
this.energyData.baseLineCP = shapeEnergyData
this.redrawCtrlPointBySeriesName()
this.dataProcess(result)
},
//
@ -1772,6 +1725,7 @@ export default {
height: 100%;
position: relative;
overflow: hidden;
outline: none;
}
&-thumbnail {

View File

@ -10,7 +10,10 @@
:overlay-style="operation.style"
:key="operation.title"
>
<a-button type="primary">{{ operation.title }}</a-button>
<a-button type="primary">
<a-icon type="loading" v-if="operation.loading"></a-icon>
{{ operation.title }}
</a-button>
<div slot="overlay">
<template v-for="(child, index) in operation.children">
<component v-if="child.show !== false" :is="child.type" :key="index" v-bind="child.attrs" v-on="child.on">
@ -88,7 +91,11 @@
<!-- 分析-设置弹窗结束 -->
<!-- 分析工具弹窗开始 -->
<analyze-interactive-tool-modal v-model="analyzeInteractiveToolModalVisible" :sampleId="sampleData.sampleId" />
<analyze-interactive-tool-modal
v-model="analyzeInteractiveToolModalVisible"
:sampleId="sampleData.sampleId"
:colorConfig="colorConfig"
/>
<!-- 分析工具弹窗结束 -->
<!-- Korsum 弹窗开始 -->
@ -116,7 +123,7 @@
<!-- SpectrumComments 弹窗结束 -->
<!-- Color Config 弹窗开始 -->
<color-config-modal v-model="colorConfigModalVisible" />
<color-config-modal v-model="colorConfigModalVisible" :colorConfig="colorConfig" @colorChange="handleColorChange" />
<!-- Color Config 弹窗结束 -->
<!-- Data Processing Log 弹窗开始 -->
@ -165,6 +172,7 @@
<!-- Beta-Gamma 的Energy Calibration开始 -->
<beta-gamma-energy-calibration-modal
v-model="betaGammaEnergyCalibrationModalVisible"
:sampleList="sampleList"
@sendInfo="getCheckFlag"
@sendXeData="getXeData"
/>
@ -190,12 +198,13 @@
<!-- Beta-Gamma QC Result 弹窗 结束 -->
<!-- Beta-Gamma RLR 弹窗 -->
<beta-gamma-rlr-modal v-model="betaGammaRlrModalVisible" :sampleData="sampleData" />
<beta-gamma-rlr-modal v-model="betaGammaRlrModalVisible" />
<!-- Beta-Gamma RLR 弹窗 结束 -->
<!-- Beta-Gamma Statistics Paramer History 弹窗 -->
<statistics-paramer-history-modal v-model="statisticsParamerHistoryModalVisible" />
<!-- Beta-Gamma Statistics Paramer History 弹窗 结束 -->
<bg-log-viewer v-model="bgLogViewerVisible" />
</div>
</template>
<script>
@ -239,6 +248,7 @@ import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/Bet
import { getAction } from '@/api/manage'
import { clearSampleCache } from './clearSampleCache'
import { fetchAndDownload } from '@/utils/file'
import BGLogViewer from './components/Modals/BetaGammaModals/BGLogViewer.vue'
//
const ANALYZE_TYPE = {
@ -283,6 +293,7 @@ export default {
BetaGammaEnergyCalibrationModal,
AutomaticAnalysisLogModal,
BetaGammaExtrapolationModal,
BgLogViewer: BGLogViewer,
},
provide() {
@ -360,6 +371,7 @@ export default {
betaGammaQCResultsModalVisible: false, // beta-gamma QC Result
betaGammaRlrModalVisible: false, // beta-gamma RLR
statisticsParamerHistoryModalVisible: false, // beta-gamma Statistics Paramer History
bgLogViewerVisible: false, // beta-gamma Log BG log viewer
analyseCurrentSpectrumData: {},
resultDisplayFlag: [],
params_toDB: {
@ -387,6 +399,10 @@ export default {
updateFlag: '2',
isReAnalyed_gamma: false,
isReAnalyed_beta: false,
isSaving: false,
colorConfig: {}, //
}
},
created() {
@ -397,6 +413,7 @@ export default {
// dbName: 'auto',
// inputFileName: 'CAX05_001-20230731_1528_S_FULL_37563.6.PHD',
// })
this.getColorConfig()
},
destroyed() {
@ -409,7 +426,6 @@ export default {
this.isReAnalyed_gamma = val
},
getUpdateFlag(val) {
console.log('qerq', val)
this.updateFlag = val
},
getcommentsInfo(val) {
@ -417,10 +433,10 @@ export default {
},
getStationName(arg, val, flag) {
arg.forEach((item) => {
item.conc = Number(item.conc).toFixed(6)
item.concErr = Number(item.concErr).toFixed(6)
item.lc = Number(item.lc).toFixed(6)
item.mdc = Number(item.mdc).toFixed(6)
item.conc = Number(item.conc).toPrecision(6)
item.concErr = Number(item.concErr).toPrecision(6)
item.lc = Number(item.lc).toPrecision(6)
item.mdc = Number(item.mdc).toPrecision(6)
})
this.resultDisplayFlag = arg
this.params_toDB.stationName = val
@ -492,13 +508,39 @@ export default {
},
//
async handleSaveResultsToFile(saveFormat) {
async handleSaveResultsToFile(saveFormat, isSaveAll = false) {
this.isSaving = true
if (this.isGamma) {
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
let params = {
fileName: this.newSampleData.inputFileName,
if (!isSaveAll) {
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
let params = {
fileName: this.newSampleData.inputFileName,
}
try {
await fetchAndDownload(url, params, 'get')
} catch (error) {
console.error(error)
} finally {
this.isSaving = false
}
} else {
let list = this.sampleList.filter((item) => item.sampleType !== 'B')
if (list.length > 0) {
list.forEach(async (item) => {
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
let params = {
fileName: item.inputFileName,
}
try {
await fetchAndDownload(url, params, 'get')
} catch (error) {
console.error(error)
} finally {
this.isSaving = false
}
})
}
}
fetchAndDownload(url, params, 'get')
}
if (this.isBetaGamma) {
const url =
@ -523,8 +565,13 @@ export default {
this.params_toDB.detFileName = this.newSampleData.detFileName
this.params_toDB.qcFileName = this.newSampleData.qcFileName
this.params_toDB.dbName = this.newSampleData.dbName
fetchAndDownload(url, this.params_toDB)
try {
await fetchAndDownload(url, this.params_toDB)
} catch (error) {
console.error(error)
} finally {
this.isSaving = false
}
}
},
@ -615,7 +662,7 @@ export default {
})
// reprocessing
if(inputFileName && sampleType !== 'B') {
if (inputFileName && sampleType !== 'B') {
this.$refs.gammaAnalysisRef.reProcessing(false)
}
},
@ -678,10 +725,10 @@ export default {
this.analyseCurrentSpectrumData = res.result
this.resultDisplayFlag = res.result.XeData
this.resultDisplayFlag.forEach((item) => {
item.conc = item.conc.toFixed(6)
item.concErr = item.concErr.toFixed(6)
item.lc = item.lc.toFixed(6)
item.mdc = item.mdc.toFixed(6)
item.conc = item.conc.toPrecision(6)
item.concErr = item.concErr.toPrecision(6)
item.lc = item.lc.toPrecision(6)
item.mdc = item.mdc.toPrecision(6)
})
} else {
this.$message.warning(res.message)
@ -700,14 +747,13 @@ export default {
}
postAction('/spectrumAnalysis/analyseAllSpectrum', params).then((res) => {
if (res.success) {
console.log(res)
this.analyseCurrentSpectrumData = res.result
this.resultDisplayFlag = res.result.XeData
this.resultDisplayFlag.forEach((item) => {
item.conc = item.conc.toFixed(6)
item.concErr = item.concErr.toFixed(6)
item.lc = item.lc.toFixed(6)
item.mdc = item.mdc.toFixed(6)
item.conc = item.conc.toPrecision(6)
item.concErr = item.concErr.toPrecision(6)
item.lc = item.lc.toPrecision(6)
item.mdc = item.mdc.toPrecision(6)
})
} else {
this.$message.warning(res.message)
@ -725,6 +771,26 @@ export default {
}
}
},
//
async getColorConfig() {
try {
const { success, result, message } = await getAction('/gamma/viewColorConfig')
if (success) {
this.colorConfig = result
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
},
//
handleColorChange(colorConfig) {
this.colorConfig = colorConfig
this.$refs.gammaAnalysisRef.handleColorChange(colorConfig)
},
},
computed: {
//
@ -802,6 +868,7 @@ export default {
},
{
title: 'SAVE',
loading: this.isSaving,
children: [
{
type: 'MultiLevelMenu',
@ -810,6 +877,23 @@ export default {
children: [
{
title: 'Save Results to File',
children: [
{
title: 'Save Txt',
key: 'saveTxt',
show: this.isBetaGamma,
},
{
title: 'Save Excel',
key: 'saveExcel',
show: this.isBetaGamma,
},
{
title: 'Save Html',
key: 'saveHtml',
show: this.isBetaGamma,
},
],
},
{
title: 'Save Results to DB',
@ -821,6 +905,7 @@ export default {
{
title: 'Save All',
key: 'all',
show: this.isGamma,
},
],
key: 'resultsToDB',
@ -845,14 +930,21 @@ export default {
},
on: {
menuClick: () => {
console.log(this.isBetaGamma, this.isGamma)
this.saveSettingModalVisible = true
if (this.isGamma) {
this.saveSettingModalVisible = true
}
},
submenuClick: ({ item, child }) => {
if (item.key == 'resultsToDB') {
this.handleSaveResultsToDB(child.key)
} else if (item.key == 'phdToFile') {
this.handleSavePHDToFile(child.key)
} else if (child.key == 'saveTxt') {
this.handleSaveResultsToFile('txt')
} else if (child.key == 'saveExcel') {
this.handleSaveResultsToFile('xls')
} else if (child.key == 'saveHtml') {
this.handleSaveResultsToFile('html')
}
},
},
@ -1048,7 +1140,6 @@ export default {
type: 'a-menu-item',
title: 'ARR',
handler: () => {
console.log(this.newSampleData)
if (this.newSampleData.sampleId) {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}
@ -1196,7 +1287,9 @@ export default {
type: 'a-menu-item',
title: 'BG log viewer',
show: this.isBetaGamma,
handler: () => {},
handler: () => {
this.bgLogViewerVisible = true
},
},
{
type: 'a-menu-item',