From a529001f82de17fa687f66ccf309311e1f8cedd2 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 25 Jul 2022 15:36:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=BF=AB=E7=85=A7=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0panel=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/mixin/exportHtml.js | 9 ++++++++- .../src/components/common/panel/panelVariables.vue | 3 +++ nezha-fronted/src/entrance/exportHtml/exportHtml.html | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/common/mixin/exportHtml.js b/nezha-fronted/src/components/common/mixin/exportHtml.js index 22419a679..40e56100b 100644 --- a/nezha-fronted/src/components/common/mixin/exportHtml.js +++ b/nezha-fronted/src/components/common/mixin/exportHtml.js @@ -7,11 +7,18 @@ export default { }, methods: { exportToHtml (name) { + const vars = this.$store.getters.getVariablesArr.map(item => { + return { + "name": item.name, + "value": item.checked.join('|') + } + }) const params = { format: 'html', panelId: this.showPanel.id, start: this.$stringTimeParseToUnix(bus.formateTimeToTime(this.searchTime[0])), - end: this.$stringTimeParseToUnix(bus.formateTimeToTime(this.searchTime[1])) + end: this.$stringTimeParseToUnix(bus.formateTimeToTime(this.searchTime[1])), + vars: vars } this.$get('/visual/panel/snapshot', params, 'blob').then(res => { const self = this diff --git a/nezha-fronted/src/components/common/panel/panelVariables.vue b/nezha-fronted/src/components/common/panel/panelVariables.vue index d123399ae..4ebc43eac 100644 --- a/nezha-fronted/src/components/common/panel/panelVariables.vue +++ b/nezha-fronted/src/components/common/panel/panelVariables.vue @@ -396,6 +396,9 @@ export default { item.visible = false }) } + }, + beforeDestroy () { + this.$store.dispatch('dispatchVariablesArr', []) } } diff --git a/nezha-fronted/src/entrance/exportHtml/exportHtml.html b/nezha-fronted/src/entrance/exportHtml/exportHtml.html index d914ecceb..b7fd4294d 100644 --- a/nezha-fronted/src/entrance/exportHtml/exportHtml.html +++ b/nezha-fronted/src/entrance/exportHtml/exportHtml.html @@ -1,6 +1,6 @@ - +