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

This commit is contained in:
renpy 2023-09-05 14:26:55 +08:00
commit 595e71c2f4
12 changed files with 617 additions and 443 deletions

View File

@ -88,4 +88,9 @@ export function buildLineSeries(name, data, color, extra = {}) {
animation: false,
...extra
}
}
// 根据name查找series
export function findSeriesByName(series, seriesName) {
return series.find(item => item.name == seriesName)
}

View File

@ -0,0 +1,8 @@
export default {
inject: ['sample'],
computed: {
sampleData() {
return this.sample()
}
}
}

View File

@ -11,7 +11,7 @@
<div slot="custom-footer">
<a-space>
<a-button type="primary" @click="handlePeaks">Peaks</a-button>
<a-button>Cancel</a-button>
<a-button @click="visible = false">Cancel</a-button>
</a-space>
</div>
</custom-modal>

View File

@ -2,6 +2,7 @@
<custom-chart :option="option" />
</template>
<script>
import { cloneDeep } from 'lodash'
import CustomChart from '@/components/CustomChart/index.vue'
const initialOption = {
grid: {
@ -20,9 +21,6 @@ const initialOption = {
bottom: 5
},
xAxis: {
min: 620.68,
max: 629.16,
splitNumber: 3,
axisLine: {
lineStyle: {
color: '#fff'
@ -33,12 +31,12 @@ const initialOption = {
},
axisLabel: {
color: '#fff'
}
},
min: 'dataMin',
max: 'dataMax',
animation: false
},
yAxis: {
min: 417,
max: 327,
interval: 90,
axisLine: {
lineStyle: {
color: '#fff'
@ -57,71 +55,68 @@ const initialOption = {
nameTextStyle: {
color: '#8FD4F8',
fontSize: 14
}
},
series: [
{
type: 'line',
data: [
[620.68, 410],
[621.98, 390],
[622.12, 337],
[623.53, 400],
[624.37, 410],
[625.37, 410],
[626.37, 410],
[627.37, 410],
[628.37, 410]
],
itemStyle: {
color: '#8BB93C'
},
symbol: 'none',
markLine: {
data: [
{
xAxis: 625.14,
label: {
formatter: '{c} keV',
color: '#f00',
fontWeight: 'bold',
fontSize: 14
}
}
],
symbol: 'none',
lineStyle: {
color: '#f00'
}
}
},
{
type: 'line',
data: [
[620.68, 367],
[622, 367],
[623, 367],
[624, 367],
[625, 367],
[626, 367],
[627, 367],
[628, 367],
[629, 367]
],
itemStyle: {
color: '#8FD4F8'
},
symbol: 'none'
}
]
animation: false
},
series: []
}
export default {
components: {
CustomChart
},
props: {
data: {
type: Object,
default: () => ({})
}
},
data() {
return {
option: initialOption
option: cloneDeep(initialOption)
}
},
watch: {
data: {
handler() {
const { chartData, selPos } = this.data
const series = []
chartData.forEach(({ pointlist, color }) => {
series.push({
type: 'line',
data: pointlist.map(({ x, y }) => [x, y]),
itemStyle: {
color: `rgb(${color})`
},
symbol: 'none',
animation: false
})
})
series[0].markLine = {
data: [
{
xAxis: selPos,
label: {
formatter: '{c} keV',
color: '#f00',
fontWeight: 'bold',
fontSize: 14
}
}
],
symbol: 'none',
lineStyle: {
color: '#f00'
},
emphasis: {
disabled: true
}
}
this.option.series = series
},
immediate: true
}
}
}

View File

@ -1,107 +1,122 @@
<template>
<custom-modal v-model="visible" :width="1200" title="Nuclide Review" :footer="null">
<div class="nuclide-review-search">
<span @click="handleNuclideChange('prev')">&lt;</span>
<a-form-model layout="inline">
<a-form-model-item label="Energy">
<a-input-number></a-input-number>
</a-form-model-item>
<a-form-model-item label="Tolerance">
<a-input-number></a-input-number>
</a-form-model-item>
<a-button type="primary">Search</a-button>
</a-form-model>
<span @click="handleNuclideChange('next')">&gt;</span>
</div>
<custom-modal v-model="visible" :width="1200" title="Nuclide Review" :footer="null" destroy-on-close>
<a-spin :spinning="isLoading">
<div class="nuclide-review-search">
<span @click="handleNuclideChange('prev')">&lt;</span>
<a-form-model layout="inline">
<a-form-model-item label="Energy">
<a-input-number v-model="model.energy"></a-input-number>
</a-form-model-item>
<a-form-model-item label="Tolerance">
<a-input-number v-model="model.tolerance"></a-input-number>
</a-form-model-item>
<a-button type="primary">Search</a-button>
</a-form-model>
<span @click="handleNuclideChange('next')">&gt;</span>
</div>
<!-- 以下是表格部分 -->
<div class="nuclide-review-table">
<div class="nuclide-review-table-nuclide">
<div class="nuclide-review-table-nuclide-header">Nuclide</div>
<div class="nuclide-review-table-nuclide-content">
<div
class="nuclide-review-table-nuclide-item"
:class="currNuclide == item ? 'active' : ''"
v-for="(item, index) in nuclideList"
:key="item.id"
@click="handleNuclideClick(index)"
<!-- 以下是表格部分 -->
<div class="nuclide-review-table">
<div class="nuclide-review-table-nuclide">
<div class="nuclide-review-table-nuclide-header">Nuclide</div>
<div class="nuclide-review-table-nuclide-content">
<div
class="nuclide-review-table-nuclide-item"
:class="currNuclide == item ? 'active' : ''"
v-for="(item, index) in nuclideList"
:key="item"
@click="handleNuclideClick(index)"
>
{{ item }}
</div>
</div>
</div>
<div class="nuclide-review-table-table">
<div class="title">
<a-form-model>
<a-row>
<a-col :span="6">
<a-form-model-item label="Name">
{{ info.name }}
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-model-item label="Half Life">
{{ info.halfLife }}
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-model-item label="Half Life Err">
{{ info.halfLifeErr }}
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-model-item label="Lines">
{{ info.lines }}
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
<a-table
:class="list.length ? 'has-data' : ''"
:columns="columns"
:dataSource="list"
:scroll="{ y: 180 }"
:customRow="customRow"
:pagination="false"
>
{{ item.title }}
</div>
<template slot="keyLine" slot-scope="text">
<span v-if="text == 1" class="green-check-mark"> </span>
</template>
</a-table>
</div>
</div>
<div class="nuclide-review-table-table">
<div class="title">
<a-form-model>
<a-row>
<a-col :span="6">
<a-form-model-item label="Name">
{{ currNuclide.title }}
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-model-item label="Half Life">
2
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-model-item label="Half Life Err">
3
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-model-item label="Lines">
4
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
<a-table
:class="list.length ? 'has-data' : ''"
:columns="columns"
:dataSource="list"
:scroll="{ y: 180 }"
:customRow="customRow"
:pagination="false"
/>
</div>
</div>
<!-- 表格部分结束 -->
<!-- 表格部分结束 -->
<!-- 以下是图表部分 -->
<div class="nuclide-review-chart">
<div class="nuclide-review-chart-prev">
<span @click="handleChangeChart('prev')">
&lt;
</span>
<!-- 以下是图表部分 -->
<div class="nuclide-review-chart">
<div class="nuclide-review-chart-prev">
<span @click="handleChangeChart('prev')">
&lt;
</span>
</div>
<a-row class="nuclide-review-chart-list">
<a-col class="nuclide-review-chart-item" :span="8" v-for="(chartItem, index) in currChartList" :key="index">
<p>{{ chartItem.title }}</p>
<div
class="nuclide-review-chart-item-chart"
:class="currSelectedTableIndex == chartItem._index ? 'active' : ''"
>
<nuclide-review-chart :data="chartItem" />
</div>
<p>{{ chartItem.bottom }}</p>
</a-col>
</a-row>
<div class="nuclide-review-chart-next">
<span @click="handleChangeChart('next')">
&gt;
</span>
</div>
</div>
<a-row class="nuclide-review-chart-list">
<a-col class="nuclide-review-chart-item" :span="8" v-for="(chartItem, index) in currChartList" :key="index">
<p>Line{{ chartItem.id }}</p>
<div class="nuclide-review-chart-item-chart" :class="currTableItem.id == chartItem.id ? 'active' : ''">
<nuclide-review-chart />
</div>
<p>Abundance: {{ chartItem.abundance }}</p>
</a-col>
</a-row>
<div class="nuclide-review-chart-next">
<span @click="handleChangeChart('next')">
&gt;
</span>
</div>
</div>
<!-- 图表部分结束 -->
<!-- 图表部分结束 -->
</a-spin>
</custom-modal>
</template>
<script>
import { getAction } from '@/api/manage'
import NuclideReviewChart from './NuclideReviewChart.vue'
import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
const columns = [
{
title: 'Id',
dataIndex: 'id',
width: '5%'
width: '5%',
customRender: (_, __, index) => {
return index + 1
}
},
{
title: 'Full Name',
@ -115,193 +130,51 @@ const columns = [
},
{
title: 'Energy Err',
dataIndex: 'energyErr',
dataIndex: 'energyUncert',
width: '15%'
},
{
title: 'Abundance(%)',
dataIndex: 'abundance',
dataIndex: 'yield',
width: '15%'
},
{
title: 'Abundance Err(%)',
dataIndex: 'abundanceErr',
dataIndex: 'yieldUncert',
width: '15%'
},
{
title: 'KeyLine',
dataIndex: 'keyLine',
width: '15%'
dataIndex: 'keyFlag',
width: '15%',
align: 'center',
scopedSlots: {
customRender: 'keyLine'
}
}
]
export default {
components: { NuclideReviewChart },
mixins: [ModalMixin, SampleDataMixin],
props: {
value: {
type: Boolean
channel: {
type: Number
}
},
data() {
this.columns = columns
return {
nuclideList: [
{
id: 1,
title: 'Ag111',
data: [
{
id: '1',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
}
]
},
{
id: 2,
title: 'Eu157',
data: [
{
id: '1',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
},
{
id: '2',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
}
]
},
{
id: 3,
title: 'Mo99',
data: [
{
id: '1',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
},
{
id: '2',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
},
{
id: '3',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
}
]
},
{
id: 4,
title: 'Pb204M',
data: [
{
id: '1',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
},
{
id: '2',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
},
{
id: '3',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
},
{
id: '4',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
},
{
id: '5',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
},
{
id: '6',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
},
{
id: '7',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
},
{
id: '8',
fullName: 'fullName',
energy: 'energy',
energyErr: 'energyErr',
abundance: 'abundance',
abundanceErr: 'abundanceErr',
keyLine: 'keyLine'
}
]
}
],
nuclideList: [],
list: [], //
currNuclide: {},
currNuclide: '',
currTableItem: {}, //
currSelectedTableIndex: 0, //
currChartList: [] // ,3
chartList: [],
currChartList: [], // ,3
model: {},
info: {}
}
},
methods: {
@ -315,16 +188,14 @@ export default {
}
},
//
handleNuclideClick(index) {
this.currNuclide = this.nuclideList[index]
this.list = this.currNuclide.data
this.selectTableRow(0)
this.getInfoByNuclide()
},
selectTableRow(index) {
const record = this.list[index]
this.currTableItem = record
this.currSelectedTableIndex = index
let startIndex = 0
let endIndex = 0
@ -342,27 +213,24 @@ export default {
if (startIndex < 0) {
startIndex = 0
}
this.currChartList = this.list.slice(startIndex, endIndex)
this.currChartList = this.chartList.slice(startIndex, endIndex)
},
// /
handleChangeChart(direction) {
const currIndex = this.list.findIndex(item => item == this.currTableItem)
const currIndex = this.currSelectedTableIndex
if (direction == 'prev') {
const willJumpIndex = currIndex - 3
if (willJumpIndex >= 0) {
this.selectTableRow(willJumpIndex)
}
else {
} else {
this.selectTableRow(0)
}
}
else if (direction == 'next') {
} else if (direction == 'next') {
const willJumpIndex = currIndex + 3
if (willJumpIndex <= this.list.length - 2) {
this.selectTableRow(willJumpIndex)
}
else {
} else {
this.selectTableRow(this.list.length - 1)
}
}
@ -371,26 +239,96 @@ export default {
// /
customRow(record, index) {
return {
class: 'custom-table-row' + (this.currTableItem == record ? ' ant-table-row-selected' : ''),
class: 'custom-table-row' + (this.currSelectedTableIndex == index ? ' ant-table-row-selected' : ''),
on: {
click: () => {
this.selectTableRow(index)
}
}
}
}
},
computed: {
visible: {
get() {
if (this.value) {
this.content = ''
},
//
async getInfo() {
try {
this.isLoading = true
const { sampleId, inputFileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/nuclideReview', {
sampleId: sampleId,
channel: this.channel,
fileName: inputFileName
})
if (success) {
const { chart, energy, halfLife, halfLifeErr, lines, list, name, table } = result
this.model = {
energy,
tolerance: 0.5
}
this.info = {
halfLife,
halfLifeErr,
lines,
name
}
this.list = table
this.nuclideList = list
chart.forEach((chartItem, index) => (chartItem._index = index))
this.chartList = chart
this.currNuclide = this.nuclideList[0]
this.selectTableRow(table.length > 1 ? 1 : 0)
} else {
this.$message.error(message)
}
return this.value
},
set(val) {
this.$emit('input', val)
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
// Nuclide
async getInfoByNuclide() {
try {
this.isLoading = true
const { sampleId, inputFileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/changeNuclide', {
sampleId,
nuclideName: this.currNuclide,
fileName: inputFileName
})
if (success) {
console.log('%c [ ]-301', 'font-size:13px; background:pink; color:#bf2c9f;', result)
const { chart, halfLife, halfLifeErr, lines, name, table } = result
this.info = {
halfLife,
halfLifeErr,
lines,
name
}
this.list = table
chart.forEach((chartItem, index) => (chartItem._index = index))
this.chartList = chart
this.selectTableRow(table.length > 1 ? 1 : 0)
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
beforeModalOpen() {
this.getInfo()
}
}
}
@ -561,4 +499,19 @@ export default {
.custom-table-row {
cursor: pointer;
}
.green-check-mark {
&::after {
@color: #3df9a7;
content: '';
border-radius: 0px;
width: 16px;
height: 9px;
display: inline-block;
border-bottom: 3px solid @color;
border-left: 3px solid @color;
transform: rotate(-45deg);
}
}
</style>

View File

@ -41,7 +41,7 @@
<!-- 右侧 -->
<div class="interactive-analysis-tools-right">
<title-over-border title="Peak">
<title-over-border :title="btnGroupType == 1 ? 'Peak' : 'Baseline Control Points'">
<div class="peak-box">
<!-- 按钮组1 -->
<template v-if="btnGroupType == 1">
@ -61,13 +61,13 @@
</div>
<div class="peak-box-item base-line">
<a-button type="primary" @click="btnGroupType = 2">BaseLine</a-button>
<a-button type="primary" @click="handleSwitchOperation">BaseLine</a-button>
</div>
</template>
<!-- 按钮组2 -->
<template v-if="btnGroupType == 2">
<div class="peak-box-item">
<a-button type="primary">(A)dd CP</a-button>
<a-button type="primary" @click="handleAddCP">(A)dd CP</a-button>
</div>
<div class="peak-box-item">
<a-button type="primary">(R)emove CP</a-button>
@ -85,10 +85,10 @@
<a-button type="primary">Replot</a-button>
</div>
<div class="peak-box-item">
<a-button type="primary" @click="btnGroupType = 1">Accept</a-button>
<a-button type="primary" @click="handleAccept">Accept</a-button>
</div>
<div class="peak-box-item">
<a-button type="primary" @click="btnGroupType = 1">Cancel</a-button>
<a-button type="primary" @click="handleSwitchOperation">Cancel</a-button>
</div>
</template>
</div>
@ -107,20 +107,42 @@
<div class="title">
Possible Nuclide
</div>
<div class="content"></div>
<div class="content">
<template v-if="selectedTableItem && selectedTableItem._possible">
<div
class="item"
:class="{ active: possible == model.possibleNuclide }"
v-for="(possible, index) in selectedTableItem._possible"
:key="index"
@click="model.possibleNuclide = possible"
>
{{ possible }}
</div>
</template>
</div>
</div>
<div class="identify-item">
<div class="title">
Nuclide Identified
</div>
<div class="content"></div>
<div class="content">
<template v-if="selectedTableItem">
<div
class="item"
:class="{ active: identified == model.identifiedNuclide }"
v-for="(identified, index) in selectedTableItem.nuclides"
:key="index"
@click="model.identifiedNuclide = identified"
>
{{ identified }}
</div>
</template>
</div>
</div>
<div class="identify-operators">
<a-space>
<a-input></a-input>
<a-button type="primary">Add</a-button>
<a-button type="primary" @click="handleDelCurrNuclide">Del</a-button>
</a-space>
<span class="text">{{ model.possibleNuclide }}</span>
<a-button type="primary" :disabled="!model.possibleNuclide" @click="handleAddNuclide">Add</a-button>
<a-button type="primary" @click="handleDelNuclide">Del</a-button>
</div>
</title-over-border>
</div>
@ -135,7 +157,7 @@
<fit-peaks-and-base-line-modal v-model="fitPeaksAndBaselineModalVisible" />
<!-- Fit Peaks and Baseline弹窗 结束 -->
<!-- Nuclide Review 弹窗开始 -->
<nuclide-review-modal v-model="nuclideReviewModalVisible" />
<nuclide-review-modal v-model="nuclideReviewModalVisible" :sampleId="sampleId" :channel="currChannel" />
<!-- Nuclide Review 弹窗结束 -->
</custom-modal>
</template>
@ -150,14 +172,16 @@ import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '@/api/manage'
import { cloneDeep } from 'lodash'
import Response from './Response.json'
import { getXAxisAndYAxisByPosition } from '@/utils/chartHelper'
import { findSeriesByName, getXAxisAndYAxisByPosition } from '@/utils/chartHelper'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
//
const initialOption = {
grid: {
top: 40,
left: 60,
right: 50,
left: 40,
right: 30,
bottom: 30,
containLabel: true
},
title: {
@ -190,14 +214,6 @@ const initialOption = {
className: 'figure-chart-option-tooltip'
},
xAxis: {
name: 'Channel',
nameTextStyle: {
color: '#8FD4F8',
fontSize: 16,
align: 'right',
verticalAlign: 'top',
padding: [30, 0, 0, 0]
},
axisLine: {
lineStyle: {
color: '#ade6ee'
@ -217,6 +233,8 @@ const initialOption = {
},
yAxis: {
name: 'Counts',
nameLocation: 'center',
nameGap: 40,
nameTextStyle: {
color: '#8FD4F8',
fontSize: 16
@ -238,7 +256,7 @@ const initialOption = {
color: '#ade6ee'
}
},
min: 1,
min: 'dataMin',
max: 'dataMax',
animation: false
},
@ -261,7 +279,7 @@ const columns = [
},
{
title: 'Centroid (C)',
dataIndex: 'centroid',
dataIndex: 'peakCentroid',
width: 120
},
{
@ -287,7 +305,10 @@ const columns = [
{
title: 'Nuclides',
dataIndex: 'nuclides',
width: 120
width: 120,
customRender: text => {
return text && text.join(';')
}
}
]
@ -329,7 +350,7 @@ const thumbnailOption = {
series: []
}
export default {
mixins: [ModalMixin],
mixins: [ModalMixin, SampleDataMixin],
components: {
CustomChart,
TitleOverBorder,
@ -337,11 +358,6 @@ export default {
FitPeaksAndBaseLineModal,
NuclideReviewModal
},
props: {
sampleId: {
type: Number
}
},
data() {
this.columns = columns
return {
@ -351,6 +367,7 @@ export default {
isLoading: false,
list: [],
sampleId: -1,
commentModalVisible: false, // Comment
commentType: 'Peak',
@ -363,10 +380,13 @@ export default {
nuclideReviewModalVisible: false, // Nuclide Review
model: {
possibleNuclideList: [],
possibleNuclide: '',
tolerance: 0.5,
identifiedNuclide: '',
}
identifiedNuclide: ''
},
currChannel: undefined, // currChannelchannel
selectedTableItem: undefined //
}
},
methods: {
@ -375,10 +395,11 @@ export default {
this.isLoading = true
this.option.series = []
// const { success, result, message } = Response
const { success, result, message } = await getAction('/gamma/InteractiveTool', {
sampleId: this.sampleId
})
const { success, result, message } = Response
// const { success, result, message } = await getAction('/gamma/InteractiveTool', {
// sampleId: this.sampleId,
// fileName: this.fileName
// })
if (success) {
const {
barChart,
@ -465,7 +486,11 @@ export default {
this.thumbnailOption.series.push(
this.buildSeriesOption(
'BarChart',
barChart.map(({ x, y }) => [x, y])
barChart.map(({ x, y }) => [x, y]),
'#fff',
{
silent: true
}
)
)
@ -502,6 +527,13 @@ export default {
},
beforeModalOpen() {
const { sampleId, inputFileName } = this.sampleData
this.sampleId = sampleId
this.fileName = inputFileName
this.currChannel = undefined
this.btnGroupType = 1
this.getInfo()
this.opts.notMerge = false
@ -519,6 +551,8 @@ export default {
const xAxis = parseInt(point[0].toFixed())
this.option.series[0].markLine.data[0].xAxis = xAxis
this.currChannel = xAxis
// Channel
const maxXAxises = this.getPeakMaxValues()
@ -540,7 +574,12 @@ export default {
continue
}
}
this.selectedKeys = [this.list[index].index]
const selectedRow = this.list[index]
this.selectedKeys = [selectedRow.index]
this.getSelPosNuclide(selectedRow)
}
},
@ -576,6 +615,31 @@ export default {
}
},
// possible nuclide identified nuclide
async getSelPosNuclide(row) {
this.model.possibleNuclide = ''
this.model.identifiedNuclide = ''
if (!row._possible) {
try {
const { success, result, message } = await getAction('/gamma/getSelPosNuclide', {
sampleId: this.sampleId,
channel: parseInt(row.peakCentroid),
nuclides: row.nuclides.join(','),
fileName: this.fileName
})
if (success) {
const { possible } = result
this.$set(row, '_possible', possible)
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
}
},
// Channel
getPeakMaxValues() {
const maxXAxises = this.channelPeakChart.map(item => {
@ -631,19 +695,26 @@ export default {
//
handleFit() {
if(!this.list.length) {
if (!this.list.length) {
this.$message.warn('No peak to fit.')
return
}
},
//
handleTableRowClick(_, index) {
const pointlist = this.channelPeakChart[index].pointlist
handleTableRowClick(row) {
if (this.selectedTableItem == row) {
return
}
const allY = pointlist.map(point => point.y)
const findMax = pointlist.find(point => point.y == Math.max(...allY))
this.option.series[0].markLine.data[0].xAxis = findMax.x
const channel = row.peakCentroid
this.currChannel = channel
this.option.series[0].markLine.data[0].xAxis = channel
this.getSelPosNuclide(row)
this.selectedTableItem = row
},
//
@ -660,9 +731,61 @@ export default {
})
},
// nuclide
handleDelCurrNuclide() {
//
handleSwitchOperation() {
// Base Line Control Point
if (this.btnGroupType == 1) {
this.btnGroupType = 2
const originalCPSeries = findSeriesByName(this.option.series, 'BaseLine')
this.option.series.push(
this.buildSeriesOption('Edit_BaseLine', originalCPSeries.data, '#fff', {
zlevel: 21
})
)
}
// Peak
else {
this.btnGroupType = 1
this.option.series.splice(this.option.series.length - 1, 1)
}
},
// 线
handleAddCP() {
const xAxis = this.option.series[0].markLine.data[0].xAxis
if (xAxis == -1) {
this.$message.warn("Can't insert Control Point out of range")
return
}
console.log('%c [ ]-735', 'font-size:13px; background:pink; color:#bf2c9f;', xAxis)
},
// Control Point
handleAccept() {},
// nuclide
handleAddNuclide() {
const nuclides = this.selectedTableItem.nuclides
const possibleNuclide = this.model.possibleNuclide
if (this.selectedTableItem && !nuclides.includes(possibleNuclide)) {
nuclides.push(possibleNuclide)
}
},
// nuclide
handleDelNuclide() {
const [willDelKey] = this.selectedKeys
const find = this.list.find(item => item.index == willDelKey)
console.log('%c [ find ]-762', 'font-size:13px; background:pink; color:#bf2c9f;', find)
if (find) {
const nuclides = find.nuclides
const findIndex = nuclides.findIndex(nuclide => nuclide == this.model.identifiedNuclide)
if (-1 !== findIndex) {
nuclides.splice(findIndex, 1)
}
}
}
}
}
@ -682,8 +805,7 @@ export default {
.thumbnail {
height: 50px;
margin-top: 10px;
margin-bottom: 35px;
margin: 10px 10px 35px 40px;
background-color: #255369;
}
@ -797,11 +919,30 @@ export default {
height: 80px;
background-color: #275466;
margin: 10px 0;
padding: 5px;
overflow: auto;
.item {
cursor: pointer;
line-height: 26px;
padding: 0 5px;
&.active {
background: #296d81;
}
}
}
}
.identify-operators {
display: flex;
gap: 10px;
.text {
flex: 1;
line-height: 32px;
background-color: #285366;
padding: 0 10px;
}
.ant-btn {
width: 50px;

View File

@ -1,15 +1,50 @@
<template>
<custom-modal v-model="visible" :width="800" title="Auto Process Log Viewer" :okHandler="handleOk">
<a-textarea :rows="18"></a-textarea>
<custom-modal v-model="visible" :width="1000" title="Auto Process Log Viewer" :okHandler="handleOk">
<a-spin :spinning="isLoading">
<pre>
{{ content }}
</pre>
</a-spin>
</custom-modal>
</template>
<script>
import { getAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
export default {
mixins: [ModalMixin],
mixins: [ModalMixin, SampleDataMixin],
props: {
type: {
type: Number
}
},
data() {
return {
content: ''
}
},
methods: {
async getInfo() {
try {
this.isLoading = true
const { sampleId } = this.sampleData
const res = await getAction(this.type == 1 ? '/gamma/viewAutomaticAnalysisLog' : '', {
sampleId
})
this.content = res
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
beforeModalOpen() {
this.getInfo()
},
handleOk() {
console.log('%c [ ]-15', 'font-size:13px; background:pink; color:#bf2c9f;')
}
@ -17,4 +52,11 @@ export default {
}
</script>
<style></style>
<style lang="less" scoped>
pre {
height: 450px;
padding: 5px;
overflow: auto;
background-color: #285367;
}
</style>

View File

@ -162,7 +162,17 @@ export default {
getAction(this.url.list, params)
.then(res => {
if (res.success) {
this.dataSource = res.result.records || res.result
const result = res.result.records || res.result
result.forEach(item => {
const fileName = item.inputFileName
if(fileName) {
const arr = fileName.split('/')
item.inputFileName = arr[arr.length - 1]
}
})
this.dataSource = result
if (res.result.total) {
this.ipagination.total = res.result.total
} else {

View File

@ -13,7 +13,7 @@
<div class="fission-product-list">
<div
class="fission-product-list-item"
:class="fissionSelectedItem1 == item ? 'active' : ''"
:class="model.nuclide1 == item ? 'active' : ''"
v-for="(item, index) in fissionProductList1"
:key="index"
@click="handleFissonSelect(item, 1)"
@ -29,7 +29,7 @@
<div class="fission-product-list">
<div
class="fission-product-list-item"
:class="fissionSelectedItem2 == item ? 'active' : ''"
:class="model.nuclide2 == item ? 'active' : ''"
v-for="(item, index) in fissionProductList2"
:key="index"
@click="handleFissonSelect(item, 2)"
@ -57,7 +57,7 @@
Fission Product 1
</div>
<div>
<a-input v-model="model.value1"></a-input>
<a-input v-model="model.product1"></a-input>
</div>
</div>
<div class="operator">
@ -68,7 +68,7 @@
Fission Product 2
</div>
<div>
<a-input v-model="model.value2"></a-input>
<a-input v-model="model.product2"></a-input>
</div>
</div>
</div>
@ -76,14 +76,14 @@
<div class="zero-time-right-center mt-20">
<!-- Fission Target -->
<title-over-border class="fission-target" title="Fission Target">
<a-radio-group v-model="model.fissionTarget">
<a-radio-group v-model="model.target">
<a-radio value="U-235">U-235</a-radio>
<a-radio value="U-238">U-238</a-radio>
<a-radio value="PU-239">PU-239</a-radio>
</a-radio-group>
</title-over-border>
<title-over-border class="fission-energy" title="Energy of Fission Neutron">
<a-radio-group v-model="model.fissionEnergy">
<a-radio-group v-model="model.energyTFH">
<a-radio value="T">T&gt;Thermal_spectrum</a-radio>
<a-radio value="F">F&gt;Fission_spectrum</a-radio>
<a-radio value="H">H-&gt;Fast_Neutron</a-radio>
@ -102,7 +102,9 @@
</title-over-border>
<div class="zero-time-right-buttons mt-20">
<a-button type="primary" :disabled="disabled" @click="handleAnalysis">Analysis</a-button>
<a-button type="primary" :disabled="disabled" :loading="isAnalyzing" @click="handleAnalysis">
Analysis
</a-button>
<a-button type="primary">Save</a-button>
<a-button type="primary">Exit</a-button>
</div>
@ -132,16 +134,10 @@ export default {
fissionProductList1: [],
fissionProductList2: [],
fissionSelectedItem1: null,
fissionSelectedItem2: null,
dateTime: '',
model: {
date: undefined,
time: undefined,
fissionTarget: '',
fissionEnergy: ''
}
model: {},
isAnalyzing: false
}
},
methods: {
@ -170,33 +166,53 @@ export default {
// Fission
handleFissonSelect(item, which) {
if (which == 1) {
this.fissionSelectedItem1 = item
this.model.nuclide1 = item
} else {
this.fissionSelectedItem2 = item
this.model.nuclide2 = item
}
},
beforeModalOpen() {
this.model.fissionTarget = 'U-235'
this.model.fissionEnergy = 'T'
this.fissionSelectedItem1 = null
this.fissionSelectedItem2 = null
this.model = {
nuclide1: '',
nuclide2: '',
product1: '',
product2: '',
target: 'U-235',
energyTFH: 'T',
date: undefined,
time: undefined
}
this.dateTime = '2015-05-30 17:30:60'
this.getInfo()
},
//
handleAnalysis() {
console.log('%c [ ]-188', 'font-size:13px; background:pink; color:#bf2c9f;')
async handleAnalysis() {
if (!this.model.product1 || !this.model.product2) {
this.$message.warn('The Fission Product is invalid!')
return
}
try {
this.isAnalyzing = true
const { success, result, message } = await getAction('/gamma/ZeroTimeAnalyse', this.model)
if (success) {
this.dateTime = result
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isAnalyzing = false
}
}
},
computed: {
disabled() {
return (
!this.fissionSelectedItem1 ||
!this.fissionSelectedItem2 ||
this.fissionSelectedItem1 == this.fissionSelectedItem2
)
return !this.model.nuclide1 || !this.model.nuclide2 || this.model.nuclide1 == this.model.nuclide2
}
}
}

View File

@ -4,7 +4,7 @@
<span class="checkbox">
<a-icon v-if="item.checked" type="check" style="color: #0de30d" />
</span>
<span class="name">{{ getFileName(item.inputFileName) }}</span>
<span class="name">{{ item.inputFileName }}</span>
<a-icon type="delete" @click.stop="handleRemove(item)" />
</a-menu-item>
</a-menu>
@ -40,17 +40,6 @@ export default {
}
}
this.$forceUpdate()
},
/**
* 获取文件名
* @param {String} inputFileName
*/
getFileName(inputFileName) {
if (inputFileName) {
const arr = inputFileName.split('/')
return arr[arr.length - 1]
}
}
},
watch: {

View File

@ -536,6 +536,7 @@ export default {
case 'Channel':
case 'Energy':
this.graphAssistance.axisType = label
this.option.xAxis.name = label
this.handleReset()

View File

@ -152,7 +152,7 @@
<rlr-modal v-model="rlrModalVisible" :sampleId="sampleData.sampleId" />
<!-- RLR 弹窗结束 -->
<automatic-analysis-log-modal v-model="autoAnalysisMogModalVisible" />
<automatic-analysis-log-modal v-model="autoAnalysisMogModalVisible" :type="autoAnalysisMogModalType" />
<!-- Beta-Gamma 的Comments 弹窗 -->
<beta-gamma-comments-modal
@ -286,6 +286,15 @@ export default {
AutomaticAnalysisLogModal,
BetaGammaExtrapolationModal
},
provide() {
return {
sample: () => {
return this.sampleData
}
}
},
data() {
this.ANALYZE_TYPE = ANALYZE_TYPE
@ -335,6 +344,7 @@ export default {
rlrModalVisible: false, // Reports -> RLR
autoAnalysisMogModalVisible: false, // Log -> Automatic Analysis Log
autoAnalysisMogModalType: 1, // Log -> Automatic Analysis Log 1gamma 2 betagamma
/**
* 以下是beta-gamma跟前面不同的弹窗
@ -357,7 +367,8 @@ export default {
this.loadSelectedSample({
sampleId: 426530,
sampleType: 'G',
dbName: 'auto'
dbName: 'auto',
inputFileName: 'CAX05_001-20230731_1528_S_FULL_37563.6.PHD'
})
},
@ -378,6 +389,7 @@ export default {
//
async loadSelectedSample(sample) {
console.log('%c [ sample ]-381', 'font-size:13px; background:pink; color:#bf2c9f;', sample)
// Bbeta-gamma P Ggamma
if (sample.sampleType == 'B') {
this.analysisType = ANALYZE_TYPE.BETA_GAMMA
@ -884,8 +896,10 @@ export default {
{
type: 'a-menu-item',
title: 'Automatic Analysis Log',
show: this.isBetaGamma,
handler: () => (this.autoAnalysisMogModalVisible = true)
handler: () => {
this.autoAnalysisMogModalType = 1
this.autoAnalysisMogModalVisible = true
}
},
{
type: 'a-menu-item',