From ed4ff67760414ca308b6decce20365460a7e8720 Mon Sep 17 00:00:00 2001 From: ChenZhaoYu <790348264@qq.com> Date: Fri, 10 Mar 2023 14:05:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E8=B0=83=E6=95=B4=E5=88=B0=E9=A1=B6=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/chat/components/Header/index.vue | 78 ++++++++++++++++++++++ src/views/chat/index.vue | 62 +++++++---------- src/views/chat/layout/Layout.vue | 2 - src/views/chat/layout/header/index.vue | 55 --------------- 4 files changed, 102 insertions(+), 95 deletions(-) create mode 100644 src/views/chat/components/Header/index.vue delete mode 100644 src/views/chat/layout/header/index.vue diff --git a/src/views/chat/components/Header/index.vue b/src/views/chat/components/Header/index.vue new file mode 100644 index 0000000..ea53f27 --- /dev/null +++ b/src/views/chat/components/Header/index.vue @@ -0,0 +1,78 @@ + + + diff --git a/src/views/chat/index.vue b/src/views/chat/index.vue index 754ac7c..9deb15f 100644 --- a/src/views/chat/index.vue +++ b/src/views/chat/index.vue @@ -7,6 +7,7 @@ import { Message } from './components' import { useScroll } from './hooks/useScroll' import { useChat } from './hooks/useChat' import { useCopyCode } from './hooks/useCopyCode' +import HeaderComponent from './components/Header/index.vue' import { HoverButton, SvgIcon } from '@/components/common' import { useBasicLayout } from '@/hooks/useBasicLayout' import { useChatStore } from '@/store' @@ -36,7 +37,6 @@ const conversationList = computed(() => dataSources.value.filter(item => (!item. const prompt = ref('') const loading = ref(false) const usingContext = ref(true) -const actionVisible = ref(true) function handleSubmit() { onConversation() @@ -400,16 +400,6 @@ function toggleUsingContext() { ms.warning(t('chat.turnOffContext')) } -function onInputFocus() { - if (isMobile.value) - actionVisible.value = false -} - -function onInputBlur() { - if (isMobile.value) - actionVisible.value = true -} - const placeholder = computed(() => { if (isMobile.value) return t('chat.placeholderMobile') @@ -420,16 +410,10 @@ const buttonDisabled = computed(() => { return loading.value || !prompt.value || prompt.value.trim() === '' }) -const wrapClass = computed(() => { - if (isMobile.value) - return ['pt-14'] - return [] -}) - const footerClass = computed(() => { let classes = ['p-4'] if (isMobile.value) - classes = ['sticky', 'left-0', 'bottom-0', 'right-0', 'p-2', 'overflow-hidden'] + classes = ['sticky', 'left-0', 'bottom-0', 'right-0', 'p-2', 'pr-3', 'overflow-hidden'] return classes }) @@ -444,7 +428,13 @@ onUnmounted(() => {