fix:快照添加panel变量

This commit is contained in:
zhangyu
2022-07-25 15:36:58 +08:00
parent 00e1e97fae
commit a529001f82
3 changed files with 12 additions and 2 deletions

View File

@@ -7,11 +7,18 @@ export default {
}, },
methods: { methods: {
exportToHtml (name) { exportToHtml (name) {
const vars = this.$store.getters.getVariablesArr.map(item => {
return {
"name": item.name,
"value": item.checked.join('|')
}
})
const params = { const params = {
format: 'html', format: 'html',
panelId: this.showPanel.id, panelId: this.showPanel.id,
start: this.$stringTimeParseToUnix(bus.formateTimeToTime(this.searchTime[0])), 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 => { this.$get('/visual/panel/snapshot', params, 'blob').then(res => {
const self = this const self = this

View File

@@ -396,6 +396,9 @@ export default {
item.visible = false item.visible = false
}) })
} }
},
beforeDestroy () {
this.$store.dispatch('dispatchVariablesArr', [])
} }
} }
</script> </script>

File diff suppressed because one or more lines are too long