From b9c6f3c300d5e5e07c104731fa17e3af70ff5da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=98=89=E8=B1=AA?= <42510293+ziyujiahao@users.noreply.github.com> Date: Mon, 17 Nov 2025 17:40:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E3=80=81=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=AF=BC=E5=87=BA=E7=BB=84=E4=BB=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=9B=BE=E7=89=87=E5=AF=BC=E5=87=BA=E9=80=BB=E8=BE=91?= =?UTF-8?q?=20(#17438)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/package.json | 5 +++-- core/core-frontend/src/utils/imgUtils.ts | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/package.json b/core/core-frontend/package.json index f0396ddc53..25f77b832f 100644 --- a/core/core-frontend/package.json +++ b/core/core-frontend/package.json @@ -45,6 +45,7 @@ "lodash-es": "^4.17.21", "mathjs": "^11.6.0", "mitt": "^3.0.0", + "modern-screenshot": "^4.6.6", "net": "^1.0.2", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", @@ -66,9 +67,9 @@ "vue-uuid": "^3.0.0", "vue3-ace-editor": "^2.2.2", "vuedraggable": "^4.1.0", + "vxe-table": "^4.16.20", "web-storage-cache": "^1.1.1", - "xss": "^1.0.14", - "vxe-table": "^4.16.20" + "xss": "^1.0.14" }, "devDependencies": { "@intlify/unplugin-vue-i18n": "^0.8.2", diff --git a/core/core-frontend/src/utils/imgUtils.ts b/core/core-frontend/src/utils/imgUtils.ts index 27f73371b2..2414516539 100644 --- a/core/core-frontend/src/utils/imgUtils.ts +++ b/core/core-frontend/src/utils/imgUtils.ts @@ -7,6 +7,7 @@ import { findResourceAsBase64 } from '@/api/staticResource' import FileSaver from 'file-saver' import { deepCopy } from '@/utils/utils' import { toPng } from 'html-to-image' +import { domToPng } from 'modern-screenshot' const embeddedStore = useEmbedded() const dvMainStore = dvMainStoreWithOut() const { canvasStyleData, componentData, canvasViewInfo, canvasViewDataInfo, dvInfo } = @@ -78,7 +79,7 @@ export function download2AppTemplate(downloadType, canvasDom, name, attachParams } } -export function downloadCanvas2(type, canvasDom, name, callBack?) { +export function downloadCanvas(type, canvasDom, name, callBack?) { // const canvasDom = document.getElementById(canvasId) if (canvasDom) { html2canvas(canvasDom) @@ -115,8 +116,8 @@ export function downloadCanvas2(type, canvasDom, name, callBack?) { } } -export function downloadCanvas(type, canvasDom, name, callBack?) { - toPng(canvasDom) +export function downloadCanvas2(type, canvasDom, name, callBack?) { + domToPng(canvasDom) .then(dataUrl => { if (type === 'img') { const a = document.createElement('a')