Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into feature-analysis-RLR-renpy

This commit is contained in:
Xu Zhimeng 2023-10-12 18:24:38 +08:00
commit f912c4d8dc
4 changed files with 258 additions and 26 deletions

View File

@ -201,6 +201,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')
} else { } else {
this.$message.error(message) this.$message.error(message)
} }

View File

@ -1,52 +1,52 @@
<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> <div v-if="calibrationUpdatesFlag" 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="0" /> <status :status="status_ener1" />
<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="0" /> <status :status="status_reso" />
<div class="description">Resolution</div> <div class="description">Resolution</div>
</div> </div>
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="0" /> <status :status="status_ener2" />
<div class="description">Energy - Fitted Centroids</div> <div class="description">Energy - Fitted Centroids</div>
</div> </div>
</div> </div>
</div> </div>
<div style="margin-top: 20px;"> <div>
<!-- 标题 --> <!-- 标题 -->
<div class="processing-title">Spectrum Analysis</div> <div class="processing-title">Spectrum Analysis</div>
<!-- 列表 --> <!-- 列表 -->
<div class="processing-list"> <div class="processing-list">
<div class="processing-list-item"> <div class="processing-list-item">
<status :status="0" /> <status :status="status_peak" />
<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="0" /> <status :status="status_base" />
<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="1" /> <status :status="status_net" />
<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="2" /> <status :status="status_nucl" />
<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="2" /> <status :status="status_acti" />
<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="2" /> <status :status="status_qc" />
<div class="description">QC Test</div> <div class="description">QC Test</div>
</div> </div>
</div> </div>
@ -59,12 +59,24 @@
import Status from './components/status.vue' import Status from './components/status.vue'
export default { export default {
components: { components: {
Status Status,
}, },
props: { props: {
value: { value: {
type: Boolean type: Boolean,
} },
bAnalyed: {
type: Boolean,
},
checkBoxFlag: {
type: Boolean,
},
newCheckBoxFlag: {
type: String,
},
currStep: {
type: String,
},
}, },
computed: { computed: {
visible: { visible: {
@ -73,9 +85,125 @@ export default {
}, },
set(val) { set(val) {
this.$emit('input', val) this.$emit('input', val)
} },
},
},
watch: {
newCheckBoxFlag: {
handler(val) {
console.log('flag', val)
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)
}
},
},
},
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

@ -91,7 +91,15 @@
<compare-file-list-modal v-model="compareFileListModalVisible" @compareWithFile="handleCompareWithFile" /> <compare-file-list-modal v-model="compareFileListModalVisible" @compareWithFile="handleCompareWithFile" />
<!-- ReProcessing 弹窗开始 --> <!-- ReProcessing 弹窗开始 -->
<re-processing-modal v-model="reprocessingModalVisible" /> <re-processing-modal
v-if="abc"
v-model="reprocessingModalVisible"
:bAnalyed="bAnalyed"
:currStep="currStep"
:checkBoxFlag="checkBox_updateCal"
:newCheckBoxFlag="newCheckBox_updateCal"
@closeModal="haCndleCloseModal"
/>
<!-- ReProcessing 弹窗结束 --> <!-- ReProcessing 弹窗结束 -->
</div> </div>
</template> </template>
@ -121,11 +129,18 @@ import ReProcessingModal from './components/Modals/ReProcessingModal/index.vue'
import { GammaOptions, graphAssistance } from './settings' import { GammaOptions, graphAssistance } from './settings'
import store from '@/store/'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default { export default {
props: { props: {
sample: { sample: {
type: Object, type: Object,
}, },
updateFlag: {
type: String,
},
}, },
components: { components: {
CustomChart, CustomChart,
@ -141,6 +156,7 @@ export default {
}, },
data() { data() {
return { return {
abc: false,
isLoading: false, isLoading: false,
isLoadingNuclide: false, isLoadingNuclide: false,
option: cloneDeep(GammaOptions.option), option: cloneDeep(GammaOptions.option),
@ -191,6 +207,12 @@ export default {
compareFileListModalVisible: false, // Compare compareFileListModalVisible: false, // Compare
reprocessingModalVisible: false, // reprocessingModalVisible: false, //
isProcessing: false, // isProcessing: false, //
websock: null,
lockReconnect: false,
bAnalyed: false, //
checkBox_updateCal: false, //update
newCheckBox_updateCal: false, //update
currStep: '',
} }
}, },
created() { created() {
@ -210,8 +232,55 @@ export default {
}, },
mounted() { mounted() {
this.option.brush = { toolbox: [] } this.option.brush = { toolbox: [] }
this.initWebSocket()
}, },
methods: { methods: {
initWebSocket: function () {
console.log('qweqwerq')
// WebSocketwshttpwsshttps
var userId = store.getters.userInfo.id
var url =
window._CONFIG['domianURL'].replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId
//console.log(url);
//update-begin-author:taoyan date:2022-4-22 for: v2.4.6 websocket #3278
let token = Vue.ls.get(ACCESS_TOKEN)
this.websock = new WebSocket(url, [token])
//update-end-author:taoyan date:2022-4-22 for: v2.4.6 websocket #3278
this.websock.onopen = this.websocketOnopen
this.websock.onerror = this.websocketOnerror
this.websock.onmessage = this.websocketOnmessage
this.websock.onclose = this.websocketOnclose
},
websocketOnopen: function () {
// console.log('WebSocket1231')
//
//this.heartCheck.reset().start();
},
websocketOnerror: function (e) {
this.reconnect()
},
websocketOnmessage: function (e) {
// console.log('-----1231-------', e.data)
var data = eval('(' + e.data + ')') //
// console.log(data)
if (data.cmd === 'analysis-process') {
this.currStep = data.msgTxt
}
},
websocketOnclose: function (e) {
this.reconnect()
},
reconnect() {
var that = this
if (that.lockReconnect) return
that.lockReconnect = true
//
setTimeout(function () {
console.info('尝试重连...')
that.initWebSocket()
that.lockReconnect = false
}, 20000)
},
// //
async getSampleDetail() { async getSampleDetail() {
const { dbName, sampleId } = this.sample const { dbName, sampleId } = this.sample
@ -234,7 +303,7 @@ export default {
) )
console.log('%c [ result ]-243', 'font-size:13px; background:pink; color:#bf2c9f;', result) console.log('%c [ result ]-243', 'font-size:13px; background:pink; color:#bf2c9f;', result)
if (success) { if (success) {
this.dataProsess(result) this.dataProsess(result, 'db')
} else { } else {
this.$message.error(message) this.$message.error(message)
} }
@ -262,7 +331,7 @@ export default {
) )
console.log('%c [ result ]-243', 'font-size:13px; background:pink; color:#bf2c9f;', result) console.log('%c [ result ]-243', 'font-size:13px; background:pink; color:#bf2c9f;', result)
if (success) { if (success) {
this.dataProsess(result) this.dataProsess(result, 'file')
} else { } else {
this.$message.error(message) this.$message.error(message)
} }
@ -284,7 +353,7 @@ export default {
return cancelToken return cancelToken
}, },
dataProsess(result) { dataProsess(result, flag) {
this.isLoading = false this.isLoading = false
const { const {
@ -304,7 +373,12 @@ export default {
shapeChannelData, shapeChannelData,
shapeEnergyData, shapeEnergyData,
} = result } = result
if (flag && (flag == 'dab' || flag == 'file')) {
this.bAnalyed = result.bAnalyed
this.checkBox_updateCal = result.checkBox_updateCal
this.newCheckBox_updateCal = '2'
console.log(this.checkBox_updateCal)
}
this.detailedInfomation = DetailedInformation this.detailedInfomation = DetailedInformation
this.qcFlags = QCFlag this.qcFlags = QCFlag
@ -458,7 +532,7 @@ export default {
} }
return `<div class="channel">Channel: ${channel}</div> return `<div class="channel">Channel: ${channel}</div>
<div class="energy">${energy? `Energy: ${energy}`: ''}</div>` <div class="energy">${energy ? `Energy: ${energy}` : ''}</div>`
}, },
// Graph Assistance // Graph Assistance
@ -670,7 +744,7 @@ export default {
return { return {
channel, channel,
energy, energy,
counts: counts.y counts: counts.y,
} }
}, },
@ -1162,7 +1236,10 @@ export default {
} finally { } finally {
this.isLoading = false this.isLoading = false
} }
// this.reprocessingModalVisible = true },
haCndleCloseModal() {
this.reprocessingModalVisible = false
this.abc = false
}, },
/** /**
@ -1367,6 +1444,16 @@ export default {
}, },
}, },
watch: { watch: {
currStep: {
handler(val) {
console.log('dfad', val)
if (val && val == '0') {
this.abc = true
this.reprocessingModalVisible = true
}
},
immediate: true,
},
sample: { sample: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
console.log('newValnewVal', newVal) console.log('newValnewVal', newVal)
@ -1378,6 +1465,13 @@ export default {
}, },
immediate: true, immediate: true,
}, },
updateFlag: {
handler(val) {
console.log('dfad', val)
this.newCheckBox_updateCal = val
},
immediate: true,
},
}, },
} }
</script> </script>

View File

@ -30,7 +30,7 @@
<!-- 频谱分析部分 --> <!-- 频谱分析部分 -->
<div class="spectrum-analysis-main"> <div class="spectrum-analysis-main">
<!-- Gamma 分析 --> <!-- Gamma 分析 -->
<gamma-analysis v-if="isGamma" ref="gammaAnalysisRef" :sample="sampleData" /> <gamma-analysis v-if="isGamma" ref="gammaAnalysisRef" :sample="sampleData" :updateFlag="updateFlag" />
<!-- Gamma 分析 --> <!-- Gamma 分析 -->
<!-- Beta-Gamma 分析 --> <!-- Beta-Gamma 分析 -->
@ -78,7 +78,11 @@
<!-- Save Setting 弹窗结束 --> <!-- Save Setting 弹窗结束 -->
<!-- 分析-设置弹窗开始 --> <!-- 分析-设置弹窗开始 -->
<analyze-setting-modal v-model="analyzeConfigureModalVisible" :sampleId="sampleData.sampleId" /> <analyze-setting-modal
v-model="analyzeConfigureModalVisible"
:sampleId="sampleData.sampleId"
@senInfo="getUpdateFlag"
/>
<!-- 分析-设置弹窗结束 --> <!-- 分析-设置弹窗结束 -->
<!-- 分析工具弹窗开始 --> <!-- 分析工具弹窗开始 -->
@ -374,6 +378,7 @@ export default {
xe133mFlag: null, xe133mFlag: null,
xe135Flag: null, xe135Flag: null,
}, },
updateFlag: '2',
} }
}, },
created() { created() {
@ -391,6 +396,10 @@ export default {
}, },
methods: { methods: {
getUpdateFlag(val) {
console.log('qerq', val)
this.updateFlag = val
},
getcommentsInfo(val) { getcommentsInfo(val) {
this.params_toDB.comment = val.spectrumAnalysisCommentInfo this.params_toDB.comment = val.spectrumAnalysisCommentInfo
}, },