<script setup lang="ts">
import { computed } from "vue";
import { useTagsViewStore } from "@/store/modules/tagsView";
import { useRoute } from "vue-router";
import GisView from "@/components/gis/GisView.vue";

const tagsViewStore = useTagsViewStore();

const router = useRoute();
const routeKey = computed(() => router.path + Math.random());
</script>

<template>
  <section class="app-main">
    <GisView />
    <div class="gi-panels">
      <router-view v-slot="{ Component, route }" :key="routeKey">
        <transition name="router-fade" mode="out-in">
          <keep-alive :include="tagsViewStore.cachedViews">
            <component :is="Component" :key="route.fullPath" />
          </keep-alive>
        </transition>
      </router-view>
    </div>
  </section>
</template>

<style lang="scss" scoped>
@use "@/styles/variables.module.scss" as *;
.app-main {
  min-height: calc(100vh - $layout-header-height - $locationbar-height);
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
  box-sizing: border-box;
}
.gi-panels {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 900;
}
</style>
