feat: remove returnTypeOfMQE and add detail label (#277)

This commit is contained in:
Fine0830
2023-06-08 20:52:44 +08:00
committed by GitHub
parent 372aee2eb6
commit 54997794b4
16 changed files with 261 additions and 218 deletions

View File

@@ -45,6 +45,7 @@ limitations under the License. -->
subTypesOfMQE: dashboardStore.selectedGrid.subTypesOfMQE || [],
}"
:needQuery="true"
@expressionTips="getErrors"
/>
<div v-show="!graph.type" class="no-data">
{{ t("noData") }}
@@ -54,7 +55,7 @@ limitations under the License. -->
<div class="collapse" :style="{ height: configHeight + 'px' }">
<el-collapse v-model="states.activeNames" :style="{ '--el-collapse-header-font-size': '15px' }">
<el-collapse-item :title="t('selectVisualization')" name="1">
<MetricOptions @update="getSource" @loading="setLoading" />
<MetricOptions @update="getSource" @loading="setLoading" :errors="errors" :subErrors="subErrors" />
</el-collapse-item>
<el-collapse-item :title="t('graphStyles')" name="2">
<component :is="`${graph.type}Config`" />
@@ -102,6 +103,8 @@ limitations under the License. -->
const dashboardStore = useDashboardStore();
const appStoreWithOut = useAppStoreWithOut();
const loading = ref<boolean>(false);
const errors = ref<string[]>([]);
const subErrors = ref<string[]>([]);
const states = reactive<{
activeNames: string;
source: unknown;
@@ -128,6 +131,11 @@ limitations under the License. -->
states.source = source;
}
function getErrors(params: { tips: string[]; subTips: string[] }) {
errors.value = params.tips;
subErrors.value = params.subTips;
}
function setLoading(load: boolean) {
loading.value = load;
}
@@ -169,12 +177,15 @@ limitations under the License. -->
applyConfig,
cancelConfig,
getSource,
getErrors,
setLoading,
widget,
graph,
title,
tips,
hasAssociate,
errors,
subErrors,
};
},
});