From 1ee6ada6af05a1cbcbf75e3bafa87531403747fe Mon Sep 17 00:00:00 2001 From: HoshinoSuzumi Date: Wed, 27 Mar 2024 18:06:02 +0800 Subject: [PATCH] =?UTF-8?q?wip:=20=E8=81=8A=E5=A4=A9=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/aigc/chat/ChatItem.vue | 4 +- components/aigc/chat/Message.vue | 78 ++++++++++++ components/aigc/chat/index.d.ts | 1 + pages/aigc/chat/index.vue | 190 ++++++++++++++++++++++++++---- tailwind.config.ts | 6 + 5 files changed, 251 insertions(+), 28 deletions(-) create mode 100644 components/aigc/chat/Message.vue diff --git a/components/aigc/chat/ChatItem.vue b/components/aigc/chat/ChatItem.vue index a55474e..704d84e 100644 --- a/components/aigc/chat/ChatItem.vue +++ b/components/aigc/chat/ChatItem.vue @@ -33,7 +33,7 @@ const dayjs = useDayjs()
{{ dayjs(chatSession.create_at * 1000).format('YYYY-MM-DD HH:mm:ss') }}
@@ -44,7 +44,7 @@ const dayjs = useDayjs() \ No newline at end of file diff --git a/components/aigc/chat/index.d.ts b/components/aigc/chat/index.d.ts index ea22116..72ff54c 100644 --- a/components/aigc/chat/index.d.ts +++ b/components/aigc/chat/index.d.ts @@ -6,6 +6,7 @@ export interface ChatSession { subject: string create_at: number messages: ChatMessage[] + last_input?: string } export type MessageRole = 'user' | 'assistant' | 'system' diff --git a/pages/aigc/chat/index.vue b/pages/aigc/chat/index.vue index c3620ef..cdc1deb 100644 --- a/pages/aigc/chat/index.vue +++ b/pages/aigc/chat/index.vue @@ -1,46 +1,139 @@ - diff --git a/tailwind.config.ts b/tailwind.config.ts index 5cdd9fd..eb32f60 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -15,7 +15,13 @@ export default >{ boxShadow: { card: '0 2px 4px 0 rgba(0, 0, 0, .05)', sidebar: 'inset -2px 0 2px 0 rgba(0, 0, 0, .05)', + sidebar_dark: 'inset -2px 0 2px 0 rgba(255, 255, 255, .05)', } }, }, + safelist: [ + { + pattern: /^bg-/, + } + ] }