|
@@ -90,7 +90,7 @@ const handleClear = (): void => {
|
|
|
changeQuestion('')
|
|
|
}
|
|
|
|
|
|
-const handleSend = (text): void => {
|
|
|
+const continueChat = (text): void => {
|
|
|
if ((text ?? '') === '') {
|
|
|
return
|
|
|
}
|
|
@@ -103,6 +103,17 @@ const handleSend = (text): void => {
|
|
|
contents[text] = undefined
|
|
|
}
|
|
|
|
|
|
+// 开始对话
|
|
|
+const handleSend = (text: string): void => {
|
|
|
+ if ((currentQuestionId.value ?? '') === '') {
|
|
|
+ // 创建对话
|
|
|
+ changeQuestion(text)
|
|
|
+ } else {
|
|
|
+ // 继续对话
|
|
|
+ continueChat(text)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/*监控问题变化,开启问答*/
|
|
|
watch(
|
|
|
currentQuestion,
|
|
@@ -115,7 +126,7 @@ watch(
|
|
|
})
|
|
|
currentQuestionId.value = ''
|
|
|
} else {
|
|
|
- handleSend(text)
|
|
|
+ continueChat(text)
|
|
|
}
|
|
|
},
|
|
|
{ deep: true }
|