<!-- 纵向布局 -->
<template>
    <el-header style="display: flex; justify-content: space-between">
        <div class="logo flx-center">
            <img class="logo-img" src="@/assets/images/logo.png" alt="logo" />
            <span style="margin-left: 10px; font-weight: 900">{{ title }}</span>
        </div>
        <ToolBarRight />
    </el-header>
    <el-container style="height: calc(100% - 60px)">
        <el-aside>
            <div class="aside-box" style="width: 95px">
                <el-scrollbar>
                    <el-menu
                        :default-active="activeMenu"
                        :collapse="isCollapse"
                        :router="false"
                        :unique-opened="true"
                        :collapse-transition="false"
                        background-color="#161616"
                    >
                        <SubMenu :menu-list="menuList" />
                    </el-menu>
                </el-scrollbar>
            </div>
        </el-aside>
        <el-container style="height: 100%">
            <Main />
        </el-container>
    </el-container>
</template>

<script setup lang="ts" name="layoutVertical">
import { computed } from "vue";
import { useRoute } from "vue-router";
import { useAuthStore } from "@/stores/modules/auth";
import { useGlobalStore } from "@/stores/modules/global";
import { useUserStore } from "@/stores/modules/user";
const userStore = useUserStore();
import Main from "@/layouts/components/Main/index.vue";
import ToolBarRight from "@/layouts/components/Header/ToolBarRight.vue";
import SubMenu from "@/layouts/components/Menu/SubMenu.vue";

const route = useRoute();
const authStore = useAuthStore();
const globalStore = useGlobalStore();
const isCollapse = computed(() => globalStore.isCollapse);
const menuList = computed(() => authStore.showMenuListGet);

const activeMenu = computed(() => (route.meta.activeMenu ? route.meta.activeMenu : route.path) as string);
let title = ref("ORICO品牌官网开放平台");
watch(
    () => userStore.languageValue,
    newVal => {
        const PARAMS_DATA = {
            1: "ORICO品牌官网开放平台",
            2: "ORICO brand official website open platform"
        };
        title.value = PARAMS_DATA[newVal];
    },
    {
        immediate: true,
        deep: true
    }
);
</script>

<style scoped lang="scss">
@import "./index.scss";
.el-container .el-aside .aside-box .el-scrollbar {
    background-color: #161616 !important;
}
</style>
