提交
This commit is contained in:
parent
b67f8ce9f9
commit
f68d351cc9
|
|
@ -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 || {}; // 兜底result本身为空的情况(result为null/undefined)
|
||||
|
||||
// 基础赋值
|
||||
this.info = {
|
||||
halfLife,
|
||||
halfLifeErr,
|
||||
lines,
|
||||
name,
|
||||
};
|
||||
|
||||
this.list = table;
|
||||
this.nuclideList = list;
|
||||
|
||||
// 2. 遍历chart前判断数组存在,避免forEach报错
|
||||
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. 兜底result为null/undefined,解构全部字段并设置默认值
|
||||
const {
|
||||
chart = [],
|
||||
halfLife = null,
|
||||
halfLifeErr = null,
|
||||
lines = [],
|
||||
name = "",
|
||||
table = []
|
||||
} = result || {};
|
||||
|
||||
// 基础赋值
|
||||
this.info = {
|
||||
halfLife,
|
||||
halfLifeErr,
|
||||
lines,
|
||||
name,
|
||||
};
|
||||
this.list = table;
|
||||
|
||||
// 2. 安全遍历chart,chart不是数组/空数组都不会报错
|
||||
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. 安全计算表格行下标,table非数组时强制下标0
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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-key(rowCount)
|
||||
this.selectedRowKeys = [index]
|
||||
// 回填表单数据
|
||||
this.channelAndEnergyModel = cloneDeep(row)
|
||||
},
|
||||
// 输入框发生变化
|
||||
newCalibrationFuncModelChange(val, a) {
|
||||
// 输入内容的时候 需要清空table数据 20231028:Xiao
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user