mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-06 10:05:05 +00:00
fix: active widgets
This commit is contained in:
parent
4efbe48664
commit
a467269a67
@ -74,7 +74,10 @@ limitations under the License. -->
|
|||||||
@click="clickTabGrid($event, item)"
|
@click="clickTabGrid($event, item)"
|
||||||
:class="{ active: activeTabWidget === item.i }"
|
:class="{ active: activeTabWidget === item.i }"
|
||||||
>
|
>
|
||||||
<Widget :data="item" :active="activeTabWidget === item.i" />
|
<Widget
|
||||||
|
:data="item"
|
||||||
|
:activeIndex="`${data.i}-${activeTabIndex}-${item.i}`"
|
||||||
|
/>
|
||||||
</grid-item>
|
</grid-item>
|
||||||
</grid-layout>
|
</grid-layout>
|
||||||
<div class="no-data-tips" v-else>Please add widgets.</div>
|
<div class="no-data-tips" v-else>Please add widgets.</div>
|
||||||
|
@ -69,7 +69,7 @@ const props = {
|
|||||||
type: Object as PropType<LayoutConfig>,
|
type: Object as PropType<LayoutConfig>,
|
||||||
default: () => ({ widget: {} }),
|
default: () => ({ widget: {} }),
|
||||||
},
|
},
|
||||||
active: { type: Boolean, default: false },
|
activeIndex: { type: String, default: "" },
|
||||||
};
|
};
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "Widget",
|
name: "Widget",
|
||||||
@ -112,8 +112,14 @@ export default defineComponent({
|
|||||||
dashboardStore.removeControls(props.data);
|
dashboardStore.removeControls(props.data);
|
||||||
}
|
}
|
||||||
function editConfig() {
|
function editConfig() {
|
||||||
|
console.log(props.data);
|
||||||
dashboardStore.setConfigPanel(true);
|
dashboardStore.setConfigPanel(true);
|
||||||
dashboardStore.selectWidget(props.data);
|
dashboardStore.selectWidget(props.data);
|
||||||
|
if (props.activeIndex) {
|
||||||
|
dashboardStore.activeGridItem(props.activeIndex);
|
||||||
|
} else {
|
||||||
|
dashboardStore.activeGridItem(props.data.i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
watch(
|
watch(
|
||||||
() => [props.data.queryMetricType, props.data.metrics],
|
() => [props.data.queryMetricType, props.data.metrics],
|
||||||
|
Loading…
Reference in New Issue
Block a user