提交 0cf620a1 编写于 作者: D DebugIsFalse

Merge branch 'main' of gitcode.com:git_bot/ai-fe

<template> <template>
<div class="justify-between flex w-full space-x-2"> <div class="flex w-full">
<UTooltip text="停止生成" v-if="asking"> <UCard :ui="{ body: { padding: '', base: 'flex items-center pl-4 pr-1 py-1 gap-2' }, base: 'w-full', rounded: 'rounded-full' }">
<UButton <UInput
class="flex-grow"
name="queryInput"
v-model="continueQuestion"
placeholder="提出后续问题"
size="xl" size="xl"
square :padded="false"
trailing-icon="i-heroicons-stop-20-solid" variant="none"
color="gray"
@click="handleStop"
:ui="{ rounded: 'rounded-full' }"
/> />
</UTooltip> <div class="flex">
<UInput <UButton
name="queryInput" v-if="!asking"
class="w-full" :ui="{ rounded: 'rounded-full' }"
v-model="continueQuestion" :disabled="!continueQuestion"
placeholder="提出后续问题" trailing-icon="i-heroicons-chevron-right-20-solid"
size="xl" size="xl"
:disabled="asking" @click="handleAsk"
/> />
<UButton <UTooltip v-else text="停止生成">
size="xl" <UButton
square :ui="{ rounded: 'rounded-full' }"
@click="handleAsk" color="red"
:trailing-icon="asking ? '' : 'i-heroicons-chevron-right-20-solid'" trailing-icon="i-heroicons-stop-20-solid"
:disabled="!continueQuestion" size="xl"
:loading="asking" @click="handleStop"
/> />
</UTooltip>
</div>
</UCard>
</div> </div>
</template> </template>
<script setup> <script setup>
defineProps({ const props = defineProps({
asking: { asking: {
type: Boolean, type: Boolean,
default: false default: false
} }
}) })
defineShortcuts({
meta_enter: {
usingInput: 'queryInput',
handler: () => {
handleAsk()
}
}
})
const emits = defineEmits(['ask', 'stop']) const emits = defineEmits(['ask', 'stop'])
const continueQuestion = ref('') const continueQuestion = ref('')
function handleStop () { function handleStop () {
emits('stop') emits('stop')
} }
function handleAsk () { function handleAsk () {
if (props.asking) return
emits('ask', continueQuestion.value) emits('ask', continueQuestion.value)
continueQuestion.value = ''
} }
</script> </script>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
@click="handleContinueAsk" @click="handleContinueAsk"
/> />
</div> </div>
<div class="container max-w-screen-lg sticky bottom-2 flex pl-6 pr-6"> <div class="container max-w-screen-lg sticky bottom-4 flex pl-6 pr-6">
<ISearchAsk :asking="asking" @stop="handleStopGenerate" @ask="handleContinueAsk" /> <ISearchAsk :asking="asking" @stop="handleStopGenerate" @ask="handleContinueAsk" />
</div> </div>
</div> </div>
...@@ -142,14 +142,6 @@ const sourceCount = computed(() => { ...@@ -142,14 +142,6 @@ const sourceCount = computed(() => {
} }
return currentData.source.length return currentData.source.length
}) })
defineShortcuts({
meta_enter: {
usingInput: 'queryInput',
handler: () => {
handleContinueAsk(continueQuestion.value)
}
}
})
let asking = ref(false) let asking = ref(false)
const handleClearInput = () => { const handleClearInput = () => {
continueQuestion.value = '' continueQuestion.value = ''
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册