From 2fb8dee91e6a3f2707bf0d164404128503d382ef Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 13 Jun 2024 18:28:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/ai-chat/index.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 02bf02f6f..56be13c5d 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -146,7 +146,7 @@ ref="quickInputRef" v-model="inputValue" placeholder="请输入" - :autosize="{ minRows: 1, maxRows: common.isMobile() ? 4 : 10 }" + :autosize="{ minRows: 1, maxRows: isMobile ? 4 : 10 }" type="textarea" :maxlength="100000" @keydown.enter="sendChatHandle($event)" @@ -189,7 +189,8 @@ import { debounce } from 'lodash' defineOptions({ name: 'AiChat' }) const route = useRoute() const { - params: { accessToken, id } + params: { accessToken, id }, + query: { mode } } = route as any const props = defineProps({ data: { @@ -217,6 +218,10 @@ const emit = defineEmits(['refresh', 'scroll']) const { application, common } = useStore() +const isMobile = computed(() => { + return common.isMobile() || mode === 'embed' +}) + const ParagraphSourceDialogRef = ref() const aiChatRef = ref() const quickInputRef = ref() @@ -608,6 +613,12 @@ watch( { deep: true, immediate: true } ) +onMounted(() => { + setTimeout(() => { + quickInputRef.value.textarea.style.height = '0' + }, 1000) +}) + defineExpose({ setScrollBottom })