Skip to content

Commit

Permalink
feat(chat): add chat layout
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklin committed Jan 5, 2024
1 parent ec88108 commit 4c4188b
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 3 deletions.
7 changes: 7 additions & 0 deletions apps/admin/autoResolver/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ declare module 'vue' {
export interface GlobalComponents {
CAAppLogo: typeof import('@celeris/components')['CAAppLogo']
CAAppNaiveUIProvider: typeof import('@celeris/components')['CAAppNaiveUIProvider']
NAlert: typeof import('@celeris/ca-components')['NAlert']
NAvatar: typeof import('@celeris/ca-components')['NAvatar']
NButton: typeof import('@celeris/ca-components')['NButton']
NCard: typeof import('@celeris/ca-components')['NCard']
Expand All @@ -28,6 +29,10 @@ declare module 'vue' {
NGrid: typeof import('@celeris/ca-components')['NGrid']
NGridItem: typeof import('@celeris/ca-components')['NGridItem']
NInput: typeof import('@celeris/ca-components')['NInput']
NInputGroup: typeof import('@celeris/ca-components')['NInputGroup']
NLayout: typeof import('@celeris/ca-components')['NLayout']
NLayoutContent: typeof import('@celeris/ca-components')['NLayoutContent']
NLayoutSider: typeof import('@celeris/ca-components')['NLayoutSider']
NLoadingBarProvider: typeof import('@celeris/ca-components')['NLoadingBarProvider']
NMenu: typeof import('@celeris/ca-components')['NMenu']
NMessageProvider: typeof import('@celeris/ca-components')['NMessageProvider']
Expand All @@ -37,6 +42,8 @@ declare module 'vue' {
NScrollbar: typeof import('@celeris/ca-components')['NScrollbar']
NSelect: typeof import('@celeris/ca-components')['NSelect']
NSpace: typeof import('@celeris/ca-components')['NSpace']
NSpin: typeof import('@celeris/ca-components')['NSpin']
NSplit: typeof import('@celeris/ca-components')['NSplit']
NStep: typeof import('@celeris/ca-components')['NStep']
NSteps: typeof import('@celeris/ca-components')['NSteps']
NSwitch: typeof import('@celeris/ca-components')['NSwitch']
Expand Down
4 changes: 2 additions & 2 deletions apps/admin/src/layouts/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ defineOptions({
<header class="">
<Header />
</header>
<div class="block flex-1 overflow-x-hidden rounded-2xl pl-0 pr-5 pt-0 pb-6">
<div class="min-h-full w-full rounded-2xl bg-gray-100 p-4 dark:bg-gray-9">
<div class="block flex-1 h-full overflow-x-hidden rounded-2xl pl-0 pr-5 pt-0 pb-6">
<div class="min-h-full h-full w-full rounded-2xl bg-gray-100 p-4 dark:bg-gray-9">
<Content />
</div>
</div>
Expand Down
15 changes: 15 additions & 0 deletions apps/admin/src/pages/chat/components/ChatHistorySidebar/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup lang="ts">
defineOptions({
name: "ChatHistorySidebar",
});
</script>

<template>
<div>
ChatHistorySidebar
</div>
</template>

<style scoped>
</style>
49 changes: 49 additions & 0 deletions apps/admin/src/pages/chat/components/ChatLayout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<script setup lang="ts">
import ChatHistorySidebar from "./ChatHistorySidebar/index.vue";
import ChatPanel from "./ChatPanel/index.vue";
import RoleManagementSidebar from "./RoleManagementSidebar/index.vue";
</script>

<template>
<!-- 采用了分栏布局,包括一个左侧边栏和一个右侧边栏,以及一个中央面板。
左侧边栏是用于管理系统角色的区域,允许用户创建、编辑和删除系统角色。
右侧边栏显示了每个角色的聊天记录,并且可以根据用户选择的角色动态加载相应的聊天记录。
中央面板则用于展示选定角色的实时对话界面,可能包含一个消息输入框以及用于加载历史对话记录的功能。 -->
<div class="chat-layout rounded-2xl w-full h-full min-h-full ">
<NLayout has-sider sider-placement="left" class="h-full">
<NLayoutSider
collapse-mode="width"
:collapsed-width="240"
:width="360"
:native-scrollbar="true"
show-trigger="arrow-circle"
content-style="padding: 24px;"
bordered
>
<ChatHistorySidebar />
</NLayoutSider>
<NLayoutContent>
<NLayout has-sider sider-placement="right" class="h-full">
<NLayoutContent content-style="padding: 24px;">
<ChatPanel />
</NLayoutContent>
<NLayoutSider
collapse-mode="width"
:collapsed-width="240"
:width="360"
:native-scrollbar="true"
show-trigger="arrow-circle"
content-style="padding: 24px;"
bordered
>
<RoleManagementSidebar />
</NLayoutSider>
</NLayout>
</NLayoutContent>
</NLayout>
</div>
</template>

<style scoped>
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script setup lang="ts">
</script>

<template>
<div>
ChatConversation
</div>
</template>

<style scoped>
</style>
11 changes: 11 additions & 0 deletions apps/admin/src/pages/chat/components/ChatPanel/Message.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup lang="ts">
</script>

<template>
<div />
</template>

<style scoped>
</style>
13 changes: 13 additions & 0 deletions apps/admin/src/pages/chat/components/ChatPanel/MessageInput.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script setup lang="ts">
</script>

<template>
<div>
MessageInput
</div>
</template>

<style scoped>
</style>
23 changes: 23 additions & 0 deletions apps/admin/src/pages/chat/components/ChatPanel/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script setup lang="ts">
import MessageInput from "~/pages/chat/components/ChatPanel/MessageInput.vue";
import ChatConversation from "~/pages/chat/components/ChatPanel/ChatConversation.vue";
defineOptions({
name: "ChatPanel",
});
</script>

<template>
<NSplit direction="vertical" :default-size="0.8">
<template #1>
<ChatConversation />
</template>
<template #2>
<MessageInput />
</template>
</NSplit>
</template>

<style scoped>
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script setup lang="ts">
defineOptions({
name: "RoleManagementSidebar",
});
</script>

<template>
<div>RoleManagementSidebar</div>
</template>

<style scoped>
</style>
4 changes: 3 additions & 1 deletion apps/admin/src/pages/chat/index.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<script setup lang="ts">
import ChatLayout from "./components/ChatLayout.vue";
defineOptions({
name: "Chat",
});
</script>

<template>
<div />
<ChatLayout />
</template>

<style scoped>
Expand Down

0 comments on commit 4c4188b

Please sign in to comment.