@@ -61,6 +61,8 @@ import CheckGroup from './components/check-group';
6161import Inspiration from './components/inspiration' ;
6262import PreviewPicture from './components/receive-box/preview-picture' ;
6363import './styles/chat-preview.scss' ;
64+ import store from '@/store/store' ;
65+ import { setIsCurrentAnswer } from "@/store/chatStore/chatStore" ;
6466
6567/**
6668 * 应用聊天对话页面
@@ -92,6 +94,7 @@ const ChatPreview = (props) => {
9294 const isDebug = useAppSelector ( ( state ) => state . commonStore . isDebug ) ;
9395 const isGuest = useAppSelector ( ( state ) => state . appStore . isGuest ) ;
9496 const currentAnswer = useAppSelector ( ( state ) => state . chatCommonStore . currentAnswer ) ;
97+ const isCurrentAnswer = useAppSelector ( ( state ) => state . chatCommonStore . isCurrentAnswer ) ;
9598 const { showElsa } = useContext ( AippContext ) ;
9699 const [ checkedList , setCheckedList ] = useState ( [ ] ) ;
97100 const [ loading , setLoading ] = useState ( false ) ;
@@ -586,6 +589,7 @@ const ChatPreview = (props) => {
586589 let { content } = currentChatItem ;
587590 str = content + msg ;
588591 item . content = str ;
592+ store . dispatch ( setIsCurrentAnswer ( true ) ) ;
589593 if ( status === 'ARCHIVED' ) {
590594 item . finished = true ;
591595 }
@@ -646,8 +650,8 @@ const ChatPreview = (props) => {
646650 // 终止进行中的对话
647651 async function chatRunningStop ( params ) {
648652 let terminateParams : any = { } ;
649- terminateParams . content = params . content ? params . content : currentAnswer ? currentAnswer :
650- t ( 'conversationTerminated' ) ;
653+ terminateParams . content = params . content ? params . content : currentAnswer ?
654+ parseCurrentAnswer ( currentAnswer ) : t ( 'conversationTerminated' ) ;
651655 if ( params . logId ) {
652656 terminateParams . logId = params . logId ;
653657 }
@@ -671,6 +675,14 @@ const ChatPreview = (props) => {
671675 }
672676 }
673677
678+ function parseCurrentAnswer ( currentAnswer ) {
679+ if ( currentAnswer && currentAnswer . props && currentAnswer . props . dangerouslySetInnerHTML
680+ && isCurrentAnswer == true ) {
681+ store . dispatch ( setIsCurrentAnswer ( false ) ) ;
682+ return currentAnswer . props . dangerouslySetInnerHTML . __html ;
683+ }
684+ }
685+
674686 // 表单重新对话
675687 function questionClarConfirm ( params , instanceId ) {
676688 queryInstance ( params , 'clar' , instanceId ) ;
0 commit comments