From aa6ac23fd50524a882a92629309a24d44b73f69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Mon, 16 Oct 2023 16:12:04 +0800 Subject: [PATCH 1/4] =?UTF-8?q?gamma=20=20=E7=9A=84=20save=20to=20file?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=88Save=20as=20Txt=20=EF=BC=8CSave=20as?= =?UTF-8?q?=20Excel=EF=BC=89=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5=E8=81=94?= =?UTF-8?q?=E8=B0=83=20gamma=20=E7=9A=84=20Save=20PHD=20to=20File=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5=EF=BC=8C?= =?UTF-8?q?=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Modals/SaveSettingModal.vue | 20 +++---- src/views/spectrumAnalysis/gamma-analysis.vue | 3 - src/views/spectrumAnalysis/index.vue | 57 ++++++++++++------- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/src/views/spectrumAnalysis/components/Modals/SaveSettingModal.vue b/src/views/spectrumAnalysis/components/Modals/SaveSettingModal.vue index b8d03a1..ea6ed2a 100644 --- a/src/views/spectrumAnalysis/components/Modals/SaveSettingModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/SaveSettingModal.vue @@ -2,16 +2,14 @@
- - Save All - + Save All
Save as Txt Save as Excel - Save as Html +
@@ -25,13 +23,13 @@ export default { components: { TitleOverBorder }, props: { value: { - type: Boolean - } + type: Boolean, + }, }, data() { return { saveAll: false, - saveFormat: 'txt' + saveFormat: 'txt', } }, methods: { @@ -42,7 +40,7 @@ export default { handleOk() { this.$emit('save', this.saveFormat) - } + }, }, computed: { visible: { @@ -55,9 +53,9 @@ export default { } return this.value - } - } - } + }, + }, + }, } diff --git a/src/views/spectrumAnalysis/gamma-analysis.vue b/src/views/spectrumAnalysis/gamma-analysis.vue index 8076147..b423f07 100644 --- a/src/views/spectrumAnalysis/gamma-analysis.vue +++ b/src/views/spectrumAnalysis/gamma-analysis.vue @@ -1193,7 +1193,6 @@ export default { this.channelData.baseLineCP = shapeChannelData this.energyData.baseLineCP = shapeEnergyData this.redrawCtrlPointBySeriesName() - }, // 显示比较弹窗 @@ -1475,7 +1474,6 @@ export default { watch: { currStep: { handler(val) { - console.log('dfad', val) if (val && val == '0') { this.abc = true this.reprocessingModalVisible = true @@ -1496,7 +1494,6 @@ export default { }, updateFlag: { handler(val) { - console.log('dfad', val) this.newCheckBox_updateCal = val }, immediate: true, diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue index 17e0fa0..029423d 100644 --- a/src/views/spectrumAnalysis/index.vue +++ b/src/views/spectrumAnalysis/index.vue @@ -481,30 +481,39 @@ export default { // 保存结果到文件, 服务端生成文件,前端下载 async handleSaveResultsToFile(saveFormat) { - const url = - saveFormat == 'xls' - ? '/spectrumAnalysis/saveToExcel' - : saveFormat == 'txt' - ? '/spectrumAnalysis/saveToTxt' - : saveFormat == 'html' - ? '/spectrumAnalysis/saveToHTML' - : '' - if (!this.resultDisplayFlag) { - this.$message.warn('Please Analyse Spectrum First') - return + if (this.isGamma) { + const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : '' + let params = { + fileName: this.newSampleData.inputFileName, + } + downloadFile(url, `result.${saveFormat}`, params, 'get') } + if (this.isBetaGamma) { + const url = + saveFormat == 'xls' + ? '/spectrumAnalysis/saveToExcel' + : saveFormat == 'txt' + ? '/spectrumAnalysis/saveToTxt' + : saveFormat == 'html' + ? '/spectrumAnalysis/saveToHTML' + : '' + if (!this.resultDisplayFlag) { + this.$message.warn('Please Analyse Spectrum First') + return + } - this.resultDisplayFlag.forEach((item) => { - this.params_toDB[`${item.nuclideName.toLowerCase()}Flag`] = item.nidFlag - }) + this.resultDisplayFlag.forEach((item) => { + this.params_toDB[`${item.nuclideName.toLowerCase()}Flag`] = item.nidFlag + }) - this.params_toDB.sampleFileName = this.newSampleData.inputFileName - this.params_toDB.gasFileName = this.newSampleData.gasFileName - this.params_toDB.detFileName = this.newSampleData.detFileName - this.params_toDB.qcFileName = this.newSampleData.qcFileName - this.params_toDB.dbName = this.newSampleData.dbName + this.params_toDB.sampleFileName = this.newSampleData.inputFileName + this.params_toDB.gasFileName = this.newSampleData.gasFileName + this.params_toDB.detFileName = this.newSampleData.detFileName + this.params_toDB.qcFileName = this.newSampleData.qcFileName + this.params_toDB.dbName = this.newSampleData.dbName - downloadFile(url, `result.${saveFormat}`, this.params_toDB, 'post') + downloadFile(url, `result.${saveFormat}`, this.params_toDB, 'post') + } }, /** @@ -572,6 +581,13 @@ export default { */ handleSavePHDToFile(type) { console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', type) + if (this.isGamma) { + const url = '/gamma/saveToPHD' + let params = { + fileName: this.newSampleData.inputFileName, + } + downloadFile(url, `result.PHD`, params, 'get') + } }, handleReprocessAll() { @@ -797,6 +813,7 @@ export default { }, on: { menuClick: () => { + console.log(this.isBetaGamma, this.isGamma) this.saveSettingModalVisible = true }, submenuClick: ({ item, child }) => { From 765507f755cf0acaa3c588aa707f151b1792c1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Mon, 16 Oct 2023 16:33:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A4=84=E7=90=86=20Load=20From=20File=20?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E7=9A=84=EF=BC=8CARR=E3=80=80=E5=92=8C?= =?UTF-8?q?=E3=80=80Automatic=20Analysis=20Log=E3=80=80=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E7=9A=84=E5=B1=95=E7=A4=BA=E9=80=BB=E8=BE=91=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E7=BB=99=E5=87=BA=E6=8F=90=E7=A4=BA=E3=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/spectrumAnalysis/index.vue | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue index 029423d..b4e3188 100644 --- a/src/views/spectrumAnalysis/index.vue +++ b/src/views/spectrumAnalysis/index.vue @@ -1017,9 +1017,14 @@ export default { type: 'a-menu-item', title: 'ARR', handler: () => { - this.arrOrRRRModalVisible = true - this.arrOrRRRModalExtraData = {} - this.arrOrRRRModalType = 1 + console.log(this.newSampleData) + if (this.newSampleData.sampleId) { + this.arrOrRRRModalVisible = true + this.arrOrRRRModalExtraData = {} + this.arrOrRRRModalType = 1 + } else { + this.$message.warning("The file isn't existed.") + } }, show: this.isGamma, }, @@ -1134,8 +1139,17 @@ export default { title: 'Automatic Analysis Log', show: this.isBetaGamma || this.isGamma, handler: () => { - this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1 - this.autoAnalysisMogModalVisible = true + if (this.isGamma) { + if (this.newSampleData.sampleId) { + this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1 + this.autoAnalysisMogModalVisible = true + } else { + this.$message.warning("The file isn't existed.") + } + } else if (this.isBetaGamma) { + this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1 + this.autoAnalysisMogModalVisible = true + } }, }, { From 6a1fe4a7a08b2fc4fb2682984b01983fab8088ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Mon, 16 Oct 2023 18:24:54 +0800 Subject: [PATCH 3/4] =?UTF-8?q?File-Format-Ftransit=E3=80=80=E5=BC=B9?= =?UTF-8?q?=E7=AA=97INT.SPC<=3D>.IMS=E5=92=8CCanberra.IEC<=3D>.IMS?= =?UTF-8?q?=E3=80=80=E8=A1=A8=E5=8D=95=E5=AD=97=E6=AE=B5=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CanberraIECImsTransfer.vue | 80 +++++++++++++------ .../components/IntSpcImsTransfer.vue | 80 +++++++++++++------ src/views/spectrumAnalysis/index.vue | 2 +- 3 files changed, 115 insertions(+), 47 deletions(-) diff --git a/src/views/spectrumAnalysis/components/Modals/FtransltModal/components/CanberraIECImsTransfer.vue b/src/views/spectrumAnalysis/components/Modals/FtransltModal/components/CanberraIECImsTransfer.vue index 7b50ba3..26c9c6f 100644 --- a/src/views/spectrumAnalysis/components/Modals/FtransltModal/components/CanberraIECImsTransfer.vue +++ b/src/views/spectrumAnalysis/components/Modals/FtransltModal/components/CanberraIECImsTransfer.vue @@ -3,23 +3,31 @@
- + - + - + - +
-

- Total air volume sampled -

- +

Total air volume sampled

+
@@ -30,58 +38,63 @@ Designator
- +
Station code
- +
Detector code
- +
Sample geometry
- +
- - P - G - B + + P + G + B - - PREL - FULL + + PREL + FULL

Sample reference identification

- +

Background measurement identification

- +
Transmit time - +
@@ -103,8 +116,29 @@ diff --git a/src/views/spectrumAnalysis/components/Modals/FtransltModal/components/IntSpcImsTransfer.vue b/src/views/spectrumAnalysis/components/Modals/FtransltModal/components/IntSpcImsTransfer.vue index 9014786..bc4f7e9 100644 --- a/src/views/spectrumAnalysis/components/Modals/FtransltModal/components/IntSpcImsTransfer.vue +++ b/src/views/spectrumAnalysis/components/Modals/FtransltModal/components/IntSpcImsTransfer.vue @@ -3,23 +3,31 @@
- + - + - + - +
-

- Total air volume sampled -

- +

Total air volume sampled

+
@@ -30,58 +38,63 @@ Designator - +
Station code
- +
Detector code
- +
Sample geometry
- +
- - P - G - B + + P + G + B - - PREL - FULL + + PREL + FULL

Sample reference identification

- +

Background measurement identification

- +
Transmit time - +
@@ -103,8 +116,29 @@ diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue index b4e3188..e0a0afa 100644 --- a/src/views/spectrumAnalysis/index.vue +++ b/src/views/spectrumAnalysis/index.vue @@ -734,7 +734,7 @@ export default { { type: 'a-menu-item', title: 'Ftransit', - show: this.isGamma, + show: this.isGamma || this.isBetaGamma, handler: () => (this.ftransltModalVisible = true), }, { From 4edd3d250b414425fcab2df489d20324dd4cf1c5 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Mon, 16 Oct 2023 19:26:51 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20Replot=E5=8A=9F=E8=83=BD=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AnalyzeInteractiveToolModal/index.vue | 106 +++++++++++++----- 1 file changed, 80 insertions(+), 26 deletions(-) diff --git a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue index 17559f6..2a42fd6 100644 --- a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue +++ b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue @@ -104,7 +104,7 @@ Undo
- Replot + Replot
Accept @@ -474,6 +474,7 @@ export default { isFitting: false, // 正在进行Fit操作 firstFittingChannel: null, // Fit操作时点击的第一个channel isAccepting: false, + isReploting: false, operationStack: [] // 操作记录 } @@ -529,7 +530,6 @@ export default { this.setChartOption(channelBaseLineChart, channelCountChart, channelPeakChart, channelBaseCPChart, barChart) this.list = table - } else { this.$message.error(message) } @@ -787,7 +787,13 @@ export default { this.channelBaseLineChart = channelBaseLineChart this.barChart = barChart - this.setChartOption(channelBaseLineChart, this.channelCountChart, channelPeakChart, this.channelBaseCPChart, barChart) + this.setChartOption( + channelBaseLineChart, + this.channelCountChart, + channelPeakChart, + this.channelBaseCPChart, + barChart + ) this.list = table }, @@ -796,7 +802,13 @@ export default { const { channelPeakChart, table } = result this.channelPeakChart = channelPeakChart - this.setChartOption(this.channelBaseLineChart, this.channelCountChart, channelPeakChart, this.channelBaseCPChart, this.barChart) + this.setChartOption( + this.channelBaseLineChart, + this.channelCountChart, + channelPeakChart, + this.channelBaseCPChart, + this.barChart + ) this.list = table }, @@ -1035,7 +1047,10 @@ export default { else { this.btnGroupType = 1 this.opts.notMerge = true - this.option.series.splice(this.option.series.length - 1, 1) // 去掉白色的基线副本 + const baseLineEditSeries = findSeriesByName(this.option.series, 'BaseLine_Edit') + const index = this.option.series.findIndex(item => item == baseLineEditSeries) + this.option.series.splice(index, 1) + this.clearRect() const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine') @@ -1044,6 +1059,8 @@ export default { const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point') baseLineCP.data = this.buildCPPointData(this.channelBaseCPChart) + this.redrawPeaks(this.channelPeakChart) + this.$nextTick(() => { this.resetChartOpts() }) @@ -1098,6 +1115,14 @@ export default { } }, + // 重绘Peaks + redrawPeaks(peakList) { + this.option.series = this.option.series.filter((item) => { + return !item.name.includes('Peak_') + }) + this.option.series.push(...this.buildPeaks(peakList)) + }, + /** * 设置小方块可拖拽 */ @@ -1231,26 +1256,53 @@ export default { }, // 将原先的基线和控制点移动到新位置 - handleReplot() { - const { xctrl, yctrl, yslope, baseline } = this.baseCtrls_Copy - const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine') - baseLineSeries.data = baseline.map((val, index) => [index + 1, val]) + async handleReplot() { + try { + const { inputFileName: fileName } = this.sampleData + this.isReploting = true + const { success, result, message } = await postAction('/gamma/replotBaseLine', { + ...this.baseCtrls_Copy, + fileName, + replotNeeded: true + }) + if (success) { + const { chartData, peakSet, shapeData } = result - const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point') - // 第一个控制点(因为第一个和最后一个不会被删除) - const firstCP = this.channelBaseCPChart[0] - const { color, size } = firstCP - const baseCPPoints = xctrl.map((xAxis, index) => { - return { - size, - color, - point: { - x: xAxis, - y: yctrl[index] - } + const { xctrl, yctrl, yslope, baseline } = this.baseCtrls_Copy + const baseLineSeries = findSeriesByName(this.option.series, 'BaseLine') + baseLineSeries.data = baseline.map((val, index) => [index + 1, val]) + + const baseLineCP = findSeriesByName(this.option.series, 'BaseLine_Ctrl_Point') + // 第一个控制点(因为第一个和最后一个不会被删除) + const firstCP = this.channelBaseCPChart[0] + const { color, size } = firstCP + const baseCPPoints = xctrl.map((xAxis, index) => { + return { + size, + color, + point: { + x: xAxis, + y: yctrl[index] + } + } + }) + baseLineCP.data = this.buildCPPointData(baseCPPoints) + + this.opts.notMerge = true + this.redrawPeaks(peakSet) + this.$nextTick(() => { + this.resetChartOpts() + }) + + this.BaseCtrls = cloneDeep(this.baseCtrls_Copy) + } else { + this.$message.error(message) } - }) - baseLineCP.data = this.buildCPPointData(baseCPPoints) + } catch (error) { + console.error(error) + } finally { + this.isReploting = false + } }, /** @@ -1272,8 +1324,8 @@ export default { // 确定对Baseline Control Points 的操作 async handleAccept() { - this.BaseCtrls = cloneDeep(this.baseCtrls_Copy) - const { baseline, xctrl, yctrl } = this.BaseCtrls + // this.BaseCtrls = cloneDeep(this.baseCtrls_Copy) + // const { baseline, xctrl, yctrl } = this.BaseCtrls // this.channelBaseLineChart.pointlist = baseline.map((val, index) => { // return { // x: index + 1, @@ -1298,10 +1350,12 @@ export default { try { this.isAccepting = true const { success, result, message } = await postAction('/gamma/acceptBaseLine', { - ...this.BaseCtrls, + ...this.baseCtrls_Copy, fileName }) if (success) { + this.BaseCtrls = cloneDeep(this.baseCtrls_Copy) + const { allData, barChart,