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('添加图片失败,请稍后重试!')
}