fix: update

This commit is contained in:
Fine 2023-12-13 15:45:24 +08:00
parent e63ceb0891
commit 762b3e8894
2 changed files with 5 additions and 4 deletions

View File

@ -13,7 +13,7 @@ limitations under the License. -->
<template> <template>
<div class="item"> <div class="item">
<span class="label">{{ t("tabExpressions") }}</span> <span class="label">{{ t("tabExpressions") }}</span>
<div class="mt-10" v-for="(child, index) in dashboardStore.selectedGrid.children || []" :key="index"> <div class="mt-10" v-for="(child, index) in widgetTabs || []" :key="index">
<span class="name">{{ child.name }}</span> <span class="name">{{ child.name }}</span>
<el-input class="input" size="small" v-model="expressions[child.name]" @change="changeExpression(child.name)" /> <el-input class="input" size="small" v-model="expressions[child.name]" @change="changeExpression(child.name)" />
</div> </div>

View File

@ -127,7 +127,7 @@ 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 controls from "./tab"; import controls from "./tab";
import { dragIgnoreFrom } from "../data"; import { dragIgnoreFrom, WidgetType } from "../data";
import copy from "@/utils/copy"; import copy from "@/utils/copy";
import { useExpressionsQueryProcessor } from "@/hooks/useExpressionsProcessor"; import { useExpressionsQueryProcessor } from "@/hooks/useExpressionsProcessor";
@ -261,13 +261,14 @@ limitations under the License. -->
for (const child of tabsProps.children || []) { for (const child of tabsProps.children || []) {
if (params.source[child.expression || ""]) { if (params.source[child.expression || ""]) {
child.enable = !!Number(params.source[child.expression || ""]); child.enable =
!!Number(params.source[child.expression || ""]) &&
!!child.children.find((item: { type: string }) => item.type === WidgetType.Widget);
} else { } else {
child.enable = true; child.enable = true;
} }
} }
dashboardStore.setConfigs(tabsProps); dashboardStore.setConfigs(tabsProps);
console.log(props.data);
} }
watch( watch(