From b32e06e03ba801fdfad84cc5b4c18dfbed08c76a Mon Sep 17 00:00:00 2001 From: MTrun <1262327911@qq.com> Date: Tue, 15 Feb 2022 15:42:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8D=E4=BC=9A=E8=87=AA=E5=8A=A8=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CanvasPage/index.vue | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/views/chart/ContentDetails/components/CanvasPage/index.vue b/src/views/chart/ContentDetails/components/CanvasPage/index.vue index 4bc8c8f6..7efbaff4 100644 --- a/src/views/chart/ContentDetails/components/CanvasPage/index.vue +++ b/src/views/chart/ContentDetails/components/CanvasPage/index.vue @@ -37,7 +37,8 @@
- 背景图需小于 {{backgroundImageSize}}M ,格式为 png/jpg/gif 的文件 + 背景图需小于 {{ backgroundImageSize }}M ,格式为 png/jpg/gif + 的文件
@@ -164,7 +165,9 @@ const beforeUploadHandle = async ({ file }) => { const size = file.file.size if (size > 1024 * 1024 * backgroundImageSize) { - window['$message'].warning(`图片超出 ${backgroundImageSize}M 限制,请重新上传!`) + window['$message'].warning( + `图片超出 ${backgroundImageSize}M 限制,请重新上传!` + ) return false } if (type !== 'image/png' && type !== 'image/jpeg' && type !== 'image/gif') { @@ -180,6 +183,7 @@ const clearImage = () => { EditCanvasConfigEnum.BACKGROUND_IAMGE, undefined ) + chartEditStoreStore.setCanvasConfig(EditCanvasConfigEnum.SELECT_COLOR, true) } // 清除颜色 @@ -188,9 +192,15 @@ const clearColor = () => { EditCanvasConfigEnum.BACKGROUND, undefined ) + if (canvasConfig.backgroundImage) { + chartEditStoreStore.setCanvasConfig( + EditCanvasConfigEnum.SELECT_COLOR, + false + ) + } } -// 启用背景 +// 启用/关闭 颜色 const switchSelectColorHandle = () => { switchSelectColorLoading.value = true setTimeout(() => { @@ -218,6 +228,10 @@ const customRequest = (options: UploadCustomRequestOptions) => { EditCanvasConfigEnum.BACKGROUND_IAMGE, ImageUrl ) + chartEditStoreStore.setCanvasConfig( + EditCanvasConfigEnum.SELECT_COLOR, + false + ) } else { window['$message'].error('添加图片失败,请稍后重试!') }