Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
98f17c8e31
|
@ -9,19 +9,26 @@ const sample = {
|
||||||
|
|
||||||
ADD_SAMPLE_DATA: (state, sampleData) => {
|
ADD_SAMPLE_DATA: (state, sampleData) => {
|
||||||
const find = state.sampleList.find(item => item.inputFileName == sampleData.inputFileName)
|
const find = state.sampleList.find(item => item.inputFileName == sampleData.inputFileName)
|
||||||
if(find) {
|
if (find) {
|
||||||
find.data = sampleData.data
|
find.data = sampleData.data
|
||||||
} else {
|
} else {
|
||||||
state.sampleList.push(sampleData)
|
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) => {
|
REMOVE_SAMPLE_DATA: (state, inputFileName) => {
|
||||||
const findIndex = state.sampleList.findIndex(item => item.inputFileName == inputFileName)
|
const findIndex = state.sampleList.findIndex(item => item.inputFileName == inputFileName)
|
||||||
state.sampleList.splice(findIndex, 1)
|
state.sampleList.splice(findIndex, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
CLEAR_SAMPLE_DATA: () => {
|
CLEAR_SAMPLE_DATA: (state) => {
|
||||||
state.sampleList = []
|
state.sampleList = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
20
src/utils/sampleHelper.js
Normal file
20
src/utils/sampleHelper.js
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/**
|
||||||
|
* 在返回的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])
|
||||||
|
}
|
|
@ -478,6 +478,12 @@ export default {
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
// this.currResultDisplay = newVal.XeData
|
// this.currResultDisplay = newVal.XeData
|
||||||
this.resultDisplay = newVal.XeData || []
|
this.resultDisplay = newVal.XeData || []
|
||||||
|
|
||||||
|
this.$store.commit('UPDATE_SAMPLE_DATA', {
|
||||||
|
inputFileName: this.sample.inputFileName,
|
||||||
|
key: 'XeData',
|
||||||
|
data: newVal.XeData
|
||||||
|
})
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
deep: true,
|
deep: true,
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
<span @click="handleChangeMarkLine('next')">></span>
|
<span @click="handleChangeMarkLine('next')">></span>
|
||||||
</p>
|
</p>
|
||||||
<custom-table
|
<custom-table
|
||||||
|
size="small"
|
||||||
:class="list.length ? 'has-data' : ''"
|
:class="list.length ? 'has-data' : ''"
|
||||||
:list="list"
|
:list="list"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -215,6 +216,7 @@ import Response from './Response.json'
|
||||||
import { updateBaseLine } from '@/utils/WasmHelper'
|
import { updateBaseLine } from '@/utils/WasmHelper'
|
||||||
import RectList from './components/RectList.vue'
|
import RectList from './components/RectList.vue'
|
||||||
import { isNullOrUndefined } from '@/utils/util'
|
import { isNullOrUndefined } from '@/utils/util'
|
||||||
|
import { getLineData, transformPointListData } from '@/utils/sampleHelper'
|
||||||
|
|
||||||
// 初始配置
|
// 初始配置
|
||||||
const initialOption = {
|
const initialOption = {
|
||||||
|
@ -223,7 +225,7 @@ const initialOption = {
|
||||||
left: 40,
|
left: 40,
|
||||||
right: 30,
|
right: 30,
|
||||||
bottom: 30,
|
bottom: 30,
|
||||||
containLabel: true
|
containLabel: true,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
text: '',
|
text: '',
|
||||||
|
@ -234,39 +236,39 @@ const initialOption = {
|
||||||
rich: {
|
rich: {
|
||||||
a: {
|
a: {
|
||||||
padding: [0, 20, 0, 0],
|
padding: [0, 20, 0, 0],
|
||||||
fontSize: 16
|
fontSize: 16,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#3CAEBB',
|
color: '#3CAEBB',
|
||||||
width: 1
|
width: 1,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
formatter: undefined,
|
formatter: undefined,
|
||||||
className: 'figure-chart-option-tooltip'
|
className: 'figure-chart-option-tooltip',
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 'dataMax',
|
max: 'dataMax',
|
||||||
animation: false
|
animation: false,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'log',
|
type: 'log',
|
||||||
|
@ -275,31 +277,31 @@ const initialOption = {
|
||||||
nameGap: 40,
|
nameGap: 40,
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
color: '#8FD4F8',
|
color: '#8FD4F8',
|
||||||
fontSize: 16
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'rgba(173, 230, 238, .2)'
|
color: 'rgba(173, 230, 238, .2)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: '#ade6ee'
|
color: '#ade6ee',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
min: 0.1,
|
min: 0.1,
|
||||||
max: 'dataMax',
|
max: 'dataMax',
|
||||||
animation: false
|
animation: false,
|
||||||
},
|
},
|
||||||
series: [],
|
series: [],
|
||||||
brush: {}
|
brush: {},
|
||||||
}
|
}
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
|
@ -308,61 +310,62 @@ const columns = [
|
||||||
customRender: (_, __, index) => {
|
customRender: (_, __, index) => {
|
||||||
return index + 1
|
return index + 1
|
||||||
},
|
},
|
||||||
width: 60
|
width: 60,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Energy (keV)',
|
title: 'Energy (keV)',
|
||||||
dataIndex: 'energy',
|
dataIndex: 'energy',
|
||||||
width: 120,
|
width: 120,
|
||||||
customRender: text => {
|
customRender: (text) => {
|
||||||
return text.toFixed(3)
|
return text.toFixed(3)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Centroid (C)',
|
title: 'Centroid (C)',
|
||||||
dataIndex: 'peakCentroid',
|
dataIndex: 'peakCentroid',
|
||||||
width: 120,
|
width: 120,
|
||||||
customRender: text => {
|
customRender: (text) => {
|
||||||
return text.toFixed(3)
|
return text.toFixed(3)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'FWHM (keV)',
|
title: 'FWHM (keV)',
|
||||||
dataIndex: 'fwhm',
|
dataIndex: 'fwhm',
|
||||||
width: 120,
|
width: 120,
|
||||||
customRender: text => {
|
customRender: (text) => {
|
||||||
return text.toFixed(3)
|
return text.toFixed(3)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Area',
|
title: 'Area',
|
||||||
dataIndex: 'area',
|
dataIndex: 'area',
|
||||||
width: 120,
|
width: 120,
|
||||||
customRender: text => {
|
customRender: (text) => {
|
||||||
return text.toFixed(3)
|
return text.toFixed(3)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Detectability',
|
title: 'Detectability',
|
||||||
dataIndex: 'significance',
|
dataIndex: 'significance',
|
||||||
width: 120,
|
width: 120,
|
||||||
customRender: text => {
|
customRender: (text) => {
|
||||||
return text.toFixed(3)
|
return text.toFixed(3)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '#Cmnt',
|
title: '#Cmnt',
|
||||||
dataIndex: 'comments',
|
dataIndex: 'comments',
|
||||||
width: 120
|
width: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Nuclides',
|
title: 'Nuclides',
|
||||||
dataIndex: 'nuclides',
|
dataIndex: 'nuclides',
|
||||||
width: 120,
|
width: 120,
|
||||||
customRender: text => {
|
ellipsis: true,
|
||||||
|
customRender: (text) => {
|
||||||
return text && text.join(';')
|
return text && text.join(';')
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
// 缩略图配置
|
// 缩略图配置
|
||||||
|
@ -371,43 +374,43 @@ const thumbnailOption = {
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 5,
|
left: 5,
|
||||||
right: 5,
|
right: 5,
|
||||||
bottom: 0
|
bottom: 0,
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 'dataMax'
|
max: 'dataMax',
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
min: 0.1,
|
min: 0.1,
|
||||||
max: 'dataMax'
|
max: 'dataMax',
|
||||||
},
|
},
|
||||||
series: null
|
series: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
const nuclideIdentifyModal = {
|
const nuclideIdentifyModal = {
|
||||||
possibleNuclide: '',
|
possibleNuclide: '',
|
||||||
tolerance: 0.5,
|
tolerance: 0.5,
|
||||||
identifiedNuclide: ''
|
identifiedNuclide: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
// 操作类型
|
// 操作类型
|
||||||
|
@ -415,7 +418,7 @@ const Operators = {
|
||||||
ADD: 1, // 新增
|
ADD: 1, // 新增
|
||||||
REMOVE: 2, // 移除
|
REMOVE: 2, // 移除
|
||||||
MODIFY: 3, // 改变
|
MODIFY: 3, // 改变
|
||||||
SLOPE_CHANGE: 4 // 改变slope
|
SLOPE_CHANGE: 4, // 改变slope
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -428,7 +431,7 @@ export default {
|
||||||
NuclideReviewModal,
|
NuclideReviewModal,
|
||||||
GeneralCommentModal,
|
GeneralCommentModal,
|
||||||
EditSlopeModal,
|
EditSlopeModal,
|
||||||
RectList
|
RectList,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
|
@ -477,66 +480,47 @@ export default {
|
||||||
isReploting: false,
|
isReploting: false,
|
||||||
|
|
||||||
operationStack: [], // 操作记录
|
operationStack: [], // 操作记录
|
||||||
replotNeeded: false
|
replotNeeded: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.option.tooltip.formatter = params => {
|
this.option.tooltip.formatter = (params) => {
|
||||||
const channel = parseInt(params[0].value[0])
|
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>
|
return `<div class="channel">Channel: ${channel}</div>
|
||||||
<div class="energy">${isNullOrUndefined(energy) ? '' : `Energy: ${energy.toFixed(2)}`}</div>`
|
<div class="energy">${isNullOrUndefined(energy) ? '' : `Energy: ${energy.toFixed(2)}`}</div>`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getInfo() {
|
async getInfo() {
|
||||||
try {
|
this.option.series = []
|
||||||
this.isLoading = true
|
this.thumbnailOption.series = []
|
||||||
this.option.series = []
|
this.list = []
|
||||||
this.thumbnailOption.series = []
|
this.model = cloneDeep(nuclideIdentifyModal)
|
||||||
this.list = []
|
|
||||||
this.model = cloneDeep(nuclideIdentifyModal)
|
|
||||||
|
|
||||||
const { success, result, message } = await getAction('/gamma/InteractiveTool', {
|
const { inputFileName } = this.sampleData
|
||||||
sampleId: this.sampleId,
|
|
||||||
fileName: this.fileName
|
|
||||||
})
|
|
||||||
|
|
||||||
// const { success, result, message } = cloneDeep(Response)
|
const currSampleDetailInfo = await this.$store.dispatch('GET_SAMPLE_DATA', inputFileName)
|
||||||
|
const {
|
||||||
|
data: { allData, shadowChannelChart, shapeChannelData, peak },
|
||||||
|
} = currSampleDetailInfo
|
||||||
|
|
||||||
if (success) {
|
const channelBaseLine = getLineData(allData, 'BaseLine', 'channel')
|
||||||
this.isLoading = false
|
const channelPeakGroup = getLineData(allData, 'Peak', 'channel', true)
|
||||||
const {
|
|
||||||
barChart,
|
|
||||||
channelBaseCPChart,
|
|
||||||
channelBaseLineChart,
|
|
||||||
channelCountChart,
|
|
||||||
channelPeakChart,
|
|
||||||
energy,
|
|
||||||
table,
|
|
||||||
BaseCtrls,
|
|
||||||
FitBaseLine
|
|
||||||
} = result
|
|
||||||
|
|
||||||
console.log('%c [ ]-374', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
const allEnergy = getLineData(allData, 'Energy', 'energy')
|
||||||
|
|
||||||
this.channelBaseCPChart = channelBaseCPChart
|
this.channelBaseCPChart = shapeChannelData
|
||||||
this.channelBaseLineChart = channelBaseLineChart
|
this.channelBaseLineChart = channelBaseLine
|
||||||
this.channelCountChart = channelCountChart
|
this.channelCountChart = shadowChannelChart
|
||||||
this.channelPeakChart = channelPeakChart
|
this.channelPeakChart = channelPeakGroup
|
||||||
this.energy = energy
|
this.energy = allEnergy
|
||||||
this.BaseCtrls = BaseCtrls
|
// this.BaseCtrls = BaseCtrls
|
||||||
this.FitBaseLine = FitBaseLine
|
// this.FitBaseLine = FitBaseLine
|
||||||
this.barChart = barChart
|
this.barChart = shadowChannelChart
|
||||||
|
|
||||||
this.setChartOption(channelBaseLineChart, channelCountChart, channelPeakChart, channelBaseCPChart, barChart)
|
this.setChartOption(channelBaseLine, shadowChannelChart, channelPeakGroup, shapeChannelData, shadowChannelChart)
|
||||||
this.list = table
|
this.list = peak
|
||||||
} else {
|
|
||||||
this.$message.error(message)
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setChartOption(baseLine, count, peaks, baseCP, bar) {
|
setChartOption(baseLine, count, peaks, baseCP, bar) {
|
||||||
|
@ -554,7 +538,7 @@ export default {
|
||||||
// 推入基线控制点
|
// 推入基线控制点
|
||||||
series.push(this.buildCtrlPoint(baseCP))
|
series.push(this.buildCtrlPoint(baseCP))
|
||||||
|
|
||||||
this.thumbnailOption.series = this.buildBarChart(bar)
|
// this.thumbnailOption.series = this.buildBarChart(bar)
|
||||||
|
|
||||||
this.option.series = series
|
this.option.series = series
|
||||||
},
|
},
|
||||||
|
@ -573,10 +557,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeModalOpen() {
|
beforeModalOpen() {
|
||||||
const { sampleId, inputFileName } = this.sampleData
|
|
||||||
this.sampleId = sampleId
|
|
||||||
this.fileName = inputFileName
|
|
||||||
|
|
||||||
this.getInfo()
|
this.getInfo()
|
||||||
this.reset()
|
this.reset()
|
||||||
},
|
},
|
||||||
|
@ -640,7 +620,7 @@ export default {
|
||||||
left = channel
|
left = channel
|
||||||
}
|
}
|
||||||
|
|
||||||
const peaksBetweenChannel = this.list.filter(peak => {
|
const peaksBetweenChannel = this.list.filter((peak) => {
|
||||||
const centroidId = peak.peakCentroid
|
const centroidId = peak.peakCentroid
|
||||||
return centroidId >= left && centroidId <= right
|
return centroidId >= left && centroidId <= right
|
||||||
})
|
})
|
||||||
|
@ -672,7 +652,7 @@ export default {
|
||||||
const maxXAxises = this.getPeakMaxValues()
|
const maxXAxises = this.getPeakMaxValues()
|
||||||
if (direction == 'next') {
|
if (direction == 'next') {
|
||||||
// 找到第一个比prevAxis大的xAxis
|
// 找到第一个比prevAxis大的xAxis
|
||||||
const find = maxXAxises.find(xAxis => xAxis > prevAxis)
|
const find = maxXAxises.find((xAxis) => xAxis > prevAxis)
|
||||||
if (find) {
|
if (find) {
|
||||||
markLineOption.xAxis = find
|
markLineOption.xAxis = find
|
||||||
}
|
}
|
||||||
|
@ -680,7 +660,7 @@ export default {
|
||||||
// 找到第一个比prevAxis小的xAxis
|
// 找到第一个比prevAxis小的xAxis
|
||||||
const find = cloneDeep(maxXAxises)
|
const find = cloneDeep(maxXAxises)
|
||||||
.reverse()
|
.reverse()
|
||||||
.find(xAxis => xAxis < prevAxis)
|
.find((xAxis) => xAxis < prevAxis)
|
||||||
if (find) {
|
if (find) {
|
||||||
markLineOption.xAxis = find
|
markLineOption.xAxis = find
|
||||||
}
|
}
|
||||||
|
@ -688,11 +668,24 @@ export default {
|
||||||
|
|
||||||
const xAxis = markLineOption.xAxis
|
const xAxis = markLineOption.xAxis
|
||||||
if (xAxis >= 0) {
|
if (xAxis >= 0) {
|
||||||
const index = maxXAxises.findIndex(item => item == xAxis)
|
const index = maxXAxises.findIndex((item) => item == xAxis)
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
this.selectedKeys = [this.list[index].index]
|
this.selectedKeys = [this.list[index].index]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取右下角possible nuclide 和 identified nuclide
|
// 获取右下角possible nuclide 和 identified nuclide
|
||||||
|
@ -703,10 +696,11 @@ export default {
|
||||||
if (!row._possible) {
|
if (!row._possible) {
|
||||||
this.$set(row, '_loading', true)
|
this.$set(row, '_loading', true)
|
||||||
try {
|
try {
|
||||||
|
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||||
const { success, result, message } = await getAction('/gamma/getSelPosNuclide', {
|
const { success, result, message } = await getAction('/gamma/getSelPosNuclide', {
|
||||||
sampleId: this.sampleId,
|
sampleId,
|
||||||
channel: parseInt(row.peakCentroid),
|
channel: parseInt(row.peakCentroid),
|
||||||
fileName: this.fileName
|
fileName,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
const { possible } = result
|
const { possible } = result
|
||||||
|
@ -724,9 +718,9 @@ export default {
|
||||||
|
|
||||||
// 获取每一段 Channel 中的最大值
|
// 获取每一段 Channel 中的最大值
|
||||||
getPeakMaxValues() {
|
getPeakMaxValues() {
|
||||||
const maxXAxises = this.channelPeakChart.map(item => {
|
const maxXAxises = this.channelPeakChart.map((item) => {
|
||||||
const allY = item.pointlist.map(point => point.y)
|
const allY = item.pointlist.map((point) => point.y)
|
||||||
const max = item.pointlist.find(point => point.y == Math.max(...allY))
|
const max = item.pointlist.find((point) => point.y == Math.max(...allY))
|
||||||
return max.x
|
return max.x
|
||||||
})
|
})
|
||||||
return maxXAxises
|
return maxXAxises
|
||||||
|
@ -772,7 +766,7 @@ export default {
|
||||||
shadowEnergyChart,
|
shadowEnergyChart,
|
||||||
shapeChannelData,
|
shapeChannelData,
|
||||||
shapeEnergyData,
|
shapeEnergyData,
|
||||||
table
|
table,
|
||||||
} = result
|
} = result
|
||||||
|
|
||||||
this.$bus.$emit('gammaRefresh', {
|
this.$bus.$emit('gammaRefresh', {
|
||||||
|
@ -781,7 +775,7 @@ export default {
|
||||||
shadowChannelChart,
|
shadowChannelChart,
|
||||||
shadowEnergyChart,
|
shadowEnergyChart,
|
||||||
shapeChannelData,
|
shapeChannelData,
|
||||||
shapeEnergyData
|
shapeEnergyData,
|
||||||
})
|
})
|
||||||
|
|
||||||
this.channelPeakChart = channelPeakChart
|
this.channelPeakChart = channelPeakChart
|
||||||
|
@ -828,8 +822,8 @@ export default {
|
||||||
content: 'Are you sure to delete this peak?',
|
content: 'Are you sure to delete this peak?',
|
||||||
cancelButtonProps: {
|
cancelButtonProps: {
|
||||||
props: {
|
props: {
|
||||||
type: 'warn'
|
type: 'warn',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
// this.list.splice(findIndex, 1)
|
// this.list.splice(findIndex, 1)
|
||||||
|
@ -850,7 +844,7 @@ export default {
|
||||||
const { inputFileName: fileName } = this.sampleData
|
const { inputFileName: fileName } = this.sampleData
|
||||||
const { success, result, message } = await getAction('/gamma/deletePeak', {
|
const { success, result, message } = await getAction('/gamma/deletePeak', {
|
||||||
fileName,
|
fileName,
|
||||||
curRow: this.curRow
|
curRow: this.curRow,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
const {
|
const {
|
||||||
|
@ -860,7 +854,7 @@ export default {
|
||||||
shadowEnergyChart,
|
shadowEnergyChart,
|
||||||
shapeChannelData,
|
shapeChannelData,
|
||||||
shapeEnergyData,
|
shapeEnergyData,
|
||||||
table
|
table,
|
||||||
} = result
|
} = result
|
||||||
|
|
||||||
this.$bus.$emit('gammaRefresh', {
|
this.$bus.$emit('gammaRefresh', {
|
||||||
|
@ -869,7 +863,7 @@ export default {
|
||||||
shadowChannelChart,
|
shadowChannelChart,
|
||||||
shadowEnergyChart,
|
shadowEnergyChart,
|
||||||
shapeChannelData,
|
shapeChannelData,
|
||||||
shapeEnergyData
|
shapeEnergyData,
|
||||||
})
|
})
|
||||||
|
|
||||||
this.channelPeakChart = channelPeakChart
|
this.channelPeakChart = channelPeakChart
|
||||||
|
@ -896,7 +890,7 @@ export default {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -928,6 +922,19 @@ export default {
|
||||||
|
|
||||||
this.option.series[0].markLine.data[0].xAxis = 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.getSelPosNuclide(row)
|
||||||
|
|
||||||
this.selectedTableItem = row
|
this.selectedTableItem = row
|
||||||
|
@ -946,8 +953,8 @@ export default {
|
||||||
key: 'brush',
|
key: 'brush',
|
||||||
brushOption: {
|
brushOption: {
|
||||||
// 参见 brush 组件的 brushType。如果设置为 false 则关闭“可刷选状态”。
|
// 参见 brush 组件的 brushType。如果设置为 false 则关闭“可刷选状态”。
|
||||||
brushType: 'rect'
|
brushType: 'rect',
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -962,12 +969,12 @@ export default {
|
||||||
// 清理刷选的范围
|
// 清理刷选的范围
|
||||||
chart.dispatchAction({
|
chart.dispatchAction({
|
||||||
type: 'brush',
|
type: 'brush',
|
||||||
areas: []
|
areas: [],
|
||||||
})
|
})
|
||||||
|
|
||||||
// 改为不可刷选状态
|
// 改为不可刷选状态
|
||||||
chart.dispatchAction({
|
chart.dispatchAction({
|
||||||
type: 'takeGlobalCursor'
|
type: 'takeGlobalCursor',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -978,8 +985,8 @@ export default {
|
||||||
if (areas) {
|
if (areas) {
|
||||||
const range = areas.range
|
const range = areas.range
|
||||||
const [[minX, maxX], [minY, maxY]] = range
|
const [[minX, maxX], [minY, maxY]] = range
|
||||||
const point1 = chart.convertFromPixel({ seriesIndex: 0 }, [minX, minY]).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 point2 = chart.convertFromPixel({ seriesIndex: 0 }, [maxX, maxY]).map((num) => parseInt(num.toFixed()))
|
||||||
const xAxisMax = chart.getModel().getComponent('xAxis').axis.scale._extent[1]
|
const xAxisMax = chart.getModel().getComponent('xAxis').axis.scale._extent[1]
|
||||||
const yAxisMax = this.option.yAxis.max
|
const yAxisMax = this.option.yAxis.max
|
||||||
let [x1, y2, x2, y1] = [...point1, ...point2] // 根据解析出的数据确定真实的范围
|
let [x1, y2, x2, y1] = [...point1, ...point2] // 根据解析出的数据确定真实的范围
|
||||||
|
@ -1036,7 +1043,7 @@ export default {
|
||||||
this.baseCtrls_Copy.baseline.map((val, index) => [index + 1, val]),
|
this.baseCtrls_Copy.baseline.map((val, index) => [index + 1, val]),
|
||||||
this.FitBaseLine,
|
this.FitBaseLine,
|
||||||
{
|
{
|
||||||
zlevel: 21
|
zlevel: 21,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this.option.series.push(baseLineEditSeries)
|
this.option.series.push(baseLineEditSeries)
|
||||||
|
@ -1050,13 +1057,13 @@ export default {
|
||||||
this.btnGroupType = 1
|
this.btnGroupType = 1
|
||||||
this.opts.notMerge = true
|
this.opts.notMerge = true
|
||||||
const baseLineEditSeries = findSeriesByName(this.option.series, 'BaseLine_Edit')
|
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.option.series.splice(index, 1)
|
||||||
|
|
||||||
this.clearRect()
|
this.clearRect()
|
||||||
|
|
||||||
const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine')
|
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')
|
const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point')
|
||||||
baseLineCP.data = this.buildCPPointData(this.channelBaseCPChart)
|
baseLineCP.data = this.buildCPPointData(this.channelBaseCPChart)
|
||||||
|
@ -1096,7 +1103,7 @@ export default {
|
||||||
this.isModifying = false
|
this.isModifying = false
|
||||||
this.pushOperationStack(Operators.MODIFY, {
|
this.pushOperationStack(Operators.MODIFY, {
|
||||||
index,
|
index,
|
||||||
prevYAxis
|
prevYAxis,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1120,7 +1127,7 @@ export default {
|
||||||
|
|
||||||
// 重绘Peaks
|
// 重绘Peaks
|
||||||
redrawPeaks(peakList) {
|
redrawPeaks(peakList) {
|
||||||
this.option.series = this.option.series.filter(item => {
|
this.option.series = this.option.series.filter((item) => {
|
||||||
return !item.name.includes('Peak_')
|
return !item.name.includes('Peak_')
|
||||||
})
|
})
|
||||||
this.option.series.push(...this.buildPeaks(peakList))
|
this.option.series.push(...this.buildPeaks(peakList))
|
||||||
|
@ -1196,7 +1203,7 @@ export default {
|
||||||
index: i,
|
index: i,
|
||||||
removeXAxis,
|
removeXAxis,
|
||||||
removeYAxis,
|
removeYAxis,
|
||||||
removeYSlope
|
removeYSlope,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1232,7 +1239,7 @@ export default {
|
||||||
this.$refs.editSlopeModal.open({
|
this.$refs.editSlopeModal.open({
|
||||||
index: i,
|
index: i,
|
||||||
value: yslope[i],
|
value: yslope[i],
|
||||||
allowNaN: !(i == 0 || i == n - 1)
|
allowNaN: !(i == 0 || i == n - 1),
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1246,7 +1253,7 @@ export default {
|
||||||
yslope[index] = slope
|
yslope[index] = slope
|
||||||
this.pushOperationStack(Operators.SLOPE_CHANGE, {
|
this.pushOperationStack(Operators.SLOPE_CHANGE, {
|
||||||
index,
|
index,
|
||||||
slope: prevSlope
|
slope: prevSlope,
|
||||||
})
|
})
|
||||||
this.redrawBaseLine()
|
this.redrawBaseLine()
|
||||||
this.buildRect()
|
this.buildRect()
|
||||||
|
@ -1269,7 +1276,7 @@ export default {
|
||||||
const { success, result, message } = await postAction('/gamma/replotBaseLine', {
|
const { success, result, message } = await postAction('/gamma/replotBaseLine', {
|
||||||
...this.baseCtrls_Copy,
|
...this.baseCtrls_Copy,
|
||||||
fileName,
|
fileName,
|
||||||
replotNeeded: this.replotNeeded
|
replotNeeded: this.replotNeeded,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
const { chartData, peakSet, shapeData } = result
|
const { chartData, peakSet, shapeData } = result
|
||||||
|
@ -1288,8 +1295,8 @@ export default {
|
||||||
color,
|
color,
|
||||||
point: {
|
point: {
|
||||||
x: xAxis,
|
x: xAxis,
|
||||||
y: yctrl[index]
|
y: yctrl[index],
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
baseLineCP.data = this.buildCPPointData(baseCPPoints)
|
baseLineCP.data = this.buildCPPointData(baseCPPoints)
|
||||||
|
@ -1323,8 +1330,8 @@ export default {
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: 'transparent',
|
color: 'transparent',
|
||||||
borderColor: color,
|
borderColor: color,
|
||||||
borderWidth: size / 2
|
borderWidth: size / 2,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -1358,7 +1365,7 @@ export default {
|
||||||
this.isAccepting = true
|
this.isAccepting = true
|
||||||
const { success, result, message } = await postAction('/gamma/acceptBaseLine', {
|
const { success, result, message } = await postAction('/gamma/acceptBaseLine', {
|
||||||
...this.baseCtrls_Copy,
|
...this.baseCtrls_Copy,
|
||||||
fileName
|
fileName,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
|
this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
|
||||||
|
@ -1372,7 +1379,7 @@ export default {
|
||||||
shadowEnergyChart,
|
shadowEnergyChart,
|
||||||
shapeChannelData,
|
shapeChannelData,
|
||||||
shapeData,
|
shapeData,
|
||||||
shapeEnergyData
|
shapeEnergyData,
|
||||||
} = result
|
} = result
|
||||||
|
|
||||||
this.channelBaseLineChart = channelBaseLineChart
|
this.channelBaseLineChart = channelBaseLineChart
|
||||||
|
@ -1416,7 +1423,7 @@ export default {
|
||||||
curRow: this.curRow,
|
curRow: this.curRow,
|
||||||
nuclideName: possibleNuclide,
|
nuclideName: possibleNuclide,
|
||||||
fileName,
|
fileName,
|
||||||
list_identify: nuclides
|
list_identify: nuclides,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
nuclides.push(possibleNuclide)
|
nuclides.push(possibleNuclide)
|
||||||
|
@ -1439,7 +1446,7 @@ export default {
|
||||||
if (this.selectedTableItem._deleting) {
|
if (this.selectedTableItem._deleting) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const findIndex = nuclides.findIndex(nuclide => nuclide == this.model.identifiedNuclide)
|
const findIndex = nuclides.findIndex((nuclide) => nuclide == this.model.identifiedNuclide)
|
||||||
if (-1 !== findIndex) {
|
if (-1 !== findIndex) {
|
||||||
try {
|
try {
|
||||||
this.$set(this.selectedTableItem, '_deleting', true)
|
this.$set(this.selectedTableItem, '_deleting', true)
|
||||||
|
@ -1448,7 +1455,7 @@ export default {
|
||||||
curRow: this.curRow,
|
curRow: this.curRow,
|
||||||
nuclideName: this.model.identifiedNuclide,
|
nuclideName: this.model.identifiedNuclide,
|
||||||
fileName,
|
fileName,
|
||||||
list_identify: nuclides
|
list_identify: nuclides,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
nuclides.splice(findIndex, 1)
|
nuclides.splice(findIndex, 1)
|
||||||
|
@ -1467,43 +1474,35 @@ export default {
|
||||||
buildBaseLine(channelBaseLineChart) {
|
buildBaseLine(channelBaseLineChart) {
|
||||||
return buildLineSeries(
|
return buildLineSeries(
|
||||||
'BaseLine',
|
'BaseLine',
|
||||||
channelBaseLineChart.pointlist.map(({ x, y }) => [x, y]),
|
transformPointListData(channelBaseLineChart.pointlist),
|
||||||
channelBaseLineChart.color,
|
channelBaseLineChart.color,
|
||||||
{
|
{
|
||||||
markLine: {
|
markLine: {
|
||||||
silent: true,
|
silent: true,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
label: {
|
label: {
|
||||||
show: false
|
show: false,
|
||||||
},
|
},
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: 'red',
|
color: 'red',
|
||||||
width: 1
|
width: 1,
|
||||||
},
|
},
|
||||||
data: [{ xAxis: -1 }]
|
data: [{ xAxis: -1 }],
|
||||||
},
|
},
|
||||||
zlevel: 10
|
zlevel: 10,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 构建count
|
// 构建count
|
||||||
buildCountLine(channelCountChart) {
|
buildCountLine(channelCountChart) {
|
||||||
return buildLineSeries(
|
return buildLineSeries('CountChart', transformPointListData(channelCountChart.pointlist), channelCountChart.color)
|
||||||
'CountChart',
|
|
||||||
channelCountChart.pointlist.map(({ x, y }) => [x, y]),
|
|
||||||
channelCountChart.color
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 构建Peaks
|
// 构建Peaks
|
||||||
buildPeaks(channelPeakChart) {
|
buildPeaks(channelPeakChart) {
|
||||||
return channelPeakChart.map((item, index) => {
|
return channelPeakChart.map((item, index) => {
|
||||||
return buildLineSeries(
|
return buildLineSeries('Peak_' + (index + 1), transformPointListData(item.pointlist), item.color)
|
||||||
'Peak_' + (index + 1),
|
|
||||||
item.pointlist.map(({ x, y }) => [x, y]),
|
|
||||||
item.color
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1515,7 +1514,7 @@ export default {
|
||||||
data: this.buildCPPointData(channelBaseCPChart),
|
data: this.buildCPPointData(channelBaseCPChart),
|
||||||
silent: true,
|
silent: true,
|
||||||
animation: false,
|
animation: false,
|
||||||
zlevel: 20
|
zlevel: 20,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1526,7 +1525,7 @@ export default {
|
||||||
barChart.map(({ x, y }) => [x, y]),
|
barChart.map(({ x, y }) => [x, y]),
|
||||||
'#fff',
|
'#fff',
|
||||||
{
|
{
|
||||||
silent: true
|
silent: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
@ -1539,7 +1538,7 @@ export default {
|
||||||
pushOperationStack(operator, operand) {
|
pushOperationStack(operator, operand) {
|
||||||
this.operationStack.push({
|
this.operationStack.push({
|
||||||
operator,
|
operator,
|
||||||
operand
|
operand,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1584,19 +1583,19 @@ export default {
|
||||||
*/
|
*/
|
||||||
clearOperationStack() {
|
clearOperationStack() {
|
||||||
this.operationStack = []
|
this.operationStack = []
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
curRow() {
|
curRow() {
|
||||||
const [selectedKey] = this.selectedKeys
|
const [selectedKey] = this.selectedKeys
|
||||||
const findIndex = this.list.findIndex(item => item.index == selectedKey)
|
const findIndex = this.list.findIndex((item) => item.index == selectedKey)
|
||||||
return findIndex
|
return findIndex
|
||||||
},
|
},
|
||||||
|
|
||||||
isOperationStackEmpty() {
|
isOperationStackEmpty() {
|
||||||
return this.operationStack.length == 0
|
return this.operationStack.length == 0
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -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>
|
|
@ -52,6 +52,12 @@ import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder
|
||||||
export default {
|
export default {
|
||||||
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
|
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
|
||||||
mixins: [ModalMixin, SampleDataMixin],
|
mixins: [ModalMixin, SampleDataMixin],
|
||||||
|
props: {
|
||||||
|
sampleList: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currTab: 'gamma',
|
currTab: 'gamma',
|
||||||
|
@ -85,6 +91,28 @@ export default {
|
||||||
this.gammaEnergyValid = val
|
this.gammaEnergyValid = val
|
||||||
},
|
},
|
||||||
handleReAnalyse() {
|
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 = {
|
let params = {
|
||||||
applyType: this.newCalibrationIsAppliedTo,
|
applyType: this.newCalibrationIsAppliedTo,
|
||||||
sampleData: this.recalculateROICountsFor.includes('sample') ? true : false,
|
sampleData: this.recalculateROICountsFor.includes('sample') ? true : false,
|
||||||
|
@ -93,13 +121,14 @@ export default {
|
||||||
qcData: this.recalculateROICountsFor.includes('qc') ? true : false,
|
qcData: this.recalculateROICountsFor.includes('qc') ? true : false,
|
||||||
betaEnergyValid: this.betaEnergyValid,
|
betaEnergyValid: this.betaEnergyValid,
|
||||||
gammaEnergyValid: this.gammaEnergyValid,
|
gammaEnergyValid: this.gammaEnergyValid,
|
||||||
dbNames: [this.newSampleData.dbName],
|
dbNames,
|
||||||
sampleIds: [this.newSampleData.sampleId ? this.newSampleData.sampleId : ''],
|
sampleIds,
|
||||||
sampleFileNames: [this.newSampleData.inputFileName],
|
sampleFileNames,
|
||||||
gasFileNames: [this.newSampleData.gasFileName],
|
gasFileNames,
|
||||||
detFileNames: [this.newSampleData.detFileName],
|
detFileNames,
|
||||||
qcFileNames: [this.newSampleData.qcFileName],
|
qcFileNames,
|
||||||
currentFileName: this.newSampleData.inputFileName,
|
currentFileName: this.newSampleData.inputFileName,
|
||||||
|
currentQCFileName: this.newSampleData.qcFileName,
|
||||||
}
|
}
|
||||||
postAction('/spectrumAnalysis/ReAnalyse', params).then((res) => {
|
postAction('/spectrumAnalysis/ReAnalyse', params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
|
@ -116,11 +116,6 @@ export default {
|
||||||
AdditionalInfo,
|
AdditionalInfo,
|
||||||
Notes,
|
Notes,
|
||||||
},
|
},
|
||||||
props: {
|
|
||||||
sampleData: {
|
|
||||||
type: Object,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
this.tabs = tabs
|
this.tabs = tabs
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -39,7 +39,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleOk() {
|
handleOk() {
|
||||||
this.$emit('save', this.saveFormat)
|
this.$emit('save', this.saveFormat, this.saveAll)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<div v-if="item.children" :key="index">
|
<div v-if="item.children" :key="index">
|
||||||
<a-menu class="multi-level-menu-sub-menu">
|
<a-menu class="multi-level-menu-sub-menu">
|
||||||
<template v-for="child in item.children">
|
<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 }}
|
{{ child.title }}
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</template>
|
</template>
|
||||||
|
@ -22,23 +22,23 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
children: {
|
children: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
},
|
},
|
||||||
width: {
|
width: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'auto'
|
default: 'auto',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleMenuClick(item) {
|
handleMenuClick(item) {
|
||||||
if (!item.children) {
|
// if (!item.children) {
|
||||||
this.$emit('menuClick', item)
|
this.$emit('menuClick', item)
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
handleSubMenuClick(item, child) {
|
handleSubMenuClick(item, child) {
|
||||||
this.$emit('submenuClick', { item, child })
|
this.$emit('submenuClick', { item, child })
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -413,7 +413,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
initWebSocket: function () {
|
initWebSocket: function () {
|
||||||
console.log('qweqwerq')
|
|
||||||
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
||||||
var userId = store.getters.userInfo.id
|
var userId = store.getters.userInfo.id
|
||||||
var url =
|
var url =
|
||||||
|
|
|
@ -10,7 +10,10 @@
|
||||||
:overlay-style="operation.style"
|
:overlay-style="operation.style"
|
||||||
:key="operation.title"
|
: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">
|
<div slot="overlay">
|
||||||
<template v-for="(child, index) in operation.children">
|
<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">
|
<component v-if="child.show !== false" :is="child.type" :key="index" v-bind="child.attrs" v-on="child.on">
|
||||||
|
@ -165,6 +168,7 @@
|
||||||
<!-- Beta-Gamma 的Energy Calibration开始 -->
|
<!-- Beta-Gamma 的Energy Calibration开始 -->
|
||||||
<beta-gamma-energy-calibration-modal
|
<beta-gamma-energy-calibration-modal
|
||||||
v-model="betaGammaEnergyCalibrationModalVisible"
|
v-model="betaGammaEnergyCalibrationModalVisible"
|
||||||
|
:sampleList="sampleList"
|
||||||
@sendInfo="getCheckFlag"
|
@sendInfo="getCheckFlag"
|
||||||
@sendXeData="getXeData"
|
@sendXeData="getXeData"
|
||||||
/>
|
/>
|
||||||
|
@ -190,12 +194,13 @@
|
||||||
<!-- Beta-Gamma 的 QC Result 弹窗 结束 -->
|
<!-- Beta-Gamma 的 QC Result 弹窗 结束 -->
|
||||||
|
|
||||||
<!-- Beta-Gamma 的 RLR 弹窗 -->
|
<!-- Beta-Gamma 的 RLR 弹窗 -->
|
||||||
<beta-gamma-rlr-modal v-model="betaGammaRlrModalVisible" :sampleData="sampleData" />
|
<beta-gamma-rlr-modal v-model="betaGammaRlrModalVisible" />
|
||||||
<!-- Beta-Gamma 的 RLR 弹窗 结束 -->
|
<!-- Beta-Gamma 的 RLR 弹窗 结束 -->
|
||||||
|
|
||||||
<!-- Beta-Gamma 的 Statistics Paramer History 弹窗 -->
|
<!-- Beta-Gamma 的 Statistics Paramer History 弹窗 -->
|
||||||
<statistics-paramer-history-modal v-model="statisticsParamerHistoryModalVisible" />
|
<statistics-paramer-history-modal v-model="statisticsParamerHistoryModalVisible" />
|
||||||
<!-- Beta-Gamma 的 Statistics Paramer History 弹窗 结束 -->
|
<!-- Beta-Gamma 的 Statistics Paramer History 弹窗 结束 -->
|
||||||
|
<bg-log-viewer v-model="bgLogViewerVisible" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -239,6 +244,7 @@ import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/Bet
|
||||||
import { getAction } from '@/api/manage'
|
import { getAction } from '@/api/manage'
|
||||||
import { clearSampleCache } from './clearSampleCache'
|
import { clearSampleCache } from './clearSampleCache'
|
||||||
import { fetchAndDownload } from '@/utils/file'
|
import { fetchAndDownload } from '@/utils/file'
|
||||||
|
import BGLogViewer from './components/Modals/BetaGammaModals/BGLogViewer.vue'
|
||||||
|
|
||||||
// 分析类型
|
// 分析类型
|
||||||
const ANALYZE_TYPE = {
|
const ANALYZE_TYPE = {
|
||||||
|
@ -283,6 +289,7 @@ export default {
|
||||||
BetaGammaEnergyCalibrationModal,
|
BetaGammaEnergyCalibrationModal,
|
||||||
AutomaticAnalysisLogModal,
|
AutomaticAnalysisLogModal,
|
||||||
BetaGammaExtrapolationModal,
|
BetaGammaExtrapolationModal,
|
||||||
|
BgLogViewer: BGLogViewer,
|
||||||
},
|
},
|
||||||
|
|
||||||
provide() {
|
provide() {
|
||||||
|
@ -360,6 +367,7 @@ export default {
|
||||||
betaGammaQCResultsModalVisible: false, // beta-gamma QC Result 弹窗
|
betaGammaQCResultsModalVisible: false, // beta-gamma QC Result 弹窗
|
||||||
betaGammaRlrModalVisible: false, // beta-gamma RLR 弹窗
|
betaGammaRlrModalVisible: false, // beta-gamma RLR 弹窗
|
||||||
statisticsParamerHistoryModalVisible: false, // beta-gamma Statistics Paramer History 弹窗
|
statisticsParamerHistoryModalVisible: false, // beta-gamma Statistics Paramer History 弹窗
|
||||||
|
bgLogViewerVisible: false, // beta-gamma Log 下的BG log viewer 弹窗
|
||||||
analyseCurrentSpectrumData: {},
|
analyseCurrentSpectrumData: {},
|
||||||
resultDisplayFlag: [],
|
resultDisplayFlag: [],
|
||||||
params_toDB: {
|
params_toDB: {
|
||||||
|
@ -387,6 +395,8 @@ export default {
|
||||||
updateFlag: '2',
|
updateFlag: '2',
|
||||||
isReAnalyed_gamma: false,
|
isReAnalyed_gamma: false,
|
||||||
isReAnalyed_beta: false,
|
isReAnalyed_beta: false,
|
||||||
|
|
||||||
|
isSaving: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -409,7 +419,6 @@ export default {
|
||||||
this.isReAnalyed_gamma = val
|
this.isReAnalyed_gamma = val
|
||||||
},
|
},
|
||||||
getUpdateFlag(val) {
|
getUpdateFlag(val) {
|
||||||
console.log('qerq', val)
|
|
||||||
this.updateFlag = val
|
this.updateFlag = val
|
||||||
},
|
},
|
||||||
getcommentsInfo(val) {
|
getcommentsInfo(val) {
|
||||||
|
@ -492,13 +501,39 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 保存结果到文件, 服务端生成文件,前端下载
|
// 保存结果到文件, 服务端生成文件,前端下载
|
||||||
async handleSaveResultsToFile(saveFormat) {
|
async handleSaveResultsToFile(saveFormat, isSaveAll = false) {
|
||||||
|
this.isSaving = true
|
||||||
if (this.isGamma) {
|
if (this.isGamma) {
|
||||||
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
|
if (!isSaveAll) {
|
||||||
let params = {
|
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
|
||||||
fileName: this.newSampleData.inputFileName,
|
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) {
|
if (this.isBetaGamma) {
|
||||||
const url =
|
const url =
|
||||||
|
@ -523,8 +558,13 @@ export default {
|
||||||
this.params_toDB.detFileName = this.newSampleData.detFileName
|
this.params_toDB.detFileName = this.newSampleData.detFileName
|
||||||
this.params_toDB.qcFileName = this.newSampleData.qcFileName
|
this.params_toDB.qcFileName = this.newSampleData.qcFileName
|
||||||
this.params_toDB.dbName = this.newSampleData.dbName
|
this.params_toDB.dbName = this.newSampleData.dbName
|
||||||
|
try {
|
||||||
fetchAndDownload(url, this.params_toDB)
|
await fetchAndDownload(url, this.params_toDB)
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
this.isSaving = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -615,7 +655,7 @@ export default {
|
||||||
})
|
})
|
||||||
|
|
||||||
// 处理当前的谱的reprocessing
|
// 处理当前的谱的reprocessing
|
||||||
if(inputFileName && sampleType !== 'B') {
|
if (inputFileName && sampleType !== 'B') {
|
||||||
this.$refs.gammaAnalysisRef.reProcessing(false)
|
this.$refs.gammaAnalysisRef.reProcessing(false)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -700,7 +740,6 @@ export default {
|
||||||
}
|
}
|
||||||
postAction('/spectrumAnalysis/analyseAllSpectrum', params).then((res) => {
|
postAction('/spectrumAnalysis/analyseAllSpectrum', params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
console.log(res)
|
|
||||||
this.analyseCurrentSpectrumData = res.result
|
this.analyseCurrentSpectrumData = res.result
|
||||||
this.resultDisplayFlag = res.result.XeData
|
this.resultDisplayFlag = res.result.XeData
|
||||||
this.resultDisplayFlag.forEach((item) => {
|
this.resultDisplayFlag.forEach((item) => {
|
||||||
|
@ -802,6 +841,7 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'SAVE',
|
title: 'SAVE',
|
||||||
|
loading: this.isSaving,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: 'MultiLevelMenu',
|
type: 'MultiLevelMenu',
|
||||||
|
@ -810,6 +850,23 @@ export default {
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
title: 'Save Results to File',
|
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',
|
title: 'Save Results to DB',
|
||||||
|
@ -821,6 +878,7 @@ export default {
|
||||||
{
|
{
|
||||||
title: 'Save All',
|
title: 'Save All',
|
||||||
key: 'all',
|
key: 'all',
|
||||||
|
show: this.isGamma,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
key: 'resultsToDB',
|
key: 'resultsToDB',
|
||||||
|
@ -845,14 +903,21 @@ export default {
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
menuClick: () => {
|
menuClick: () => {
|
||||||
console.log(this.isBetaGamma, this.isGamma)
|
if (this.isGamma) {
|
||||||
this.saveSettingModalVisible = true
|
this.saveSettingModalVisible = true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
submenuClick: ({ item, child }) => {
|
submenuClick: ({ item, child }) => {
|
||||||
if (item.key == 'resultsToDB') {
|
if (item.key == 'resultsToDB') {
|
||||||
this.handleSaveResultsToDB(child.key)
|
this.handleSaveResultsToDB(child.key)
|
||||||
} else if (item.key == 'phdToFile') {
|
} else if (item.key == 'phdToFile') {
|
||||||
this.handleSavePHDToFile(child.key)
|
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 +1113,6 @@ export default {
|
||||||
type: 'a-menu-item',
|
type: 'a-menu-item',
|
||||||
title: 'ARR',
|
title: 'ARR',
|
||||||
handler: () => {
|
handler: () => {
|
||||||
console.log(this.newSampleData)
|
|
||||||
if (this.newSampleData.sampleId) {
|
if (this.newSampleData.sampleId) {
|
||||||
this.arrOrRRRModalVisible = true
|
this.arrOrRRRModalVisible = true
|
||||||
this.arrOrRRRModalExtraData = {}
|
this.arrOrRRRModalExtraData = {}
|
||||||
|
@ -1196,7 +1260,9 @@ export default {
|
||||||
type: 'a-menu-item',
|
type: 'a-menu-item',
|
||||||
title: 'BG log viewer',
|
title: 'BG log viewer',
|
||||||
show: this.isBetaGamma,
|
show: this.isBetaGamma,
|
||||||
handler: () => {},
|
handler: () => {
|
||||||
|
this.bgLogViewerVisible = true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'a-menu-item',
|
type: 'a-menu-item',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user