From cab3432d03eafc92c7adcd4e44c822eb256fb7f5 Mon Sep 17 00:00:00 2001 From: Li Date: Mon, 10 Apr 2023 15:10:22 +0800 Subject: [PATCH] fix: repeated display of theme tabs. (#3727) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind bug /area console #### What this PR does / why we need it: 获取主题配置时,重复添加了上次已经获取到的主题配置,导致重复显示。并同步修改了 plugin 中可能出现问题的位置。 #### Which issue(s) this PR fixes: Fixes #3726 #### Special notes for your reviewer: 1. 打开 Console 端主题页面 2. 点击右上角预览页面 3. 关闭预览页面,选项卡无重复即为正常。 #### Does this PR introduce a user-facing change? ```release-note 修复 Console 端主题设置中,选项卡会重复显示的问题 ``` --- console/src/modules/interface/themes/layouts/ThemeLayout.vue | 2 +- console/src/modules/system/plugins/layouts/PluginLayout.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/console/src/modules/interface/themes/layouts/ThemeLayout.vue b/console/src/modules/interface/themes/layouts/ThemeLayout.vue index bc5b083d4..8b316c6af 100644 --- a/console/src/modules/interface/themes/layouts/ThemeLayout.vue +++ b/console/src/modules/interface/themes/layouts/ThemeLayout.vue @@ -90,7 +90,7 @@ const { data: setting } = useQuery({ if (data) { const { forms } = data.spec; tabs.value = [ - ...tabs.value, + ...initialTabs, ...forms.map((item: SettingForm) => { return { id: item.group, diff --git a/console/src/modules/system/plugins/layouts/PluginLayout.vue b/console/src/modules/system/plugins/layouts/PluginLayout.vue index 6f63f6c63..358e93993 100644 --- a/console/src/modules/system/plugins/layouts/PluginLayout.vue +++ b/console/src/modules/system/plugins/layouts/PluginLayout.vue @@ -88,7 +88,7 @@ const { data: setting } = useQuery({ if (data) { const { forms } = data.spec; tabs.value = [ - ...tabs.value, + ...initialTabs, ...forms.map((item: SettingForm) => { return { id: item.group,