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
ca2b7202
authored
May 17, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【调整】AI 对话调整,提示词发送
parent
b6c654f0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
src/views/ai/chat/index.vue
+7
-3
No files found.
src/views/ai/chat/index.vue
View file @
ca2b7202
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<el-main
class=
"main-container"
>
<el-main
class=
"main-container"
>
<div
class=
"message-container"
>
<div
class=
"message-container"
>
<Message
v-if=
"list.length > 0"
ref=
"messageRef"
:list=
"list"
@
on-delete-success=
"handlerMessageDelete"
/>
<Message
v-if=
"list.length > 0"
ref=
"messageRef"
:list=
"list"
@
on-delete-success=
"handlerMessageDelete"
/>
<ChatEmpty
v-if=
"list.length === 0"
@
on-prompt=
"
on
Send"
/>
<ChatEmpty
v-if=
"list.length === 0"
@
on-prompt=
"
do
Send"
/>
</div>
</div>
</el-main>
</el-main>
...
@@ -158,7 +158,7 @@ const onPromptInput = (event) => {
...
@@ -158,7 +158,7 @@ const onPromptInput = (event) => {
/**
/**
* 发送消息
* 发送消息
*/
*/
const
onSend
=
async
(
val
?:
string
)
=>
{
const
onSend
=
async
()
=>
{
// 判断用户是否在输入
// 判断用户是否在输入
if
(
isComposing
.
value
)
{
if
(
isComposing
.
value
)
{
return
return
...
@@ -167,7 +167,11 @@ const onSend = async (val?: string) => {
...
@@ -167,7 +167,11 @@ const onSend = async (val?: string) => {
if
(
conversationInProgress
.
value
)
{
if
(
conversationInProgress
.
value
)
{
return
return
}
}
const
content
=
(
val
?
val
:
prompt
.
value
?.
trim
())
as
string
const
content
=
prompt
.
value
?.
trim
()
as
string
await
doSend
(
content
)
}
const
doSend
=
async
(
content
:
string
)
=>
{
if
(
content
.
length
<
2
)
{
if
(
content
.
length
<
2
)
{
ElMessage
({
ElMessage
({
message
:
'请输入内容!'
,
message
:
'请输入内容!'
,
...
...
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