feat: 快捷问题

This commit is contained in:
wangdan-fit2cloud 2024-03-15 16:17:21 +08:00
parent e05eca14cf
commit 0d3c6f1bb7

View File

@ -181,6 +181,7 @@ import useStore from '@/stores'
import MdRenderer from '@/components/markdown-renderer/MdRenderer.vue' import MdRenderer from '@/components/markdown-renderer/MdRenderer.vue'
import { MdPreview } from 'md-editor-v3' import { MdPreview } from 'md-editor-v3'
import { MsgError } from '@/utils/message' import { MsgError } from '@/utils/message'
import { debounce } from 'lodash'
defineOptions({ name: 'AiChat' }) defineOptions({ name: 'AiChat' })
const route = useRoute() const route = useRoute()
const { const {
@ -266,15 +267,20 @@ function openParagraph(row: any, id?: string) {
} }
function quickProblemHandel(val: string) { function quickProblemHandel(val: string) {
if (!props.log) { if (!props.log && !loading.value) {
// inputValue.value = val // inputValue.value = val
// nextTick(() => { // nextTick(() => {
// quickInputRef.value?.focus() // quickInputRef.value?.focus()
// }) // })
chatMessage(null, val)
handleDebounceClick(val)
} }
} }
const handleDebounceClick = debounce((val) => {
chatMessage(null, val)
}, 200)
function sendChatHandle(event: any) { function sendChatHandle(event: any) {
if (!event.ctrlKey) { if (!event.ctrlKey) {
// ctrl // ctrl