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); }