From cc2ca225e1e2212cc756e859f60cf3cd32a031ed Mon Sep 17 00:00:00 2001 From: Fine Date: Thu, 24 Oct 2024 15:13:51 +0800 Subject: [PATCH] fix --- src/views/dashboard/panel/Layout.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/views/dashboard/panel/Layout.vue b/src/views/dashboard/panel/Layout.vue index a3ae9ce1..3fd9c971 100644 --- a/src/views/dashboard/panel/Layout.vue +++ b/src/views/dashboard/panel/Layout.vue @@ -78,7 +78,6 @@ limitations under the License. --> } async function queryMetrics() { const widgets = []; - for (const item of dashboardStore.layout) { const isList = ListChartTypes.includes(item.type || ""); if (item.type === WidgetType.Widget && !isList) { @@ -86,7 +85,7 @@ limitations under the License. --> } if (item.type === WidgetType.Tab) { const index = isNaN(item.activedTabIndex) ? 0 : item.activedTabIndex; - widgets.push(...item.children[index].children); + widgets.push(...item.children[index].children.filter((d: LayoutConfig) => ListChartTypes.includes(d.type))); } } const configList = widgets.map((d: LayoutConfig) => ({ @@ -151,7 +150,7 @@ limitations under the License. --> }, ); watch( - () => appStore.durationTime, + () => [appStore.durationTime, dashboardStore.layout], () => { if (dashboardStore.entity === EntityType[1].value) { queryMetrics();