fix: expressions

This commit is contained in:
Fine 2023-06-03 15:04:36 +08:00
parent 73f7eb362e
commit 09e4f6786c
2 changed files with 7 additions and 2 deletions

View File

@ -86,7 +86,7 @@ limitations under the License. -->
/> />
<Icon class="cp" iconName="remove_circle_outline" size="middle" @click="deleteMetric(index)" /> <Icon class="cp" iconName="remove_circle_outline" size="middle" @click="deleteMetric(index)" />
</span> </span>
<span v-if="states.tips[index]" class="ml-10 red sm">{{ states.tips[index] }}</span> <span v-if="states.tips[index] && isExpression" class="ml-10 red sm">{{ states.tips[index] }}</span>
</div> </div>
<div>{{ t("visualization") }}</div> <div>{{ t("visualization") }}</div>
<div class="chart-types"> <div class="chart-types">
@ -210,6 +210,11 @@ limitations under the License. -->
} }
}); });
if (isExpression.value) { if (isExpression.value) {
if (states.metrics && states.metrics[0]) {
queryMetrics();
} else {
emit("update", {});
}
return; return;
} }
const metrics: any = states.metricList.filter((d: { value: string; type: string }) => const metrics: any = states.metricList.filter((d: { value: string; type: string }) =>
@ -487,6 +492,7 @@ limitations under the License. -->
metricConfig: backupMetricConfig.value, metricConfig: backupMetricConfig.value,
}); });
backupMetricConfig.value = config; backupMetricConfig.value = config;
queryMetrics();
} }
async function changeExpression(event: any, index: number) { async function changeExpression(event: any, index: number) {
const params = event.target.textContent; const params = event.target.textContent;

View File

@ -127,7 +127,6 @@ limitations under the License. -->
queryServices(); queryServices();
async function queryServices() { async function queryServices() {
console.log(props.config);
chartLoading.value = true; chartLoading.value = true;
const resp = await selectorStore.fetchServices(dashboardStore.layerId); const resp = await selectorStore.fetchServices(dashboardStore.layerId);