diff --git a/core/frontend/src/components/canvas/components/editor/CanvasOptBar.vue b/core/frontend/src/components/canvas/components/editor/CanvasOptBar.vue index d81fb40174..2eff60e48f 100644 --- a/core/frontend/src/components/canvas/components/editor/CanvasOptBar.vue +++ b/core/frontend/src/components/canvas/components/editor/CanvasOptBar.vue @@ -106,7 +106,7 @@ export default { }, computed: { isPcTerminal() { - return this.terminal === 'PC' + return this.terminal === 'pc' }, functionClass() { let result = 'function-light' diff --git a/core/frontend/src/components/canvas/components/editor/Preview.vue b/core/frontend/src/components/canvas/components/editor/Preview.vue index 1cbca01509..073ec965e9 100644 --- a/core/frontend/src/components/canvas/components/editor/Preview.vue +++ b/core/frontend/src/components/canvas/components/editor/Preview.vue @@ -116,15 +116,39 @@ v-if="chartDetailsVisible" style="position: absolute;right: 70px;top:15px" > - - {{ $t('chart.export_img') }} - + + + 导出分辨率 + + + + + + + + {{ $t('chart.export_img') }} + + + { + this.$refs['userViewDialog-canvas-main'].exportViewImg(this.pixel, () => { this.imageDownloading = false }) }, diff --git a/core/frontend/src/components/canvas/customComponent/UserViewDialog.vue b/core/frontend/src/components/canvas/customComponent/UserViewDialog.vue index abde76c736..8439019ce9 100644 --- a/core/frontend/src/components/canvas/customComponent/UserViewDialog.vue +++ b/core/frontend/src/components/canvas/customComponent/UserViewDialog.vue @@ -5,7 +5,6 @@ > { const dom = document.body.appendChild(canvas) dom.style.display = 'none' @@ -238,8 +243,10 @@ export function exportImg(imgName, callback) { a.click() URL.revokeObjectURL(blob) document.body.removeChild(a) + window.devicePixelRatio = originalDPR callback() }).catch(() => { + window.devicePixelRatio = originalDPR callback() }) }