UnisKB/ui/src/layout/layout-template/SimpleLayout.vue

54 lines
1.6 KiB
Vue
Raw Normal View History

<template>
<div class="app-layout" style="display: flex; flex-direction: column; height: 100vh;">
<div class="app-header" :class="!isDefaultTheme ? 'custom-header' : ''" style="position: static;">
<el-alert
v-if="user.isExpire()"
:title="$t('layout.isExpire')"
type="warning"
class="border-b"
show-icon
:closable="false"
/>
<SystemHeader />
</div>
<!-- 主内容区 -->
<div class="app-main" :class="user.isExpire() ? 'isExpire' : ''" style="display: flex; flex: 1; overflow: hidden;">
<!-- 最左侧侧边栏 -->
<div style="width: 240px; border-right: 1px solid #e5e7eb;">
<Sidebar />
</div>
<!-- 内容区域 -->
<div style="flex: 1; overflow: auto;">
<AppMain />
</div>
</div>
</div>
</template>
2025-04-30 06:53:42 +00:00
<script setup lang="ts">
2025-06-20 19:55:48 +00:00
import { computed } from 'vue'
import Sidebar from '@/layout/components/sidebar/index.vue'
2025-04-30 06:53:42 +00:00
import AppMain from '@/layout/app-main/index.vue'
import SystemHeader from '@/layout/layout-header/SystemHeader.vue'
2025-06-20 19:55:48 +00:00
import useStore from '@/stores'
2025-07-02 14:41:33 +00:00
import { useRoute } from 'vue-router'
const route = useRoute()
const { user, theme } = useStore()
2025-07-02 14:41:33 +00:00
const {
params: { folderId }, // id为knowledgeID
2025-07-30 11:36:37 +00:00
query: { from },
2025-07-02 14:41:33 +00:00
} = route as any
const isShared = computed(() => {
2025-07-30 11:36:37 +00:00
return (
folderId === 'shared' ||
from === 'systemShare' ||
from === 'systemManage' ||
route.path.includes('resource-management')
2025-07-30 11:36:37 +00:00
)
2025-07-02 14:41:33 +00:00
})
const isDefaultTheme = computed(() => {
return theme.isDefaultTheme()
})
2025-04-30 06:53:42 +00:00
</script>
<style lang="scss">
@use './index.scss';
</style>