Compare commits

...

5 Commits

8 changed files with 268 additions and 26 deletions

View File

@ -322,7 +322,7 @@ export default {
updateSampleData({ updateSampleData({
inputFileName, inputFileName,
key: 'isReprocessed', key: 'savedAnalysisResult',
data: true, data: true,
}) })
}, },

View File

@ -1,5 +1,5 @@
<template> <template>
<custom-modal v-model="visible" title="Beta" width="800px" destroy-on-close> <custom-modal v-model="visible" title="Beta" width="800px" destroy-on-close enable-full-screen>
<div class="beta-modal"> <div class="beta-modal">
<div class="beta-modal__header"> <div class="beta-modal__header">
<span class="count">Channel: {{ axisInfo.channel }}</span> <span class="count">Channel: {{ axisInfo.channel }}</span>
@ -7,15 +7,31 @@
<span class="energy">Energy: {{ axisInfo.energy }}</span> <span class="energy">Energy: {{ axisInfo.energy }}</span>
</div> </div>
<div class="beta-modal__content"> <div class="beta-modal__content">
<custom-chart :option="option" autoresize /> <CustomChart
ref="chartRef"
:option="option"
:opts="opts"
autoresize
@zr:mousedown="handleMouseDown"
@zr:mouseup="handleMouseUp"
@brushEnd="handleBrushEnd"
/>
</div> </div>
</div> </div>
<template slot="custom-footer">
<div style="text-align: center">
<a-space>
<a-button type="success" @click="handleUnzoom">Unzoom</a-button>
<a-button type="warn" @click="visible = false">Cancel</a-button>
</a-space>
</div>
</template>
</custom-modal> </custom-modal>
</template> </template>
<script> <script>
import CustomChart from '@/components/CustomChart/index.vue' import CustomChart from '@/components/CustomChart/index.vue'
import { buildLineSeries } from '@/utils/chartHelper' import { buildLineSeries, getAxisMax, rangeNumber } from '@/utils/chartHelper'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
const initialOption = { const initialOption = {
@ -96,6 +112,7 @@ const initialOption = {
max: 'dataMax', max: 'dataMax',
}, },
series: buildLineSeries('Line', [], 'yellow'), series: buildLineSeries('Line', [], 'yellow'),
brush: {},
} }
const initialAxisInfo = { const initialAxisInfo = {
@ -113,6 +130,10 @@ export default {
visible: false, visible: false,
option: cloneDeep(initialOption), option: cloneDeep(initialOption),
axisInfo: cloneDeep(initialAxisInfo), axisInfo: cloneDeep(initialAxisInfo),
opts: {
notMerge: false,
},
} }
}, },
created() { created() {
@ -124,6 +145,17 @@ export default {
this.energys = energys || [] this.energys = energys || []
this.axisInfo = cloneDeep(initialAxisInfo) this.axisInfo = cloneDeep(initialAxisInfo)
this.visible = true this.visible = true
this.$nextTick(() => {
this.option.brush = { toolbox: [] }
this.handleUnzoom()
})
},
handleUnzoom() {
this.option.xAxis.min = 0
this.option.xAxis.max = 512
this.option.yAxis.min = 1
this.option.yAxis.max = 'dataMax'
}, },
handleTooltipFormat(params) { handleTooltipFormat(params) {
@ -134,6 +166,81 @@ export default {
energy: (this.energys[channel] || 0).toFixed(3), energy: (this.energys[channel] || 0).toFixed(3),
} }
}, },
getChart() {
return this.$refs.chartRef.getChartInstance()
},
//
handleMouseDown() {
const chart = this.getChart()
chart.dispatchAction({
type: 'takeGlobalCursor',
//
key: 'brush',
brushOption: {
// brush brushType false
brushType: 'rect',
},
})
},
handleMouseUp() {
this.$nextTick(() => {
this.clearBrush()
})
},
clearBrush() {
const chart = this.getChart()
//
chart.dispatchAction({
type: 'brush',
areas: [],
})
//
chart.dispatchAction({
type: 'takeGlobalCursor',
})
},
//
handleBrushEnd(param) {
const chart = this.getChart()
const areas = param.areas[0]
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 xAxisMax = getAxisMax(chart, 'xAxis')
const yAxisMax = getAxisMax(chart, 'yAxis')
//
const xAxisMin = this.option.xAxis.min
const yAxisMin = this.option.yAxis.min
let [x1, y2, x2, y1] = [...point1, ...point2] //
const xAxisLimit = rangeNumber(xAxisMin, xAxisMax)
const yAxisLimit = rangeNumber(yAxisMin, yAxisMax)
x1 = xAxisLimit(x1)
x2 = xAxisLimit(x2)
y1 = yAxisLimit(y1)
y2 = yAxisLimit(y2)
this.option.xAxis.min = x1
this.option.xAxis.max = x2
this.option.yAxis.min = y1
this.option.yAxis.max = y2
}
},
}, },
} }
</script> </script>
@ -169,4 +276,16 @@ export default {
overflow: hidden; overflow: hidden;
} }
} }
.fullscreen {
::v-deep {
.ant-modal-body {
height: calc(100% - 93px);
.beta-modal {
height: 100%;
}
}
}
}
</style> </style>

View File

@ -80,11 +80,10 @@ export default {
console.log('gammaEnergyValid>>>' + this.gammaEnergyValid) console.log('gammaEnergyValid>>>' + this.gammaEnergyValid)
}, },
async handleReAnalyse() { async handleReAnalyse() {
const { const { data } = getSampleData(this.newSampleData.inputFileName)
data: { isReprocessed }, const { savedAnalysisResult } = data
} = getSampleData(this.newSampleData.inputFileName)
if (!isReprocessed) { if (!savedAnalysisResult) {
this.$message.warning('Please analyze the spectrum first') this.$message.warning('Please analyze the spectrum first')
return return
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<custom-modal v-model="visible" title="Gamma" width="800px" destroy-on-close> <custom-modal v-model="visible" title="Gamma" width="800px" destroy-on-close enable-full-screen>
<div class="gamma-modal"> <div class="gamma-modal">
<div class="gamma-modal__header"> <div class="gamma-modal__header">
<span class="count">Channel: {{ axisInfo.channel }}</span> <span class="count">Channel: {{ axisInfo.channel }}</span>
@ -7,15 +7,31 @@
<span class="energy">Energy: {{ axisInfo.energy }}</span> <span class="energy">Energy: {{ axisInfo.energy }}</span>
</div> </div>
<div class="gamma-modal__content"> <div class="gamma-modal__content">
<custom-chart :option="option" autoresize /> <CustomChart
ref="chartRef"
:option="option"
:opts="opts"
autoresize
@zr:mousedown="handleMouseDown"
@zr:mouseup="handleMouseUp"
@brushEnd="handleBrushEnd"
/>
</div> </div>
</div> </div>
<template slot="custom-footer">
<div style="text-align: center">
<a-space>
<a-button type="success" @click="handleUnzoom">Unzoom</a-button>
<a-button type="warn" @click="visible = false">Cancel</a-button>
</a-space>
</div>
</template>
</custom-modal> </custom-modal>
</template> </template>
<script> <script>
import CustomChart from '@/components/CustomChart/index.vue' import CustomChart from '@/components/CustomChart/index.vue'
import { buildLineSeries } from '@/utils/chartHelper' import { buildLineSeries, getAxisMax, rangeNumber } from '@/utils/chartHelper'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
const initialOption = { const initialOption = {
@ -96,6 +112,7 @@ const initialOption = {
max: 'dataMax', max: 'dataMax',
}, },
series: buildLineSeries('Line', [], 'yellow'), series: buildLineSeries('Line', [], 'yellow'),
brush: {},
} }
const initialAxisInfo = { const initialAxisInfo = {
@ -113,6 +130,10 @@ export default {
visible: false, visible: false,
option: cloneDeep(initialOption), option: cloneDeep(initialOption),
axisInfo: cloneDeep(initialAxisInfo), axisInfo: cloneDeep(initialAxisInfo),
opts: {
notMerge: false,
},
} }
}, },
created() { created() {
@ -124,6 +145,17 @@ export default {
this.energys = energys || [] this.energys = energys || []
this.axisInfo = cloneDeep(initialAxisInfo) this.axisInfo = cloneDeep(initialAxisInfo)
this.visible = true this.visible = true
this.$nextTick(() => {
this.option.brush = { toolbox: [] }
this.handleUnzoom()
})
},
handleUnzoom() {
this.option.xAxis.min = 0
this.option.xAxis.max = 4096
this.option.yAxis.min = 1
this.option.yAxis.max = 'dataMax'
}, },
handleTooltipFormat(params) { handleTooltipFormat(params) {
@ -134,6 +166,81 @@ export default {
energy: (this.energys[channel] || 0).toFixed(3), energy: (this.energys[channel] || 0).toFixed(3),
} }
}, },
getChart() {
return this.$refs.chartRef.getChartInstance()
},
//
handleMouseDown() {
const chart = this.getChart()
chart.dispatchAction({
type: 'takeGlobalCursor',
//
key: 'brush',
brushOption: {
// brush brushType false
brushType: 'rect',
},
})
},
handleMouseUp() {
this.$nextTick(() => {
this.clearBrush()
})
},
clearBrush() {
const chart = this.getChart()
//
chart.dispatchAction({
type: 'brush',
areas: [],
})
//
chart.dispatchAction({
type: 'takeGlobalCursor',
})
},
//
handleBrushEnd(param) {
const chart = this.getChart()
const areas = param.areas[0]
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 xAxisMax = getAxisMax(chart, 'xAxis')
const yAxisMax = getAxisMax(chart, 'yAxis')
//
const xAxisMin = this.option.xAxis.min
const yAxisMin = this.option.yAxis.min
let [x1, y2, x2, y1] = [...point1, ...point2] //
const xAxisLimit = rangeNumber(xAxisMin, xAxisMax)
const yAxisLimit = rangeNumber(yAxisMin, yAxisMax)
x1 = xAxisLimit(x1)
x2 = xAxisLimit(x2)
y1 = yAxisLimit(y1)
y2 = yAxisLimit(y2)
this.option.xAxis.min = x1
this.option.xAxis.max = x2
this.option.yAxis.min = y1
this.option.yAxis.max = y2
}
},
}, },
} }
</script> </script>
@ -169,4 +276,16 @@ export default {
overflow: hidden; overflow: hidden;
} }
} }
.fullscreen {
::v-deep {
.ant-modal-body {
height: calc(100% - 93px);
.gamma-modal {
height: 100%;
}
}
}
}
</style> </style>

View File

@ -96,7 +96,7 @@ export default {
async getInfo() { async getInfo() {
try { try {
this.isLoading = true this.isLoading = true
const { sampleFileName } = this.sampleData const { inputFileName: sampleFileName } = this.sampleData
const { success, result, message } = await getAction('/selfStation/peakInformation', { const { success, result, message } = await getAction('/selfStation/peakInformation', {
sampleFileName, sampleFileName,
}) })

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="beta-gamma-spectrum" :class="{ 'has-max': isMax }"> <div class="beta-gamma-spectrum" :class="{ 'has-max': isMax }">
<roi-limit-item <roi-limit-item
v-for="(_, index) in 4" v-for="(item, index) in RoiTitleNames"
:key="index" :key="index"
:title="`ROI${index + 1}`" :title="`ROI${index + 1}: ${item}`"
:title-color="RoiTitleColors[index]" :title-color="RoiTitleColors[index]"
:roi-list="ROILists[index]" :roi-list="ROILists[index]"
:analyze-result="ROIAnalyzeLists[index]" :analyze-result="ROIAnalyzeLists[index]"
@ -18,6 +18,8 @@ import CustomChart from '@/components/CustomChart/index.vue'
import RoiLimitItem from './components/RoiLimitItem.vue' import RoiLimitItem from './components/RoiLimitItem.vue'
const RoiTitleColors = ['#0CB4C1', '#1B88E5', '#43960C', '#D09324'] const RoiTitleColors = ['#0CB4C1', '#1B88E5', '#43960C', '#D09324']
const RoiTitleNames = ['XE-131m', 'XE-133m', 'XE-133', 'XE-135']
// 线 // 线
export default { export default {
components: { components: {
@ -39,6 +41,7 @@ export default {
return { return {
isMax: false, isMax: false,
RoiTitleNames,
} }
}, },
methods: { methods: {

View File

@ -515,10 +515,10 @@ export default {
align-items: center; align-items: center;
&-title { &-title {
width: 46px; width: 100px;
height: 100%; height: 100%;
line-height: 18px; line-height: 18px;
text-align: center; padding-left: 5px;
font-family: ArialMT; font-family: ArialMT;
font-size: 12px; font-size: 12px;
cursor: pointer; cursor: pointer;

View File

@ -657,7 +657,9 @@ export default {
dbName, dbName,
analyst: analyst ? analyst : null, analyst: analyst ? analyst : null,
sampleFileName, sampleFileName,
gasFileName,
detFileName, detFileName,
qcFileName,
} }
getAction('/selfStation/initValue', params) getAction('/selfStation/initValue', params)
} }
@ -1110,20 +1112,20 @@ export default {
// //
handleHelp() { handleHelp() {
let docPath = null let docPath = null
let apiBaseUrl = window._CONFIG['onlinePreviewDomainURL'] || "/jeecg-boot"; let apiBaseUrl = window._CONFIG['onlinePreviewDomainURL'] || '/jeecg-boot'
if(this.isGamma) { if (this.isGamma) {
docPath = `/armd-help/Gamma.pdf`; docPath = `/armd-help/Gamma.pdf`
} else if (this.isBeta) { } else if (this.isBeta) {
docPath = `/armd-help/Self-Beta-Gamma.pdf`; docPath = `/armd-help/Self-Beta-Gamma.pdf`
} else if(this.isBetaGamma) { } else if (this.isBetaGamma) {
docPath = `/armd-help/Beta-Gamma.pdf`; docPath = `/armd-help/Beta-Gamma.pdf`
} }
if(!docPath) { if (!docPath) {
this.$message.warning('Please load an spectrum first!') this.$message.warning('Please load an spectrum first!')
return ; return
} }
window.open(apiBaseUrl + docPath, '_blank'); window.open(apiBaseUrl + docPath, '_blank')
console.log('%c [ handleHelp ]-221', 'font-size:13px; background:pink; color:#bf2c9f;') console.log('%c [ handleHelp ]-221', 'font-size:13px; background:pink; color:#bf2c9f;')
}, },