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

View File

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

View File

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