From f7adc0f4fd11f67780711dcdf440506968034056 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Mon, 12 Aug 2024 16:49:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=BB=BA=E5=8F=B0=E7=AB=99=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0Reports=E5=92=8CLog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/spectrumAnalysis/beta-analysis.vue | 112 +++++++++-- .../SelfStation/SelfStationArrRrrModal.vue | 129 +++++++++++++ .../SelfStationAutomaticAnalysisLogModal.vue | 94 +++++++++ .../SelfStation/SelfStationBGLogViewer.vue | 99 ++++++++++ .../SelfStation/SelfStationPeakInfomation.vue | 179 ++++++++++++++++++ .../SelfStation/SelfStationSpectrumModal.vue | 99 ++++++++++ src/views/spectrumAnalysis/index.vue | 54 +++++- 7 files changed, 753 insertions(+), 13 deletions(-) create mode 100644 src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationArrRrrModal.vue create mode 100644 src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationAutomaticAnalysisLogModal.vue create mode 100644 src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationBGLogViewer.vue create mode 100644 src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationPeakInfomation.vue create mode 100644 src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationSpectrumModal.vue diff --git a/src/views/spectrumAnalysis/beta-analysis.vue b/src/views/spectrumAnalysis/beta-analysis.vue index 0231247..f053d8b 100644 --- a/src/views/spectrumAnalysis/beta-analysis.vue +++ b/src/views/spectrumAnalysis/beta-analysis.vue @@ -98,6 +98,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -118,6 +138,11 @@ import { addSampleData, getSampleData, updateSampleData } from '@/utils/SampleSt import { cloneDeep } from 'lodash' import GammaModal from './components/Modals/SelfStation/GammaModal.vue' import BetaModal from './components/Modals/SelfStation/BetaModal.vue' +import SelfStationArrRrrModal from './components/Modals/SelfStation/SelfStationArrRrrModal.vue' +import SelfStationSpectrumModal from './components/Modals/SelfStation/SelfStationSpectrumModal.vue' +import SelfStationPeakInfomation from './components/Modals/SelfStation/SelfStationPeakInfomation.vue' +import SelfStationAutomaticAnalysisLogModal from './components/Modals/SelfStation/SelfStationAutomaticAnalysisLogModal.vue' +import SelfStationBgLogViewer from './components/Modals/SelfStation/SelfStationBGLogViewer.vue' const SampleType = [ { @@ -151,6 +176,11 @@ export default { RoiParam, GammaModal, BetaModal, + SelfStationArrRrrModal, + SelfStationSpectrumModal, + SelfStationPeakInfomation, + SelfStationAutomaticAnalysisLogModal, + SelfStationBgLogViewer, }, props: { sample: { @@ -303,6 +333,7 @@ export default { this.isLoading = false } }, + getAnalyzeAllSpectrum() { let XeData = [ { @@ -357,6 +388,7 @@ export default { this.resultDisplay = XeData // this.$emit('reAnalyCurr', true, XeData) }, + // 点击Update async handleUpdate() { const hasEmpty = this.roiParamList.some( @@ -394,7 +426,7 @@ export default { for (let index = 0; index < 4; index++) { const key = `ROI${index + 1}` const value = result[key] - if(value) { + if (value) { this.$set(this.ROIAnalyzeLists, index, value) } } @@ -431,17 +463,7 @@ export default { this.isLoading = false } }, - // async handleDetalSelfStationCache() { - // const { inputFileName } = this.sample - // let params = { - // sampleFileName: inputFileName, - // } - // try { - // const { success, result, message } = await deleteAction('/selfStation/deleteSelfStationCache', params) - // } catch (error) { - // console.error(error) - // } - // }, + async getSelfStationSampleDetail() { this.spectraType = this.SampleType[0].value const { inputFileName, detFileName, qcFileName } = this.sample @@ -468,11 +490,56 @@ export default { this.isLoading = false } else { this.$message.error(message) + this.isLoading = false } } catch (error) { console.error(error) + const isCancel = axios.isCancel(error) + if (!isCancel) { + this.isLoading = false + } } }, + + // 获取样品详情 + async getSampleDetail() { + const { dbName, sampleId, analyst, inputFileName } = this.sample + try { + this.cancelLastRequest() + this.isLoading = true + const cancelToken = this.createCancelToken() + + const { success, result, message } = await getAction( + '/selfStation/loadFromDB', + { + dbName, + sampleId, + analyst, + }, + cancelToken + ) + if (success) { + addSampleData({ + inputFileName, + data: result, + from: 'db', + }) + this.sampleDetail = result + this.changeChartByType('sample') + this.isLoading = false + } else { + this.$message.error(message) + this.isLoading = false + } + } catch (error) { + console.error(error) + const isCancel = axios.isCancel(error) + if (!isCancel) { + this.isLoading = false + } + } + }, + changeChartByType(val) { const currSampleDetail = this.sampleDetail[this.spectraType] if (!currSampleDetail) { @@ -643,6 +710,27 @@ export default { throw new Error(message) } }, + + // 显示ARR或RRR弹窗 + showArrRRRModal(type) { + this.$refs.ARR_RRRModalRef.show(type) + }, + + showSpectrumModal() { + this.$refs.spectrumModalRef.show() + }, + + showPeakInfoModal() { + this.$refs.peakInfoModalRef.show() + }, + + showAutomaticAnalysisLog() { + this.$refs.autoAnalysisLogRef.show() + }, + + showBgLogViewer() { + this.$refs.bgLogViewerRef.show() + }, }, } diff --git a/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationArrRrrModal.vue b/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationArrRrrModal.vue new file mode 100644 index 0000000..4043a39 --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationArrRrrModal.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationAutomaticAnalysisLogModal.vue b/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationAutomaticAnalysisLogModal.vue new file mode 100644 index 0000000..d0fa3f3 --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationAutomaticAnalysisLogModal.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationBGLogViewer.vue b/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationBGLogViewer.vue new file mode 100644 index 0000000..e23b70d --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationBGLogViewer.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationPeakInfomation.vue b/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationPeakInfomation.vue new file mode 100644 index 0000000..46340d8 --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationPeakInfomation.vue @@ -0,0 +1,179 @@ + + + + + diff --git a/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationSpectrumModal.vue b/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationSpectrumModal.vue new file mode 100644 index 0000000..cb5f5d9 --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/SelfStation/SelfStationSpectrumModal.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue index 66fd08d..6006681 100644 --- a/src/views/spectrumAnalysis/index.vue +++ b/src/views/spectrumAnalysis/index.vue @@ -879,7 +879,7 @@ export default { } this.$message.success('Save Success') } catch (error) { - this.$message.error(error && (error.message || error)) + this.$message.warning(error && (error.message || error)) } finally { hideLoading() this.isSaving = false @@ -1765,6 +1765,40 @@ export default { handler: () => (this.betaGammaXeModalVisible = true), show: this.isBetaGamma, }, + + // 以下是自建台站的下拉 + { + type: 'a-menu-item', + title: 'View ARR', + show: this.isBeta, + handler: () => { + this.$refs.betaAnalysisRef.showArrRRRModal(1) + }, + }, + { + type: 'a-menu-item', + title: 'View RRR', + show: this.isBeta, + handler: () => { + this.$refs.betaAnalysisRef.showArrRRRModal(2) + }, + }, + { + type: 'a-menu-item', + title: 'View spectrum', + handler: () => { + this.$refs.betaAnalysisRef.showSpectrumModal() + }, + show: this.isBeta, + }, + { + type: 'a-menu-item', + title: 'Peak Infomation', + handler: () => { + this.$refs.betaAnalysisRef.showPeakInfoModal() + }, + show: this.isBeta, + }, ], }, ], @@ -1806,6 +1840,24 @@ export default { show: this.isGamma, handler: () => (this.dataProcessingLogModalVisible = true), }, + + // 自建台站的日志 + { + type: 'a-menu-item', + title: 'Automatic Analysis Log', + show: this.isBeta, + handler: () => { + this.$refs.betaAnalysisRef.showAutomaticAnalysisLog() + }, + }, + { + type: 'a-menu-item', + title: 'BG log viewer', + show: this.isBeta, + handler: () => { + this.$refs.betaAnalysisRef.showBgLogViewer() + }, + }, ], }, ],