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 @@ - +