From 4bc41fbde8a50fa33c7aac2e212bce4439f0673b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Mon, 27 Feb 2023 00:24:19 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=A2=9C=E8=89=B2=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CanvasPage/components/CreateColor/index.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColor/index.vue b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColor/index.vue index 1c8c3271..5edac24a 100644 --- a/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColor/index.vue +++ b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColor/index.vue @@ -183,6 +183,7 @@ const createColor = () => { colorList.push(newData) selectHandle(newData) updateColor.value = newData + saveHandle(false) } if (updateColor.value !== undefined) { goDialog({ @@ -235,11 +236,11 @@ const updateColorHandle = (newColor: ColorType) => { } // 保存数据 -const saveHandle = () => { +const saveHandle = (onMessage = true) => { if (!updateColor.value) return const index = colorList.findIndex(item => item.id === updateColor.value?.id) if (index !== -1) { - window.$message.success('颜色应用成功!') + onMessage && window.$message.success('数据应用成功!') const updateColorPrefix = cloneDeep({ ...updateColor.value, name: updateColor.value.name || '未定义' }) colorList.splice(index, 1, updateColorPrefix) updateColor.value = undefined @@ -252,7 +253,7 @@ const saveHandle = () => { chartEditStore.setEditCanvasConfig(EditCanvasConfigEnum.CHART_THEME_COLOR, selectTheme) }) } else { - window.$message.error('颜色应用失败!') + window.$message.error('数据应用失败!') } }