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

This commit is contained in:
xiaoguangbin 2023-10-19 15:47:02 +08:00
commit a59ebff589
22 changed files with 1209 additions and 487 deletions

View File

@ -6,7 +6,7 @@ import * as echarts from 'echarts'
import 'echarts-gl'
const events = ['click', 'brushEnd']
const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick']
const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick', 'contextmenu']
export default {
props: {
option: {

View File

@ -251,7 +251,6 @@ export default {
if (success) {
this.sampleDetail = result
this.changeChartByType('sample')
this.isLoading = false
this.$emit('getFiles', {
detFileName: result.detBg.fileName,
gasFileName: result.gasBg.fileName,
@ -262,6 +261,8 @@ export default {
}
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
async getSampleDetail_file() {
@ -323,7 +324,6 @@ export default {
histogramDataDList, // Beta-Gamma Spectrum: Sample 3D
Boundary, // 2d
XeData, // Result Display
spectrumData,
AcqTimeBtn, // QC Flags
@ -333,6 +333,10 @@ export default {
GasBgBtn, // QC Flags
DetBgBtn, // QC Flags
} = this.sampleDetail[this.spectraType]
const {
XeData, // Result Display
savedAnalysisResult,
} = this.sampleDetail
this.spectrumData = spectrumData
@ -348,9 +352,9 @@ export default {
this.betaProjectedData = betaProjectedData
this.betaEnergyData = betaEnergyData
this.resultDisplay = XeData
this.resultDisplay = this.resultDisplay.length > 0 ? this.resultDisplay : XeData
this.$emit('sendInfo', this.resultDisplay, this.spectrumData.stationCode)
this.$emit('sendInfo', this.resultDisplay, this.spectrumData.stationCode, savedAnalysisResult)
this.qcFlags = {
AcqTimeBtn,
@ -432,6 +436,7 @@ export default {
watch: {
sample: {
handler(newVal, oldVal) {
this.resultDisplay = []
if (newVal.sampleId) {
this.getSampleDetail()
} else {
@ -443,8 +448,8 @@ export default {
},
analyseCurrentSpectrum: {
handler(newVal, oldVal) {
this.currResultDisplay = newVal.XeData
this.resultDisplay = newVal.XeData
// this.currResultDisplay = newVal.XeData
this.resultDisplay = newVal.XeData || []
},
immediate: true,
deep: true,

View File

@ -24,8 +24,8 @@
@brushEnd="handleBrushEnd"
/>
<div class="bar">
<color-palette v-model="currCount" :maxValue="4" />
<div>{{ currCount + 1 }}</div>
<color-palette v-model="currCount" />
<div>{{ currCount }}</div>
<div class="bar-main"></div>
<div>0</div>
</div>
@ -322,8 +322,7 @@ export default {
return {
active: 0,
maxCount: 15, // count
currCount: 15,
currCount: 50,
twoDOption,
threeDSurfaceOption,
@ -359,7 +358,7 @@ export default {
this.emitRangeChange([0, 256, 0, 256])
this.reDrawRect()
this.rangeScatter()
this.buildScatterList()
},
// ROI
@ -439,26 +438,33 @@ export default {
this.reDrawRect()
this.rangeScatter()
this.buildScatterList()
}
this.clearBrush(chart)
},
/**
* 因scatterGL 不受axis中max和min的控制手动处理溢出部分
*/
rangeScatter() {
// scatter
buildScatterList() {
const {
xAxis: { min: minX, max: maxX },
yAxis: { min: minY, max: maxY }
} = this.twoDOption
const data = this.histogramDataList
this.twoDOption.series.data = this.histogramDataDList
.filter(({ b, g, c }) => c && b >= minX && b <= maxX && g >= minY && g <= maxY)
.map(({ b, g, c }) => [b, g, c])
.map(({ b, g, c }) => this.buildScatterItem(b, g, c))
},
this.twoDOption.series.data = data
// scatter
buildScatterItem(xAxis, yAxis, count) {
const { r, g, b } = this.interpolateColor(1 - (count / this.currCount))
return {
value: [xAxis, yAxis],
itemStyle: {
color: `rgb(${r}, ${g}, ${b})`
}
}
},
//
@ -482,7 +488,7 @@ export default {
}
this.reDrawRect()
this.rangeScatter()
this.buildScatterList()
},
//
@ -713,7 +719,10 @@ export default {
},
//
interpolateColor(color1, color2, percentage) {
interpolateColor(percentage) {
const color1 = { r: 255, g: 0, b: 0 },
color2 = { r: 255, g: 255, b: 255 }
const r = color1.r + (color2.r - color1.r) * percentage
const g = color1.g + (color2.g - color1.g) * percentage
const b = color1.b + (color2.b - color1.b) * percentage
@ -723,10 +732,9 @@ export default {
watch: {
// 2D
histogramDataList: {
handler(newVal) {
handler() {
this.active = 0
this.twoDOption.series.data = newVal.filter(item => item.c).map(item => [item.b, item.g, item.c]) // 2D Scatter
this.rangeScatter()
this.buildScatterList()
},
immediate: true
},
@ -759,18 +767,8 @@ export default {
},
currCount: {
handler(val) {
if (val <= this.maxCount) {
const { r, g, b } = this.interpolateColor(
{ r: 255, g: 0, b: 0 },
{ r: 255, g: 255, b: 255 },
val / this.maxCount
)
this.twoDOption.series.itemStyle.color = `rgb(${r}, ${g}, ${b})`
} else {
this.twoDOption.series.itemStyle.color = '#fff'
}
handler() {
this.buildScatterList()
},
immediate: true
}

View File

@ -23,16 +23,19 @@
</template>
<script>
const startRange = [0, 36], // 1
endRange = [324, 360], // 50
angleRange = [startRange]
for (let i = 0; i <= 47; i++) {
angleRange.push([36 + i * 6, 36 + (i + 1) * 6])
}
angleRange.push(endRange)
export default {
props: {
value: {
type: Number,
default: 1
},
maxValue: {
type: Number,
default: 0
},
circleWidth: {
type: Number,
default: 26
@ -48,7 +51,8 @@ export default {
x: 0,
y: 0
},
isMouseDown: false
isMouseDown: false,
angleRange
}
},
methods: {
@ -79,16 +83,23 @@ export default {
},
setPositionByMouseEvent(offsetX, offsetY) {
const { degree, radian } = this.getDegree([offsetX, offsetY])
for (let index = 0; index < this.range; index++) {
if (degree >= this.perDegree * index && degree < this.perDegree * (index + 1)) {
this.$emit('input', index)
const { angle } = this.getDegree([offsetX, offsetY])
for (let i = 0; i < this.angleRange.length; i++) {
const [start, end] = this.angleRange[i]
if (angle >= start && angle <= end) {
const center = (start + end) / 2
const radian = (center * Math.PI) / 180
this.setDotPosition(radian)
this.$emit('input', i + 1)
break
}
}
this.setDotPosition(radian)
},
/**
* 设置圆点位置
* @param {*} radian
*/
setDotPosition(radian) {
const circleRadius = this.circleWidth / 2 //
const dotRadius = circleRadius - this.dotWidth //
@ -102,6 +113,7 @@ export default {
/**
* 根据圆心和某个点计算从圆心到该点的角度
* @returns { { radian: number; angle: number; } } radian: 弧度 angle: 角度
*/
getDegree(point) {
// x y
@ -112,13 +124,13 @@ export default {
const deltaY = pointY - circleRadius
// 使
const radian = Math.atan2(deltaX, deltaY)
let degree = radian * (180 / Math.PI)
if (degree < 0) {
degree = 360 + degree
let angle = radian * (180 / Math.PI)
if (angle < 0) {
angle = 360 + angle
}
return {
radian,
degree
angle
}
}
},
@ -126,22 +138,13 @@ export default {
watch: {
value: {
handler(newVal) {
const degree = newVal * this.perDegree
const radian = (degree * Math.PI) / 180 //
const [start, end] = this.angleRange[newVal - 1]
const center = (start + end) / 2
const radian = (center * Math.PI) / 180 //
this.setDotPosition(radian)
},
immediate: true
}
},
computed: {
range() {
return this.maxValue > 50 ? this.maxValue : 50
},
perDegree() {
return 360 / this.range
}
}
}
</script>

View File

@ -6,16 +6,29 @@
<a-checkbox v-if="slot.isCheckbox" :key="index" v-model="record[slot.dataIndex]">
Fixed
</a-checkbox>
<a-input v-else :key="index" v-model="record[slot.dataIndex]" :readOnly="slot.isStatic"></a-input>
<a-input
v-else
:key="index"
v-model="record[slot.dataIndex]"
:readOnly="slot.isStatic"
@change="handleInput(record, slot.dataIndex)"
></a-input>
</template>
</custom-table>
</a-spin>
<div slot="custom-footer">
<a-space>
<a-button type="primary" :disabled="isCanceling || isLoading" :loading="isAcceptting" @click="handlePeaks">
<a-button
type="primary"
:disabled="isCanceling || isLoading"
:loading="isAcceptting"
@click="handlePeaks(true)"
>
Peaks
</a-button>
<a-button :disabled="isAcceptting || isLoading" :loading="isCanceling" @click="handleCancel">Cancel</a-button>
<a-button :disabled="isAcceptting || isLoading" :loading="isCanceling" @click="handlePeaks(false)"
>Cancel</a-button
>
</a-space>
</div>
</custom-modal>
@ -25,6 +38,7 @@
import { getAction, postAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import { cloneDeep } from 'lodash'
const columns = [
{
@ -116,8 +130,14 @@ const columns = [
export default {
mixins: [ModalMixin, SampleDataMixin],
props: {
curChan: {
channel_1: {
type: Number
},
channel_2: {
type: Number
},
isInsertPeak: {
type: Boolean
}
},
data() {
@ -129,18 +149,20 @@ export default {
}
},
methods: {
//
async handlePeaks() {
async handlePeaks(accept) {
try {
this.isAcceptting = true
const { inputFileName: fileName } = this.sampleData
const { success, result, message } = await postAction('/gamma/acceptResults', {
fileName,
accept: true
accept,
oldPeaks: this.oldPeaks,
newPeak: this.newPeaks,
flag: this.isInsertPeak ? 'insert' : 'fit'
})
if (success) {
this.visible = false
this.$emit('result', result)
this.$emit(accept ? 'result' : 'cancel', result)
} else {
this.$message.error(message)
}
@ -151,46 +173,51 @@ export default {
}
},
//
async handleCancel() {
try {
this.isCanceling = true
const { inputFileName: fileName } = this.sampleData
const { success, result, message } = await postAction('/gamma/acceptResults', {
fileName,
accept: false,
oldPeak: this.oldPeaks
})
if (success) {
this.visible = false
this.$emit('cancel', result)
} else {
this.$message.error(message)
//
handleInput(record, index) {
const find = this.newPeaks.find(item => item.index == record.lab)
if (find) {
const table2NewPeakMap = {
energy: 'energy',
netArea: 'area',
fwhm: 'fwhm'
}
} catch (error) {
console.error(error)
} finally {
this.isCanceling = false
find[table2NewPeakMap[index]] = record[index]
}
},
async getData() {
const { sampleId, inputFileName: fileName } = this.sampleData
try {
let url = '/gamma/fitPeak'
let params = {
left: this.channel_1,
right: this.channel_2,
fileName
}
// Insert Peak
if (this.isInsertPeak) {
url = '/gamma/insertPeak'
params = {
sampleId,
fileName,
curChan: Math.ceil(this.channel_1)
}
}
this.isLoading = true
const { sampleId, inputFileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/insertPeak', {
sampleId,
fileName: inputFileName,
curChan: Math.ceil(this.curChan)
})
const { success, result, message } = await getAction(url, params)
if (success) {
const { oldPeaks, tablePeaksList } = result
const { newPeaks, oldPeaks, tablePeaksList } = result
tablePeaksList.forEach(item => {
item.energy = Number(item.energy).toPrecision(6)
item.netArea = Number(item.netArea).toPrecision(6)
item.fwhm = Number(item.fwhm).toPrecision(6)
})
this.list = tablePeaksList
this.newPeaks = newPeaks
this.oldPeaks = oldPeaks
} else {
this.$message.error(message)

View File

@ -104,10 +104,10 @@
<a-button type="primary" :disabled="isOperationStackEmpty" @click="handleUndo">Undo</a-button>
</div>
<div class="peak-box-item">
<a-button type="primary" @click="handleReplot">Replot</a-button>
<a-button type="primary" :loading="isReploting" @click="handleReplot">Replot</a-button>
</div>
<div class="peak-box-item">
<a-button type="primary" @click="handleAccept">Accept</a-button>
<a-button type="primary" :loading="isAccepting" @click="handleAccept">Accept</a-button>
</div>
<div class="peak-box-item">
<a-button type="primary" @click="handleSwitchOperation">Cancel</a-button>
@ -181,7 +181,9 @@
<!-- Fit Peaks and Baseline弹窗 开始 -->
<fit-peaks-and-base-line-modal
v-model="fitPeaksAndBaselineModalVisible"
:curChan="currChannel"
:channel_1="channel_1"
:channel_2="channel_2"
:isInsertPeak="isInsertPeak"
@result="handleInsertSuccess"
@cancel="handleCancelSuccess"
/>
@ -461,13 +463,21 @@ export default {
model: cloneDeep(nuclideIdentifyModal),
currChannel: undefined, // currChannelchannel
channel_1: undefined, // Fit Peaks And Baseline Modal
channel_2: undefined,
isInsertPeak: false, // Peak
selectedTableItem: undefined, //
isModifying: false, //
isFitting: false, // Fit
firstFittingChannel: null, // Fitchannel
isAccepting: false,
isReploting: false,
operationStack: [] //
operationStack: [], //
replotNeeded: false
}
},
created() {
@ -517,25 +527,10 @@ export default {
this.energy = energy
this.BaseCtrls = BaseCtrls
this.FitBaseLine = FitBaseLine
this.barChart = barChart
const series = []
// BaseLine
series.push(this.buildBaseLine(channelBaseLineChart))
// Count
series.push(this.buildCountLine(channelCountChart))
// Peak
series.push(...this.buildPeaks(channelPeakChart))
// 线
series.push(this.buildCtrlPoint(channelBaseCPChart))
this.thumbnailOption.series = this.buildBarChart(barChart)
this.setChartOption(channelBaseLineChart, channelCountChart, channelPeakChart, channelBaseCPChart, barChart)
this.list = table
this.option.series = series
} else {
this.$message.error(message)
}
@ -544,11 +539,32 @@ export default {
}
},
setChartOption(baseLine, count, peaks, baseCP, bar) {
const series = []
// BaseLine
series.push(this.buildBaseLine(baseLine))
// Count
series.push(this.buildCountLine(count))
// Peak
series.push(...this.buildPeaks(peaks))
// 线
series.push(this.buildCtrlPoint(baseCP))
this.thumbnailOption.series = this.buildBarChart(bar)
this.option.series = series
},
reset() {
this.currChannel = undefined
this.btnGroupType = 1
this.opts.notMerge = false
this.isFitting = false
this.replotNeeded = false
this.$nextTick(() => {
this.option.brush = { toolbox: [] }
this.selectedKeys = []
@ -597,13 +613,12 @@ export default {
}
}
const selectedRow = this.list[index]
this.selectedKeys = [selectedRow.index]
this.getSelPosNuclide(selectedRow)
this.selectedTableItem = selectedRow
if (this.list.length) {
const selectedRow = this.list[index]
this.selectedKeys = [selectedRow.index]
this.getSelPosNuclide(selectedRow)
this.selectedTableItem = selectedRow
}
// Fit
if (this.isFitting) {
@ -636,6 +651,9 @@ export default {
return
}
this.channel_1 = left
this.channel_2 = right
this.isInsertPeak = false
this.fitPeaksAndBaselineModalVisible = true
this.isFitting = false
@ -737,7 +755,10 @@ export default {
return
}
this.channel_1 = this.currChannel
this.fitPeaksAndBaselineModalVisible = true
this.isInsertPeak = true
},
// Fit Peak XXX Peaks
@ -765,47 +786,32 @@ export default {
this.channelPeakChart = channelPeakChart
this.channelBaseLineChart = channelBaseLineChart
this.barChart = barChart
const series = []
// BaseLine
series.push(this.buildBaseLine(channelBaseLineChart))
// Count
series.push(this.buildCountLine(channelCountChart))
// Peak
series.push(...this.buildPeaks(channelPeakChart))
// 线
series.push(this.buildCtrlPoint(channelBaseCPChart))
this.thumbnailOption.series = this.buildBarChart(barChart)
this.setChartOption(
channelBaseLineChart,
this.channelCountChart,
channelPeakChart,
this.channelBaseCPChart,
barChart
)
this.list = table
this.option.series = series
},
// Fit Peak XXX Cancel
handleCancelSuccess(result) {
const { channelPeakChart, table } = result
this.channelPeakChart = channelPeakChart
const series = []
// BaseLine
series.push(this.buildBaseLine(this.channelBaseLineChart))
// Count
series.push(this.buildCountLine(this.channelCountChart))
// Peak
series.push(...this.buildPeaks(channelPeakChart))
// 线
series.push(this.buildCtrlPoint(this.channelBaseCPChart))
this.setChartOption(
this.channelBaseLineChart,
this.channelCountChart,
channelPeakChart,
this.channelBaseCPChart,
this.barChart
)
this.list = table
this.option.series = series
},
//
@ -1022,6 +1028,7 @@ export default {
if (this.btnGroupType == 1) {
this.btnGroupType = 2
this.baseCtrls_Copy = cloneDeep(this.BaseCtrls)
this.replotNeeded = false
// 线
const baseLineEditSeries = buildLineSeries(
@ -1042,7 +1049,10 @@ export default {
else {
this.btnGroupType = 1
this.opts.notMerge = true
this.option.series.splice(this.option.series.length - 1, 1) // 线
const baseLineEditSeries = findSeriesByName(this.option.series, 'BaseLine_Edit')
const index = this.option.series.findIndex(item => item == baseLineEditSeries)
this.option.series.splice(index, 1)
this.clearRect()
const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine')
@ -1051,6 +1061,8 @@ export default {
const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point')
baseLineCP.data = this.buildCPPointData(this.channelBaseCPChart)
this.redrawPeaks(this.channelPeakChart)
this.$nextTick(() => {
this.resetChartOpts()
})
@ -1090,6 +1102,7 @@ export default {
// 线
redrawBaseLine() {
this.replotNeeded = true
try {
console.time('updateBaseLine')
const res = updateBaseLine(JSON.stringify(this.baseCtrls_Copy))
@ -1105,6 +1118,14 @@ export default {
}
},
// Peaks
redrawPeaks(peakList) {
this.option.series = this.option.series.filter(item => {
return !item.name.includes('Peak_')
})
this.option.series.push(...this.buildPeaks(peakList))
},
/**
* 设置小方块可拖拽
*/
@ -1238,26 +1259,57 @@ export default {
},
// 线
handleReplot() {
const { xctrl, yctrl, yslope, baseline } = this.baseCtrls_Copy
const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine')
baseLineSeries.data = baseline.map((val, index) => [index + 1, val])
async handleReplot() {
if (!this.replotNeeded) {
return
}
try {
const { inputFileName: fileName } = this.sampleData
this.isReploting = true
const { success, result, message } = await postAction('/gamma/replotBaseLine', {
...this.baseCtrls_Copy,
fileName,
replotNeeded: this.replotNeeded
})
if (success) {
const { chartData, peakSet, shapeData } = result
const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point')
//
const firstCP = this.channelBaseCPChart[0]
const { color, size } = firstCP
const baseCPPoints = xctrl.map((xAxis, index) => {
return {
size,
color,
point: {
x: xAxis,
y: yctrl[index]
}
const { xctrl, yctrl, yslope, baseline } = this.baseCtrls_Copy
const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine')
baseLineSeries.data = baseline.map((val, index) => [index + 1, val])
const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point')
//
const firstCP = this.channelBaseCPChart[0]
const { color, size } = firstCP
const baseCPPoints = xctrl.map((xAxis, index) => {
return {
size,
color,
point: {
x: xAxis,
y: yctrl[index]
}
}
})
baseLineCP.data = this.buildCPPointData(baseCPPoints)
this.opts.notMerge = true
this.redrawPeaks(peakSet)
this.$nextTick(() => {
this.resetChartOpts()
})
this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
this.replotNeeded = false
} else {
this.$message.error(message)
}
})
baseLineCP.data = this.buildCPPointData(baseCPPoints)
} catch (error) {
console.error(error)
} finally {
this.isReploting = false
}
},
/**
@ -1278,31 +1330,75 @@ export default {
},
// Baseline Control Points
handleAccept() {
this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
const { baseline, xctrl, yctrl } = this.BaseCtrls
this.channelBaseLineChart.pointlist = baseline.map((val, index) => {
return {
x: index + 1,
y: val
async handleAccept() {
// this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
// const { baseline, xctrl, yctrl } = this.BaseCtrls
// this.channelBaseLineChart.pointlist = baseline.map((val, index) => {
// return {
// x: index + 1,
// y: val
// }
// })
// this.channelBaseCPChart = xctrl.map((val, index) => {
// return {
// color: this.channelBaseCPChart[0].color,
// name: index.toString(),
// point: {
// x: val,
// y: yctrl[index]
// },
// size: 4
// }
// })
const { inputFileName: fileName } = this.sampleData
try {
this.isAccepting = true
const { success, result, message } = await postAction('/gamma/acceptBaseLine', {
...this.baseCtrls_Copy,
fileName
})
if (success) {
this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
const {
allData,
barChart,
channelBaseLineChart,
peakSet,
shadowChannelChart,
shadowEnergyChart,
shapeChannelData,
shapeData,
shapeEnergyData
} = result
this.channelBaseLineChart = channelBaseLineChart
this.channelPeakChart = peakSet
this.shadowChannelChart = shadowChannelChart
this.channelBaseCPChart = shapeChannelData
this.barChart = barChart
this.btnGroupType = 1
this.opts.notMerge = true
this.clearRect()
this.setChartOption(channelBaseLineChart, this.channelCountChart, peakSet, this.channelBaseCPChart, barChart)
this.$nextTick(() => {
this.resetChartOpts()
})
this.$bus.$emit('accept', result)
} else {
this.$message.error(message)
}
})
this.channelBaseCPChart = xctrl.map((val, index) => {
return {
color: this.channelBaseCPChart[0].color,
name: index.toString(),
point: {
x: val,
y: yctrl[index]
},
size: 4
}
})
this.handleSwitchOperation()
this.$bus.$emit('accept')
} catch (error) {
console.error(error)
} finally {
this.isAccepting = false
}
},
// nuclide

View File

@ -52,16 +52,43 @@ export default {
url = '/spectrumAnalysis/viewRRR'
break
}
console.log(this.extraData)
try {
this.content = ''
this.isLoading = true
const { sampleId, inputFileName: fileName } = this.sampleData
const method = this.type == 4? postAction : getAction
const res = await method(url, {
console.log(this.sampleData)
const {
sampleId,
fileName,
...this.extraData,
})
inputFileName: fileName,
dbName,
detFileName,
gasFileName,
qcFileName,
sampleFileName,
} = this.sampleData
// const method = this.type == 4 ? postAction : getAction
let res = null
if (this.type == 4) {
let params = {
dbName,
sampleId,
sampleData: this.extraData.sampleData,
gasBgData: this.extraData.GasBgData,
detBgData: this.extraData.DetBgData,
qcData: this.extraData.QCData,
sampleFileName,
gasFileName,
detFileName,
qcFileName,
}
res = await postAction(url, params)
} else {
res = await getAction(url, {
sampleId,
fileName,
...this.extraData,
})
}
if (typeof res == 'string') {
this.content = res

View File

@ -596,6 +596,7 @@ export default {
count: 0, // tableWidgets
isFirstFitting: true,
isInverse: false, //
betaIsFitting: false,
}
},
created() {
@ -869,6 +870,8 @@ export default {
})
if (success) {
this.isFirstFitting = false
this.betaIsFitting = true
this.$emit('isFitting', this.betaIsFitting)
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
this.newE2C = EToC

View File

@ -467,6 +467,7 @@ export default {
count: 0, // tableWidgets
isFirstFitting: true,
isInverse: false, //
gammaIsFitting: false,
}
},
created() {
@ -646,6 +647,8 @@ export default {
})
if (success) {
this.isFirstFitting = false
this.gammaIsFitting = false
this.$emit('isFitting', this.gammaIsFitting)
const { EToC, newLineSeries, newScatterSeriesData, tableWidgets, CToE } = result
this.newE2C = EToC

View File

@ -9,19 +9,19 @@
>
<a-tabs :animated="false" v-model="currTab">
<a-tab-pane tab="Gamma Detector Calibration" key="gamma">
<gamma-detector-calibration />
<gamma-detector-calibration @isFitting="getFittingFlag_gamma" />
</a-tab-pane>
<a-tab-pane tab="Beta Detector Calibration" key="beta">
<beta-detector-calibration />
<beta-detector-calibration @isFitting="getFittingFlag_beta" />
</a-tab-pane>
</a-tabs>
<div class="footer">
<title-over-border title="New Calibration is Applied to">
<a-radio-group v-model="newCalibrationIsAppliedTo">
<p>
<a-radio value="1">All Spectra</a-radio>
<a-radio value="AllSpectrum">All Spectra</a-radio>
</p>
<a-radio value="2">Current Spectrum</a-radio>
<a-radio value="CurrentSpectrum">Current Spectrum</a-radio>
</a-radio-group>
</title-over-border>
<title-over-border title="Recalculate ROI Counts For">
@ -44,22 +44,26 @@
<script>
import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import { postAction } from '@/api/manage'
import BetaDetectorCalibration from './components/BetaDetectorCalibration.vue'
import GammaDetectorCalibration from './components/GammaDetectorCalibration.vue'
import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder.vue'
export default {
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
mixins: [ModalMixin],
mixins: [ModalMixin, SampleDataMixin],
data() {
return {
currTab: 'gamma',
newCalibrationIsAppliedTo: '2',
newCalibrationIsAppliedTo: 'CurrentSpectrum',
recalculateROICountsFor: [],
checkFlag: {
checkSample: false,
checkGas: false,
checkDet: false,
},
betaEnergyValid: false,
gammaEnergyValid: true,
}
},
methods: {
@ -74,8 +78,44 @@ export default {
this.checkFlag.checkDet = checkedVal.includes('detBg') ? true : false
this.$emit('sendInfo', this.checkFlag)
},
getFittingFlag_beta(val) {
this.betaEnergyValid = val
},
getFittingFlag_gamma(val) {
this.gammaEnergyValid = val
},
handleReAnalyse() {
console.log(this.currTab)
let params = {
applyType: this.newCalibrationIsAppliedTo,
sampleData: this.recalculateROICountsFor.includes('sample') ? true : false,
gasBgData: this.recalculateROICountsFor.includes('gasBg') ? true : false,
detBgData: this.recalculateROICountsFor.includes('detBg') ? true : false,
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],
currentFileName: this.newSampleData.inputFileName,
}
postAction('/spectrumAnalysis/ReAnalyse', params).then((res) => {
if (res.success) {
res.result.XeData.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)
})
this.$emit('sendXeData', res.result.XeData)
this.$message.success('Analyse Success!')
this.visible = false
} else {
this.$message.warning(res.message)
}
})
},
handleExit() {
this.visible = false

View File

@ -30,9 +30,21 @@
<!-- 两个图表开始 -->
<div class="gamma-beta-spectrum-sample border">
<div class="gamma-spectrum-sample">
<div class="title">Gamma Spectrum:Sample</div>
<div class="title">
<div>Gamma Spectrum:Sample</div>
<div class="total-counts">
<span>Total Counts:</span>
<span class="count-1">{{ totalCount[0] }}</span>
<span class="count-2">{{ totalCount[1] }}</span>
</div>
</div>
<div class="chart border">
<custom-chart ref="gammaSpectrumChart" :option="gammaSpectrumChartOption" @zr:click="handleChartClick" />
<custom-chart
ref="gammaSpectrumChart"
:option="gammaSpectrumChartOption"
@zr:click="handleChartClick($event, true)"
@zr:contextmenu="handleChartClick($event, false)"
/>
<!-- 自定义tooltip用于点击图表后的tooltip显示 -->
<div
v-if="customToolTip.visible"
@ -45,6 +57,17 @@
<div class="channel">Channel: {{ customToolTip.channel }}</div>
<div class="channel">Energy: {{ customToolTip.energy }}</div>
</div>
<div
v-if="customToolTip2.visible"
class="custom-tool-tip"
:style="{
top: customToolTip2.top + 'px',
left: customToolTip2.left + 'px'
}"
>
<div class="channel">Channel: {{ customToolTip2.channel }}</div>
<div class="channel">Energy: {{ customToolTip2.energy }}</div>
</div>
<!-- tooltip结束 -->
</div>
</div>
@ -66,33 +89,35 @@
<div class="title">Gamma Window Setting</div>
<div class="content">
<div class="label">Gamma Window Begin:</div>
<a-input-number size="small"></a-input-number> Channel
<a-input-number size="small" v-model="model.windowBegin" @change="calculateTotalCount"></a-input-number>
Channel
<div class="label">Gamma Window End:</div>
<a-input-number size="small"></a-input-number> Channel
<a-input-number size="small" v-model="model.windowEnd" @change="calculateTotalCount"></a-input-number>
Channel
</div>
</div>
<div class="setting-item">
<div class="title">Parameter Setting</div>
<div class="content">
<div class="label">Min of Energy:</div>
<a-input-number size="small"></a-input-number> keV
<a-input-number size="small" v-model="model.minEnergy"></a-input-number> keV
<div class="label">Half Life:</div>
<a-input-number size="small"></a-input-number> Day
<a-input-number size="small" v-model="model.halfLife"></a-input-number> Day
</div>
</div>
<div class="setting-item">
<div class="title">Function of Fitting</div>
<div class="content">
<a-radio-group v-model="model.fittingType">
<a-radio value="1">Linear</a-radio>
<a-radio value="2">2-polynomial</a-radio>
<a-radio-group v-model="model.fitType" @change="handleFuncChange">
<a-radio value="liner">Linear</a-radio>
<a-radio value="poly2">2-polynomial</a-radio>
</a-radio-group>
</div>
</div>
</div>
<div class="btns">
<a-button type="primary">Analyse</a-button>
<a-button type="primary" :loading="isAnalysing" @click="handleAnalyse">Analyse</a-button>
<a-button @click="visible = false">Exit</a-button>
</div>
</div>
@ -110,8 +135,10 @@
:class="tableList.length ? 'has-data' : ''"
:scroll="{ y: 101 }"
>
<template slot="delete">
<a-button type="link" size="small">Delete</a-button>
<template slot="delete" slot-scope="text, record, index">
<a-button type="link" size="small" @click="handleDel(index)">
<a-icon type="delete" style="color: red;"></a-icon>
</a-button>
</template>
</a-table>
<!-- 表格结束 -->
@ -132,25 +159,20 @@
<!-- 右下角信息开始 -->
<div class="info">
<title-over-border title="Function of Fitting">
<template v-if="model.fittingType == '1'">
y = ax + b
</template>
<template v-if="model.fittingType == '2'">
y = axx + bx + c
</template>
{{ currFunction }}
</title-over-border>
<title-over-border title="Xe Activity (Bq)">
<div class="xe-activity">
<div class="item">
<label>Reference Time :</label>
<span>
这是内容
{{ xeActivity.referenceTime }}
</span>
</div>
<div class="item">
<label>Xe Activity (Bq) :</label>
<span>
这是内容
{{ xeActivity.activity }}
</span>
</div>
</div>
@ -170,10 +192,11 @@ import ModalMixin from '@/mixins/ModalMixin'
import { cloneDeep } from 'lodash'
import CustomChart from '@/components/CustomChart/index.vue'
import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/chartHelper'
import { getAction } from '@/api/manage'
import { getAction, postAction } from '@/api/manage'
import { useBaseChartSetting } from '../../../useChart'
import TitleOverBorder from '../../TitleOverBorder.vue'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import { isNullOrUndefined } from '@/utils/util'
const initialGammaChartOption = {
grid: {
@ -226,7 +249,8 @@ const initialGammaChartOption = {
},
axisLabel: {
color: '#ade6ee'
}
},
animation: false
},
series: [
{
@ -248,8 +272,9 @@ const initialGammaChartOption = {
lineStyle: {
color: '#f00'
},
data: []
}
data: [{ xAxis: -1 }, { xAxis: -1 }]
},
animation: false
},
{
type: 'line',
@ -257,7 +282,8 @@ const initialGammaChartOption = {
color: '#A8DA56'
},
symbol: 'none',
data: []
data: [],
animation: false
}
]
}
@ -313,7 +339,8 @@ const initialBetaChartOption = {
},
axisLabel: {
color: '#ade6ee'
}
},
animation: false
},
series: [
{
@ -336,7 +363,8 @@ const initialBetaChartOption = {
color: '#f00'
},
data: []
}
},
animation: false
},
{
type: 'line',
@ -344,7 +372,8 @@ const initialBetaChartOption = {
color: '#A8DA56'
},
symbol: 'none',
data: []
data: [],
animation: false
}
]
}
@ -359,32 +388,23 @@ const initialResultChartOption = {
},
symbol: 'none',
data: [],
markLine: {
symbol: 'none',
label: {
show: false
},
animation: false,
emphasis: {
disabled: true
},
lineStyle: {
color: '#f00'
},
data: []
}
animation: false
},
{
type: 'line',
type: 'scatter',
itemStyle: {
color: '#A8DA56'
color: 'red'
},
symbol: 'none',
data: []
symbolSize: 6,
data: [],
zlevel: 2,
animation: false
}
]
}
initialResultChartOption.yAxis.boundaryGap = ['20%', '20%']
const columns = [
{
title: 'Index',
@ -395,17 +415,17 @@ const columns = [
},
{
title: 'Eb',
dataIndex: 'Eb',
dataIndex: 'eb',
align: 'center'
},
{
title: 'Nx',
dataIndex: 'Nx',
dataIndex: 'nx',
align: 'center'
},
{
title: 'Ny',
dataIndex: 'Ny',
dataIndex: 'ny',
align: 'center'
},
{
@ -417,6 +437,20 @@ const columns = [
}
]
const initialModel = {
windowBegin: undefined,
windowEnd: undefined,
minEnergy: 0.1,
halfLife: 5.243,
fitType: 'liner'
}
// Function of Fitting
const funcList = {
liner: 'y = ax + b',
poly2: 'y = axx + bx + c'
}
export default {
mixins: [ModalMixin, SampleDataMixin],
components: {
@ -437,28 +471,42 @@ export default {
channel: '',
energy: ''
},
customToolTip2: {
top: 0,
left: 0,
visible: false,
channel: '',
energy: ''
},
totalCount: [0, 0],
currFunction: '',
xeActivity: {},
isLoading: false,
detail: {},
gammaChannelEnergy: [],
model: {
fittingType: '1'
},
tableList: []
model: cloneDeep(initialModel),
tableList: [],
isAnalysing: false
}
},
methods: {
beforeModalOpen() {
this.customToolTip.visible = false
const gammaSeries = this.gammaSpectrumChartOption.series
gammaSeries[0].data = []
gammaSeries[1].data = []
this.customToolTip2.visible = false
this.gammaSpectrumChartOption = cloneDeep(initialGammaChartOption)
this.betaSpectrumChartOption = cloneDeep(initialBetaChartOption)
this.resultChartOption = cloneDeep(initialResultChartOption)
this.model = cloneDeep(initialModel)
this.currFunction = funcList[this.model.fitType]
this.tableList = []
this.calculateTotalCount()
const betaSeries = this.betaSpectrumChartOption.series
betaSeries[0].data = []
betaSeries[1].data = []
this.getDetail()
},
@ -518,28 +566,171 @@ export default {
}
},
//
handleChartClick(param) {
const { offsetX, offsetY } = param
handleChartClick({ offsetX, offsetY, event }, isMouseLeft) {
event.preventDefault()
const point = getXAxisAndYAxisByPosition(this.$refs.gammaSpectrumChart.getChartInstance(), offsetX, offsetY)
if (point) {
const markLineData = this.gammaSpectrumChartOption.series[0].markLine.data
const xAxis = parseInt(point[0].toFixed())
this.gammaSpectrumChartOption.series[0].markLine.data = [{ xAxis }]
this.customToolTip.top = offsetY
if (xAxis > 225) {
this.customToolTip.left = offsetX - 125
} else {
this.customToolTip.left = offsetX + 20
let currToolTip = this.customToolTip2
//
if (isMouseLeft) {
//
if (!isNullOrUndefined(this.model.windowEnd) && xAxis >= this.model.windowEnd) {
this.clearMarkLineAndToolTip()
return
}
currToolTip = this.customToolTip
markLineData[0].xAxis = xAxis
this.model.windowBegin = xAxis
}
this.customToolTip.visible = true
this.customToolTip.channel = xAxis
//
else {
if (!isNullOrUndefined(this.model.windowBegin) && xAxis <= this.model.windowBegin) {
this.clearMarkLineAndToolTip()
return
}
markLineData[1].xAxis = xAxis
this.model.windowEnd = xAxis
}
currToolTip.top = offsetY
if (xAxis > 225) {
currToolTip.left = offsetX - 125
} else {
currToolTip.left = offsetX + 20
}
currToolTip.visible = true
currToolTip.channel = xAxis
const energy = this.gammaChannelEnergy[xAxis] || 0
this.customToolTip.energy = parseInt(energy) + 'keV'
currToolTip.energy = parseInt(energy) + 'keV'
this.calculateTotalCount()
}
},
clearMarkLineAndToolTip() {
const markLineData = this.gammaSpectrumChartOption.series[0].markLine.data
markLineData[0].xAxis = -1
markLineData[1].xAxis = -1
this.customToolTip.visible = false
this.customToolTip2.visible = false
this.model.windowBegin = null
this.model.windowEnd = null
this.calculateTotalCount()
},
// Total Count
calculateTotalCount() {
if (!this.model.windowBegin || !this.model.windowEnd || this.model.windowBegin >= this.model.windowEnd) {
this.totalCount = [0, 0]
return
}
const gammaOriginSeriseData = this.gammaSpectrumChartOption.series[0].data
const betaProjectedSeriseData = this.betaSpectrumChartOption.series[1].data
const originSeriseTotalCount = gammaOriginSeriseData
.slice(this.model.windowBegin, this.model.windowEnd + 1)
.reduce((prev, curr) => prev + curr[1], 0)
const projectedSeriseTotalCount = betaProjectedSeriseData
.slice(this.model.windowBegin, this.model.windowEnd + 1)
.reduce((prev, curr) => prev + curr[1], 0)
this.totalCount = [originSeriseTotalCount, projectedSeriseTotalCount]
},
// Function of Fitting
handleFuncChange() {
this.xeActivity = {}
this.currFunction = funcList[this.model.fitType]
},
handleSnapshot() {
exportEchartImg(this.$refs.chartRef.getChartInstance())
},
//
async handleAnalyse() {
const { windowBegin, windowEnd, minEnergy, halfLife, fitType } = this.model
if (
isNullOrUndefined(windowBegin) ||
isNullOrUndefined(windowEnd) ||
isNullOrUndefined(minEnergy) ||
isNullOrUndefined(halfLife)
) {
return
}
try {
const { sampleFileName, detFileName } = this.sampleData
const params = {
sampleId: null,
dbName: '',
sampleFileName,
detFileName,
gammaBegin: windowBegin,
gammaEnd: windowEnd,
minEnergy,
halfLife,
fitType //Linear liner 2-Polynomial poly2
}
this.isAnalysing = true
const { success, result, message } = await postAction('/spectrumAnalysis/analyseExtrapolation', params)
if (success) {
console.log('%c [ ]-679', 'font-size:13px; background:pink; color:#bf2c9f;', result)
const {
functionFit, // Function of Fitting
resultViewLineDataValue, // 线
resultViewScatterDataValue, //
tableData, //
xeAct
} = result
this.currFunction = functionFit
const [lineSeries, scatterSeries] = this.resultChartOption.series
lineSeries.data = resultViewLineDataValue.map(({ x, y }) => [x, y])
scatterSeries.data = resultViewScatterDataValue.map(({ x, y }) => [x, y])
this.resetResultChartPerform()
this.xeActivity = {
referenceTime: this.detail.acquisitionStart,
activity: Number.isNaN(xeAct)? xeAct: Number(xeAct).toPrecision(6)
}
this.tableList = tableData
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isAnalysing = false
}
},
resetResultChartPerform() {
this.resultChartOption.yAxis.min = undefined
this.resultChartOption.yAxis.max = undefined
this.resultChartOption.xAxis.min = undefined
this.resultChartOption.xAxis.max = undefined
this.resultChartOption.yAxis.interval = undefined
this.resultChartOption.xAxis.interval = undefined
},
//
handleDel(index) {
this.tableList.splice(index, 1)
this.resultChartOption.series[1].data.splice(index, 1)
}
}
}
@ -551,6 +742,21 @@ export default {
.title {
color: @primary-color;
display: flex;
justify-content: space-between;
}
.total-counts {
.count-1 {
color: @primary-color;
margin-left: 15px;
}
.count-2 {
color: #ffc90e;
margin-left: 15px;
margin-right: 15px;
}
}
.sample-infomation {
@ -570,6 +776,7 @@ export default {
padding: 5px;
width: 200px;
height: 100%;
line-height: 22px;
}
}
}
@ -635,7 +842,7 @@ export default {
width: 100%;
&:last-child {
margin-top: 10px;
margin-top: 10px;
}
}
}
@ -725,7 +932,7 @@ export default {
}
.xe-activity {
width: 80%;
width: 90%;
.item {
display: flex;

View File

@ -12,7 +12,7 @@
@change="handleTableChange"
></custom-table>
<div slot="custom-footer">
<a-button type="primary" :loading="isComparing" @click="handleOk">Compare</a-button>
<a-button type="primary" @click="handleOk">Ok</a-button>
<a-button @click="visible = false">Cancel</a-button>
</div>
</custom-modal>
@ -22,7 +22,6 @@
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '../../SampleDataMixin'
const columns = [
{
@ -56,7 +55,7 @@ const formItems = [
]
export default {
mixins: [ModalMixin, JeecgListMixin, SampleDataMixin],
mixins: [ModalMixin, JeecgListMixin],
data() {
this.columns = columns
this.formItems = formItems
@ -64,8 +63,7 @@ export default {
return {
queryParam: {},
selectedRowKeys: [],
selectionRows: [],
isComparing: false
selectionRows: []
}
},
methods: {
@ -109,27 +107,9 @@ export default {
this.$message.warn('Please Select A File to Compare')
return
}
try {
const { inputFileName: fileName } = this.sampleData
const compareFileName = this.selectionRows[0].name
this.isComparing = true
const { success, result, message } = await getAction('/gamma/Compare', {
fileName,
compareFileName
})
if (success) {
this.visible = false
this.$emit('compareWithFile', result)
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isComparing = false
}
this.$emit('fileSelect', this.selectionRows[0].name)
this.visible = false
}
}
}

View File

@ -1,5 +1,5 @@
<template>
<custom-modal v-model="visible" :width="1280" title="Efficiency Calibration" :footer="null" destroy-on-close>
<custom-modal v-model="visible" :width="1280" title="Efficiency Calibration" :footer="null">
<a-spin :spinning="isLoading">
<div class="energy-calibration">
<div class="left">
@ -125,19 +125,23 @@ import { showSaveFileModal } from '@/utils/file'
const columns = [
{
title: 'Energy(keV)',
dataIndex: 'energy'
dataIndex: 'energy',
customRender: (text) => Number(text).toFixed(3)
},
{
title: 'Efficiency',
dataIndex: 'efficiency'
dataIndex: 'efficiency',
customRender: (text) => Number(text).toFixed(3)
},
{
title: 'Fit(keV)',
dataIndex: 'fit'
dataIndex: 'fit',
customRender: (text) => Number(text).toFixed(3)
},
{
title: 'Delta(%)',
dataIndex: 'delta'
dataIndex: 'delta',
customRender: (text) => Number(text).toFixed(3)
}
]
@ -282,11 +286,11 @@ export default {
})
this.isLoading = false
if (success) {
const { list_dataSource, ECutAnalysis_Low, G_energy_span } = result
const { list_dataSource, ECutAnalysis_Low, G_energy_span, currentText: resultCurrentText } = result
this.dataSourceList = list_dataSource
if (!currentText) {
this.currSelectedDataSource = list_dataSource[list_dataSource.length - 1]
this.appliedDataSource = list_dataSource[list_dataSource.length - 1]
this.currSelectedDataSource = resultCurrentText
this.appliedDataSource = resultCurrentText
}
this.ECutAnalysis_Low = ECutAnalysis_Low

View File

@ -120,19 +120,23 @@ import { showSaveFileModal } from '@/utils/file'
const columns = [
{
title: 'Channel',
dataIndex: 'channel'
dataIndex: 'channel',
customRender: (text) => Number(text).toFixed(3)
},
{
title: 'Energy(keV)',
dataIndex: 'energy'
dataIndex: 'energy',
customRender: (text) => Number(text).toFixed(3)
},
{
title: 'Fit(keV)',
dataIndex: 'fit'
dataIndex: 'fit',
customRender: (text) => Number(text).toFixed(3)
},
{
title: 'Delta(%)',
dataIndex: 'delta'
dataIndex: 'delta',
customRender: (text) => Number(text).toFixed(3)
}
]
@ -244,11 +248,11 @@ export default {
})
this.isLoading = false
if (success) {
const { list_dataSource, rg_high, rg_low } = result
const { list_dataSource, rg_high, rg_low, currentText: resultCurrentText } = result
this.dataSourceList = list_dataSource
if (!currentText) {
this.currSelectedDataSource = list_dataSource[list_dataSource.length - 1]
this.appliedDataSource = list_dataSource[list_dataSource.length - 1]
this.currSelectedDataSource = resultCurrentText
this.appliedDataSource = resultCurrentText
}
this.rg_high = rg_high

View File

@ -3,23 +3,31 @@
<a-form-model class="settings" :labelCol="{ style: { width: '75px', textAlign: 'center' } }">
<div class="top-left">
<a-form-model-item label="MSG_ID">
<a-input></a-input>
<a-input v-model="canberraIecImsParams.msgId"></a-input>
</a-form-model-item>
<a-form-model-item label="Comment">
<a-textarea></a-textarea>
<a-textarea v-model="canberraIecImsParams.comment"></a-textarea>
</a-form-model-item>
<title-over-border title="Collection Block">
<a-form-model-item label="Start Time">
<custom-date-picker show-time />
<custom-date-picker
show-time
format="YYYY/MM/DD HH:mm:ss"
valueFormat="YYYY/MM/DD HH:mm:ss"
v-model="canberraIecImsParams.startTime"
/>
</a-form-model-item>
<a-form-model-item label="Stop Time">
<custom-date-picker show-time />
<custom-date-picker
show-time
format="YYYY/MM/DD HH:mm:ss"
valueFormat="YYYY/MM/DD HH:mm:ss"
v-model="canberraIecImsParams.stopTime"
/>
</a-form-model-item>
<div>
<p>
Total air volume sampled
</p>
<a-input></a-input>
<p>Total air volume sampled</p>
<a-input v-model="canberraIecImsParams.totalAir"></a-input>
</div>
</title-over-border>
</div>
@ -30,81 +38,139 @@
<a-checkbox></a-checkbox>
Designator
</div>
<a-input></a-input>
<a-input v-model="canberraIecImsParams.designator"></a-input>
</div>
<div class="header-block-item">
<div>
<a-checkbox></a-checkbox>
Station code
</div>
<a-input></a-input>
<a-input v-model="canberraIecImsParams.stationCode"></a-input>
</div>
<div class="header-block-item">
<div>
<a-checkbox></a-checkbox>
Detector code
</div>
<a-input></a-input>
<a-input v-model="canberraIecImsParams.detectorCode"></a-input>
</div>
<div class="header-block-item">
<div>
<a-checkbox></a-checkbox>
Sample geometry
</div>
<a-input></a-input>
<a-input v-model="canberraIecImsParams.sampleGeometry"></a-input>
</div>
</div>
<div class="system-type-and-spectrum-qualifier">
<title-over-border title="System type" class="system-type">
<a-radio-group>
<a-radio>P</a-radio>
<a-radio>G</a-radio>
<a-radio>B</a-radio>
<a-radio-group v-model="canberraIecImsParams.systemType">
<a-radio value="P">P</a-radio>
<a-radio value="G">G</a-radio>
<a-radio value="B">B</a-radio>
</a-radio-group>
</title-over-border>
<title-over-border title="Spectrum qualifier" class="spectrum-qualifier">
<a-radio-group>
<a-radio>PREL</a-radio>
<a-radio>FULL</a-radio>
<a-radio-group v-model="canberraIecImsParams.spectrumQualifier">
<a-radio value="PREL">PREL</a-radio>
<a-radio value="FULL">FULL</a-radio>
</a-radio-group>
</title-over-border>
</div>
<div class="identifications">
<div>
<p>Sample reference identification</p>
<a-input></a-input>
<a-input v-model="canberraIecImsParams.sampleRef"></a-input>
</div>
<div>
<p>Background measurement identification</p>
<a-input></a-input>
<a-input v-model="canberraIecImsParams.backgroundMea"></a-input>
</div>
</div>
<div class="transmit-time">
<a-checkbox>Transmit time</a-checkbox>
<custom-date-picker></custom-date-picker>
<custom-date-picker
show-time
format="YYYY/MM/DD HH:mm:ss"
valueFormat="YYYY/MM/DD HH:mm:ss"
v-model="canberraIecImsParams.transmitTime"
/>
</div>
</title-over-border>
</a-form-model>
<title-over-border title="Spectrum Transfer" class="spectrum-transfer">
<div class="title-container">
<div class="title">Canberra IEC1455(.IEC)</div>
<div class="title">
<a-upload name="file" :multiple="true" :showUploadList="false" :beforeUpload="ortecBeforeUpload">
<div>Canberra IEC1455(.IEC)</div>
</a-upload>
</div>
<div class="data-type">
Data type
<div class="data-type-select">
<custom-select :option="[{ label: 'SAMPLEPHD', value: 1 }]" />
</div>
</div>
<div class="title">IMS .ims .rms</div>
<div class="title">
<a-upload name="file" :multiple="true" :showUploadList="false" :beforeUpload="imsBeforeUpload">
<div>IMS .ims .rms</div>
</a-upload>
</div>
</div>
<a-transfer></a-transfer>
<a-transfer :render="(item) => item.title" :data-source="dataSource" :target-keys="targetKeys" />
</title-over-border>
</div>
</template>
<script>
import TitleOverBorder from '../../../TitleOverBorder.vue'
import moment from 'moment'
export default {
components: { TitleOverBorder }
components: { TitleOverBorder },
data() {
return {
canberraIecImsParams: {
msgId: '123456789',
comment: '',
startTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
stopTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
totalAir: '0',
designator: '3',
stationCode: 'CNL06',
detectorCode: 'CNL06_001',
sampleGeometry: 'DISC70MMX5MM',
systemType: 'P',
spectrumQualifier: 'FULL',
sampleRef: '123456789',
backgroundMea: '0',
transmitTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
},
dataSource: [],
targetKeys: [],
}
},
methods: {
ortecBeforeUpload(file, fileList) {
console.log(file, fileList)
this.dataSource = fileList.map((item) => {
return {
key: item.uid,
title: item.name,
}
})
},
imsBeforeUpload(file, fileList) {
console.log(file, fileList)
let arr = fileList.map((item) => {
return {
key: item.uid,
title: item.name,
}
})
this.targetKeys = arr.map((item) => item.key)
this.dataSource.push(...arr)
},
},
}
</script>
@ -205,6 +271,10 @@ export default {
background-color: #225a6a;
height: 32px;
line-height: 32px;
/deep/.ant-upload {
width: 100%;
cursor: pointer;
}
}
}

View File

@ -3,23 +3,31 @@
<a-form-model class="settings" :labelCol="{ style: { width: '75px', textAlign: 'center' } }">
<div class="top-left">
<a-form-model-item label="MSG_ID">
<a-input></a-input>
<a-input v-model="intSpacImsParams.msgId"></a-input>
</a-form-model-item>
<a-form-model-item label="Comment">
<a-textarea></a-textarea>
<a-textarea v-model="intSpacImsParams.comment"></a-textarea>
</a-form-model-item>
<title-over-border title="Collection Block">
<a-form-model-item label="Start Time">
<custom-date-picker show-time />
<custom-date-picker
show-time
format="YYYY/MM/DD HH:mm:ss"
valueFormat="YYYY/MM/DD HH:mm:ss"
v-model="intSpacImsParams.startTime"
/>
</a-form-model-item>
<a-form-model-item label="Stop Time">
<custom-date-picker show-time />
<custom-date-picker
show-time
format="YYYY/MM/DD HH:mm:ss"
valueFormat="YYYY/MM/DD HH:mm:ss"
v-model="intSpacImsParams.stopTime"
/>
</a-form-model-item>
<div>
<p>
Total air volume sampled
</p>
<a-input></a-input>
<p>Total air volume sampled</p>
<a-input v-model="intSpacImsParams.totalAir"></a-input>
</div>
</title-over-border>
</div>
@ -30,81 +38,139 @@
<a-checkbox></a-checkbox>
Designator
</div>
<a-input></a-input>
<a-input v-model="intSpacImsParams.designator"></a-input>
</div>
<div class="header-block-item">
<div>
<a-checkbox></a-checkbox>
Station code
</div>
<a-input></a-input>
<a-input v-model="intSpacImsParams.stationCode"></a-input>
</div>
<div class="header-block-item">
<div>
<a-checkbox></a-checkbox>
Detector code
</div>
<a-input></a-input>
<a-input v-model="intSpacImsParams.detectorCode"></a-input>
</div>
<div class="header-block-item">
<div>
<a-checkbox></a-checkbox>
Sample geometry
</div>
<a-input></a-input>
<a-input v-model="intSpacImsParams.sampleGeometry"></a-input>
</div>
</div>
<div class="system-type-and-spectrum-qualifier">
<title-over-border title="System type" class="system-type">
<a-radio-group>
<a-radio>P</a-radio>
<a-radio>G</a-radio>
<a-radio>B</a-radio>
<a-radio-group v-model="intSpacImsParams.systemType">
<a-radio value="P">P</a-radio>
<a-radio value="G">G</a-radio>
<a-radio value="B">B</a-radio>
</a-radio-group>
</title-over-border>
<title-over-border title="Spectrum qualifier" class="spectrum-qualifier">
<a-radio-group>
<a-radio>PREL</a-radio>
<a-radio>FULL</a-radio>
<a-radio-group v-model="intSpacImsParams.spectrumQualifier">
<a-radio value="PREL">PREL</a-radio>
<a-radio value="FULL">FULL</a-radio>
</a-radio-group>
</title-over-border>
</div>
<div class="identifications">
<div>
<p>Sample reference identification</p>
<a-input></a-input>
<a-input v-model="intSpacImsParams.sampleRef"></a-input>
</div>
<div>
<p>Background measurement identification</p>
<a-input></a-input>
<a-input v-model="intSpacImsParams.backgroundMea"></a-input>
</div>
</div>
<div class="transmit-time">
<a-checkbox>Transmit time</a-checkbox>
<custom-date-picker></custom-date-picker>
<custom-date-picker
show-time
format="YYYY/MM/DD HH:mm:ss"
valueFormat="YYYY/MM/DD HH:mm:ss"
v-model="intSpacImsParams.transmitTime"
/>
</div>
</title-over-border>
</a-form-model>
<title-over-border title="Spectrum Transfer" class="spectrum-transfer">
<div class="title-container">
<div class="title">ORTEC int.spc</div>
<div class="title">
<a-upload name="file" :multiple="true" :showUploadList="false" :beforeUpload="ortecBeforeUpload">
<div>ORTEC int.spc</div>
</a-upload>
</div>
<div class="data-type">
Data type
<div class="data-type-select">
<custom-select :option="[{ label: 'SAMPLEPHD', value: 1 }]" />
</div>
</div>
<div class="title">IMS .ims .rms</div>
<div class="title">
<a-upload name="file" :multiple="true" :showUploadList="false" :beforeUpload="imsBeforeUpload">
<div>IMS .ims .rms</div>
</a-upload>
</div>
</div>
<a-transfer></a-transfer>
<a-transfer :render="(item) => item.title" :data-source="dataSource" :target-keys="targetKeys" />
</title-over-border>
</div>
</template>
<script>
import TitleOverBorder from '../../../TitleOverBorder.vue'
import moment from 'moment'
export default {
components: { TitleOverBorder }
components: { TitleOverBorder },
data() {
return {
intSpacImsParams: {
msgId: '123456789',
comment: '',
startTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
stopTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
totalAir: '0',
designator: '3',
stationCode: 'CNL06',
detectorCode: 'CNL06_001',
sampleGeometry: 'DISC70MMX5MM',
systemType: 'P',
spectrumQualifier: 'FULL',
sampleRef: '123456789',
backgroundMea: '0',
transmitTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
},
dataSource: [],
targetKeys: [],
}
},
methods: {
ortecBeforeUpload(file, fileList) {
console.log(file, fileList)
this.dataSource = fileList.map((item) => {
return {
key: item.uid,
title: item.name,
}
})
},
imsBeforeUpload(file, fileList) {
console.log(file, fileList)
let arr = fileList.map((item) => {
return {
key: item.uid,
title: item.name,
}
})
this.targetKeys = arr.map((item) => item.key)
this.dataSource.push(...arr)
},
},
}
</script>
@ -205,6 +271,10 @@ export default {
background-color: #225a6a;
height: 32px;
line-height: 32px;
/deep/.ant-upload {
width: 100%;
cursor: pointer;
}
}
}

View File

@ -12,7 +12,7 @@
<a-input v-model="model.dataType" @change="e=>handleValueChange(e.target.value)"/>
</a-form-model-item>
<a-form-model-item label="Priority Level">
<custom-select v-model="model.priorityLevel" style="width: 150px" :options="priorityLevbelOptions" @change="handleValueChange"> </custom-select>
<custom-select v-model="model.priorityLevel" :options="priorityLevbelOptions" @change="handleValueChange"> </custom-select>
</a-form-model-item>
<a-form-model-item label="Station Code">
<a-input v-model="model.stationCode" @change="e=>handleValueChange(e.target.value)"/>
@ -27,13 +27,13 @@
<a-input v-model="model.labDetector" @change="e=>handleValueChange(e.target.value)"/>
</a-form-model-item>
<a-form-model-item label="Report Type">
<custom-select v-model="model.reportType" style="width: 150px" :options="reportTypeOptions" @change="handleValueChange"> </custom-select>
<custom-select v-model="model.reportType" :options="reportTypeOptions" @change="handleValueChange"> </custom-select>
</a-form-model-item>
<a-form-model-item label="Report Number">
<a-input-number v-model="model.reportnumber" style="width: 100%;" @change="handleValueChange"/>
</a-form-model-item>
<a-form-model-item label="Sample Category">
<custom-select v-model="model.sampleCategory" style="width: 150px" :options="sampleCategoryOptions" @change="handleValueChange"> </custom-select>
<custom-select v-model="model.sampleCategory" :options="sampleCategoryOptions" @change="handleValueChange"> </custom-select>
</a-form-model-item>
<a-form-model-item label="Message Transmission Time">
<custom-date-picker v-model="model.transmission" show-time @change="(mont,date)=>handleValueChange(date)"/>

View File

@ -120,19 +120,23 @@ import { showSaveFileModal } from '@/utils/file'
const columns = [
{
title: 'Energy(keV)',
dataIndex: 'energy'
dataIndex: 'energy',
customRender: (text) => Number(text).toFixed(3)
},
{
title: 'FWHM(keV)',
dataIndex: 'fwhm'
dataIndex: 'fwhm',
customRender: (text) => Number(text).toFixed(3)
},
{
title: 'Fit(keV)',
dataIndex: 'fit'
dataIndex: 'fit',
customRender: (text) => Number(text).toFixed(3)
},
{
title: 'Delta(%)',
dataIndex: 'delta'
dataIndex: 'delta',
customRender: (text) => Number(text).toFixed(3)
}
]
@ -243,11 +247,11 @@ export default {
})
this.isLoading = false
if (success) {
const { list_dataSource, ECutAnalysis_Low, G_energy_span } = result
const { list_dataSource, ECutAnalysis_Low, G_energy_span, currentText: resultCurrentText } = result
this.dataSourceList = list_dataSource
if (!currentText) {
this.currSelectedDataSource = list_dataSource[list_dataSource.length - 1]
this.appliedDataSource = list_dataSource[list_dataSource.length - 1]
this.currSelectedDataSource = resultCurrentText
this.appliedDataSource = resultCurrentText
}
this.ECutAnalysis_Low = ECutAnalysis_Low

View File

@ -2,16 +2,14 @@
<custom-modal v-model="visible" title="Save Setting" :width="380" :okHandler="handleOk">
<div class="save-setting">
<div class="save-setting-all">
<a-checkbox v-model="saveAll">
Save All
</a-checkbox>
<a-checkbox v-model="saveAll"> Save All </a-checkbox>
</div>
<div>
<title-over-border title="Format">
<a-radio-group v-model="saveFormat" class="format-radio-group">
<a-radio value="txt">Save as Txt</a-radio>
<a-radio value="xls">Save as Excel</a-radio>
<a-radio value="html">Save as Html</a-radio>
<!-- <a-radio value="html">Save as Html</a-radio> -->
</a-radio-group>
</title-over-border>
</div>
@ -25,13 +23,13 @@ export default {
components: { TitleOverBorder },
props: {
value: {
type: Boolean
}
type: Boolean,
},
},
data() {
return {
saveAll: false,
saveFormat: 'txt'
saveFormat: 'txt',
}
},
methods: {
@ -42,7 +40,7 @@ export default {
handleOk() {
this.$emit('save', this.saveFormat)
}
},
},
computed: {
visible: {
@ -55,9 +53,9 @@ export default {
}
return this.value
}
}
}
},
},
},
}
</script>

View File

@ -1,25 +1,45 @@
<template>
<custom-modal v-model="visible" title="Ratio" :width="240" :okHandler="handleOk">
<custom-modal v-model="visible" title="Ratio" :width="240" @cancel="handleReject">
<a-input-number :min="1" v-model="ratio"></a-input-number>
<div slot="custom-footer">
<a-button type="primary" @click="handleOk">OK</a-button>
<a-button @click="handleCancel">Cancel</a-button>
</div>
</custom-modal>
</template>
<script>
import ModalMixin from '@/mixins/ModalMixin'
export default {
mixins: [ModalMixin],
data() {
return {
visible: false,
ratio: 1
}
},
methods: {
getRatio() {
this.visible = true
this.ratio = 1
return new Promise((resolve, reject) => {
this.resolve = resolve
this.reject = reject
})
},
handleOk() {
console.log('%c [ ]-14', 'font-size:13px; background:pink; color:#bf2c9f;', this.ratio)
if(!this.ratio) {
this.$message.warn('Ratio Cannot Be Null')
throw new Error('Ratio Empty')
}
this.resolve(this.ratio)
this.visible = false
},
handleCancel() {
this.resolve()
this.visible = false
},
handleReject() {
this.reject('cancel')
}
}
}

View File

@ -89,7 +89,12 @@
:nuclide="nuclideReview.nuclide"
/>
<compare-file-list-modal v-model="compareFileListModalVisible" @compareWithFile="handleCompareWithFile" />
<compare-file-list-modal v-model="compareFileListModalVisible" @fileSelect="handleFileSelect" />
<!-- Strip 弹窗开始 -->
<strip-modal ref="stripModal" />
<!-- Strip 弹窗结束 -->
<!-- ReProcessing 弹窗开始 -->
<re-processing-modal
v-if="abc"
@ -132,6 +137,7 @@ import { GammaOptions, graphAssistance } from './settings'
import store from '@/store/'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import StripModal from './components/Modals/StripModal.vue'
export default {
props: {
@ -153,6 +159,7 @@ export default {
NuclideReviewModal,
CompareFileListModal,
ReProcessingModal,
StripModal,
},
data() {
return {
@ -205,6 +212,8 @@ export default {
currChannel: -1,
compareFileListModalVisible: false, // Compare
isStrip: false,
reprocessingModalVisible: false, //
isProcessing: false, //
websock: null,
@ -213,6 +222,7 @@ export default {
checkBox_updateCal: false, //update
newCheckBox_updateCal: false, //update
currStep: '',
isReAnalyed: false,
}
},
created() {
@ -306,9 +316,11 @@ export default {
this.dataProsess(result, 'db')
} else {
this.$message.error(message)
this.isLoading = false
}
} catch (error) {
console.error(error)
this.isLoading = false
}
},
@ -334,9 +346,11 @@ export default {
this.dataProsess(result, 'file')
} else {
this.$message.error(message)
this.isLoading = false
}
} catch (error) {
console.error(error)
this.isLoading = false
}
},
@ -375,6 +389,7 @@ export default {
} = result
if (flag && (flag == 'dab' || flag == 'file')) {
this.bAnalyed = result.bAnalyed
this.$emit('reAnalyed', this.bAnalyed)
this.checkBox_updateCal = result.checkBox_updateCal
this.newCheckBox_updateCal = '2'
console.log(this.checkBox_updateCal)
@ -1159,15 +1174,40 @@ export default {
// Accept
handleAccept(data) {
console.log('%c [ handleAccept ]-1088', 'font-size:13px; background:pink; color:#bf2c9f;', data)
this.handleResetState()
// data.DetailedInformation = this.detailedInfomation
console.log('%c [ data ]-1166', 'font-size:13px; background:pink; color:#bf2c9f;', data)
const {
allData,
barChart,
channelBaseLineChart,
peakSet,
shadowChannelChart,
shadowEnergyChart,
shapeChannelData,
shapeData,
shapeEnergyData,
} = data
this.clearCompareLine()
// this.dataProsess(data)
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()
},
//
showCompareModal() {
showCompareModal(isStrip) {
if (this.isLoading) {
this.$message.warn('Sample is Loading')
return
@ -1175,21 +1215,55 @@ export default {
this.handleResetChart()
this.clearCompareLine()
this.compareFileListModalVisible = true
this.isStrip = isStrip
},
//
handleCompareWithFile([channelData, energyData]) {
this.channelCompareLine = channelData
this.energyCompareLine = energyData
this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
async handleFileSelect(selectedFileName) {
const { inputFileName: fileName } = this.sample
if (this.isScatter()) {
lineSeries.type = 'scatterGL'
try {
let param = {
fileName,
compareFileName: selectedFileName,
},
url = '/gamma/Compare'
// Strip
if (this.isStrip) {
const ratio = await this.$refs.stripModal.getRatio()
param = {
fileName,
stripFileName: selectedFileName,
ratioRate: ratio || 1,
}
url = '/gamma/Strip'
}
this.isLoading = true
const { success, result, message } = await getAction(url, param)
if (success) {
const [channelData, energyData] = result
this.channelCompareLine = channelData
this.energyCompareLine = energyData
this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
if (this.isScatter()) {
lineSeries.type = 'scatterGL'
}
this.$nextTick(() => {
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
})
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
this.$nextTick(() => {
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
})
},
// Compare 线
@ -1216,11 +1290,12 @@ export default {
try {
this.isLoading = true
this.handleResetState()
const { inputFileName: fileName } = this.sample
const { success, result, message } = await postAction(`/gamma/Reprocessing?fileName=${fileName}`)
if (success) {
this.isReAnalyed = true
this.$emit('reAnalyed', this.isReAnalyed)
this.handleResetState()
result.DetailedInformation = this.detailedInfomation
this.dataProsess(result)
} else {
@ -1446,7 +1521,6 @@ export default {
watch: {
currStep: {
handler(val) {
console.log('dfad', val)
if (val && val == '0') {
this.abc = true
this.reprocessingModalVisible = true
@ -1467,7 +1541,6 @@ export default {
},
updateFlag: {
handler(val) {
console.log('dfad', val)
this.newCheckBox_updateCal = val
},
immediate: true,

View File

@ -30,7 +30,13 @@
<!-- 频谱分析部分 -->
<div class="spectrum-analysis-main">
<!-- Gamma 分析 -->
<gamma-analysis v-if="isGamma" ref="gammaAnalysisRef" :sample="sampleData" :updateFlag="updateFlag" />
<gamma-analysis
v-if="isGamma"
ref="gammaAnalysisRef"
:sample="sampleData"
:updateFlag="updateFlag"
@reAnalyed="handleReAnalyed"
/>
<!-- Gamma 分析 -->
<!-- Beta-Gamma 分析 -->
@ -57,10 +63,6 @@
<load-from-file-modal v-model="loadFromFileModalVisible" @loadFormFile="handleLoadSampleFromFile" />
<!-- 从文件加载结束 -->
<!-- Strip 弹窗开始 -->
<strip-modal v-model="stripModalVisible" />
<!-- Strip 弹窗结束 -->
<!-- Ftransit 弹窗开始 -->
<ftranslt-modal v-model="ftransltModalVisible" />
<!-- Ftransit 弹窗结束 -->
@ -160,7 +162,11 @@
<!-- Beta-Gamma 的Comments 结束 -->
<!-- Beta-Gamma 的Energy Calibration开始 -->
<beta-gamma-energy-calibration-modal v-model="betaGammaEnergyCalibrationModalVisible" @sendInfo="getCheckFlag" />
<beta-gamma-energy-calibration-modal
v-model="betaGammaEnergyCalibrationModalVisible"
@sendInfo="getCheckFlag"
@sendXeData="getXeData"
/>
<!-- Beta-Gamma 的Energy Calibration结束 -->
<!-- Beta-Gamma Extrapolation 弹窗开始 -->
@ -227,7 +233,6 @@ import BetaGammaRlrModal from './components/Modals/BetaGammaModals/BetaGammaRLRM
import StatisticsParamerHistoryModal from './components/Modals/BetaGammaModals/StatisticsParamerHistoryModal.vue'
import FtransltModal from './components/Modals/FtransltModal/index.vue'
import BetaGammaEnergyCalibrationModal from './components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue'
import StripModal from './components/Modals/StripModal.vue'
import AutomaticAnalysisLogModal from './components/Modals/BetaGammaModals/AutomaticAnalysisLogModal.vue'
import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue'
import { getAction } from '@/api/manage'
@ -273,7 +278,6 @@ export default {
StatisticsParamerHistoryModal,
FtransltModal,
BetaGammaEnergyCalibrationModal,
StripModal,
AutomaticAnalysisLogModal,
BetaGammaExtrapolationModal,
},
@ -299,7 +303,6 @@ export default {
loadFromDbModalVisible: false, //
loadFromFileModalVisible: false, //
stripModalVisible: false, // Strip
ftransltModalVisible: false, // Ftransit
sampleData: {}, //
@ -379,6 +382,8 @@ export default {
xe135Flag: null,
},
updateFlag: '2',
isReAnalyed_gamma: false,
isReAnalyed_beta: false,
}
},
created() {
@ -396,6 +401,9 @@ export default {
},
methods: {
handleReAnalyed(val) {
this.isReAnalyed_gamma = val
},
getUpdateFlag(val) {
console.log('qerq', val)
this.updateFlag = val
@ -403,15 +411,26 @@ export default {
getcommentsInfo(val) {
this.params_toDB.comment = val.spectrumAnalysisCommentInfo
},
getStationName(arg, val) {
getStationName(arg, val, flag) {
arg.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)
})
this.resultDisplayFlag = arg
this.params_toDB.stationName = val
this.isReAnalyed_beta = flag
},
getCheckFlag(val) {
this.params_toDB.checkSample = val.checkSample
this.params_toDB.checkGas = val.checkGas
this.params_toDB.checkDet = val.checkDet
},
getXeData(val) {
this.$set(this.analyseCurrentSpectrumData, 'XeData', val)
this.resultDisplayFlag = val
},
// formDB sampleData
getFiles(val) {
this.newSampleData = { ...this.sampleData, ...val }
@ -467,30 +486,39 @@ export default {
//
async handleSaveResultsToFile(saveFormat) {
const url =
saveFormat == 'xls'
? '/spectrumAnalysis/saveToExcel'
: saveFormat == 'txt'
? '/spectrumAnalysis/saveToTxt'
: saveFormat == 'html'
? '/spectrumAnalysis/saveToHTML'
: ''
if (!this.resultDisplayFlag) {
this.$message.warn('Please Analyse Spectrum First')
return
if (this.isGamma) {
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
let params = {
fileName: this.newSampleData.inputFileName,
}
downloadFile(url, `result.${saveFormat}`, params, 'get')
}
if (this.isBetaGamma) {
const url =
saveFormat == 'xls'
? '/spectrumAnalysis/saveToExcel'
: saveFormat == 'txt'
? '/spectrumAnalysis/saveToTxt'
: saveFormat == 'html'
? '/spectrumAnalysis/saveToHTML'
: ''
if (!this.resultDisplayFlag) {
this.$message.warn('Please Analyse Spectrum First')
return
}
this.resultDisplayFlag.forEach((item) => {
this.params_toDB[`${item.nuclideName.toLowerCase()}Flag`] = item.nidFlag
})
this.resultDisplayFlag.forEach((item) => {
this.params_toDB[`${item.nuclideName.toLowerCase()}Flag`] = item.nidFlag
})
this.params_toDB.sampleFileName = this.newSampleData.inputFileName
this.params_toDB.gasFileName = this.newSampleData.gasFileName
this.params_toDB.detFileName = this.newSampleData.detFileName
this.params_toDB.qcFileName = this.newSampleData.qcFileName
this.params_toDB.dbName = this.newSampleData.dbName
this.params_toDB.sampleFileName = this.newSampleData.inputFileName
this.params_toDB.gasFileName = this.newSampleData.gasFileName
this.params_toDB.detFileName = this.newSampleData.detFileName
this.params_toDB.qcFileName = this.newSampleData.qcFileName
this.params_toDB.dbName = this.newSampleData.dbName
downloadFile(url, `result.${saveFormat}`, this.params_toDB, 'post')
downloadFile(url, `result.${saveFormat}`, this.params_toDB, 'post')
}
},
/**
@ -558,6 +586,13 @@ export default {
*/
handleSavePHDToFile(type) {
console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', type)
if (this.isGamma) {
const url = '/gamma/saveToPHD'
let params = {
fileName: this.newSampleData.inputFileName,
}
downloadFile(url, `result.PHD`, params, 'get')
}
},
handleReprocessAll() {
@ -610,13 +645,41 @@ export default {
getAnalyzeCurrentSpectrum() {
let params = {
dbNames: [this.newSampleData.dbName],
sampleIds: [this.newSampleData.sampleId],
sampleIds: [this.newSampleData.sampleId ? this.newSampleData.sampleId : ''],
sampleFileNames: [this.newSampleData.inputFileName],
gasFileNames: [this.newSampleData.gasFileName],
detFileNames: [this.newSampleData.detFileName],
qcFileNames: [this.newSampleData.qcFileName],
}
postAction('/spectrumAnalysis/analyseCurrentSpectrum', params).then((res) => {
if (res.success) {
this.isReAnalyed_beta = true
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)
})
} else {
this.$message.warning(res.message)
}
})
},
getAnalyzeAllSpectrum() {
let params = {
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],
currentFileName: this.newSampleData.inputFileName,
}
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) => {
@ -666,18 +729,18 @@ export default {
type: 'a-menu-item',
title: 'Compare',
show: this.isGamma,
handler: () => this.$refs.gammaAnalysisRef.showCompareModal(),
handler: () => this.$refs.gammaAnalysisRef.showCompareModal(false),
},
{
type: 'a-menu-item',
title: 'Strip',
show: this.isGamma,
handler: () => (this.stripModalVisible = true),
handler: () => this.$refs.gammaAnalysisRef.showCompareModal(true),
},
{
type: 'a-menu-item',
title: 'Ftransit',
show: this.isGamma,
show: this.isGamma || this.isBetaGamma,
handler: () => (this.ftransltModalVisible = true),
},
{
@ -737,6 +800,7 @@ export default {
key: 'all',
},
],
key: 'resultsToDB',
},
{
title: 'Save PHD to File',
@ -750,18 +814,20 @@ export default {
key: 'all',
},
],
key: 'phdToFile',
},
],
width: '170px',
},
on: {
menuClick: () => {
console.log(this.isBetaGamma, this.isGamma)
this.saveSettingModalVisible = true
},
submenuClick: ({ item, child }) => {
if (item.title == 'Save Results to DB') {
if (item.key == 'resultsToDB') {
this.handleSaveResultsToDB(child.key)
} else if (item.title == 'Save PHD to File') {
} else if (item.key == 'phdToFile') {
this.handleSavePHDToFile(child.key)
}
},
@ -823,7 +889,9 @@ export default {
type: 'a-menu-item',
title: 'Analyze all spectra',
show: this.isBetaGamma,
handler: () => {},
handler: () => {
this.getAnalyzeAllSpectrum()
},
},
],
},
@ -871,6 +939,7 @@ export default {
},
{
title: 'NUCLIDELIBRARY',
show: !this.isBetaGamma,
children: [
{
type: 'a-menu',
@ -878,13 +947,11 @@ export default {
{
type: 'a-menu-item',
title: 'Nuclide Library',
show: this.isGamma,
handler: () => (this.nuclideLibraryModalVisible = true),
},
{
type: 'a-menu-item',
title: 'Config User Library',
show: this.isGamma,
handler: () => (this.configUserLibModalVisible = true),
},
],
@ -957,9 +1024,14 @@ export default {
type: 'a-menu-item',
title: 'ARR',
handler: () => {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}
this.arrOrRRRModalType = 1
console.log(this.newSampleData)
if (this.newSampleData.sampleId) {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}
this.arrOrRRRModalType = 1
} else {
this.$message.warning("The file isn't existed.")
}
},
show: this.isGamma,
},
@ -967,9 +1039,13 @@ export default {
type: 'a-menu-item',
title: 'RRR',
handler: () => {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}
this.arrOrRRRModalType = 2
if (this.isReAnalyed_gamma) {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}
this.arrOrRRRModalType = 2
} else {
this.$message.warning('Please analyze the spectrum first!')
}
},
show: this.isGamma,
},
@ -1010,28 +1086,36 @@ export default {
{
type: 'a-menu-item',
title: 'View ARR',
handler: () => {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}
this.arrOrRRRModalType = 3
},
show: this.isBetaGamma,
handler: () => {
if (this.newSampleData.sampleId) {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}
this.arrOrRRRModalType = 3
} else {
this.$message.warning("The file isn't existed.")
}
},
},
{
type: 'a-menu-item',
title: 'View RRR',
handler: () => {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {
dbName: this.sampleData.dbName,
sampleData: false,
GasBgData: false,
DetBgData: false,
QCData: false,
bGammaEnergyValid: false,
bBetaEnergyValid: false,
if (this.isReAnalyed_beta) {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {
dbName: this.sampleData.dbName,
sampleData: false,
GasBgData: false,
DetBgData: false,
QCData: false,
bGammaEnergyValid: false,
bBetaEnergyValid: false,
}
this.arrOrRRRModalType = 4
} else {
this.$message.warning('Please analyze the spectrum first!')
}
this.arrOrRRRModalType = 4
},
show: this.isBetaGamma,
},
@ -1074,8 +1158,14 @@ export default {
title: 'Automatic Analysis Log',
show: this.isBetaGamma || this.isGamma,
handler: () => {
this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1
this.autoAnalysisMogModalVisible = true
if (this.isBetaGamma || this.isGamma) {
if (this.newSampleData.sampleId) {
this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1
this.autoAnalysisMogModalVisible = true
} else {
this.$message.warning("The file isn't existed.")
}
}
},
},
{