This commit is contained in:
wangchengming 2026-07-13 19:02:06 +08:00
parent b67f8ce9f9
commit f68d351cc9
3 changed files with 140 additions and 95 deletions

View File

@ -20,13 +20,8 @@
<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)"
>
<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>
@ -58,16 +53,8 @@
</a-row>
</a-form-model>
</div>
<a-table
ref="tableRef"
:class="list.length ? 'has-data' : ''"
:columns="columns"
:dataSource="list"
:scroll="{ y: 180 }"
:customRow="customRow"
:pagination="false"
size="small"
>
<a-table ref="tableRef" :class="list.length ? 'has-data' : ''" :columns="columns" :dataSource="list"
:scroll="{ y: 180 }" :customRow="customRow" :pagination="false" size="small">
<template slot="keyLine" slot-scope="text">
<span v-if="text == 1" class="green-check-mark"> </span>
</template>
@ -84,10 +71,8 @@
<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' : ''"
>
<div class="nuclide-review-chart-item-chart"
:class="currSelectedTableIndex == chartItem._index ? 'active' : ''">
<nuclide-review-chart :data="chartItem" />
</div>
<p>{{ chartItem.bottom }}</p>
@ -211,6 +196,7 @@ export default {
selectTableRow(index) {
this.currSelectedTableIndex = index
console.log('this.list', this.list)
let startIndex = 0
let endIndex = 0
if (index == 0) {
@ -273,7 +259,7 @@ export default {
const { sampleId, inputFileName: fileName } = this.sampleData
let url = '/gamma/nuclideReview'
// 20231219:xiao
if(this.page === 'gamma-analysis'){
if (this.page === 'gamma-analysis') {
url = '/gamma/nuclideReviewGamma'
}
const { success, result, message } = await getAction(url, {
@ -316,23 +302,45 @@ export default {
}
}
const { chart, halfLife, halfLifeErr, lines, list, name, table } = result
// 1.
const {
chart = [],
halfLife = null,
halfLifeErr = null,
lines = [],
list = [],
name = '',
table = []
} = result || {}; // resultresultnull/undefined
//
this.info = {
halfLife,
halfLifeErr,
lines,
name,
};
this.list = table;
this.nuclideList = list;
// 2. chartforEach
if (Array.isArray(chart)) {
chart.forEach((chartItem, index) => {
chartItem._index = index;
});
}
this.chartList = chart;
this.list = table
this.nuclideList = list
// 3. undefined
this.currNuclide = this.nuclideList.length ? this.nuclideList[0] : undefined;
chart.forEach((chartItem, index) => (chartItem._index = index))
this.chartList = chart
this.currNuclide = this.nuclideList[0]
this.selectTableRow(table.length > 1 ? 1 : 0)
// 4. selectTableRow table
let targetRowIndex = 0;
if (Array.isArray(table) && table.length > 1) {
targetRowIndex = 1;
}
this.selectTableRow(targetRowIndex);
},
// Nuclide
@ -342,7 +350,7 @@ export default {
const { sampleId, inputFileName } = this.sampleData
let url = '/gamma/changeNuclide'
// 20231219:xiao
if(this.page === 'gamma-analysis'){
if (this.page === 'gamma-analysis') {
url = '/gamma/changeNuclideGamma'
}
const { success, result, message } = await getAction(url, {
@ -350,21 +358,40 @@ export default {
nuclideName: this.currNuclide,
fileName: inputFileName,
})
if (success) {
const { chart, halfLife, halfLifeErr, lines, name, table } = result
if (success) {
// 1. resultnull/undefined
const {
chart = [],
halfLife = null,
halfLifeErr = null,
lines = [],
name = "",
table = []
} = result || {};
//
this.info = {
halfLife,
halfLifeErr,
lines,
name,
};
this.list = table;
// 2. chartchart/
if (Array.isArray(chart)) {
chart.forEach((chartItem, index) => {
chartItem._index = index;
});
}
this.chartList = chart;
this.list = table
chart.forEach((chartItem, index) => (chartItem._index = index))
this.chartList = chart
this.selectTableRow(table.length > 1 ? 1 : 0)
// 3. table0
let targetIndex = 0;
if (Array.isArray(table) && table.length > 1) {
targetIndex = 1;
}
this.selectTableRow(targetIndex);
} else {
this.$message.error(message)
}
@ -414,7 +441,7 @@ export default {
border-bottom: 1px solid rgba(12, 235, 201, 0.3);
background-color: rgba(12, 235, 201, 0.05);
> span {
>span {
color: @primary-color;
width: 30px;
height: 30px;
@ -526,6 +553,7 @@ export default {
&-item {
height: 100%;
p {
height: 30px;
line-height: 30px;

View File

@ -1,7 +1,8 @@
<template>
<custom-modal v-model="visible" :width="1200" :title="type == 1 || type == 3 ? 'ARR' : 'RRR'">
<a-spin :spinning="isLoading">
<a-textarea style="font-family: 仿宋" v-model="content" :readonly="type == 1 || type == 2"></a-textarea>
<a-textarea v-if="type == 1 || type == 3" style="font-family: 仿宋" v-model="content" :readonly="type == 1 || type == 3"></a-textarea>
<div v-else style="font-family: 仿宋; max-height: 680px; overflow-y: auto;" v-html="content" ></div>
</a-spin>
<div slot="custom-footer" style="text-align: center">
<a-space :size="20">
@ -16,7 +17,9 @@
import ModalMixin from '@/mixins/ModalMixin'
import { getAction, postAction } from '../../../../api/manage'
import { saveAs } from 'file-saver'
import SampleDataMixin from '../../SampleDataMixin'
import SampleDataMixin from '../../SampleDataMixin'
import * as echarts from 'echarts'
export default {
mixins: [ModalMixin, SampleDataMixin],
props: {
@ -43,13 +46,13 @@ export default {
url = '/gamma/viewARR'
break
case 2:
url = '/gamma/viewRRR'
url = '/gamma/viewRRRHtml'
break
case 3:
url = '/spectrumAnalysis/viewARR'
break
case 4:
url = '/spectrumAnalysis/viewRRR'
url = '/spectrumAnalysis/viewRRRHtml'
break
}
console.log(this.extraData)
@ -83,7 +86,8 @@ export default {
sampleId,
})
}
console.log('请求结果', res)
if (typeof res == 'string') {
this.content = res
} else {
@ -117,7 +121,7 @@ export default {
if (this.type == 1 || this.type == 3) {
saveAs(strData, `ARR_${name}.txt`)
} else {
saveAs(strData, `RRR_${name}.txt`)
saveAs(strData, `RRR_${name}.html`)
}
// let _this = this
// this.$confirm({

View File

@ -6,23 +6,15 @@
<p>Gamma Spectrum: QC</p>
<div class="content">
<div class="gamma-spectrum-chart">
<custom-chart
ref="gammaSpectrumChart"
:option="gammaSpectrumChartOption"
@zr:click="handleGammaSpectrumChartClick"
/>
<a-button type="primary" @click="handleSnapshot($refs.gammaSpectrumChart)" size="small"
>Snapshot</a-button
>
<custom-chart ref="gammaSpectrumChart" :option="gammaSpectrumChartOption"
@zr:click="handleGammaSpectrumChartClick" />
<a-button type="primary" @click="handleSnapshot($refs.gammaSpectrumChart)"
size="small">Snapshot</a-button>
<!-- 自定义tooltip用于点击图表后的tooltip显示 -->
<div
v-if="tooltipVisible"
class="custom-tool-tip"
:style="{
top: tooltipPosition.top + 'px',
left: tooltipPosition.left + 'px',
}"
>
<div v-if="tooltipVisible" class="custom-tool-tip" :style="{
top: tooltipPosition.top + 'px',
left: tooltipPosition.left + 'px',
}">
<div class="channel">Channel: {{ tooltipChannel }}</div>
</div>
<!-- tooltip结束 -->
@ -34,24 +26,17 @@
<a-input-number v-model="channelAndEnergyModel.channel" size="small"></a-input-number>
</a-form-model-item>
<a-form-model-item label="Energy">
<a-input-number
ref="energyInputRef"
v-model="channelAndEnergyModel.energy"
size="small"
></a-input-number>
<a-input-number ref="energyInputRef" v-model="channelAndEnergyModel.energy"
size="small"></a-input-number>
</a-form-model-item>
</a-form-model>
<a-button type="primary" @click="handleAddChannelAndEnergy" size="small">Add</a-button>
<a-button type="primary" @click="handleModifyChannelAndEnergy" size="small">Modify</a-button>
</div>
<!-- 表格开始 -->
<a-table
size="small"
:columns="columns"
:dataSource="list"
:pagination="false"
:class="list.length ? 'has-data' : ''"
:scroll="{ y: 99 }"
>
<a-table size="small" :columns="columns" :dataSource="list" :pagination="false" row-key="rowCount"
v-model:selectedRowKeys="selectedRowKeys" :customRow="getRowEvent" :class="list.length ? 'has-data' : ''"
:scroll="{ y: 99 }" :canDeselect="false">
<template slot="operation" slot-scope="text, record, index">
<a-icon type="delete" style="color: #f00" @click="handleDel(index)"></a-icon>
</template>
@ -84,8 +69,7 @@
</p>
<div class="func">
<span>E to C : </span>
<span
>C = {{ scientificNotationStr2Fixed(e2c[0]) }} + {{ scientificNotationStr2Fixed(e2c[1]) }} *E +
<span>C = {{ scientificNotationStr2Fixed(e2c[0]) }} + {{ scientificNotationStr2Fixed(e2c[1]) }} *E +
{{ scientificNotationStr2Fixed(e2c[2]) }} *E <sup>2</sup>
</span>
</div>
@ -95,30 +79,21 @@
<span>C to E : </span>
<span>
E =
<a-input-number
size="small"
v-model="newCalibrationFuncModel.paramA"
@change="newCalibrationFuncModelChange()"
/>
<a-input-number size="small" v-model="newCalibrationFuncModel.paramA"
@change="newCalibrationFuncModelChange()" />
+
<a-input-number
size="small"
v-model="newCalibrationFuncModel.paramB"
@change="newCalibrationFuncModelChange()"
/>
<a-input-number size="small" v-model="newCalibrationFuncModel.paramB"
@change="newCalibrationFuncModelChange()" />
*C +
<a-input-number
size="small"
v-model="newCalibrationFuncModel.paramC"
@change="newCalibrationFuncModelChange()"
/>
<a-input-number size="small" v-model="newCalibrationFuncModel.paramC"
@change="newCalibrationFuncModelChange()" />
*C <sup>2</sup>
</span>
</p>
<div class="func">
<span>E to C : </span>
<span
>C = {{ scientificNotationStr2Fixed(newE2C[0]) }} + {{ scientificNotationStr2Fixed(newE2C[1]) }} *E
<span>C = {{ scientificNotationStr2Fixed(newE2C[0]) }} + {{ scientificNotationStr2Fixed(newE2C[1]) }}
*E
+ {{ scientificNotationStr2Fixed(newE2C[2]) }} *E <sup>2</sup>
</span>
</div>
@ -465,6 +440,8 @@ export default {
count: 0, // tableWidgets
isInverse: false, //
gammaIsFitting: false,
selectedRowKeys: []
}
},
created() {
@ -489,12 +466,13 @@ export default {
})
if (res.success) {
const { CToE, EToC, gammaEnergy, gammaSpectrum, max, min, oldScatterSeries, newCToE, newEToC } = res.result
const { CToE, EToC, gammaEnergy, gammaSpectrum, max, min, oldScatterSeries, newCToE, newEToC, tableWidgets } = res.result
this.c2e = CToE
this.e2c = EToC
this.oldScatterSeries = oldScatterSeries
this.count = oldScatterSeries.length
this.list = tableWidgets
const { max: _max, min: _min, interval: _interval } = splitAxis(max, min, 4)
@ -615,6 +593,40 @@ export default {
this.isInverse = true
},
// Channel Energy
handleModifyChannelAndEnergy() {
if (this.selectedRowKeys.length) {
const centroid = parseFloat(this.channelAndEnergyModel.channel)
const energy = parseFloat(this.channelAndEnergyModel.energy)
if (Number.isNaN(centroid) || Number.isNaN(energy)) {
this.$message.warn('Format is invalid.')
return
}
const [currSelectedIndex] = this.selectedRowKeys
this.list[currSelectedIndex].channel = centroid
this.list[currSelectedIndex].energy = energy
}
},
//
getRowEvent(record, index) {
return {
on: {
click: () => {
this.handleRowClick(record, index)
}
}
}
},
handleRowClick(row, index) {
// row-keyrowCount
this.selectedRowKeys = [index]
//
this.channelAndEnergyModel = cloneDeep(row)
},
//
newCalibrationFuncModelChange(val, a) {
// table 20231028Xiao
@ -827,6 +839,7 @@ p {
border: 1px solid #0c6a66;
padding: 10px;
}
.gamma-spectrum-qc {
.gamma-spectrum-chart {
height: 200px;
@ -905,7 +918,7 @@ p {
flex: 1;
gap: 10px;
> div {
>div {
&:first-child {
flex: 10;
}