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

This commit is contained in:
orgin 2023-11-02 13:42:55 +08:00
commit 27f08b2fe2
3 changed files with 75 additions and 70 deletions

View File

@ -3,9 +3,7 @@
<a-spin :spinning="isLoading">
<custom-table :columns="columns" :list="list" :canSelect="false">
<template v-for="(slot, index) in slots" :slot="slot.slotName" slot-scope="{ record }">
<a-checkbox v-if="slot.isCheckbox" :key="index" v-model="record[slot.dataIndex]">
Fixed
</a-checkbox>
<a-checkbox v-if="slot.isCheckbox" :key="index" v-model="record[slot.dataIndex]"> Fixed </a-checkbox>
<a-input
v-else
:key="index"
@ -18,17 +16,10 @@
</a-spin>
<div slot="custom-footer">
<a-space>
<a-button
type="primary"
:disabled="isCanceling || isLoading"
:loading="isAcceptting"
@click="handlePeaks(true)"
>
<a-button type="primary" :disabled="isLoading" :loading="isAcceptting" @click="handlePeaks(true)">
Peaks
</a-button>
<a-button :disabled="isAcceptting || isLoading" :loading="isCanceling" @click="handlePeaks(false)"
>Cancel</a-button
>
<a-button>Cancel</a-button>
</a-space>
</div>
</custom-modal>
@ -46,106 +37,105 @@ const columns = [
dataIndex: 'lab',
width: 100,
scopedSlots: {
customRender: 'lab'
customRender: 'lab',
},
isStatic: true
isStatic: true,
},
{
title: 'Nuclide',
dataIndex: 'nuclide',
width: 100,
scopedSlots: {
customRender: 'nuclide'
customRender: 'nuclide',
},
isStatic: true
isStatic: true,
},
{
title: 'Energy',
dataIndex: 'energy',
width: 100,
scopedSlots: {
customRender: 'Energy'
}
customRender: 'Energy',
},
},
{
title: 'NetArea',
dataIndex: 'netArea',
width: 100,
scopedSlots: {
customRender: 'netArea'
}
customRender: 'netArea',
},
},
{
title: 'FWHM',
dataIndex: 'fwhm',
width: 100,
scopedSlots: {
customRender: 'fwhm'
}
customRender: 'fwhm',
},
},
{
title: 'Step',
dataIndex: 'step',
width: 100,
scopedSlots: {
customRender: 'Step'
}
customRender: 'Step',
},
},
{
title: 'BWGamma',
dataIndex: 'bwGamma',
width: 100,
scopedSlots: {
customRender: 'BWGamma'
}
customRender: 'BWGamma',
},
},
{
title: 'NetArea',
dataIndex: 'netAreaB',
width: 100,
scopedSlots: {
customRender: 'netAreaB'
customRender: 'netAreaB',
},
isCheckbox: true
isCheckbox: true,
},
{
title: 'Centroid',
dataIndex: 'centroid',
width: 100,
scopedSlots: {
customRender: 'Centroid'
customRender: 'Centroid',
},
isCheckbox: true
isCheckbox: true,
},
{
title: 'FWHM',
dataIndex: 'fwhmB',
width: 100,
scopedSlots: {
customRender: 'fwhmB'
customRender: 'fwhmB',
},
isCheckbox: true
}
isCheckbox: true,
},
]
export default {
mixins: [ModalMixin, SampleDataMixin],
props: {
channel_1: {
type: Number
type: Number,
},
channel_2: {
type: Number
type: Number,
},
isInsertPeak: {
type: Boolean
}
type: Boolean,
},
},
data() {
this.columns = columns
return {
list: [],
isAcceptting: false,
isCanceling: false
}
},
methods: {
@ -159,7 +149,7 @@ export default {
oldPeak: this.oldPeaks,
newPeak: this.newPeaks,
flag: this.isInsertPeak ? 'insert' : 'fit',
tablePeaksList: this.list
tablePeaksList: this.list,
})
if (success) {
this.visible = false
@ -176,12 +166,12 @@ export default {
//
handleInput(record, index) {
const find = this.newPeaks.find(item => item.index == record.lab)
const find = this.newPeaks.find((item) => item.index == record.lab)
if (find) {
const table2NewPeakMap = {
energy: 'energy',
netArea: 'area',
fwhm: 'fwhm'
fwhm: 'fwhm',
}
find[table2NewPeakMap[index]] = record[index]
@ -195,7 +185,7 @@ export default {
let params = {
left: this.channel_1,
right: this.channel_2,
fileName
fileName,
}
// Insert Peak
@ -204,7 +194,7 @@ export default {
params = {
sampleId,
fileName,
curChan: Math.ceil(this.channel_1)
curChan: Math.ceil(this.channel_1),
}
}
@ -212,7 +202,7 @@ export default {
const { success, result, message } = await getAction(url, params)
if (success) {
const { newPeaks, oldPeaks, tablePeaksList } = result
tablePeaksList.forEach(item => {
tablePeaksList.forEach((item) => {
item.energy = Number(item.energy).toPrecision(6)
item.netArea = Number(item.netArea).toPrecision(6)
item.fwhm = Number(item.fwhm).toPrecision(6)
@ -232,20 +222,20 @@ export default {
beforeModalOpen() {
this.getData()
}
},
},
computed: {
slots() {
return columns.map(column => {
return columns.map((column) => {
return {
isCheckbox: column.isCheckbox,
isStatic: column.isStatic,
dataIndex: column.dataIndex,
slotName: column.scopedSlots.customRender
slotName: column.scopedSlots.customRender,
}
})
}
}
},
},
}
</script>

View File

@ -381,7 +381,7 @@ const thumbnailOption = {
axisLine: {
lineStyle: {
color: '#fff',
}
},
},
splitLine: {
show: false,
@ -406,12 +406,8 @@ const thumbnailOption = {
axisLabel: {
show: false,
},
max: (value) => {
return (Math.abs(value.min) < value.max ? value.max : -value.min).toFixed(2)
},
min: (value) => {
return (Math.abs(value.min) < value.max ? -value.max : value.min).toFixed(2)
},
max: 0,
min: 0,
},
series: null,
}
@ -461,6 +457,7 @@ export default {
channelBaseLineChart: [],
channelCountChart: [],
channelPeakChart: [],
barChart: [],
energy: [],
list: [],
BaseCtrls: {},
@ -550,10 +547,12 @@ export default {
// 线
series.push(this.buildCtrlPoint(baseCP))
this.option.series = series
this.thumbnailOption.series = this.buildBarChart(bar)
this.option.series = series
const thumbnailYMax = this.getThumbnailYMax(0, bar.length)
this.thumbnailOption.yAxis.max = thumbnailYMax
this.thumbnailOption.yAxis.min = -thumbnailYMax
},
reset() {
@ -567,6 +566,7 @@ export default {
this.selectedKeys = []
})
this.clearRect()
this.handleResetChart()
},
beforeModalOpen() {
@ -1030,8 +1030,11 @@ export default {
this.option.yAxis.min = y1
this.option.yAxis.max = y2
const thumbnailYMax = this.getThumbnailYMax(x1 - 1, x2)
this.thumbnailOption.xAxis.min = x1
this.thumbnailOption.xAxis.max = x2
this.thumbnailOption.yAxis.max = thumbnailYMax
this.thumbnailOption.yAxis.min = -thumbnailYMax
if (this.btnGroupType == 2) {
this.buildRect()
@ -1040,14 +1043,26 @@ export default {
this.clearBrush(chart)
},
// barChart
getThumbnailYMax(minIndex, maxIndex) {
const slicedArr = this.barChart.slice(minIndex, maxIndex)
const yData = slicedArr.map(({ y }) => y)
const max = Math.max(...yData)
const min = Math.min(...yData)
return Math.max(Math.abs(max), Math.abs(min))
},
handleResetChart() {
this.option.xAxis.min = 1
this.option.xAxis.max = 'dataMax'
this.option.yAxis.min = 0.1
this.option.yAxis.max = 'dataMax'
const thumbnailYMax = this.getThumbnailYMax(0, this.barChart.length)
this.thumbnailOption.xAxis.min = 1
this.thumbnailOption.xAxis.max = 'dataMax'
this.thumbnailOption.yAxis.max = thumbnailYMax
this.thumbnailOption.yAxis.min = -thumbnailYMax
if (this.btnGroupType == 2) {
this.buildRect()

View File

@ -433,10 +433,10 @@ export default {
},
getStationName(arg, val, flag) {
arg.forEach((item) => {
item.conc = Number(item.conc).toPrecision(6)
item.concErr = Number(item.concErr).toPrecision(6)
item.lc = Number(item.lc).toPrecision(6)
item.mdc = Number(item.mdc).toPrecision(6)
item.conc = parseFloat(Number(item.conc).toPrecision(6))
item.concErr = parseFloat(Number(item.concErr).toPrecision(6))
item.lc = parseFloat(Number(item.lc).toPrecision(6))
item.mdc = parseFloat(Number(item.mdc).toPrecision(6))
})
this.resultDisplayFlag = arg
this.params_toDB.stationName = val
@ -725,10 +725,10 @@ export default {
this.analyseCurrentSpectrumData = res.result
this.resultDisplayFlag = res.result.XeData
this.resultDisplayFlag.forEach((item) => {
item.conc = item.conc.toPrecision(6)
item.concErr = item.concErr.toPrecision(6)
item.lc = item.lc.toPrecision(6)
item.mdc = item.mdc.toPrecision(6)
item.conc = parseFloat(item.conc.toPrecision(6))
item.concErr = parseFloat(item.concErr.toPrecision(6))
item.lc = parseFloat(item.lc.toPrecision(6))
item.mdc = parseFloat(item.mdc.toPrecision(6))
})
} else {
this.$message.warning(res.message)
@ -750,10 +750,10 @@ export default {
this.analyseCurrentSpectrumData = res.result
this.resultDisplayFlag = res.result.XeData
this.resultDisplayFlag.forEach((item) => {
item.conc = item.conc.toPrecision(6)
item.concErr = item.concErr.toPrecision(6)
item.lc = item.lc.toPrecision(6)
item.mdc = item.mdc.toPrecision(6)
item.conc = parseFloat(item.conc.toPrecision(6))
item.concErr = parseFloat(item.concErr.toPrecision(6))
item.lc = parseFloat(item.lc.toPrecision(6))
item.mdc = parseFloat(item.mdc.toPrecision(6))
})
} else {
this.$message.warning(res.message)