fix: update

This commit is contained in:
Fine 2023-12-20 17:18:08 +08:00
parent 562737432e
commit 5f91852f0c
2 changed files with 4 additions and 4 deletions

View File

@ -166,7 +166,6 @@ limitations under the License. -->
queryExpressions();
function clickTabs(e: Event, idx: number) {
console.log(idx);
e.stopPropagation();
activeTabIndex.value = idx;
dashboardStore.activeGridItem(props.data.i);
@ -272,7 +271,7 @@ limitations under the License. -->
}
dashboardStore.setConfigs(tabsProps);
if ((props.data.children || [])[activeTabIndex.value]?.enable === false) {
if (((props.data.children || [])[activeTabIndex.value] || {}).enable === false) {
const index = (props.data.children || []).findIndex((tab: any) => tab.enable !== false) || 0;
const items = ((props.data.children || [])[index] || {}).children;
dashboardStore.setCurrentTabItems(items || []);

View File

@ -60,8 +60,9 @@ limitations under the License. -->
dashboardStore.selectWidget(item);
if (
item.type === "Tab" &&
(event.target as HTMLDivElement)?.className !== "tab-layout" &&
(event.target as HTMLDivElement)?.classList[2] !== "icon-tool"
!["operations", "tab-layout"].includes((event.target as HTMLDivElement)?.className) &&
(event.target as HTMLDivElement)?.classList[2] !== "icon-tool" &&
(event.target as HTMLDivElement)?.nodeName !== "use"
) {
dashboardStore.setActiveTabIndex(0);
}