mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 04:14:56 +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
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
|
@ -29,7 +29,7 @@ limitations under the License. -->
|
||||
:h="item.h"
|
||||
:i="item.i"
|
||||
:key="item.i"
|
||||
@click="clickGrid(item)"
|
||||
@click="clickGrid(item, $event)"
|
||||
:class="{ active: dashboardStore.activedGridItem === item.i }"
|
||||
:drag-ignore-from="dragIgnoreFrom"
|
||||
>
|
||||
@ -55,10 +55,13 @@ export default defineComponent({
|
||||
const dashboardStore = useDashboardStore();
|
||||
const selectorStore = useSelectorStore();
|
||||
|
||||
function clickGrid(item: LayoutConfig) {
|
||||
function clickGrid(item: LayoutConfig, event: Event) {
|
||||
dashboardStore.activeGridItem(item.i);
|
||||
dashboardStore.selectWidget(item);
|
||||
if (item.type === "Tab") {
|
||||
if (
|
||||
item.type === "Tab" &&
|
||||
(event.target as HTMLDivElement)?.className !== "tab-layout"
|
||||
) {
|
||||
dashboardStore.setActiveTabIndex(0);
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ limitations under the License. -->
|
||||
</div>
|
||||
<div class="flex-h tools" v-loading="loading" v-if="!appStore.isMobile">
|
||||
<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>
|
||||
<Icon class="icon-btn" size="sm" iconName="control" />
|
||||
</i>
|
||||
|
@ -40,7 +40,12 @@ limitations under the License. -->
|
||||
@change="changeAggregateType"
|
||||
class="selector mr-10"
|
||||
/>
|
||||
<el-popover placement="bottom" :width="680" trigger="click">
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
:width="680"
|
||||
trigger="click"
|
||||
:persistent="false"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="primary" size="small">
|
||||
{{ t("processSelect") }}
|
||||
|
Loading…
Reference in New Issue
Block a user