From 2aeb9fd9ac941f7bd869c78ce7f6a226dc84cd09 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 6 Jul 2022 15:46:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E8=A7=86=E5=9B=BE):=20=E5=B0=86?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E8=B7=9F=E9=9A=8F=E4=B8=BB=E9=A2=98=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=8F=98=E6=9B=B4=E5=BC=BA=E5=88=B6=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=BA=E5=93=8D=E5=BA=94=E5=BC=8F=EF=BC=8C=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E5=90=8E=E5=8A=A0=E7=9A=84=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=9C=AA=E7=9B=B8=E5=BA=94=E4=B8=BB=E9=A2=98=E7=9A=84=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/utils/style.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/canvas/utils/style.js b/frontend/src/components/canvas/utils/style.js index b010aed82a..a2ee7a9f10 100644 --- a/frontend/src/components/canvas/utils/style.js +++ b/frontend/src/components/canvas/utils/style.js @@ -10,6 +10,7 @@ export const DARK_THEME_COLOR_MAIN = '#FFFFFF' export const DARK_THEME_COLOR_SLAVE1 = '#CCCCCC' export const DARK_THEME_PANEL_BACKGROUND = '#030B2E' export const DARK_THEME_COMPONENT_BACKGROUND = '#131E42' +export const DARK_THEME_COMPONENT_BACKGROUND_BACK = '#5a5c62' export function getStyle(style, filter = []) { const needUnit = [ @@ -298,8 +299,8 @@ export function recursionThemTransObj(template, infoObj, color) { // 如果是数组 进行赋值计算 if (template[templateKey] instanceof Array) { template[templateKey].forEach(templateProp => { - if (infoObj[templateKey] && infoObj[templateKey][templateProp]) { - infoObj[templateKey][templateProp] = color + if (infoObj[templateKey]) { + Vue.set(infoObj[templateKey], templateProp, color) } }) } else { @@ -332,7 +333,7 @@ export function adaptCurTheme(customStyle, customAttr) { recursionThemTransObj(THEME_STYLE_TRANS_MAIN, customStyle, DARK_THEME_COLOR_MAIN) recursionThemTransObj(THEME_STYLE_TRANS_SLAVE1, customStyle, DARK_THEME_COLOR_SLAVE1) recursionThemTransObj(THEME_ATTR_TRANS_MAIN, customAttr, DARK_THEME_COLOR_MAIN) - recursionThemTransObj(THEME_ATTR_TRANS_SLAVE1_BACKGROUND, customAttr, DARK_THEME_COMPONENT_BACKGROUND) + recursionThemTransObj(THEME_ATTR_TRANS_SLAVE1_BACKGROUND, customAttr, DARK_THEME_COMPONENT_BACKGROUND_BACK) } customAttr['color'] = { ...canvasStyle.chartInfo.chartColor } customStyle['text'] = { ...canvasStyle.chartInfo.chartTitle, title: customStyle['text']['title'] } @@ -375,7 +376,7 @@ export function adaptCurThemeFilterStyleAll(styleKey) { const filterStyle = store.state.canvasStyleData.chartInfo.filterStyle componentData.forEach((item) => { if (isFilterComponent(item.component)) { - item.style[styleKey] = filterStyle[styleKey] + Vue.set(item.style, styleKey, filterStyle[styleKey]) } }) }