|
@@ -2,7 +2,8 @@
|
|
|
import { computed } from 'vue'
|
|
import { computed } from 'vue'
|
|
|
import { NLayout, NLayoutContent } from 'naive-ui'
|
|
import { NLayout, NLayoutContent } from 'naive-ui'
|
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
|
-import Sider from './sider/index.vue'
|
|
|
|
|
|
|
+import ChatSider from './sider/Chat.vue'
|
|
|
|
|
+import AgentSider from './sider/Agent.vue'
|
|
|
import Permission from './Permission.vue'
|
|
import Permission from './Permission.vue'
|
|
|
import { useBasicLayout } from '@/hooks/useBasicLayout'
|
|
import { useBasicLayout } from '@/hooks/useBasicLayout'
|
|
|
import { useAppStore, useAuthStore, useChatStore } from '@/store'
|
|
import { useAppStore, useAuthStore, useChatStore } from '@/store'
|
|
@@ -16,7 +17,8 @@ router.replace({ name: 'Chat', params: { uuid: chatStore.active } })
|
|
|
|
|
|
|
|
const { isMobile } = useBasicLayout()
|
|
const { isMobile } = useBasicLayout()
|
|
|
|
|
|
|
|
-const collapsed = computed(() => appStore.siderCollapsed)
|
|
|
|
|
|
|
+const chatCollapsed = computed(() => appStore.chatSiderCollapsed)
|
|
|
|
|
+const agentCollapsed = computed(() => appStore.agentSiderCollapsed)
|
|
|
|
|
|
|
|
const needPermission = computed(() => !!authStore.session?.auth && !authStore.token)
|
|
const needPermission = computed(() => !!authStore.session?.auth && !authStore.token)
|
|
|
|
|
|
|
@@ -26,25 +28,33 @@ const getMobileClass = computed(() => {
|
|
|
return ['border', 'rounded-md', 'shadow-md', 'dark:border-neutral-800']
|
|
return ['border', 'rounded-md', 'shadow-md', 'dark:border-neutral-800']
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const getContainerClass = computed(() => {
|
|
|
|
|
|
|
+const getChatContainerClass = computed(() => {
|
|
|
return [
|
|
return [
|
|
|
'h-full',
|
|
'h-full',
|
|
|
- { 'pl-[260px]': !isMobile.value && !collapsed.value },
|
|
|
|
|
]
|
|
]
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+const getAgentContainerClass = computed(() => {
|
|
|
|
|
+ return [
|
|
|
|
|
+ 'h-full',
|
|
|
|
|
+ ]
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<div class="h-full dark:bg-[#24272e] transition-all" :class="[isMobile ? 'p-0' : 'p-4']">
|
|
<div class="h-full dark:bg-[#24272e] transition-all" :class="[isMobile ? 'p-0' : 'p-4']">
|
|
|
<div class="h-full overflow-hidden" :class="getMobileClass">
|
|
<div class="h-full overflow-hidden" :class="getMobileClass">
|
|
|
- <NLayout class="z-40 transition" :class="getContainerClass" has-sider>
|
|
|
|
|
- <Sider />
|
|
|
|
|
- <NLayoutContent class="h-full">
|
|
|
|
|
- <RouterView v-slot="{ Component, route }">
|
|
|
|
|
- <component :is="Component" :key="route.fullPath" />
|
|
|
|
|
- </RouterView>
|
|
|
|
|
- </NLayoutContent>
|
|
|
|
|
- </NLayout>
|
|
|
|
|
|
|
+ <NLayout class="z-40 transition" :class="getChatContainerClass" has-sider sider-placement="left">
|
|
|
|
|
+ <ChatSider />
|
|
|
|
|
+ <NLayout class="z-40 transition" :class="getAgentContainerClass" has-sider sider-placement="right">
|
|
|
|
|
+ <NLayoutContent class="h-full">
|
|
|
|
|
+ <RouterView v-slot="{ Component, route }">
|
|
|
|
|
+ <component :is="Component" :key="route.fullPath" />
|
|
|
|
|
+ </RouterView>
|
|
|
|
|
+ </NLayoutContent>
|
|
|
|
|
+ <AgentSider />
|
|
|
|
|
+ </NLayout>
|
|
|
|
|
+ </NLayout>
|
|
|
</div>
|
|
</div>
|
|
|
<Permission :visible="needPermission" />
|
|
<Permission :visible="needPermission" />
|
|
|
</div>
|
|
</div>
|