From 8c7cd9b152b3e3b26390a6beccc4dbd56fd4fc19 Mon Sep 17 00:00:00 2001 From: YuanFeng <770153798@qq.com> Date: Sun, 8 Sep 2024 17:59:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=A8=BF=E4=BB=B6?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=9B=BE=E7=89=87=E6=97=A0=E6=B3=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DraftDesign/components/DesignPropEdit.vue | 6 ++- .../src/components/DraftDesign/index.vue | 39 +++++++++---------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue index 03e23d9..f74bedd 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue +++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue @@ -63,7 +63,6 @@
-
主题风格:
{ that.sizeInfo = that.pageConfig.editArea // true, conf.pageConfig, conf.data, test draftDesignEditRef.value.init(false, that.pageConfig, that.data, that.propInfo) - showPng(); + loading.value = true + setTimeout(()=>{ + showPng(); + },300) queryUseLabel(); } const queryUseLabel = (label) => { diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue index eda2701..4d917f3 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue +++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue @@ -698,27 +698,24 @@ const toPngUrl = (callback: (url: string) => void, options?: { } }) => { - setTimeout(()=>{ - //处理图片等待加载完成 - let widthScale = options && options.widthScale ? options.widthScale : 5 - let heightScale = options && options.heightScale ? options.heightScale : 5 - graph.toPNG((dataUri) => { - that.previewUrl = dataUri; - callback(that.previewUrl) - }, { - backgroundColor: that.pageConfig.background.areaColor, - width: that.pageConfig.width * (widthScale), - height: that.pageConfig.height * (heightScale), - padding: { - top: 0, - left: 0, - right: 0, - bottom: 0 - }, - quality: 1, - ...options - }) - },500) + let widthScale = options && options.widthScale ? options.widthScale : 5 + let heightScale = options && options.heightScale ? options.heightScale : 5 + graph.toPNG((dataUri) => { + that.previewUrl = dataUri; + callback(that.previewUrl) + }, { + backgroundColor: that.pageConfig.background.areaColor, + width: that.pageConfig.width * (widthScale), + height: that.pageConfig.height * (heightScale), + padding: { + top: 0, + left: 0, + right: 0, + bottom: 0 + }, + quality: 1, + ...options + }) } const setPropList = (propDataInfo) => { const keys = Object.keys(propDataInfo)