fix: update

This commit is contained in:
Fine 2024-08-21 15:33:31 +08:00
parent 8bf5a6c169
commit 7ca5eda863

View File

@ -75,11 +75,10 @@ limitations under the License. -->
import type { LayoutConfig } from "@/types/dashboard"; import type { LayoutConfig } from "@/types/dashboard";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { useAppStoreWithOut } from "@/store/modules/app"; import { useAppStoreWithOut } from "@/store/modules/app";
import { useSelectorStore } from "@/store/modules/selectors";
import graphs from "../graphs"; import graphs from "../graphs";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { useExpressionsQueryProcessor } from "@/hooks/useExpressionsProcessor"; import { useDashboardQueryProcessor } from "@/hooks/useExpressionsProcessor";
import { EntityType, ListChartTypes } from "../data"; import { ListChartTypes } from "../data";
import type { EventParams } from "@/types/dashboard"; import type { EventParams } from "@/types/dashboard";
import getDashboard from "@/hooks/useDashboardsSession"; import getDashboard from "@/hooks/useDashboardsSession";
@ -89,7 +88,7 @@ limitations under the License. -->
default: () => ({ widget: {}, graph: {} }), default: () => ({ widget: {}, graph: {} }),
}, },
metricsValues: { metricsValues: {
type: Object as PropType<any>, type: Object as PropType<{ [key: string]: { source: { [key: string]: unknown }; typesOfMQE: string[] } }>,
default: () => ({}), default: () => ({}),
}, },
activeIndex: { type: String, default: "" }, activeIndex: { type: String, default: "" },
@ -116,11 +115,13 @@ limitations under the License. -->
async function queryMetrics() { async function queryMetrics() {
loading.value = true; loading.value = true;
const e = { const config = {
metrics: props.data.expressions || [], metrics: props.data.expressions || [],
metricConfig: props.data.metricConfig || [], metricConfig: props.data.metricConfig || [],
id: props.data.i,
}; };
const params = (await useExpressionsQueryProcessor(e)) || {}; const values = (await useDashboardQueryProcessor([config])) || {};
const params = values[data.value.i];
loading.value = false; loading.value = false;
state.source = params.source || {}; state.source = params.source || {};
typesOfMQE.value = params.typesOfMQE; typesOfMQE.value = params.typesOfMQE;