From 75fd69b6443e478f966ba1f71971d795ba410c5c Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Sat, 26 Mar 2022 14:06:36 +0800 Subject: [PATCH] fix config --- src/components/Select.vue | 1 + src/views/dashboard/configuration/widget/metric/Index.vue | 8 +++++++- .../dashboard/configuration/widget/metric/Standard.vue | 7 ++----- src/views/dashboard/graphs/EndpointList.vue | 6 ++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/Select.vue b/src/components/Select.vue index ceea97fb..571ef8af 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -118,6 +118,7 @@ function removeSelected() { } .rk-opt-wrapper { + color: #606266; position: absolute; top: 26px; left: 0; diff --git a/src/views/dashboard/configuration/widget/metric/Index.vue b/src/views/dashboard/configuration/widget/metric/Index.vue index e1182702..cc55cb0b 100644 --- a/src/views/dashboard/configuration/widget/metric/Index.vue +++ b/src/views/dashboard/configuration/widget/metric/Index.vue @@ -56,7 +56,7 @@ limitations under the License. --> @@ -339,6 +339,12 @@ function changeMetricType(index: number, opt: Option[] | any) { } queryMetrics(); } +async function queryListMetrics(metricConfig: MetricConfigOpt[]) { + dashboardStore.selectWidget({ + ...dashboardStore.selectedGrid, + metricConfig, + }); +} async function queryMetrics() { if (states.isList) { return; diff --git a/src/views/dashboard/configuration/widget/metric/Standard.vue b/src/views/dashboard/configuration/widget/metric/Standard.vue index 03c3bcdf..3ed2c75d 100644 --- a/src/views/dashboard/configuration/widget/metric/Standard.vue +++ b/src/views/dashboard/configuration/widget/metric/Standard.vue @@ -97,11 +97,8 @@ const metricType = ref( function changeConfigs(index: number, param: { [key: string]: string }) { const metricConfig = dashboardStore.selectedGrid.metricConfig || []; metricConfig[index] = { ...metricConfig[index], ...param }; - dashboardStore.selectWidget({ - ...dashboardStore.selectedGrid, - metricConfig, - }); - emit("update"); + + emit("update", metricConfig); }