From 3885617b58e2f54680ab31c2176cdd23c5538e0e Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Fri, 18 Mar 2022 10:17:52 +0800 Subject: [PATCH] fix viewing dashboard with url --- .../dashboard/configuration/widget/MetricOptions.vue | 1 - src/views/dashboard/controls/Widget.vue | 12 ++++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/views/dashboard/configuration/widget/MetricOptions.vue b/src/views/dashboard/configuration/widget/MetricOptions.vue index 29a423eb..52261b42 100644 --- a/src/views/dashboard/configuration/widget/MetricOptions.vue +++ b/src/views/dashboard/configuration/widget/MetricOptions.vue @@ -261,7 +261,6 @@ function changeMetrics( }); return; } - console.log(arr); states.metrics[index] = arr[0].value; const typeOfMetrics = arr[0].type; diff --git a/src/views/dashboard/controls/Widget.vue b/src/views/dashboard/controls/Widget.vue index 121989bf..46cf7af4 100644 --- a/src/views/dashboard/controls/Widget.vue +++ b/src/views/dashboard/controls/Widget.vue @@ -101,7 +101,11 @@ export default defineComponent({ const dashboardStore = useDashboardStore(); const selectorStore = useSelectorStore(); - if (dashboardStore.entity === EntityType[1].value || props.needQuery) { + if ( + dashboardStore.entity === EntityType[1].value || + props.needQuery || + !dashboardStore.currentDashboard.id + ) { queryMetrics(); } @@ -154,7 +158,11 @@ export default defineComponent({ } ); watch( - () => [selectorStore.currentService, selectorStore.currentDestService], + () => [ + selectorStore.currentService, + selectorStore.currentDestService, + appStore.durationTime, + ], () => { if ( dashboardStore.entity === EntityType[0].value ||