Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a431867f
authored
May 21, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【优化】AI chat 发送按钮独立方法
parent
32c6818e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
+9
-1
src/views/ai/chat/index.vue
+9
-1
No files found.
src/views/ai/chat/index.vue
View file @
a431867f
...
...
@@ -56,7 +56,7 @@
<el-button
type=
"primary"
size=
"default"
@
click=
"onSend"
@
click=
"onSend
Btn
"
:loading=
"conversationInProgress"
v-if=
"conversationInProgress == false"
>
...
...
@@ -254,6 +254,10 @@ const onSend = async (event) => {
}
}
const
onSendBtn
=
async
()
=>
{
await
doSend
(
prompt
.
value
?.
trim
()
as
string
)
}
const
doSend
=
async
(
content
:
string
)
=>
{
if
(
content
.
length
<
2
)
{
ElMessage
({
...
...
@@ -303,6 +307,10 @@ const doSendStream = async (userMessage: ChatMessageVO) => {
content
:
'思考中...'
,
createTime
:
new
Date
()
}
as
ChatMessageVO
)
// 滚动到最下面
nextTick
(
async
()
=>
{
await
scrollToBottom
()
})
// 开始滚动
textRoll
()
// 发送 event stream
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment