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(() => {