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 })