feat: 增加道址显示,修改ROI范围后Update按钮变红,交互分析弹窗中表格增加感兴趣元素高亮显示,增加Apply按钮以更新XeData

This commit is contained in:
Xu Zhimeng 2025-08-11 10:37:34 +08:00
parent 6deaca4d4b
commit 1c8de3ecfb
3 changed files with 322 additions and 192 deletions

View File

@ -11,7 +11,7 @@
:loading="loading"
:pagination="pagination"
:customRow="multiple && mouseMoveSelect ? customMouseMoveSelectRow : customRow"
:rowClassName="() => (canSelect ? 'custom-table-row' : '')"
:rowClassName="(record, index) => innerRowClassName(record, index)"
@change="handleTableChange"
>
<!-- 处理 scopedSlots -->
@ -25,55 +25,58 @@ export default {
props: {
list: {
type: Array,
default: () => [],
default: () => []
},
columns: {
type: Array,
default: () => [],
default: () => []
},
size: {
type: String,
default: 'middle',
default: 'middle'
},
rowKey: {
type: String,
default: 'id',
default: 'id'
},
loading: {
type: Boolean,
type: Boolean
},
pagination: {
type: [Object, Boolean],
type: [Object, Boolean]
},
selectedRowKeys: {
type: Array,
type: Array
},
selectionRows: {
type: Array,
type: Array
},
canSelect: {
type: Boolean,
default: true,
default: true
},
canDeselect: {
type: Boolean,
default: true,
default: true
},
//
multiple: {
type: Boolean,
default: false,
default: false
},
//
mouseMoveSelect: {
type: Boolean,
default: true,
default: true
},
customRowClassName: {
type: Function
}
},
data() {
return {
innerSelectedRowKeys: [],
innerSelectedRows: [],
innerSelectedRows: []
}
},
mounted() {
@ -85,6 +88,14 @@ export default {
}
},
methods: {
innerRowClassName(record, index) {
let className = ''
if (this.customRowClassName) {
className = this.customRowClassName({ record, index })
}
return (this.canSelect ? 'custom-table-row' : '') + ' ' + className
},
// /
customRow(record, index) {
const key = record[this.rowKey]
@ -98,7 +109,7 @@ export default {
//
if (this.innerSelectedRowKeys.includes(key)) {
if (this.multiple || this.canDeselect) {
const findIndex = this.innerSelectedRowKeys.findIndex((k) => k == key)
const findIndex = this.innerSelectedRowKeys.findIndex(k => k == key)
this.innerSelectedRowKeys.splice(findIndex, 1)
}
}
@ -116,8 +127,8 @@ export default {
},
dblclick: () => {
this.$emit('rowDblClick', record, index)
},
},
}
}
}
},
@ -134,7 +145,7 @@ export default {
mouseenter: () => {
if (this.mouseMoveStartIndex !== undefined) {
const indexes = [this.mouseMoveStartIndex, index].sort((a, b) => a - b)
this.innerSelectedRowKeys = this.list.slice(indexes[0], indexes[1] + 1).map((item) => item[this.rowKey])
this.innerSelectedRowKeys = this.list.slice(indexes[0], indexes[1] + 1).map(item => item[this.rowKey])
}
},
mouseup: () => {
@ -143,8 +154,8 @@ export default {
this.innerSelectedRowKeys = [key]
}
this.mouseMoveStartIndex = undefined
},
},
}
}
}
},
@ -158,7 +169,7 @@ export default {
const tableBodyEle = tableEle.querySelector('.ant-table-body')
const prevEle = tableBodyEle.querySelector(`.ant-table-row:nth-child(${index + 1})`)
tableBodyEle.scrollTop = prevEle.offsetTop
},
}
},
watch: {
selectedRowKeys(val) {
@ -166,17 +177,17 @@ export default {
},
innerSelectedRowKeys() {
this.$emit('update:selectedRowKeys', this.innerSelectedRowKeys)
this.innerSelectedRows = this.innerSelectedRowKeys.map((key) => {
return this.list.find((item) => item[this.rowKey] === key)
this.innerSelectedRows = this.innerSelectedRowKeys.map(key => {
return this.list.find(item => item[this.rowKey] === key)
})
this.$emit('update:selectionRows', this.innerSelectedRows)
},
}
},
computed: {
scopedSlotsKeys() {
return Object.keys(this.$scopedSlots)
},
},
}
}
}
</script>
<style lang="less" scoped>
@ -192,7 +203,8 @@ export default {
border-color: #416f7f;
}
.ant-table-bordered .ant-table-thead > tr > th, .ant-table-bordered .ant-table-tbody > tr > td {
.ant-table-bordered .ant-table-thead > tr > th,
.ant-table-bordered .ant-table-tbody > tr > td {
border-color: #416f7f;
}
}

View File

@ -19,26 +19,33 @@
ROI{{ index + 1 }}
</div>
<a-input-group>
<a-input
type="number"
v-model="roiParamList[index][0]"
class="spectrum-analysis-sub-operators-roi-input"
placeholder="Beta1"
:disabled="spectraType !== 'sample'"
/>
<div>
<a-input
type="number"
v-model="roiParamList[index][0]"
class="spectrum-analysis-sub-operators-roi-input"
placeholder="Beta1"
:disabled="spectraType !== 'sample'"
/>
<span class="spectrum-analysis-sub-operators-roi-energy">({{ getEnergy(roiParamList[index][0]) }})</span>
</div>
<span class="spectrum-analysis-sub-operators-roi-split">,</span>
<a-input
type="number"
v-model="roiParamList[index][1]"
class="spectrum-analysis-sub-operators-roi-input"
placeholder="Beta2"
:disabled="spectraType !== 'sample'"
/>
<div>
<a-input
type="number"
v-model="roiParamList[index][1]"
class="spectrum-analysis-sub-operators-roi-input"
placeholder="Beta2"
:disabled="spectraType !== 'sample'"
/>
<span class="spectrum-analysis-sub-operators-roi-energy">({{ getEnergy(roiParamList[index][1]) }})</span>
</div>
</a-input-group>
</div>
<a-button
type="primary"
class="spectrum-analysis-sub-operators-button"
:class="{ 'is-changed': isChanged }"
:disabled="spectraType !== 'sample'"
@click="handleUpdate"
>
@ -142,16 +149,16 @@ import SelfStationBgLogViewer from './components/Modals/SelfStation/SelfStationB
const SampleType = [
{
label: 'Sample Data',
value: 'sample',
value: 'sample'
},
{
label: 'DetBg Data',
value: 'det',
value: 'det'
},
{
label: 'QC Data',
value: 'qc',
},
value: 'qc'
}
]
const InitialRoiParamList = new Array(4).fill([0, 0])
@ -175,16 +182,16 @@ export default {
SelfStationSpectrumModal,
SelfStationPeakInfomation,
SelfStationAutomaticAnalysisLogModal,
SelfStationBgLogViewer,
SelfStationBgLogViewer
},
props: {
sample: {
type: Object,
type: Object
},
sampleList: {
type: Array,
default: () => [],
},
default: () => []
}
},
data() {
this.SampleType = SampleType
@ -200,8 +207,9 @@ export default {
ROILists: [],
ROIAnalyzeLists: [],
roiParamList: cloneDeep(InitialRoiParamList),
roiParamListState: cloneDeep(InitialRoiParamList),
resultDisplay: [],
timerStamp: Date.now(),
timerStamp: Date.now()
}
},
watch: {
@ -229,21 +237,42 @@ export default {
this.$bus.$emit('resetROIRectState')
},
immediate: true,
deep: true,
},
deep: true
}
},
created() {
this.$bus.$on('selfRefresh', this.handleRefresh)
this.$bus.$on('selfAccept', this.handleAccept)
this.$bus.$on('ReAnalyses', this.updateByReprocessingData)
this.$bus.$on('selfUpdateXeData', this.updateXeData)
},
beforeDestroy() {
this.cancelLastRequest()
this.$bus.$off('selfRefresh', this.handleRefresh)
this.$bus.$off('selfAccept', this.handleAccept)
this.$bus.$off('ReAnalyses', this.updateByReprocessingData)
this.$bus.$off('selfUpdateXeData', this.updateXeData)
},
computed: {
isChanged() {
//
return this.roiParamListState.some((item, index) => {
return item[0] !== this.roiParamList[index][0] || item[1] !== this.roiParamList[index][1]
})
}
},
methods: {
updateXeData(XeData) {
this.resultDisplay = XeData
updateSampleData({ inputFileName: this.sample.inputFileName, key: 'XeData', data: XeData })
},
//
getEnergy(channel) {
const energy = this.betaEnergyData[channel]
return energy ? energy.toFixed(2) : 0
},
// db
getROIAnalyzeListsFromResult(sampleData) {
const arr = []
@ -275,7 +304,7 @@ export default {
const arr = message.split('\n')
this.$warning({
title: 'Warning',
content: () => arr.map((text) => <div>{text}</div>),
content: () => arr.map(text => <div>{text}</div>)
})
}
} catch (error) {
@ -292,14 +321,14 @@ export default {
updateSampleData({
inputFileName,
key: 'ROIAnalyzeLists',
data: analyseList,
data: analyseList
})
// XeData
updateSampleData({
inputFileName,
key: 'XeData',
data: result.XeData,
data: result.XeData
})
this.resultDisplay = result.XeData
@ -312,18 +341,18 @@ export default {
updateSampleData({
inputFileName,
key: 'sample.betaEnergyData',
data: betaEnergyData,
data: betaEnergyData
})
updateSampleData({
inputFileName,
key: 'sample.gammaEnergyData',
data: gammaEnergyData,
data: gammaEnergyData
})
updateSampleData({
inputFileName,
key: 'savedAnalysisResult',
data: true,
data: true
})
},
@ -353,7 +382,7 @@ export default {
const params = this.roiParamList.map(([startChannel, endChannel], index) => ({
startChannel,
endChannel,
roiNum: index + 1,
roiNum: index + 1
}))
const { inputFileName } = this.sample
@ -376,7 +405,7 @@ export default {
updateSampleData({
inputFileName,
key: 'ROIAnalyzeLists',
data: cloneDeep(this.ROIAnalyzeLists),
data: cloneDeep(this.ROIAnalyzeLists)
})
this.$refs.betaChartRef.setBoundaryList(cloneDeep(this.roiParamList))
@ -388,19 +417,22 @@ export default {
updateSampleData({
inputFileName,
key: `sample.${realKey}`,
data: this.roiParamList[index][ind],
data: this.roiParamList[index][ind]
})
})
})
// XeData
this.resultDisplay = result.XeData
// RoiParamList
this.roiParamListState = cloneDeep(this.roiParamList)
} else {
this.isLoading = false
const arr = message.split('\n')
this.$warning({
title: 'Warning',
content: () => arr.map((text) => <div>{text}</div>),
content: () => arr.map(text => <div>{text}</div>)
})
}
} catch (error) {
@ -416,7 +448,7 @@ export default {
let params = {
sampleFileName: inputFileName,
detFileName: detFileName,
qcFileName: qcFileName,
qcFileName: qcFileName
}
try {
this.isLoading = true
@ -427,7 +459,7 @@ export default {
addSampleData({
inputFileName,
data: result,
from: 'file',
from: 'file'
})
this.sampleDetail = result
this.changeChartByType('sample')
@ -458,7 +490,7 @@ export default {
{
dbName,
sampleId,
analyst,
analyst
},
cancelToken
)
@ -466,14 +498,14 @@ export default {
addSampleData({
inputFileName,
data: result,
from: 'db',
from: 'db'
})
const analyseList = this.getROIAnalyzeListsFromResult(result.sample)
updateSampleData({
inputFileName,
key: 'ROIAnalyzeLists',
data: analyseList,
data: analyseList
})
this.sampleDetail = result
@ -533,7 +565,7 @@ export default {
ROIThreeStart,
ROIThreeStop,
ROIFourStart,
ROIFourStop,
ROIFourStop
} = currSampleDetail
this.spectrumData = spectrumData
@ -542,10 +574,11 @@ export default {
[ROIOneStart, ROIOneStop],
[ROITwoStart, ROITwoStop],
[ROIThreeStart, ROIThreeStop],
[ROIFourStart, ROIFourStop],
[ROIFourStart, ROIFourStop]
]
this.roiParamList = cloneDeep(boundaryList)
this.roiParamListState = cloneDeep(boundaryList)
this.$nextTick(() => {
this.$refs.betaChartRef.setBoundaryList(boundaryList)
this.$refs.betaChartRef.setData(histogramDataList, histogramDataDList)
@ -562,13 +595,13 @@ export default {
},
createCancelToken() {
const cancelToken = new axios.CancelToken((c) => {
const cancelToken = new axios.CancelToken(c => {
this._cancelToken = c
})
return cancelToken
},
handleGetFlag(val, obj) {
this.resultDisplay.forEach((item) => {
this.resultDisplay.forEach(item => {
if (item.nuclideName === obj.nuclideName) {
item.nidFlag = val ? 1 : 0
}
@ -592,7 +625,7 @@ export default {
updateSampleData({
inputFileName,
key: 'ROIAnalyzeLists',
data: this.ROIAnalyzeLists,
data: this.ROIAnalyzeLists
})
},
@ -606,7 +639,7 @@ export default {
shapeChannelData,
shapeEnergyData,
barChart,
BaseCtrls,
BaseCtrls
} = data
this.$set(this.ROIAnalyzeLists, index, {
@ -617,14 +650,14 @@ export default {
shapeChannelData,
shapeEnergyData,
barChart,
BaseCtrls,
BaseCtrls
})
const { inputFileName } = this.sample
updateSampleData({
inputFileName,
key: 'ROIAnalyzeLists',
data: this.ROIAnalyzeLists,
data: this.ROIAnalyzeLists
})
},
@ -647,12 +680,17 @@ export default {
if (!this.ROIAnalyzeLists || !this.ROIAnalyzeLists.length) {
throw new Error('Please Analyse Spectrum First')
}
if (this.isChanged) {
await this.confirm()
}
const { inputFileName: fileName } = this.sample
const sampleData = getSampleData(fileName)
const { success, message, result } = await getAction('/selfStation/saveToDB', {
fileName,
comment: sampleData.data.comment,
comment: sampleData.data.comment
})
if (success) {
Object.entries(result).forEach(([k, v]) => {
@ -660,7 +698,7 @@ export default {
updateSampleData({
inputFileName: fileName,
key: `${k}.spectrumData`,
data: v,
data: v
})
})
@ -670,6 +708,21 @@ export default {
}
},
confirm() {
return new Promise((resolve, reject) => {
this.$confirm({
title: 'Save Changes?',
content: "You have modified the channel addresses but haven't updated yet. Do you want to save directly?",
onOk: async () => {
resolve()
},
onCancel: () => {
reject('cancel')
}
})
})
},
// ARRRRR
showArrRRRModal(type) {
this.$refs.ARR_RRRModalRef.show(type)
@ -689,8 +742,8 @@ export default {
showBgLogViewer() {
this.$refs.bgLogViewerRef.show()
},
},
}
}
}
</script>
@ -784,15 +837,31 @@ export default {
.ant-input-group {
display: flex;
gap: 5px;
background-color: #04414d;
border: solid 1px #0b8c82;
padding: 0 5px;
> div {
width: 110px;
display: flex;
gap: 5px;
align-items: center;
span {
color: #f00;
flex-shrink: 0;
max-width: 75px;
}
}
}
&-input {
width: 80px;
flex: 1;
text-align: center;
border: 0;
background: transparent;
padding: 0;
}
&-split {
@ -819,4 +888,8 @@ export default {
}
//
</style>
.is-changed {
color: #f00;
}
</style>

View File

@ -54,12 +54,15 @@
:selectedRowKeys.sync="selectedKeys"
rowKey="index"
:canDeselect="false"
:custom-row-class-name="rowClassName"
@rowClick="handleTableRowClick"
>
</custom-table>
<div class="operators">
<a-select v-model="currROIIndex" style="flex: 1" @change="setInfoByType">
<a-select-option v-for="(_, index) in 4" :value="index" :key="index">ROI{{ _ }}</a-select-option>
<a-select-option v-for="(_, index) in nuclideNames" :value="index" :key="index">
ROI{{ index + 1 }}
</a-select-option>
</a-select>
<a-button type="primary" @click="nuclideReviewModalVisible = true">Nuclide Review Window</a-button>
<a-button type="primary" @click="handleAddPeakComment()">Add Peak Comment</a-button>
@ -127,6 +130,7 @@
</title-over-border>
<div class="reset-btn-box">
<a-button type="primary" @click="handleResetChart">Reset Chart</a-button>
<a-button type="primary" :loading="isApplying" @click="handleApply">Apply</a-button>
</div>
<div class="identify-box">
<title-over-border title="Nuclide Identify">
@ -243,7 +247,7 @@ const initialOption = {
top: 40,
left: 80,
right: 30,
bottom: 30,
bottom: 30
},
title: {
text: '',
@ -254,39 +258,39 @@ const initialOption = {
rich: {
a: {
padding: [0, 20, 0, 0],
fontSize: 16,
},
},
},
fontSize: 16
}
}
}
},
tooltip: {
trigger: 'axis',
axisPointer: {
lineStyle: {
color: '#3CAEBB',
width: 1,
},
width: 1
}
},
formatter: undefined,
className: 'figure-chart-option-tooltip',
className: 'figure-chart-option-tooltip'
},
xAxis: {
axisLine: {
lineStyle: {
color: '#ade6ee',
},
color: '#ade6ee'
}
},
splitLine: {
show: false,
show: false
},
axisLabel: {
textStyle: {
color: '#ade6ee',
},
color: '#ade6ee'
}
},
min: 1,
max: 'dataMax',
animation: false,
animation: false
},
yAxis: {
type: 'log',
@ -295,31 +299,31 @@ const initialOption = {
nameGap: 40,
nameTextStyle: {
color: '#8FD4F8',
fontSize: 16,
fontSize: 16
},
axisLine: {
show: true,
lineStyle: {
color: '#ade6ee',
},
color: '#ade6ee'
}
},
splitLine: {
show: true,
lineStyle: {
color: 'rgba(173, 230, 238, .2)',
},
color: 'rgba(173, 230, 238, .2)'
}
},
axisLabel: {
textStyle: {
color: '#ade6ee',
},
color: '#ade6ee'
}
},
min: 0.1,
max: 'dataMax',
animation: false,
animation: false
},
series: [],
brush: {},
brush: {}
}
const columns = [
@ -328,62 +332,62 @@ const columns = [
customRender: (_, __, index) => {
return index + 1
},
width: 60,
width: 60
},
{
title: 'Energy (keV)',
dataIndex: 'energy',
width: 120,
customRender: (text) => {
customRender: text => {
return text.toFixed(3)
},
}
},
{
title: 'Centroid (C)',
dataIndex: 'peakCentroid',
width: 120,
customRender: (text) => {
customRender: text => {
return text.toFixed(3)
},
}
},
{
title: 'FWHM (keV)',
dataIndex: 'fwhm',
width: 120,
customRender: (text) => {
customRender: text => {
return text.toFixed(3)
},
}
},
{
title: 'Area',
dataIndex: 'area',
width: 120,
customRender: (text) => {
customRender: text => {
return text.toFixed(3)
},
}
},
{
title: 'Detectability',
dataIndex: 'significance',
width: 120,
customRender: (text) => {
customRender: text => {
return text == 'Infinity' ? 'inf' : text.toFixed(3)
},
}
},
{
title: '#Cmnt',
dataIndex: 'comments',
width: 120,
width: 120
},
{
title: 'Nuclides',
dataIndex: 'nuclides',
width: 120,
ellipsis: true,
customRender: (text) => {
customRender: text => {
return text && text.join(';')
},
},
}
}
]
//
@ -392,48 +396,48 @@ const thumbnailOption = {
top: 0,
left: 0,
right: 0,
bottom: 0,
bottom: 0
},
xAxis: {
type: 'category',
axisLine: {
lineStyle: {
color: '#fff',
},
color: '#fff'
}
},
splitLine: {
show: false,
show: false
},
axisLabel: {
show: false,
show: false
},
axisTick: {
show: false,
show: false
},
min: 1,
max: 'dataMax',
max: 'dataMax'
},
yAxis: {
type: 'value',
axisLine: {
show: false,
show: false
},
splitLine: {
show: false,
show: false
},
axisLabel: {
show: false,
show: false
},
max: 0,
min: 0,
min: 0
},
series: null,
series: null
}
const nuclideIdentifyModal = {
possibleNuclide: '',
tolerance: 0.5,
identifiedNuclide: '',
identifiedNuclide: ''
}
//
@ -441,9 +445,12 @@ const Operators = {
ADD: 1, //
REMOVE: 2, //
MODIFY: 3, //
SLOPE_CHANGE: 4, // slope
SLOPE_CHANGE: 4 // slope
}
//
const nuclideNames = ['Xe131M', 'Xe131M', 'Xe133', 'Xe135']
export default {
mixins: [SampleDataMixin],
components: {
@ -454,13 +461,13 @@ export default {
NuclideReviewModal,
GeneralCommentModal,
EditSlopeModal,
RectList,
RectList
},
props: {
colorConfig: {
type: Object,
default: () => ({}),
},
default: () => ({})
}
},
data() {
return {
@ -469,7 +476,7 @@ export default {
columns,
searchParam: {
energy: '',
tolerance: '',
tolerance: ''
},
option: cloneDeep(initialOption),
opts: { notMerge: false },
@ -515,10 +522,13 @@ export default {
replotNeeded: false,
currROIIndex: 0,
isApplying: false
}
},
created() {
this.option.tooltip.formatter = (params) => {
this.nuclideNames = nuclideNames
this.option.tooltip.formatter = params => {
const channel = parseInt(params[0].value[0])
const energy = this.energy.pointlist ? this.energy.pointlist[channel - 1].x : 0
return `<div class="channel">Channel: ${channel}</div>
@ -531,6 +541,13 @@ export default {
this.$bus.$off('selfAnalyzeSampleTypeChange', this.selfAnalyzeSampleTypeChange)
},
methods: {
rowClassName({ record }) {
const nuclides = record.nuclides || []
return -1 !== nuclides.findIndex(item => item.toLowerCase() == nuclideNames[this.currROIIndex].toLowerCase())
? 'has-nuclide'
: ''
},
// SampleType
selfAnalyzeSampleTypeChange(sampleType) {
this.sampleType = sampleType
@ -582,7 +599,7 @@ export default {
this.channelBaseLineChart = {}
this.channelCountChart = {
color: 'yellow',
pointlist: currROIItem,
pointlist: currROIItem
}
this.channelPeakChart = []
this.energy = []
@ -599,7 +616,7 @@ export default {
baseline: [],
baseStack: [],
replotUsed: false,
stepCounts: [],
stepCounts: []
}
this.list = []
@ -693,7 +710,7 @@ export default {
left = channel
}
const peaksBetweenChannel = this.list.filter((peak) => {
const peaksBetweenChannel = this.list.filter(peak => {
const centroidId = peak.peakCentroid
return centroidId >= left && centroidId <= right
})
@ -753,7 +770,7 @@ export default {
*/
adjustArea() {
const {
xAxis: { max, min },
xAxis: { max, min }
} = this.option
//
@ -775,7 +792,7 @@ export default {
if (find.x >= min && find.x <= max) {
peaks.push({
max: peakMaxY,
min: Math.min(pointlist[0].y, pointlist[pointlist.length - 1].y),
min: Math.min(pointlist[0].y, pointlist[pointlist.length - 1].y)
})
}
}
@ -784,7 +801,7 @@ export default {
const peaksMin = Math.min(...peaks.map(({ min }) => min))
const {
yAxis: { max: yAxisMax, min: yAxisMin },
yAxis: { max: yAxisMax, min: yAxisMin }
} = this.option
if (peaksMax > yAxisMax) {
@ -842,7 +859,7 @@ export default {
sampleId,
channel: Math.round(row.peakCentroid),
fileName,
gammaROINum: this.currROIIndex + 1,
gammaROINum: this.currROIIndex + 1
})
if (success) {
const { possible } = result
@ -867,7 +884,7 @@ export default {
sampleId,
fileName,
...this.searchParam,
gammaROINum: this.currROIIndex + 1,
gammaROINum: this.currROIIndex + 1
})
if (success) {
const { list } = result
@ -922,7 +939,7 @@ export default {
shadowEnergyChart,
shapeChannelData,
shapeEnergyData,
table,
table
} = result
this.$bus.$emit(
@ -936,7 +953,7 @@ export default {
shapeEnergyData,
peak: table,
barChart: this.barChart,
BaseCtrls: cloneDeep(this.BaseCtrls),
BaseCtrls: cloneDeep(this.BaseCtrls)
},
this.currROIIndex
)
@ -986,8 +1003,8 @@ export default {
content: 'Are you sure to delete this peak?',
cancelButtonProps: {
props: {
type: 'warn',
},
type: 'warn'
}
},
onOk: async () => {
// this.list.splice(findIndex, 1)
@ -1009,7 +1026,7 @@ export default {
const { success, result, message } = await getAction('/selfStation/deletePeak', {
fileName,
curRow: this.curRow,
gammaROINum: this.currROIIndex + 1,
gammaROINum: this.currROIIndex + 1
})
if (success) {
const {
@ -1019,7 +1036,7 @@ export default {
shadowEnergyChart,
shapeChannelData,
shapeEnergyData,
table,
table
} = result
this.$bus.$emit(
@ -1033,7 +1050,7 @@ export default {
shapeEnergyData,
peak: table,
barChart: this.barChart,
BaseCtrls: cloneDeep(this.BaseCtrls),
BaseCtrls: cloneDeep(this.BaseCtrls)
},
this.currROIIndex
)
@ -1069,7 +1086,7 @@ export default {
} catch (error) {
console.error(error)
}
},
}
})
},
@ -1136,8 +1153,8 @@ export default {
key: 'brush',
brushOption: {
// brush brushType false
brushType: 'rect',
},
brushType: 'rect'
}
})
},
@ -1152,12 +1169,12 @@ export default {
//
chart.dispatchAction({
type: 'brush',
areas: [],
areas: []
})
//
chart.dispatchAction({
type: 'takeGlobalCursor',
type: 'takeGlobalCursor'
})
},
@ -1168,8 +1185,8 @@ export default {
if (areas) {
const range = areas.range
const [[minX, maxX], [minY, maxY]] = range
const point1 = chart.convertFromPixel({ seriesIndex: 0 }, [minX, minY]).map((num) => parseInt(num.toFixed()))
const point2 = chart.convertFromPixel({ seriesIndex: 0 }, [maxX, maxY]).map((num) => parseInt(num.toFixed()))
const point1 = chart.convertFromPixel({ seriesIndex: 0 }, [minX, minY]).map(num => parseInt(num.toFixed()))
const point2 = chart.convertFromPixel({ seriesIndex: 0 }, [maxX, maxY]).map(num => parseInt(num.toFixed()))
const xAxisMax = chart.getModel().getComponent('xAxis').axis.scale._extent[1]
const yAxisMax = this.option.yAxis.max
let [x1, y2, x2, y1] = [...point1, ...point2] //
@ -1221,6 +1238,28 @@ export default {
}
},
//
async handleApply() {
try {
this.isApplying = true
const { sampleId, inputFileName: fileName } = this.sampleData
const { success, message, result } = await getAction('/selfStation/recalculateActivity', {
fileName,
sampleId
})
if (success) {
const { XeData } = result
this.$bus.$emit('selfUpdateXeData', XeData)
} else {
this.$message.error(message || 'Apply failed!')
}
} catch (error) {
console.log(error)
} finally {
this.isApplying = false
}
},
//
handleSwitchOperation() {
// Base Line Control Point
@ -1235,7 +1274,7 @@ export default {
this.baseCtrls_Copy.baseline.map((val, index) => [index + 1, val]),
this.colorConfig.Color_Fitbase || '#fff',
{
zlevel: 21,
zlevel: 21
}
)
this.option.series.push(baseLineEditSeries)
@ -1249,7 +1288,7 @@ export default {
this.btnGroupType = 1
this.opts.notMerge = true
const baseLineEditSeries = findSeriesByName(this.option.series, 'BaseLine_Edit')
const index = this.option.series.findIndex((item) => item == baseLineEditSeries)
const index = this.option.series.findIndex(item => item == baseLineEditSeries)
this.option.series.splice(index, 1)
this.clearRect()
@ -1295,7 +1334,7 @@ export default {
this.isModifying = false
this.pushOperationStack(Operators.MODIFY, {
index,
prevYAxis,
prevYAxis
})
},
@ -1319,7 +1358,7 @@ export default {
// Peaks
redrawPeaks(peakList) {
this.option.series = this.option.series.filter((item) => {
this.option.series = this.option.series.filter(item => {
return !item.name.includes('Peak_')
})
this.option.series.push(...this.buildPeaks(peakList))
@ -1395,7 +1434,7 @@ export default {
index: i,
removeXAxis,
removeYAxis,
removeYSlope,
removeYSlope
})
},
@ -1431,7 +1470,7 @@ export default {
this.$refs.editSlopeModal.open({
index: i,
value: yslope[i],
allowNaN: !(i == 0 || i == n - 1),
allowNaN: !(i == 0 || i == n - 1)
})
},
@ -1445,7 +1484,7 @@ export default {
yslope[index] = slope
this.pushOperationStack(Operators.SLOPE_CHANGE, {
index,
slope: prevSlope,
slope: prevSlope
})
this.redrawBaseLine()
this.buildRect()
@ -1469,7 +1508,7 @@ export default {
...this.baseCtrls_Copy,
fileName,
replotNeeded: this.replotNeeded,
gammaROINum: this.currROIIndex + 1,
gammaROINum: this.currROIIndex + 1
})
if (success) {
const { chartData, peakSet, shapeData } = result
@ -1488,8 +1527,8 @@ export default {
color,
point: {
x: xAxis,
y: yctrl[index],
},
y: yctrl[index]
}
}
})
baseLineCP.data = this.buildCPPointData(baseCPPoints)
@ -1522,8 +1561,8 @@ export default {
itemStyle: {
color: 'transparent',
borderColor: color,
borderWidth: size / 2,
},
borderWidth: size / 2
}
}
})
},
@ -1536,7 +1575,7 @@ export default {
const { success, result, message } = await postAction('/selfStation/acceptBaseLine', {
...this.baseCtrls_Copy,
fileName,
gammaROINum: this.currROIIndex + 1,
gammaROINum: this.currROIIndex + 1
})
if (success) {
this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
@ -1550,7 +1589,7 @@ export default {
shadowEnergyChart,
shapeChannelData,
shapeData,
shapeEnergyData,
shapeEnergyData
} = result
this.channelBaseLineChart = channelBaseLineChart
@ -1572,7 +1611,7 @@ export default {
'selfAccept',
{
...result,
BaseCtrls: cloneDeep(this.baseCtrls_Copy),
BaseCtrls: cloneDeep(this.baseCtrls_Copy)
},
this.currROIIndex
)
@ -1626,7 +1665,7 @@ export default {
if (this.selectedTableItem._deleting) {
return
}
const findIndex = nuclides.findIndex((nuclide) => nuclide == this.model.identifiedNuclide)
const findIndex = nuclides.findIndex(nuclide => nuclide == this.model.identifiedNuclide)
if (-1 !== findIndex) {
try {
this.$set(this.selectedTableItem, '_deleting', true)
@ -1636,7 +1675,7 @@ export default {
nuclideName: this.model.identifiedNuclide,
fileName,
list_identify: nuclides,
gammaROINum: this.currROIIndex + 1,
gammaROINum: this.currROIIndex + 1
})
if (success) {
const { identify, table } = result
@ -1664,15 +1703,15 @@ export default {
silent: true,
symbol: 'none',
label: {
show: false,
show: false
},
lineStyle: {
color: 'red',
width: 1,
width: 1
},
data: [{ xAxis: -1 }],
data: [{ xAxis: -1 }]
},
zlevel: 10,
zlevel: 10
}
)
},
@ -1697,7 +1736,7 @@ export default {
data: this.buildCPPointData(channelBaseCPChart),
silent: true,
animation: false,
zlevel: 20,
zlevel: 20
}
},
@ -1708,18 +1747,18 @@ export default {
type: 'bar',
data: barChart.map(({ x, y }) => [x, y]),
itemStyle: {
color: '#fff',
color: '#fff'
},
lineStyle: {
width: 1,
width: 1
},
symbol: 'none',
symbolSize: 1,
emphasis: {
disabled: true,
disabled: true
},
animation: false,
silent: true,
silent: true
}
},
@ -1731,7 +1770,7 @@ export default {
pushOperationStack(operator, operand) {
this.operationStack.push({
operator,
operand,
operand
})
},
@ -1780,19 +1819,19 @@ export default {
handleFullScreenChange(isFullScreen) {
this.columns[7].width = isFullScreen ? 180 : 120
},
}
},
computed: {
curRow() {
const [selectedKey] = this.selectedKeys
const findIndex = this.list.findIndex((item) => item.index == selectedKey)
const findIndex = this.list.findIndex(item => item.index == selectedKey)
return findIndex
},
isOperationStackEmpty() {
return this.operationStack.length == 0
},
},
}
}
}
</script>
@ -1894,6 +1933,8 @@ export default {
.reset-btn-box {
margin-top: 20px;
margin-bottom: 30px;
display: flex;
gap: 10px;
}
.identify-box {
@ -2055,4 +2096,8 @@ export default {
}
}
}
.ant-table-tbody tr.has-nuclide {
color: yellow;
}
</style>