<template>
  <el-container>
    <el-header><Headers /></el-header>
    <el-container>
      <el-aside width="200px">
        <Aside />
      </el-aside>
      <el-main>
        <keep-alive>
          <router-view />
        </keep-alive>
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup lang="ts">
import Aside from './components/aside.vue'
import Headers from './components/header.vue'
import { useTenantStore } from '@/stores/modules/tenant'

const router = useRouter()
const tenantStore = useTenantStore()
const tenantList = computed(() => tenantStore.getTenantList)

watch(
  () => tenantList.value,
  (list: any) => {
    if (!list.length) return router.push('/')
  },
  { immediate: true }
)
</script>

<style scoped>
.el-container {
  height: 100%;
}
.el-main {
  --el-main-padding: 30px;
}
.el-header {
  background-color: #545c64;
  border-bottom: 1px solid #ffffff;
  box-sizing: border-box;
  height: 50px;
}
</style>
