Commit 5c59a5d0 by weiyudumei

feat: 当 firstQaFlag 为 true 且存在 workflow 卡片时,隐藏整个流式返回结果(表单会自动提交,用户不需要看到这次的结果)

parent b23d7f44
...@@ -125,6 +125,11 @@ export const CardWorkflowForm: React.FC<CardWorkflowFormProps> = ({ ...@@ -125,6 +125,11 @@ export const CardWorkflowForm: React.FC<CardWorkflowFormProps> = ({
return null return null
} }
// 如果 firstQaFlag 为 true 且已经自动提交,隐藏表单
if (answer.firstQaFlag === true && hasAutoSubmittedRef.current) {
return null
}
return ( return (
<div className="card-workflow-form"> <div className="card-workflow-form">
<div className="flex flex-col gap-[12px]"> <div className="flex flex-col gap-[12px]">
......
...@@ -178,6 +178,12 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ isLastAnswer ...@@ -178,6 +178,12 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ isLastAnswer
const shouldHideOperate = hideOperateByCard || hideOperate const shouldHideOperate = hideOperateByCard || hideOperate
// 如果 firstQaFlag 为 true 且存在 workflow 卡片,隐藏整个答案内容(表单会自动提交,用户不需要看到这次的结果)
const hasWorkflowCard = (answer.cardList || []).some(attachment => attachment.type === 'card-workflow')
if (answer.firstQaFlag === true && hasWorkflowCard) {
return null
}
return ( return (
<div className="answerParser"> <div className="answerParser">
......
...@@ -18,6 +18,13 @@ interface ChatAnswerShowerProps { ...@@ -18,6 +18,13 @@ interface ChatAnswerShowerProps {
export const ChatAnswerShower: React.FC<ChatAnswerShowerProps> = ({ answer, isLastAnswer, onSubmitQuestion, hideOperate: hideOperateProp, onWorkflowSubmit, isWorkflowSubmitting, isAsking = false }) => { export const ChatAnswerShower: React.FC<ChatAnswerShowerProps> = ({ answer, isLastAnswer, onSubmitQuestion, hideOperate: hideOperateProp, onWorkflowSubmit, isWorkflowSubmitting, isAsking = false }) => {
const hideOperateByCard = (answer.cardList || []).some(attachment => attachment.type === 'box' || attachment?.type?.includes('card-')) const hideOperateByCard = (answer.cardList || []).some(attachment => attachment.type === 'box' || attachment?.type?.includes('card-'))
const hideOperate = hideOperateByCard || hideOperateProp const hideOperate = hideOperateByCard || hideOperateProp
// 如果 firstQaFlag 为 true 且存在 workflow 卡片,隐藏整个答案内容(表单会自动提交,用户不需要看到这次的结果)
const hasWorkflowCard = (answer.cardList || []).some(attachment => attachment.type === 'card-workflow')
if (answer.firstQaFlag === true && hasWorkflowCard) {
return null
}
return ( return (
<div className="answerShower"> <div className="answerShower">
{answer.answer && ( {answer.answer && (
......
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