2025-07-23 17:02:24 +08:00
|
|
|
<script setup>
|
2025-08-16 17:55:49 +08:00
|
|
|
import { Layout } from 'ant-design-vue';
|
2025-08-18 17:22:11 +08:00
|
|
|
import Navbar from './components/navbar';
|
|
|
|
|
import SiderBar from './components/siderBar';
|
2025-08-16 17:55:49 +08:00
|
|
|
|
2025-06-16 14:42:26 +08:00
|
|
|
import { useAppStore } from '@/stores';
|
2025-08-18 17:22:11 +08:00
|
|
|
import { useSidebarStore } from '@/stores/modules/side-bar';
|
2025-06-16 14:42:26 +08:00
|
|
|
import { useResponsive } from '@/hooks';
|
2025-06-20 18:16:40 +08:00
|
|
|
import JoinModal from '@/components/join-modal.vue';
|
|
|
|
|
import { getQueryParam } from '@/utils/helper';
|
2025-07-23 17:02:24 +08:00
|
|
|
import { useUserStore } from '@/stores';
|
|
|
|
|
|
2025-06-22 22:52:03 -04:00
|
|
|
import { ref, onMounted, computed } from 'vue';
|
|
|
|
|
import { useRoute } from 'vue-router';
|
2025-06-16 14:42:26 +08:00
|
|
|
|
2025-06-20 18:16:40 +08:00
|
|
|
const joinEnterpriseVisible = ref(false);
|
2025-07-23 17:02:24 +08:00
|
|
|
const joinModalRef = ref(null);
|
2025-06-16 14:42:26 +08:00
|
|
|
const appStore = useAppStore();
|
2025-08-18 17:22:11 +08:00
|
|
|
const sidebarStore = useSidebarStore();
|
2025-07-23 17:02:24 +08:00
|
|
|
const userStore = useUserStore();
|
2025-06-16 14:42:26 +08:00
|
|
|
const router = useRouter();
|
2025-06-22 22:52:03 -04:00
|
|
|
const route = useRoute();
|
2025-06-16 14:42:26 +08:00
|
|
|
|
|
|
|
|
useResponsive(true);
|
2025-08-18 17:38:14 +08:00
|
|
|
|
2025-08-19 18:10:36 +08:00
|
|
|
const isHomeRoute = computed(() => {
|
|
|
|
|
return route.name === 'Home';
|
|
|
|
|
});
|
2025-08-21 16:26:57 +08:00
|
|
|
const showInOnePage = computed(() => {
|
|
|
|
|
return isHomeRoute.value;
|
|
|
|
|
});
|
2025-06-16 14:42:26 +08:00
|
|
|
|
2025-08-19 18:01:30 +08:00
|
|
|
const layoutPageClass = computed(() => {
|
2025-08-21 16:26:57 +08:00
|
|
|
let result = showInOnePage.value ? 'overflow-hidden' : '';
|
2025-08-19 18:10:36 +08:00
|
|
|
if (isHomeRoute.value) {
|
2025-08-27 12:04:23 +08:00
|
|
|
result += ' pb-8px pr-8px';
|
2025-08-21 16:26:57 +08:00
|
|
|
} else {
|
2025-08-27 12:04:23 +08:00
|
|
|
result += ' pb-24px pr-24px';
|
2025-08-19 18:01:30 +08:00
|
|
|
}
|
2025-08-21 16:26:57 +08:00
|
|
|
return result;
|
2025-08-19 10:43:53 +08:00
|
|
|
});
|
|
|
|
|
|
2025-06-20 18:16:40 +08:00
|
|
|
onMounted(() => {
|
|
|
|
|
checkHasInviteCode();
|
|
|
|
|
});
|
2025-06-16 14:42:26 +08:00
|
|
|
|
2025-06-20 18:16:40 +08:00
|
|
|
const checkHasInviteCode = () => {
|
|
|
|
|
const inviteCode = getQueryParam('invite_code');
|
2025-07-23 17:02:24 +08:00
|
|
|
if (userStore.isLogin && inviteCode) {
|
2025-06-20 18:16:40 +08:00
|
|
|
joinEnterpriseVisible.value = true;
|
2025-07-23 17:02:24 +08:00
|
|
|
joinModalRef.value?.getEnterprise?.();
|
2025-06-20 18:16:40 +08:00
|
|
|
}
|
|
|
|
|
};
|
2025-06-16 14:42:26 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-08-16 17:55:49 +08:00
|
|
|
<Layout :class="['layout-wrap', { mobile: appStore.hideMenu }]" class="h-full flex flex-col w-full">
|
2025-07-23 17:02:24 +08:00
|
|
|
<JoinModal v-model:visible="joinEnterpriseVisible" ref="joinModalRef" />
|
2025-08-18 10:09:41 +08:00
|
|
|
<Layout.Header class="layout-header-wrap">
|
|
|
|
|
<Navbar />
|
|
|
|
|
</Layout.Header>
|
2025-09-01 17:00:40 +08:00
|
|
|
<Layout class="flex app-content-layout">
|
|
|
|
|
<div class="flex flex-1 app-content-scroll">
|
|
|
|
|
<div class="app-content-inner">
|
|
|
|
|
<SiderBar />
|
|
|
|
|
<Layout
|
|
|
|
|
class="layout-content"
|
|
|
|
|
:style="{
|
|
|
|
|
width: `calc(100vw - ${sidebarStore.sidebarWidth}px)`,
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<Layout.Content :class="layoutPageClass" class="!min-h-initial w-full">
|
|
|
|
|
<layout-page />
|
|
|
|
|
</Layout.Content>
|
|
|
|
|
</Layout>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-08-16 17:55:49 +08:00
|
|
|
</Layout>
|
|
|
|
|
</Layout>
|
2025-06-16 14:42:26 +08:00
|
|
|
</template>
|
|
|
|
|
|
2025-07-11 16:50:48 +08:00
|
|
|
<style scoped lang="scss">
|
2025-08-16 17:01:06 +08:00
|
|
|
.layout-wrap {
|
2025-08-16 17:55:49 +08:00
|
|
|
font-family: inherit;
|
|
|
|
|
background: transparent;
|
2025-08-29 15:49:50 +08:00
|
|
|
min-width: $layout-min-width;
|
2025-08-16 18:00:06 +08:00
|
|
|
.layout-header-wrap {
|
|
|
|
|
background: transparent;
|
2025-08-15 14:32:40 +08:00
|
|
|
height: $navbar-height;
|
2025-08-16 18:00:06 +08:00
|
|
|
line-height: $navbar-height;
|
|
|
|
|
padding-inline: inherit;
|
|
|
|
|
color: inherit;
|
2025-09-01 17:00:40 +08:00
|
|
|
// position: fixed;
|
|
|
|
|
// top: 0;
|
|
|
|
|
// left: 0;
|
|
|
|
|
// z-index: 1000;
|
2025-08-19 10:43:53 +08:00
|
|
|
width: 100%;
|
2025-08-29 15:49:50 +08:00
|
|
|
min-width: $layout-min-width;
|
2025-06-16 14:42:26 +08:00
|
|
|
}
|
2025-09-01 17:00:40 +08:00
|
|
|
.app-content-layout {
|
2025-08-19 10:43:53 +08:00
|
|
|
width: 100%;
|
2025-08-15 14:32:40 +08:00
|
|
|
height: 100%;
|
2025-08-16 17:55:49 +08:00
|
|
|
background: transparent;
|
2025-08-16 17:01:06 +08:00
|
|
|
min-height: calc(100vh - $navbar-height);
|
2025-09-01 17:00:40 +08:00
|
|
|
.app-content-scroll {
|
|
|
|
|
min-height: calc(100vh - $navbar-height);
|
|
|
|
|
height: calc(100vh - $navbar-height);
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
.app-content-inner {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: calc(100vh - $navbar-height);
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-16 17:55:49 +08:00
|
|
|
:deep(.ant-layout-sider) {
|
2025-08-16 17:01:06 +08:00
|
|
|
background: none;
|
|
|
|
|
box-shadow: none;
|
2025-09-01 17:00:40 +08:00
|
|
|
// padding-top: $navbar-height;
|
2025-08-16 17:55:49 +08:00
|
|
|
padding-bottom: 0;
|
2025-09-01 17:00:40 +08:00
|
|
|
// position: fixed;
|
|
|
|
|
// top: 0;
|
|
|
|
|
// left: 0;
|
|
|
|
|
// z-index: 999;
|
2025-08-19 10:43:53 +08:00
|
|
|
height: 100%;
|
|
|
|
|
transition: all 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
|
2025-08-16 17:55:49 +08:00
|
|
|
.ant-layout-sider-trigger {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
.ant-layout-sider-children {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
2025-06-16 14:42:26 +08:00
|
|
|
}
|
2025-08-16 17:01:06 +08:00
|
|
|
.layout-content {
|
2025-08-16 17:55:49 +08:00
|
|
|
background: transparent;
|
2025-08-16 17:01:06 +08:00
|
|
|
transition: padding 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
|
2025-09-01 17:00:40 +08:00
|
|
|
flex: 1;
|
|
|
|
|
height: 100%;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
overflow-x: hidden;
|
2025-08-16 17:01:06 +08:00
|
|
|
}
|
2025-08-15 14:32:40 +08:00
|
|
|
}
|
2025-06-16 14:42:26 +08:00
|
|
|
}
|
|
|
|
|
</style>
|