mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-16 18:45:23 +00:00
fix rerender
This commit is contained in:
parent
a23013bb28
commit
0cf2c15cdc
@ -42,6 +42,9 @@ onMounted(async () => {
|
||||
setTimeout(() => {
|
||||
const instance = getInstance();
|
||||
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
instance.on("click", (params: any) => {
|
||||
emits("select", params);
|
||||
});
|
||||
|
@ -141,10 +141,10 @@ export default defineComponent({
|
||||
watch(
|
||||
() => [props.data.metricTypes, props.data.metrics],
|
||||
() => {
|
||||
if (
|
||||
dashboardStore.selectedGrid &&
|
||||
props.data.i !== dashboardStore.selectedGrid.i
|
||||
) {
|
||||
if (!dashboardStore.selectedGrid) {
|
||||
return;
|
||||
}
|
||||
if (props.data.i !== dashboardStore.selectedGrid.i) {
|
||||
return;
|
||||
}
|
||||
if (TableChartTypes.includes(dashboardStore.selectedGrid.graph.type)) {
|
||||
|
@ -39,7 +39,7 @@ limitations under the License. -->
|
||||
<div class="no-data-tips" v-else>Please add widgets.</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { defineComponent, onBeforeUnmount } from "vue";
|
||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||
import { LayoutConfig } from "@/types/dashboard";
|
||||
import controls from "../controls/index";
|
||||
@ -56,6 +56,9 @@ export default defineComponent({
|
||||
dashboardStore.activeGridItem(item.i);
|
||||
dashboardStore.selectWidget(item);
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
dashboardStore.setLayout([]);
|
||||
});
|
||||
return {
|
||||
dashboardStore,
|
||||
layoutUpdatedEvent,
|
||||
|
@ -108,7 +108,8 @@ const selectorStore = useSelectorStore();
|
||||
const appStore = useAppStoreWithOut();
|
||||
const params = useRoute().params;
|
||||
const type = EntityType.filter((d: Option) => d.value === params.entity)[0];
|
||||
const toolIcons = ref<any[]>(PodRelationTools);
|
||||
const toolIcons =
|
||||
ref<{ name: string; content: string; id: string }[]>(PodRelationTools);
|
||||
const states = reactive<{
|
||||
destService: string;
|
||||
destPod: string;
|
||||
@ -129,6 +130,7 @@ const states = reactive<{
|
||||
|
||||
dashboardStore.setLayer(String(params.layerId));
|
||||
dashboardStore.setEntity(String(params.entity));
|
||||
appStore.setEventStack([initSelector]);
|
||||
|
||||
initSelector();
|
||||
|
||||
@ -423,7 +425,6 @@ function getTools() {
|
||||
toolIcons.value = PodRelationTools;
|
||||
}
|
||||
}
|
||||
appStore.setEventStack([initSelector]);
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.dashboard-tool {
|
||||
|
Loading…
Reference in New Issue
Block a user