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
5b082fd7
Commit
5b082fd7
authored
Jan 23, 2026
by
weiyudumei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 历史记录中如果 firstQaFlag 为 true 则不展示该条 chatItem
parent
eb862599
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
src/pages/Chat/Chat.tsx
+5
-0
src/pages/ChatTactics/TacticsChat.tsx
+17
-14
No files found.
src/pages/Chat/Chat.tsx
View file @
5b082fd7
...
...
@@ -949,6 +949,11 @@ export const Chat: React.FC = () => {
>
<
div
className=
{
styles
.
inter
}
>
{
allItems
.
map
((
record
,
index
)
=>
{
// 如果历史记录中 firstQaFlag 为 true,则不展示该条 chatItem
if
(
record
.
role
===
'ai'
&&
record
.
answerList
?.[
0
]?.
firstQaFlag
===
true
)
{
return
null
}
const
recordId
=
record
.
answerList
?.[
0
]?.
recordId
||
record
.
groupId
const
uniqueKey
=
recordId
?
`${record.role}-${recordId}`
...
...
src/pages/ChatTactics/TacticsChat.tsx
View file @
5b082fd7
...
...
@@ -391,11 +391,11 @@ export const TacticsChat: React.FC = () => {
...
prevItems
,
...(
shouldIncludeQuestion
?
[
{
role
:
'user'
,
question
,
}
as
ChatRecord
,
]
{
role
:
'user'
,
question
,
}
as
ChatRecord
,
]
:
[]),
{
role
:
'ai'
,
...
...
@@ -500,12 +500,12 @@ export const TacticsChat: React.FC = () => {
if
(
extra
?.
recordId
)
{
requestBody
.
recordId
=
extra
.
recordId
}
// workFlowSessionId 的传递逻辑:
// 1. 如果是重新分析(isReanalyze === true),不传递 workFlowSessionId
// 2. 优先使用 extra 中的值
// 3. 如果都没有,从会话历史中找到最后一个有 workFlowSessionId 的答案
const
isReanalyze
=
extra
?.
isReanalyze
===
true
// 注意:isReanalyze 已在上面声明(第 366 行),这里直接使用
if
(
!
isReanalyze
)
{
if
(
extra
?.
workFlowSessionId
)
{
requestBody
.
workFlowSessionId
=
extra
.
workFlowSessionId
...
...
@@ -1063,7 +1063,7 @@ export const TacticsChat: React.FC = () => {
if
(
recordId
)
{
extraParams
.
recordId
=
recordId
}
if
(
orderMeta
)
{
return
handleSubmitQuestion
(
question
,
...
...
@@ -1139,11 +1139,10 @@ export const TacticsChat: React.FC = () => {
type=
"button"
onClick=
{
handleReanalyze
}
disabled=
{
!
currentIdRef
.
current
||
isLoading
||
isAsking
||
isRecommendLoading
}
className=
{
`flex items-center gap-[4px] text-[14px] transition-opacity bg-transparent border-none outline-none ${
!currentIdRef.current || isLoading || isAsking || isRecommendLoading
? 'text-[#B2B8C1] cursor-not-allowed opacity-60'
: 'text-[#4A90E2] hover:opacity-80 cursor-pointer'
}`
}
className=
{
`flex items-center gap-[4px] text-[14px] transition-opacity bg-transparent border-none outline-none ${!currentIdRef.current || isLoading || isAsking || isRecommendLoading
? 'text-[#B2B8C1] cursor-not-allowed opacity-60'
: 'text-[#4A90E2] hover:opacity-80 cursor-pointer'
}`
}
>
<
RefreshIcon
className=
"w-[16px] h-[16px] text-[#B2B8C1]"
/>
<
span
>
重新分析
</
span
>
...
...
@@ -1196,6 +1195,10 @@ export const TacticsChat: React.FC = () => {
if
(
record
.
role
===
'user'
&&
!
record
.
question
)
{
return
null
}
// 如果历史记录中 firstQaFlag 为 true,则不展示该条 chatItem
if
(
record
.
role
===
'ai'
&&
record
.
answerList
?.[
0
]?.
firstQaFlag
===
true
)
{
return
null
}
const
matchedDivider
=
historyDividers
.
find
(
divider
=>
divider
.
index
===
index
+
1
)
const
recordId
=
record
.
answerList
?.[
0
]?.
recordId
||
record
.
groupId
const
uniqueKey
=
recordId
...
...
@@ -1214,7 +1217,7 @@ export const TacticsChat: React.FC = () => {
<
div
className=
"w-full chatItem mx-auto"
>
{
record
.
role
===
'system'
&&
<
TacticsWelcome
cleared=
{
hasCleared
}
/>
}
{
record
.
role
===
'system'
&&
<
TacticsWelcome
cleared=
{
hasCleared
}
/>
}
{
record
.
role
===
'user'
&&
<
ChatItemUser
record=
{
record
}
/>
}
{
record
.
role
===
'ai'
&&
(
<
ChatAnswerBox
...
...
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