<script lang="ts" setup>
import { computed, ref } from 'vue'
import Header from './components/Header.vue'
import Sidebar from './components/Sidebar.vue'
import Menu from '../../layout/components/Menu.vue'
import Main from '../../layout/components/Main.vue'
import CollapseBar from '../../layout/components/CollapseBar.vue'
import { ElContainer } from 'element-plus-secondary'
import { useRoute } from 'vue-router'
import { XpackComponent } from '@/components/plugin'
import { useI18n } from '@/hooks/web/useI18n'
const route = useRoute()
const systemMenu = computed(() => route.path.includes('system'))
const settingMenu = computed(() => route.path.includes('sys-setting'))
const marketMenu = computed(() => route.path.includes('template-market'))
const toolboxMenu = computed(() => route.path.includes('toolbox'))
const msgFillMenu = computed(() => route.path.includes('msg-fill'))
const isCollapse = ref(false)
const setCollapse = () => {
  isCollapse.value = !isCollapse.value
}
const { t } = useI18n()
</script>

<template>
  <div class="common-layout">
    <Sidebar class="left-sidebar"> </Sidebar>
    <el-container class="layout-container">
      <Header class="layout-header"></Header>
      <Main
        class="layout-main"
      ></Main>
    </el-container>
  </div>
  <XpackComponent jsname="L2NvbXBvbmVudC9sb2dpbi9Qd2RJbnZhbGlkVGlwcw==" />
</template>

<style lang="less" scoped>
.common-layout {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  // flex-direction: column;
  background: rgb(21,21,21);
  color: #1f2329;
  min-width: 1000px;
  overflow-x: auto;
  .left-sidebar{
    width:260px;
    
    height: 100vh;
    background: rgba(37, 38, 38, 1);
  }

  .layout-container {
    position: relative;
    width:calc(100vw - 260px);
    
    z-index: 1;
    .layout-header{
       position:absolute;
       right: 0;
       z-index:1
    }
    .layout-sidebar {
      height: calc(100vh - 106px);
    }

    .layout-sidebar-collapse {
      width: 64px;
    }

    .org-config-center {
      height: 48px;
      padding-left: 24px;
      display: flex;
      align-items: center;
      font-size: 14px;
      font-weight: 500;
      line-height: 22px;
      color: #8f959e;
      border-bottom: 1px solid #1f232926;
      position: sticky;
      top: 0;
      left: 0;
      background: #fff;
      z-index: 10;
    }

    .layout-main {
      flex: 1;
      padding: 0;
    }

    .with-sider {
      padding: 16px 24px 24px 24px;
    }
    .with-sider:has(.appearance-foot) {
      padding: 16px 24px 0px 24px !important;
    }
  }
}
</style>
