wujingjing
2025-03-06 c6d8ea02ade42a78e9f4a2304e8e1c5f67853d91
src/components/chat/assistant/index.vue
@@ -52,17 +52,23 @@
                                    :title="subItem.title"
                                    :status="stepEnumMap[subItem.status]"
                                 >
                                    <template #icon v-if="stepIndex + 1 === msg?.stepGroup?.[index].value.length && isTalking && isLast&&(subItem.finishLoading===false || subItem.finishLoading===undefined)">
                                    <template
                                       #icon
                                       v-if="
                                          stepIndex + 1 === msg?.stepGroup?.[index].value.length &&
                                          isTalking &&
                                          isLast &&
                                          (subItem.finishLoading === false || subItem.finishLoading === undefined)
                                       "
                                    >
                                       <span class="ywifont ywicon-loading1 animate-spin !text-[24px]"></span>
                                    </template>
                                    <template #title>
                                       <span class="">
                                          <span v-html="md.render(subItem.title)"></span>
                                          <span v-html="renderMd(subItem.title ?? '')"></span>
                                          <span v-if="subItem.ms" class="text-green-600">{{ `(${subItem.ms})` }}</span></span
                                       >
                                    </template>
                                    <template #description v-if="subItem?.subStep?.length > 0">
                                       <div class="my-1 flex flex-col gap-1 text-[14px]">
@@ -89,7 +95,7 @@
                              为了解决这个问题,等到 msg.historyId 存在时,再渲染 recordSetTable
                              -->
                           <component
                              v-if="msg.content?.values?.[index]  && msg.content?.errCode !== ErrorCode.Message"
                              v-if="msg.content?.values?.[index]"
                              :reportIndex="index"
                              :conclusion="msg.content.values[index].conclusion"
                              :is="answerTypeMapCom[msg.content.values[index].content.type]"
@@ -111,6 +117,8 @@
                     :originData="msg"
                     :isTalking="isTalking && isLast"
                  />
                  <CreateWorkOrder v-if="msg?.modeContent?.mode === 'create_work_order'" :data="msg?.modeContent" />
                  <!-- #endregion -->
                  <!-- </template> -->
                  <!-- #region ====================== 报错信息 ======================-->
@@ -140,7 +148,9 @@
                  <!-- #region ====================== 停止 ======================-->
                  <span v-if="msg.isStopMsg && msg?.role === RoleEnum.assistant" class="text-gray-400 text-[12px]">(已停止)</span>
                  <!-- parseContent 返回为 null -->
                  <p v-if="!msg.content && !isTalking && !msg.isStopMsg && msg.content?.errCode !== ErrorCode.Message" class="text-red-500">暂无数据</p>
                  <p v-if="!msg.content && !isTalking && !msg.isStopMsg && msg.content?.errCode !== ErrorCode.Message" class="text-red-500">
                     暂无数据
                  </p>
                  <!-- #endregion -->
                  <!-- #endregion -->
               </div>
@@ -225,6 +235,7 @@
import type { PropType } from 'vue';
import { useAssistantContentOpt } from '../hooks/useAssistantContentOpt';
import type { ChatContent } from '../model/types';
import CreateWorkOrder from '../modeComponents/CreateWorkOrder.vue';
import {
   AnswerState,
   AnswerType,
@@ -243,6 +254,10 @@
import { question_stream_reply } from '/@/api/ai/chat';
import { md } from '/@/components/chat/libs/markdown';
const renderMd = (text: string) => {
   return md.render(text ?? '');
};
const props = defineProps({
   /** @description 当前消息 */
   msg: {