Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
ff4515aa
Commit
ff4515aa
authored
Sep 02, 2024
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 回答的operate调整
parent
2e98e73c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
src/pages/Chat/components/ChatItem/ChatAnswerAttchment.tsx
+7
-2
src/pages/Chat/components/ChatItem/ChatAnswerParser.tsx
+1
-1
src/pages/Chat/components/ChatItem/ChatAnswerShower.tsx
+2
-1
No files found.
src/pages/Chat/components/ChatItem/ChatAnswerAttchment.tsx
View file @
ff4515aa
...
@@ -39,7 +39,9 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
...
@@ -39,7 +39,9 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
}
}
return
(
return
(
<
div
className=
"attachmentList flex flex-col gap-[20px]"
>
<
div
className=
"attachmentList flex flex-col gap-[20px]"
>
{
answer
.
attachmentList
&&
answer
.
attachmentList
.
map
((
attachment
,
index
)
=>
(
{
answer
.
attachmentList
&&
answer
.
attachmentList
.
map
((
attachment
,
index
)
=>
{
if
(
attachment
?.
type
)
{
return
(
<
div
key=
{
`${attachment.type}_${index}`
}
>
<
div
key=
{
`${attachment.type}_${index}`
}
>
{
/* 附件:product-detail */
}
{
/* 附件:product-detail */
}
{
attachment
.
type
===
'product-detail'
&&
(
{
attachment
.
type
===
'product-detail'
&&
(
...
@@ -111,7 +113,10 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
...
@@ -111,7 +113,10 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
)
)
}
}
</
div
>
</
div
>
))
}
)
}
return
null
})
}
</
div
>
</
div
>
)
)
}
}
src/pages/Chat/components/ChatItem/ChatAnswerParser.tsx
View file @
ff4515aa
...
@@ -124,7 +124,7 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ isLastAnswer
...
@@ -124,7 +124,7 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ isLastAnswer
},
[
isStopTyping
])
},
[
isStopTyping
])
useEffect
(()
=>
{
useEffect
(()
=>
{
setHideOperate
((
answer
.
attachmentList
||
[]).
some
(
attachment
=>
attachment
.
type
===
'box'
))
setHideOperate
((
answer
.
attachmentList
||
[]).
some
(
attachment
=>
attachment
?.
type
===
'box'
||
attachment
?.
type
?.
includes
(
'card-'
)
))
},
[
answer
.
attachmentList
])
},
[
answer
.
attachmentList
])
return
(
return
(
...
...
src/pages/Chat/components/ChatItem/ChatAnswerShower.tsx
View file @
ff4515aa
...
@@ -11,7 +11,7 @@ interface ChatAnswerShowerProps {
...
@@ -11,7 +11,7 @@ interface ChatAnswerShowerProps {
}
}
export
const
ChatAnswerShower
:
React
.
FC
<
ChatAnswerShowerProps
>
=
({
answer
,
isLastAnswer
,
onSubmitQuestion
})
=>
{
export
const
ChatAnswerShower
:
React
.
FC
<
ChatAnswerShowerProps
>
=
({
answer
,
isLastAnswer
,
onSubmitQuestion
})
=>
{
const
hideOperate
=
(
answer
.
attachmentList
||
[]).
some
(
attachment
=>
attachment
.
type
===
'box'
)
const
hideOperate
=
(
answer
.
attachmentList
||
[]).
some
(
attachment
=>
attachment
.
type
===
'box'
||
attachment
?.
type
?.
includes
(
'card-'
)
)
return
(
return
(
<
div
className=
"answerShower"
>
<
div
className=
"answerShower"
>
{
answer
.
answer
&&
(
{
answer
.
answer
&&
(
...
@@ -22,6 +22,7 @@ export const ChatAnswerShower: React.FC<ChatAnswerShowerProps> = ({ answer, isLa
...
@@ -22,6 +22,7 @@ export const ChatAnswerShower: React.FC<ChatAnswerShowerProps> = ({ answer, isLa
</
div
>
</
div
>
)
}
)
}
{
answer
.
attachmentList
&&
answer
.
attachmentList
?.
length
!==
0
&&
<
ChatAnswerAttachment
onSubmitQuestion=
{
onSubmitQuestion
}
isLastAnswer=
{
isLastAnswer
}
answer=
{
answer
}
/>
}
{
answer
.
attachmentList
&&
answer
.
attachmentList
?.
length
!==
0
&&
<
ChatAnswerAttachment
onSubmitQuestion=
{
onSubmitQuestion
}
isLastAnswer=
{
isLastAnswer
}
answer=
{
answer
}
/>
}
{
/* {} */
}
{
!
hideOperate
&&
<
ChatAnswerOperate
answer=
{
answer
}
/>
}
{
!
hideOperate
&&
<
ChatAnswerOperate
answer=
{
answer
}
/>
}
</
div
>
</
div
>
)
)
...
...
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