mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 14:34:46 +00:00
fix: activate the correct tab index after renaming a Tabs name (#103)
This commit is contained in:
parent
30069ce825
commit
c875c95c20
@ -1,4 +1,3 @@
|
|||||||
import { ElMessage } from "element-plus";
|
|
||||||
/**
|
/**
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
@ -29,7 +29,7 @@ limitations under the License. -->
|
|||||||
:h="item.h"
|
:h="item.h"
|
||||||
:i="item.i"
|
:i="item.i"
|
||||||
:key="item.i"
|
:key="item.i"
|
||||||
@click="clickGrid(item)"
|
@click="clickGrid(item, $event)"
|
||||||
:class="{ active: dashboardStore.activedGridItem === item.i }"
|
:class="{ active: dashboardStore.activedGridItem === item.i }"
|
||||||
:drag-ignore-from="dragIgnoreFrom"
|
:drag-ignore-from="dragIgnoreFrom"
|
||||||
>
|
>
|
||||||
@ -55,10 +55,13 @@ export default defineComponent({
|
|||||||
const dashboardStore = useDashboardStore();
|
const dashboardStore = useDashboardStore();
|
||||||
const selectorStore = useSelectorStore();
|
const selectorStore = useSelectorStore();
|
||||||
|
|
||||||
function clickGrid(item: LayoutConfig) {
|
function clickGrid(item: LayoutConfig, event: Event) {
|
||||||
dashboardStore.activeGridItem(item.i);
|
dashboardStore.activeGridItem(item.i);
|
||||||
dashboardStore.selectWidget(item);
|
dashboardStore.selectWidget(item);
|
||||||
if (item.type === "Tab") {
|
if (
|
||||||
|
item.type === "Tab" &&
|
||||||
|
(event.target as HTMLDivElement)?.className !== "tab-layout"
|
||||||
|
) {
|
||||||
dashboardStore.setActiveTabIndex(0);
|
dashboardStore.setActiveTabIndex(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ limitations under the License. -->
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex-h tools" v-loading="loading" v-if="!appStore.isMobile">
|
<div class="flex-h tools" v-loading="loading" v-if="!appStore.isMobile">
|
||||||
<div class="tool-icons flex-h" v-if="dashboardStore.editMode">
|
<div class="tool-icons flex-h" v-if="dashboardStore.editMode">
|
||||||
<el-dropdown content="Controls" placement="bottom">
|
<el-dropdown content="Controls" placement="bottom" :persistent="false">
|
||||||
<i>
|
<i>
|
||||||
<Icon class="icon-btn" size="sm" iconName="control" />
|
<Icon class="icon-btn" size="sm" iconName="control" />
|
||||||
</i>
|
</i>
|
||||||
|
@ -40,7 +40,12 @@ limitations under the License. -->
|
|||||||
@change="changeAggregateType"
|
@change="changeAggregateType"
|
||||||
class="selector mr-10"
|
class="selector mr-10"
|
||||||
/>
|
/>
|
||||||
<el-popover placement="bottom" :width="680" trigger="click">
|
<el-popover
|
||||||
|
placement="bottom"
|
||||||
|
:width="680"
|
||||||
|
trigger="click"
|
||||||
|
:persistent="false"
|
||||||
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button type="primary" size="small">
|
<el-button type="primary" size="small">
|
||||||
{{ t("processSelect") }}
|
{{ t("processSelect") }}
|
||||||
|
Loading…
Reference in New Issue
Block a user