From 4c84da88ea5a46eb67fb7d1ab5f94863782a1f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Mon, 30 Oct 2023 19:39:02 +0800 Subject: [PATCH] =?UTF-8?q?beta=20=20=E7=9A=84=20Save=20Results=20to=20Fil?= =?UTF-8?q?e=20=E5=8A=9F=E8=83=BD=E8=B0=83=E6=95=B4=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20save=20to=20Html=20=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=8F=8A?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/MultiLevelMenu.vue | 18 +++++----- src/views/spectrumAnalysis/index.vue | 34 +++++++++++++++++-- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/views/spectrumAnalysis/components/MultiLevelMenu.vue b/src/views/spectrumAnalysis/components/MultiLevelMenu.vue index da1c86d..770ad4b 100644 --- a/src/views/spectrumAnalysis/components/MultiLevelMenu.vue +++ b/src/views/spectrumAnalysis/components/MultiLevelMenu.vue @@ -6,7 +6,7 @@
@@ -22,23 +22,23 @@ export default { props: { children: { type: Array, - default: () => [] + default: () => [], }, width: { type: String, - default: 'auto' - } + default: 'auto', + }, }, methods: { handleMenuClick(item) { - if (!item.children) { - this.$emit('menuClick', item) - } + // if (!item.children) { + this.$emit('menuClick', item) + // } }, handleSubMenuClick(item, child) { this.$emit('submenuClick', { item, child }) - } - } + }, + }, } diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue index 23a0180..05014d0 100644 --- a/src/views/spectrumAnalysis/index.vue +++ b/src/views/spectrumAnalysis/index.vue @@ -512,7 +512,7 @@ export default { try { await fetchAndDownload(url, params, 'get') } catch (error) { - console.error(error) + console.error(error) } finally { this.isSaving = false } @@ -637,7 +637,7 @@ export default { }) // 处理当前的谱的reprocessing - if(inputFileName && sampleType !== 'B') { + if (inputFileName && sampleType !== 'B') { this.$refs.gammaAnalysisRef.reProcessing(false) } }, @@ -833,6 +833,23 @@ export default { children: [ { title: 'Save Results to File', + children: [ + { + title: 'Save Txt', + key: 'saveTxt', + show: this.isBetaGamma, + }, + { + title: 'Save Excel', + key: 'saveExcel', + show: this.isBetaGamma, + }, + { + title: 'Save Html', + key: 'saveHtml', + show: this.isBetaGamma, + }, + ], }, { title: 'Save Results to DB', @@ -844,6 +861,7 @@ export default { { title: 'Save All', key: 'all', + show: this.isGamma, }, ], key: 'resultsToDB', @@ -869,13 +887,23 @@ export default { on: { menuClick: () => { console.log(this.isBetaGamma, this.isGamma) - this.saveSettingModalVisible = true + if (this.isGamma) { + this.saveSettingModalVisible = true + } }, submenuClick: ({ item, child }) => { + console.log('item, child', item, child) + debugger if (item.key == 'resultsToDB') { this.handleSaveResultsToDB(child.key) } else if (item.key == 'phdToFile') { this.handleSavePHDToFile(child.key) + } else if (child.key == 'saveTxt') { + this.handleSaveResultsToFile('txt') + } else if (child.key == 'saveExcel') { + this.handleSaveResultsToFile('xls') + } else if (child.key == 'saveHtml') { + this.handleSaveResultsToFile('html') } }, },