refactor: 重构Gamma的分析进度弹窗逻辑

This commit is contained in:
Xu Zhimeng 2024-08-07 17:59:50 +08:00
parent 6e305d9e7d
commit abe080c0e3
5 changed files with 109 additions and 184 deletions

View File

@ -117,6 +117,7 @@ import TitleOverBorder from '../TitleOverBorder.vue'
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
import moment from 'moment' import moment from 'moment'
import { updateSampleData } from '@/utils/SampleStore'
export default { export default {
components: { TitleOverBorder }, components: { TitleOverBorder },
@ -146,6 +147,9 @@ export default {
result.dateTime_Conc = moment(result.dateTime_Conc || '2000/01/01 00:00:00').format('YYYY/MM/DD HH:mm:ss') result.dateTime_Conc = moment(result.dateTime_Conc || '2000/01/01 00:00:00').format('YYYY/MM/DD HH:mm:ss')
this.model = result this.model = result
//
this.$emit('changeUpdateCalibration', result.checkBox_updateCal, false)
} else { } else {
this.$message.error(message) this.$message.error(message)
} }
@ -203,7 +207,7 @@ export default {
const { success, message } = await postAction('/gamma/configureSave', param) const { success, message } = await postAction('/gamma/configureSave', param)
if (success) { if (success) {
this.$message.success('Save Success') this.$message.success('Save Success')
this.$emit('senInfo', checkBox_updateCal ? '1' : '0') this.$emit('changeUpdateCalibration', checkBox_updateCal, group_calPS)
} else { } else {
this.$message.error(message) this.$message.error(message)
} }

View File

@ -1,21 +1,22 @@
<template> <template>
<custom-modal v-model="visible" :width="400" title="Processing Monitor" :footer="null"> <custom-modal v-model="visible" :width="400" title="Processing Monitor" :footer="null">
<div class="processing"> <div class="processing">
<div v-if="calibrationUpdatesFlag" style="margin-bottom: 20px"> <!-- 是否展示上半部分的Calibration Updates未分析且Configure 中的 Update Calibration勾选了才展示 -->
<div v-if="!bAnalyed && checkBoxFlag" style="margin-bottom: 20px">
<!-- 标题 --> <!-- 标题 -->
<div class="processing-title">Calibration Updates</div> <div class="processing-title">Calibration Updates</div>
<!-- 列表 --> <!-- 列表 -->
<div class="processing-list"> <div class="processing-list">
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="status_ener1" /> <status :status="statusList[0]" />
<div class="description">Energy - Mariscotti Centroids</div> <div class="description">Energy - Mariscotti Centroids</div>
</div> </div>
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="status_reso" /> <status :status="statusList[1]" />
<div class="description">Resolution</div> <div class="description">Resolution</div>
</div> </div>
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="status_ener2" /> <status :status="statusList[2]" />
<div class="description">Energy - Fitted Centroids</div> <div class="description">Energy - Fitted Centroids</div>
</div> </div>
</div> </div>
@ -26,27 +27,27 @@
<!-- 列表 --> <!-- 列表 -->
<div class="processing-list"> <div class="processing-list">
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="status_peak" /> <status :status="statusList[3]" />
<div class="description">Peak Search</div> <div class="description">Peak Search</div>
</div> </div>
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="status_base" /> <status :status="statusList[4]" />
<div class="description">Baseline Fitting</div> <div class="description">Baseline Fitting</div>
</div> </div>
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="status_net" /> <status :status="statusList[5]" />
<div class="description">Net Area Fitting</div> <div class="description">Net Area Fitting</div>
</div> </div>
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="status_nucl" /> <status :status="statusList[6]" />
<div class="description">Nuclide Identification</div> <div class="description">Nuclide Identification</div>
</div> </div>
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="status_acti" /> <status :status="statusList[6]" />
<div class="description">Activity and MDA</div> <div class="description">Activity and MDA</div>
</div> </div>
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="status_qc" /> <status :status="statusList[7]" />
<div class="description">QC Test</div> <div class="description">QC Test</div>
</div> </div>
</div> </div>
@ -57,6 +58,10 @@
<script> <script>
import Status from './components/status.vue' import Status from './components/status.vue'
import { cloneDeep } from 'lodash'
const initialStatusList = [1, 1, 1, 2, 2, 2, 2, 2, 2]
export default { export default {
components: { components: {
Status, Status,
@ -71,9 +76,6 @@ export default {
checkBoxFlag: { checkBoxFlag: {
type: Boolean, type: Boolean,
}, },
newCheckBoxFlag: {
type: String,
},
currStep: { currStep: {
type: String, type: String,
}, },
@ -89,131 +91,39 @@ export default {
}, },
}, },
watch: { watch: {
newCheckBoxFlag: { currStep: {
handler(val) { handler(val) {
console.log('flag', val) this.setCurrStep(val || '0')
if (this.bAnalyed) {
this.calibrationUpdatesFlag = false
this.status_peak = 1
this.status_base = 2
this.status_net = 2
this.status_nucl = 2
this.status_acti = 2
this.status_qc = 2
} else {
if (val === '0') {
this.calibrationUpdatesFlag = false
this.status_peak = 1
this.status_base = 2
this.status_net = 2
this.status_nucl = 2
this.status_acti = 2
this.status_qc = 2
} else if (val === '1') {
this.calibrationUpdatesFlag = true
this.status_ener1 = 1
this.status_reso = 1
this.status_ener2 = 1
this.status_peak = 2
this.status_base = 2
this.status_net = 2
this.status_nucl = 2
this.status_acti = 2
this.status_qc = 2
} else {
this.calibrationUpdatesFlag = this.checkBoxFlag
this.status_peak = this.checkBoxFlag ? 2 : 1
this.status_ener1 = 1
this.status_reso = 1
this.status_ener2 = 1
this.status_base = 2
this.status_net = 2
this.status_nucl = 2
this.status_acti = 2
this.status_qc = 2
}
}
}, },
immediate: true, immediate: true,
}, },
currStep: { },
handler(val) { data() {
if (val === '0' && this.calibrationUpdatesFlag) { return {
this.status_ener1 = 0 statusList: cloneDeep(initialStatusList),
this.status_reso = 0 }
this.status_ener2 = 0 },
this.status_peak = 1 methods: {
} else if (val === '1') { //
this.status_ener1 = 0 setCurrStep(currStep) {
this.status_reso = 0 const realIndex = parseInt(currStep) + 1
this.status_ener2 = 0 for (let index = 0; index <= realIndex; index++) {
this.status_peak = 0 this.$set(this.statusList, index, 0)
this.status_base = 1 }
} else if (val === '2') {
this.status_ener1 = 0 const nextIndex = realIndex + 1,
this.status_reso = 0 nextStatus = this.statusList[nextIndex]
this.status_ener2 = 0 if (nextStatus) {
this.status_peak = 0 this.$set(this.statusList, nextIndex, 1)
this.status_base = 0 }
this.status_net = 1
} else if (val === '3') { if (realIndex == 7) {
this.status_ener1 = 0
this.status_reso = 0
this.status_ener2 = 0
this.status_peak = 0
this.status_base = 0
this.status_net = 0
this.status_nucl = 1
} else if (val === '4') {
this.status_ener1 = 0
this.status_reso = 0
this.status_ener2 = 0
this.status_peak = 0
this.status_base = 0
this.status_net = 0
this.status_nucl = 0
this.status_acti = 1
} else if (val === '5') {
this.status_ener1 = 0
this.status_reso = 0
this.status_ener2 = 0
this.status_peak = 0
this.status_base = 0
this.status_net = 0
this.status_nucl = 0
this.status_acti = 0
this.status_qc = 1
} else if (val === '6') {
this.status_ener1 = 0
this.status_reso = 0
this.status_ener2 = 0
this.status_peak = 0
this.status_base = 0
this.status_net = 0
this.status_nucl = 0
this.status_acti = 0
this.status_qc = 0
setTimeout(() => { setTimeout(() => {
this.$emit('closeModal') this.$emit('closeModal')
}, 500) }, 500)
} }
}, },
}, },
},
data() {
return {
calibrationUpdatesFlag: true,
status_ener1: 1,
status_reso: 1,
status_ener2: 1,
status_peak: 2,
status_base: 2,
status_net: 2,
status_nucl: 2,
status_acti: 2,
status_qc: 2,
}
},
} }
</script> </script>

View File

@ -205,7 +205,6 @@ export default {
const { success, message } = await postAction('/selfStation/configureSave', param) const { success, message } = await postAction('/selfStation/configureSave', param)
if (success) { if (success) {
this.$message.success('Save Success') this.$message.success('Save Success')
this.$emit('senInfo', checkBox_updateCal ? '1' : '0')
} else { } else {
this.$message.error(message) this.$message.error(message)
} }

View File

@ -88,14 +88,21 @@
<strip-modal ref="stripModal" /> <strip-modal ref="stripModal" />
<!-- Strip 弹窗结束 --> <!-- Strip 弹窗结束 -->
<!-- 分析-设置弹窗开始 -->
<analyze-setting-modal
v-model="analyzeConfigureModalVisible"
:sampleId="sample.sampleId"
@changeUpdateCalibration="handleUpdateCalibration"
/>
<!-- 分析-设置弹窗结束 -->
<!-- ReProcessing 弹窗开始 --> <!-- ReProcessing 弹窗开始 -->
<re-processing-modal <re-processing-modal
v-if="abc" v-if="reprocessingModalVisible"
v-model="reprocessingModalVisible" v-model="reprocessingModalVisible"
:bAnalyed="bAnalyed" :bAnalyed="bAnalyed"
:currStep="currStep" :currStep="currStep"
:checkBoxFlag="checkBox_updateCal" :checkBoxFlag="checkBox_updateCal"
:newCheckBoxFlag="newCheckBox_updateCal"
@closeModal="handleCloseModal" @closeModal="handleCloseModal"
/> />
<!-- ReProcessing 弹窗结束 --> <!-- ReProcessing 弹窗结束 -->
@ -136,15 +143,17 @@ import { readFile, zipFile } from '@/utils/file'
import { findNearPeak } from '@/utils/sampleHelper' import { findNearPeak } from '@/utils/sampleHelper'
import { add, subtract } from 'xe-utils/methods' import { add, subtract } from 'xe-utils/methods'
import { PHDParser, isSample, getSampleTypeIdentify } from '@/utils/phdHelper' import { PHDParser, isSample, getSampleTypeIdentify } from '@/utils/phdHelper'
import { addSampleData, getSampleData } from '@/utils/SampleStore' import { addSampleData, getSampleData, updateSampleData } from '@/utils/SampleStore'
import AnalyzeSettingModal from './components/Modals/AnalyzeSettingModal.vue'
export default { export default {
props: { props: {
sample: { sample: {
type: Object, type: Object,
}, },
updateFlag: { sampleList: {
type: String, type: Array,
default: () => [],
}, },
currSampleDet: { currSampleDet: {
type: Array, type: Array,
@ -162,6 +171,7 @@ export default {
CompareFileListModal, CompareFileListModal,
ReProcessingModal, ReProcessingModal,
StripModal, StripModal,
AnalyzeSettingModal,
}, },
data() { data() {
this.channelData = { this.channelData = {
@ -195,7 +205,6 @@ export default {
this.baseCtrls = {} // BaseCtrls this.baseCtrls = {} // BaseCtrls
return { return {
abc: false,
isLoading: false, isLoading: false,
isLoadingNuclide: false, isLoadingNuclide: false,
option: cloneDeep(GammaOptions.option), option: cloneDeep(GammaOptions.option),
@ -237,11 +246,12 @@ export default {
websock: null, websock: null,
lockReconnect: false, lockReconnect: false,
bAnalyed: false, // bAnalyed: false, //
checkBox_updateCal: false, //update checkBox_updateCal: true, // update, '1' '0'
newCheckBox_updateCal: false, //update
currStep: '', currStep: '',
isReAnalyed: false, isReAnalyed: false,
timerStamp: Date.now(), timerStamp: Date.now(),
analyzeConfigureModalVisible: false, //
} }
}, },
created() { created() {
@ -288,6 +298,36 @@ export default {
}, 100) }, 100)
}, },
methods: { methods: {
//
showConfigureModal() {
this.analyzeConfigureModalVisible = true
},
//
handleUpdateCalibration(updateState, applyToAll) {
this.checkBox_updateCal = updateState
//
updateSampleData({
inputFileName: this.sample.inputFileName,
key: 'checkBox_updateCal',
data: updateState,
})
//
if (applyToAll) {
this.sampleList.forEach(({ inputFileName, sampleType }) => {
// beta
if (sampleType !== 'B' && sampleType !== 'C') {
updateSampleData({
inputFileName,
key: 'checkBox_updateCal',
data: updateState,
})
}
})
}
},
// //
handleKeyboardEvent(event) { handleKeyboardEvent(event) {
this.changeRectByKeyBoard(event.key) this.changeRectByKeyBoard(event.key)
@ -536,7 +576,7 @@ export default {
dbName, dbName,
sampleId, sampleId,
analyst, analyst,
status status,
}, },
cancelToken cancelToken
) )
@ -611,11 +651,6 @@ export default {
this.isLoading = false this.isLoading = false
const { const {
dead_time,
live_time,
real_time,
start_time,
DetailedInformation, DetailedInformation,
QCFlag, QCFlag,
@ -628,13 +663,14 @@ export default {
shapeEnergyData, shapeEnergyData,
peak, peak,
BaseCtrls, BaseCtrls,
bAnalyed,
checkBox_updateCal,
} = result } = result
if (flag && (flag == 'db' || flag == 'file')) { if (flag && (flag == 'db' || flag == 'file')) {
this.bAnalyed = result.bAnalyed this.bAnalyed = bAnalyed
this.$emit('reAnalyed', this.bAnalyed) this.$emit('reAnalyed', this.bAnalyed)
this.checkBox_updateCal = result.checkBox_updateCal this.checkBox_updateCal = checkBox_updateCal
this.newCheckBox_updateCal = '2'
console.log(this.checkBox_updateCal)
} }
this.detailedInfomation = DetailedInformation this.detailedInfomation = DetailedInformation
this.qcFlags = QCFlag this.qcFlags = QCFlag
@ -1854,7 +1890,6 @@ export default {
}, },
handleCloseModal() { handleCloseModal() {
this.reprocessingModalVisible = false this.reprocessingModalVisible = false
this.abc = false
}, },
/** /**
@ -2073,7 +2108,6 @@ export default {
currStep: { currStep: {
handler(val) { handler(val) {
if (val && val == '0') { if (val && val == '0') {
this.abc = true
this.reprocessingModalVisible = true this.reprocessingModalVisible = true
} }
}, },
@ -2099,12 +2133,6 @@ export default {
}, },
immediate: true, immediate: true,
}, },
updateFlag: {
handler(val) {
this.newCheckBox_updateCal = val
},
immediate: true,
},
currSampleDet: { currSampleDet: {
handler(val) { handler(val) {
this.detailedInfomation = [...val] this.detailedInfomation = [...val]

View File

@ -43,8 +43,8 @@
v-if="isGamma" v-if="isGamma"
ref="gammaAnalysisRef" ref="gammaAnalysisRef"
:sample="sampleData" :sample="sampleData"
:sampleList="sampleList"
:currSampleDet="currSampleDet" :currSampleDet="currSampleDet"
:updateFlag="updateFlag"
@reAnalyed="handleReAnalyed" @reAnalyed="handleReAnalyed"
@compareSuccess="handleCompareSuccess" @compareSuccess="handleCompareSuccess"
/> />
@ -104,19 +104,8 @@
<save-setting-modal v-model="saveSettingModalVisible" @save="handleSaveResultsToFile" /> <save-setting-modal v-model="saveSettingModalVisible" @save="handleSaveResultsToFile" />
<!-- Save Setting 弹窗结束 --> <!-- Save Setting 弹窗结束 -->
<!-- 分析-设置弹窗开始 -->
<self-station-analyze-setting-modal
v-model="analyzeConfigureModalVisible"
:sampleId="sampleData.sampleId"
@senInfo="getUpdateFlag"
/>
<!-- 分析-设置弹窗结束 -->
<!-- 自建台站的分析-设置弹窗开始 --> <!-- 自建台站的分析-设置弹窗开始 -->
<self-station-analyze-setting-modal <self-station-analyze-setting-modal ref="selfStationAnalyzeConfigureModalRef" :sampleId="sampleData.sampleId" />
ref="selfStationAnalyzeConfigureModalRef"
:sampleId="sampleData.sampleId"
@senInfo="getUpdateFlag"
/>
<!-- 自建台站的分析-设置弹窗结束 --> <!-- 自建台站的分析-设置弹窗结束 -->
<!-- 全部分析-进度弹窗开始 --> <!-- 全部分析-进度弹窗开始 -->
<processing-monitor-modal <processing-monitor-modal
@ -276,7 +265,6 @@ import NuclideActivityAndMdcModal from './components/Modals/NuclideActivityAndMD
import MdcModal from './components/Modals/MDCModal.vue' import MdcModal from './components/Modals/MDCModal.vue'
import MultiLevelMenu from './components/MultiLevelMenu.vue' import MultiLevelMenu from './components/MultiLevelMenu.vue'
import SaveSettingModal from './components/Modals/SaveSettingModal.vue' import SaveSettingModal from './components/Modals/SaveSettingModal.vue'
import AnalyzeSettingModal from './components/Modals/AnalyzeSettingModal.vue'
import ProcessingMonitorModal from './components/Modals/ProcessingMonitorModal.vue' import ProcessingMonitorModal from './components/Modals/ProcessingMonitorModal.vue'
import AnalyzeInteractiveToolModal from './components/Modals/AnalyzeInteractiveToolModal/index.vue' import AnalyzeInteractiveToolModal from './components/Modals/AnalyzeInteractiveToolModal/index.vue'
import KorsumModal from './components/Modals/KorsumModal.vue' import KorsumModal from './components/Modals/KorsumModal.vue'
@ -343,7 +331,6 @@ export default {
NuclideActivityAndMdcModal, NuclideActivityAndMdcModal,
MultiLevelMenu, MultiLevelMenu,
SaveSettingModal, SaveSettingModal,
AnalyzeSettingModal,
ProcessingMonitorModal, ProcessingMonitorModal,
AnalyzeInteractiveToolModal, AnalyzeInteractiveToolModal,
KorsumModal, KorsumModal,
@ -411,7 +398,6 @@ export default {
saveSettingModalVisible: false, // saveSettingModalVisible: false, //
analyzeConfigureModalVisible: false, //
analyzeAllModalVisible: false, // analyzeAllModalVisible: false, //
analyzeInteractiveToolModalVisible: false, // analyzeInteractiveToolModalVisible: false, //
zeroTimeModalVisible: false, // Zero Time zeroTimeModalVisible: false, // Zero Time
@ -490,7 +476,6 @@ export default {
xe133mFlag: null, xe133mFlag: null,
xe135Flag: null, xe135Flag: null,
}, },
updateFlag: '2',
isReAnalyed_gamma: false, isReAnalyed_gamma: false,
isReAnalyed_beta: false, isReAnalyed_beta: false,
@ -540,9 +525,6 @@ export default {
handleReAnalyed(val) { handleReAnalyed(val) {
this.isReAnalyed_gamma = val this.isReAnalyed_gamma = val
}, },
getUpdateFlag(val) {
this.updateFlag = val
},
getcommentsInfo(val) { getcommentsInfo(val) {
this.params_toDB.comment = val.spectrumAnalysisCommentInfo this.params_toDB.comment = val.spectrumAnalysisCommentInfo
}, },
@ -933,12 +915,14 @@ export default {
try { try {
const { result, success, message } = await getAction('/selfStation/saveToDB', { fileName }) const { result, success, message } = await getAction('/selfStation/saveToDB', { fileName })
if (success) { if (success) {
Object.entries(result).forEach(([k, v]) => {
// DetailedInfomation // DetailedInfomation
// updateSampleData({ updateSampleData({
// inputFileName: fileName, inputFileName: fileName,
// key: 'DetailedInformation', key: `${k}.spectrumData`,
// data: [...result.DetailedInformation], data: v,
// }) })
})
} else { } else {
this.$message.error(message) this.$message.error(message)
} }
@ -1433,7 +1417,7 @@ export default {
title: 'Configure', title: 'Configure',
show: this.isGamma || this.isBeta, show: this.isGamma || this.isBeta,
handler: () => { handler: () => {
if (this.isGamma) this.analyzeConfigureModalVisible = true if (this.isGamma) this.$refs.gammaAnalysisRef.showConfigureModal()
if (this.isBeta) this.$refs.selfStationAnalyzeConfigureModalRef.open() if (this.isBeta) this.$refs.selfStationAnalyzeConfigureModalRef.open()
}, },
}, },