Commit 5b082fd7 by weiyudumei

feat: 历史记录中如果 firstQaFlag 为 true 则不展示该条 chatItem

parent eb862599
......@@ -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}`
......
......@@ -505,7 +505,7 @@ export const TacticsChat: React.FC = () => {
// 1. 如果是重新分析(isReanalyze === true),不传递 workFlowSessionId
// 2. 优先使用 extra 中的值
// 3. 如果都没有,从会话历史中找到最后一个有 workFlowSessionId 的答案
const isReanalyze = extra?.isReanalyze === true
// 注意:isReanalyze 已在上面声明(第 366 行),这里直接使用
if (!isReanalyze) {
if (extra?.workFlowSessionId) {
requestBody.workFlowSessionId = extra.workFlowSessionId
......@@ -1139,8 +1139,7 @@ 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
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'
}`}
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment