Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
ai-chat-ui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenghong_tao
ai-chat-ui
Commits
af883d01
Commit
af883d01
authored
Apr 27, 2025
by
chenghong_tao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix feedback button
parent
eb7e85e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
3 deletions
+35
-3
aiBubble.vue
src/components/chatSubassembly/aiBubble.vue
+35
-3
No files found.
src/components/chatSubassembly/aiBubble.vue
View file @
af883d01
...
...
@@ -42,14 +42,14 @@
@
click=
"reStartSSE"
/>
<el-button
type=
"success
"
:type=
"clickLike ? 'success' : 'info'
"
class=
"iconfont icon-zan"
size=
"small"
circle
@
click=
"feedback('like')"
/>
<el-button
type=
"warning
"
:type=
"clickDisLike ? 'success' : 'info'
"
class=
"iconfont icon-zan icon-rotate"
size=
"small"
circle
...
...
@@ -81,6 +81,9 @@ const { startStream, cancel, data, error, isLoading } = useXStream();
const
avatarAi
=
"./avatarAI.svg"
;
const
clickLike
=
ref
(
false
)
const
clickDisLike
=
ref
(
false
)
const
props
=
defineProps
({
query
:
{
type
:
Array
,
...
...
@@ -221,9 +224,30 @@ const feedback = async (type) => {
ElMessage
.
error
(
"暂无内容可反馈"
);
return
}
if
(
type
===
'like'
)
{
if
(
!
clickLike
.
value
)
{
clickLike
.
value
=
true
;
clickDisLike
.
value
=
false
;
}
else
{
clickLike
.
value
=
false
;
type
=
null
}
}
else
{
if
(
!
clickDisLike
.
value
)
{
clickDisLike
.
value
=
true
;
clickLike
.
value
=
false
;
}
else
{
clickDisLike
.
value
=
false
;
type
=
null
}
}
const
messageId
=
props
.
messageType
===
'ai-history'
?
props
.
historyMsgId
:
workflowContent
.
value
[
0
].
message_id
;
await
difyApi
.
feedback
(
messageId
,
{
rating
:
type
,
content
:
type
});
ElMessage
.
success
(
"反馈成功"
);
if
(
type
)
{
ElMessage
.
success
(
"反馈成功"
);
}
else
{
ElMessage
.
success
(
"取消反馈"
);
}
};
const
copyContent
=
()
=>
{
...
...
@@ -321,12 +345,20 @@ function fallbackCopyTextToClipboard(text) {
color: var(--el-color-danger);
}
.is-info {
color: var(--el-color-info);
}
.is-loaidng {
color: var(--el-color-primary);
animation: spin 1s linear infinite;
}
}
.clickColor{
background-color: var(--el-color-success);
}
@keyframes spin {
0% {
transform: rotate(0deg);
...
...
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