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
bebf1e7a
authored
May 24, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【解决todo】Chat 聊天,新建对话清空输入框
parent
03c6a6ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
+17
-1
src/views/ai/chat/Conversation.vue
+8
-1
src/views/ai/chat/index.vue
+9
-0
No files found.
src/views/ai/chat/Conversation.vue
View file @
bebf1e7a
...
@@ -122,7 +122,12 @@ const props = defineProps({
...
@@ -122,7 +122,12 @@ const props = defineProps({
})
})
// 定义钩子
// 定义钩子
const
emits
=
defineEmits
([
'onConversationClick'
,
'onConversationClear'
,
'onConversationDelete'
])
const
emits
=
defineEmits
([
'onConversationCreate'
,
'onConversationClick'
,
'onConversationClear'
,
'onConversationDelete'
])
/**
/**
* 对话 - 搜索
* 对话 - 搜索
...
@@ -256,6 +261,8 @@ const createConversation = async () => {
...
@@ -256,6 +261,8 @@ const createConversation = async () => {
await
getChatConversationList
()
await
getChatConversationList
()
// 3、选中对话
// 3、选中对话
await
handleConversationClick
(
conversationId
)
await
handleConversationClick
(
conversationId
)
// 4、回调
emits
(
'onConversationCreate'
)
}
}
/**
/**
...
...
src/views/ai/chat/index.vue
View file @
bebf1e7a
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<!-- 左侧:会话列表 -->
<!-- 左侧:会话列表 -->
<Conversation
:active-id=
"activeConversationId"
<Conversation
:active-id=
"activeConversationId"
ref=
"conversationRef"
ref=
"conversationRef"
@
onConversationCreate=
"handleConversationCreate"
@
onConversationClick=
"handleConversationClick"
@
onConversationClick=
"handleConversationClick"
@
onConversationClear=
"handlerConversationClear"
@
onConversationClear=
"handlerConversationClear"
@
onConversationDelete=
"handlerConversationDelete"
@
onConversationDelete=
"handlerConversationDelete"
...
@@ -441,6 +442,14 @@ const handlerTitleSuccess = async () => {
...
@@ -441,6 +442,14 @@ const handlerTitleSuccess = async () => {
}
}
/**
/**
* 对话 - 创建
*/
const
handleConversationCreate
=
async
()
=>
{
// 创建新的对话,清空输入框
prompt
.
value
=
''
}
/**
* 对话 - 点击
* 对话 - 点击
*/
*/
const
handleConversationClick
=
async
(
conversation
:
ChatConversationVO
)
=>
{
const
handleConversationClick
=
async
(
conversation
:
ChatConversationVO
)
=>
{
...
...
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