refactor: 重构Gamma的分析进度弹窗逻辑
This commit is contained in:
parent
6e305d9e7d
commit
abe080c0e3
|
@ -117,6 +117,7 @@ import TitleOverBorder from '../TitleOverBorder.vue'
|
|||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
import moment from 'moment'
|
||||
import { updateSampleData } from '@/utils/SampleStore'
|
||||
|
||||
export default {
|
||||
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')
|
||||
|
||||
this.model = result
|
||||
|
||||
// 更新状态
|
||||
this.$emit('changeUpdateCalibration', result.checkBox_updateCal, false)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
@ -203,7 +207,7 @@ export default {
|
|||
const { success, message } = await postAction('/gamma/configureSave', param)
|
||||
if (success) {
|
||||
this.$message.success('Save Success')
|
||||
this.$emit('senInfo', checkBox_updateCal ? '1' : '0')
|
||||
this.$emit('changeUpdateCalibration', checkBox_updateCal, group_calPS)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" :width="400" title="Processing Monitor" :footer="null">
|
||||
<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-list">
|
||||
<div class="processing-list-item">
|
||||
<status :status="status_ener1" />
|
||||
<status :status="statusList[0]" />
|
||||
<div class="description">Energy - Mariscotti Centroids</div>
|
||||
</div>
|
||||
<div class="processing-list-item">
|
||||
<status :status="status_reso" />
|
||||
<status :status="statusList[1]" />
|
||||
<div class="description">Resolution</div>
|
||||
</div>
|
||||
<div class="processing-list-item">
|
||||
<status :status="status_ener2" />
|
||||
<status :status="statusList[2]" />
|
||||
<div class="description">Energy - Fitted Centroids</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -26,27 +27,27 @@
|
|||
<!-- 列表 -->
|
||||
<div class="processing-list">
|
||||
<div class="processing-list-item">
|
||||
<status :status="status_peak" />
|
||||
<status :status="statusList[3]" />
|
||||
<div class="description">Peak Search</div>
|
||||
</div>
|
||||
<div class="processing-list-item">
|
||||
<status :status="status_base" />
|
||||
<status :status="statusList[4]" />
|
||||
<div class="description">Baseline Fitting</div>
|
||||
</div>
|
||||
<div class="processing-list-item">
|
||||
<status :status="status_net" />
|
||||
<status :status="statusList[5]" />
|
||||
<div class="description">Net Area Fitting</div>
|
||||
</div>
|
||||
<div class="processing-list-item">
|
||||
<status :status="status_nucl" />
|
||||
<status :status="statusList[6]" />
|
||||
<div class="description">Nuclide Identification</div>
|
||||
</div>
|
||||
<div class="processing-list-item">
|
||||
<status :status="status_acti" />
|
||||
<status :status="statusList[6]" />
|
||||
<div class="description">Activity and MDA</div>
|
||||
</div>
|
||||
<div class="processing-list-item">
|
||||
<status :status="status_qc" />
|
||||
<status :status="statusList[7]" />
|
||||
<div class="description">QC Test</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -57,6 +58,10 @@
|
|||
|
||||
<script>
|
||||
import Status from './components/status.vue'
|
||||
import { cloneDeep } from 'lodash'
|
||||
|
||||
const initialStatusList = [1, 1, 1, 2, 2, 2, 2, 2, 2]
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Status,
|
||||
|
@ -71,9 +76,6 @@ export default {
|
|||
checkBoxFlag: {
|
||||
type: Boolean,
|
||||
},
|
||||
newCheckBoxFlag: {
|
||||
type: String,
|
||||
},
|
||||
currStep: {
|
||||
type: String,
|
||||
},
|
||||
|
@ -89,131 +91,39 @@ export default {
|
|||
},
|
||||
},
|
||||
watch: {
|
||||
newCheckBoxFlag: {
|
||||
handler(val) {
|
||||
console.log('flag', val)
|
||||
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,
|
||||
},
|
||||
currStep: {
|
||||
handler(val) {
|
||||
if (val === '0' && this.calibrationUpdatesFlag) {
|
||||
this.status_ener1 = 0
|
||||
this.status_reso = 0
|
||||
this.status_ener2 = 0
|
||||
this.status_peak = 1
|
||||
} else if (val === '1') {
|
||||
this.status_ener1 = 0
|
||||
this.status_reso = 0
|
||||
this.status_ener2 = 0
|
||||
this.status_peak = 0
|
||||
this.status_base = 1
|
||||
} else if (val === '2') {
|
||||
this.status_ener1 = 0
|
||||
this.status_reso = 0
|
||||
this.status_ener2 = 0
|
||||
this.status_peak = 0
|
||||
this.status_base = 0
|
||||
this.status_net = 1
|
||||
} else if (val === '3') {
|
||||
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(() => {
|
||||
this.$emit('closeModal')
|
||||
}, 500)
|
||||
}
|
||||
this.setCurrStep(val || '0')
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
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,
|
||||
statusList: cloneDeep(initialStatusList),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 设置当前到第几步了
|
||||
setCurrStep(currStep) {
|
||||
const realIndex = parseInt(currStep) + 1
|
||||
for (let index = 0; index <= realIndex; index++) {
|
||||
this.$set(this.statusList, index, 0)
|
||||
}
|
||||
|
||||
const nextIndex = realIndex + 1,
|
||||
nextStatus = this.statusList[nextIndex]
|
||||
if (nextStatus) {
|
||||
this.$set(this.statusList, nextIndex, 1)
|
||||
}
|
||||
|
||||
if (realIndex == 7) {
|
||||
setTimeout(() => {
|
||||
this.$emit('closeModal')
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -205,7 +205,6 @@ export default {
|
|||
const { success, message } = await postAction('/selfStation/configureSave', param)
|
||||
if (success) {
|
||||
this.$message.success('Save Success')
|
||||
this.$emit('senInfo', checkBox_updateCal ? '1' : '0')
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
|
|
@ -88,14 +88,21 @@
|
|||
<strip-modal ref="stripModal" />
|
||||
<!-- Strip 弹窗结束 -->
|
||||
|
||||
<!-- 分析-设置弹窗开始 -->
|
||||
<analyze-setting-modal
|
||||
v-model="analyzeConfigureModalVisible"
|
||||
:sampleId="sample.sampleId"
|
||||
@changeUpdateCalibration="handleUpdateCalibration"
|
||||
/>
|
||||
<!-- 分析-设置弹窗结束 -->
|
||||
|
||||
<!-- ReProcessing 弹窗开始 -->
|
||||
<re-processing-modal
|
||||
v-if="abc"
|
||||
v-if="reprocessingModalVisible"
|
||||
v-model="reprocessingModalVisible"
|
||||
:bAnalyed="bAnalyed"
|
||||
:currStep="currStep"
|
||||
:checkBoxFlag="checkBox_updateCal"
|
||||
:newCheckBoxFlag="newCheckBox_updateCal"
|
||||
@closeModal="handleCloseModal"
|
||||
/>
|
||||
<!-- ReProcessing 弹窗结束 -->
|
||||
|
@ -136,15 +143,17 @@ import { readFile, zipFile } from '@/utils/file'
|
|||
import { findNearPeak } from '@/utils/sampleHelper'
|
||||
import { add, subtract } from 'xe-utils/methods'
|
||||
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 {
|
||||
props: {
|
||||
sample: {
|
||||
type: Object,
|
||||
},
|
||||
updateFlag: {
|
||||
type: String,
|
||||
sampleList: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
currSampleDet: {
|
||||
type: Array,
|
||||
|
@ -162,6 +171,7 @@ export default {
|
|||
CompareFileListModal,
|
||||
ReProcessingModal,
|
||||
StripModal,
|
||||
AnalyzeSettingModal,
|
||||
},
|
||||
data() {
|
||||
this.channelData = {
|
||||
|
@ -195,7 +205,6 @@ export default {
|
|||
this.baseCtrls = {} // BaseCtrls
|
||||
|
||||
return {
|
||||
abc: false,
|
||||
isLoading: false,
|
||||
isLoadingNuclide: false,
|
||||
option: cloneDeep(GammaOptions.option),
|
||||
|
@ -237,11 +246,12 @@ export default {
|
|||
websock: null,
|
||||
lockReconnect: false,
|
||||
bAnalyed: false, //是否重新分析
|
||||
checkBox_updateCal: false, //update复选框状态
|
||||
newCheckBox_updateCal: false, //update复选框状态
|
||||
checkBox_updateCal: true, // update复选框状态, 选中了是 '1',未选中是 '0'
|
||||
currStep: '',
|
||||
isReAnalyed: false,
|
||||
timerStamp: Date.now(),
|
||||
|
||||
analyzeConfigureModalVisible: false, // 分析设置弹窗
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -288,6 +298,36 @@ export default {
|
|||
}, 100)
|
||||
},
|
||||
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) {
|
||||
this.changeRectByKeyBoard(event.key)
|
||||
|
@ -536,7 +576,7 @@ export default {
|
|||
dbName,
|
||||
sampleId,
|
||||
analyst,
|
||||
status
|
||||
status,
|
||||
},
|
||||
cancelToken
|
||||
)
|
||||
|
@ -611,11 +651,6 @@ export default {
|
|||
this.isLoading = false
|
||||
|
||||
const {
|
||||
dead_time,
|
||||
live_time,
|
||||
real_time,
|
||||
start_time,
|
||||
|
||||
DetailedInformation,
|
||||
QCFlag,
|
||||
|
||||
|
@ -628,13 +663,14 @@ export default {
|
|||
shapeEnergyData,
|
||||
peak,
|
||||
BaseCtrls,
|
||||
|
||||
bAnalyed,
|
||||
checkBox_updateCal,
|
||||
} = result
|
||||
if (flag && (flag == 'db' || flag == 'file')) {
|
||||
this.bAnalyed = result.bAnalyed
|
||||
this.bAnalyed = bAnalyed
|
||||
this.$emit('reAnalyed', this.bAnalyed)
|
||||
this.checkBox_updateCal = result.checkBox_updateCal
|
||||
this.newCheckBox_updateCal = '2'
|
||||
console.log(this.checkBox_updateCal)
|
||||
this.checkBox_updateCal = checkBox_updateCal
|
||||
}
|
||||
this.detailedInfomation = DetailedInformation
|
||||
this.qcFlags = QCFlag
|
||||
|
@ -1854,7 +1890,6 @@ export default {
|
|||
},
|
||||
handleCloseModal() {
|
||||
this.reprocessingModalVisible = false
|
||||
this.abc = false
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -2073,7 +2108,6 @@ export default {
|
|||
currStep: {
|
||||
handler(val) {
|
||||
if (val && val == '0') {
|
||||
this.abc = true
|
||||
this.reprocessingModalVisible = true
|
||||
}
|
||||
},
|
||||
|
@ -2099,12 +2133,6 @@ export default {
|
|||
},
|
||||
immediate: true,
|
||||
},
|
||||
updateFlag: {
|
||||
handler(val) {
|
||||
this.newCheckBox_updateCal = val
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
currSampleDet: {
|
||||
handler(val) {
|
||||
this.detailedInfomation = [...val]
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
v-if="isGamma"
|
||||
ref="gammaAnalysisRef"
|
||||
:sample="sampleData"
|
||||
:sampleList="sampleList"
|
||||
:currSampleDet="currSampleDet"
|
||||
:updateFlag="updateFlag"
|
||||
@reAnalyed="handleReAnalyed"
|
||||
@compareSuccess="handleCompareSuccess"
|
||||
/>
|
||||
|
@ -104,19 +104,8 @@
|
|||
<save-setting-modal v-model="saveSettingModalVisible" @save="handleSaveResultsToFile" />
|
||||
<!-- Save Setting 弹窗结束 -->
|
||||
|
||||
<!-- 分析-设置弹窗开始 -->
|
||||
<self-station-analyze-setting-modal
|
||||
v-model="analyzeConfigureModalVisible"
|
||||
:sampleId="sampleData.sampleId"
|
||||
@senInfo="getUpdateFlag"
|
||||
/>
|
||||
<!-- 分析-设置弹窗结束 -->
|
||||
<!-- 自建台站的分析-设置弹窗开始 -->
|
||||
<self-station-analyze-setting-modal
|
||||
ref="selfStationAnalyzeConfigureModalRef"
|
||||
:sampleId="sampleData.sampleId"
|
||||
@senInfo="getUpdateFlag"
|
||||
/>
|
||||
<self-station-analyze-setting-modal ref="selfStationAnalyzeConfigureModalRef" :sampleId="sampleData.sampleId" />
|
||||
<!-- 自建台站的分析-设置弹窗结束 -->
|
||||
<!-- 全部分析-进度弹窗开始 -->
|
||||
<processing-monitor-modal
|
||||
|
@ -276,7 +265,6 @@ import NuclideActivityAndMdcModal from './components/Modals/NuclideActivityAndMD
|
|||
import MdcModal from './components/Modals/MDCModal.vue'
|
||||
import MultiLevelMenu from './components/MultiLevelMenu.vue'
|
||||
import SaveSettingModal from './components/Modals/SaveSettingModal.vue'
|
||||
import AnalyzeSettingModal from './components/Modals/AnalyzeSettingModal.vue'
|
||||
import ProcessingMonitorModal from './components/Modals/ProcessingMonitorModal.vue'
|
||||
import AnalyzeInteractiveToolModal from './components/Modals/AnalyzeInteractiveToolModal/index.vue'
|
||||
import KorsumModal from './components/Modals/KorsumModal.vue'
|
||||
|
@ -343,7 +331,6 @@ export default {
|
|||
NuclideActivityAndMdcModal,
|
||||
MultiLevelMenu,
|
||||
SaveSettingModal,
|
||||
AnalyzeSettingModal,
|
||||
ProcessingMonitorModal,
|
||||
AnalyzeInteractiveToolModal,
|
||||
KorsumModal,
|
||||
|
@ -411,7 +398,6 @@ export default {
|
|||
|
||||
saveSettingModalVisible: false, // 保存设置弹窗
|
||||
|
||||
analyzeConfigureModalVisible: false, // 分析设置弹窗
|
||||
analyzeAllModalVisible: false, // 全部分析设置弹窗
|
||||
analyzeInteractiveToolModalVisible: false, // 分析工具弹窗
|
||||
zeroTimeModalVisible: false, // Zero Time 弹窗
|
||||
|
@ -490,7 +476,6 @@ export default {
|
|||
xe133mFlag: null,
|
||||
xe135Flag: null,
|
||||
},
|
||||
updateFlag: '2',
|
||||
isReAnalyed_gamma: false,
|
||||
isReAnalyed_beta: false,
|
||||
|
||||
|
@ -540,9 +525,6 @@ export default {
|
|||
handleReAnalyed(val) {
|
||||
this.isReAnalyed_gamma = val
|
||||
},
|
||||
getUpdateFlag(val) {
|
||||
this.updateFlag = val
|
||||
},
|
||||
getcommentsInfo(val) {
|
||||
this.params_toDB.comment = val.spectrumAnalysisCommentInfo
|
||||
},
|
||||
|
@ -933,12 +915,14 @@ export default {
|
|||
try {
|
||||
const { result, success, message } = await getAction('/selfStation/saveToDB', { fileName })
|
||||
if (success) {
|
||||
// 更新缓存中的DetailedInfomation数据
|
||||
// updateSampleData({
|
||||
// inputFileName: fileName,
|
||||
// key: 'DetailedInformation',
|
||||
// data: [...result.DetailedInformation],
|
||||
// })
|
||||
Object.entries(result).forEach(([k, v]) => {
|
||||
// 更新缓存中的DetailedInfomation数据
|
||||
updateSampleData({
|
||||
inputFileName: fileName,
|
||||
key: `${k}.spectrumData`,
|
||||
data: v,
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
@ -1433,7 +1417,7 @@ export default {
|
|||
title: 'Configure',
|
||||
show: this.isGamma || this.isBeta,
|
||||
handler: () => {
|
||||
if (this.isGamma) this.analyzeConfigureModalVisible = true
|
||||
if (this.isGamma) this.$refs.gammaAnalysisRef.showConfigureModal()
|
||||
if (this.isBeta) this.$refs.selfStationAnalyzeConfigureModalRef.open()
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user