wujingjing
2025-01-07 54e13aedf92166eabd45d151badcd8af97ee5bed
src/components/chat/assistant/index.vue
@@ -15,30 +15,8 @@
               <div class="rounded-[6px] p-4 leading-relaxed bg-white">
                  <!-- #region ====================== 消息内容 ======================-->
                  <!-- <template v-if="item.content?.values"> -->
                  <!-- #region ====================== 报错信息 ======================-->
                  <div v-if="msg.content?.errCode === ErrorCode.Message" class="flex-column w-full">
                     <p class="text-danger">
                        {{ msg.content.errMsg }}
                     </p>
                     <div class="mt-3 flex" v-if="showFixQuestion(msg)">
                        <div class="text-gray-600 flex-0 mb-auto py-3">
                           {{ '猜你想问:' }}
                        </div>
                        <div class="flex-auto space-x-2 space-y-1 inline-flex flex-wrap items-center">
                           <div
                              v-for="fixItem in msg.content.origin?.sample_question"
                              :key="fixItem"
                              class="bg-gray-200 p-3 hover:bg-[#c5e0ff] hover:text-[#1c86ff] cursor-pointer rounded-lg first-of-type:ml-2 first-of-type:mt-1"
                              @click="fixQuestionClick(fixItem, msg.content.origin)"
                           >
                              {{ fixItem }}
                           </div>
                        </div>
                     </div>
                  </div>
                  <!-- #endregion -->
                  <!-- #region ====================== 回答组件 ======================-->
                  <template v-else>
                     <template v-if="msg.content.type === AnswerType.Report">
                        <template v-if="msg?.stepGroup?.length > 0">
                           <div v-for="(num, index) in msg?.stepGroup?.length" :key="index">
@@ -109,7 +87,7 @@
                              为了解决这个问题,等到 msg.historyId 存在时,再渲染 recordSetTable
                              -->
                              <component
                                 v-if="msg.content?.values?.[index] && msg.historyId"
                              v-if="msg.content?.values?.[index] && msg.historyId && msg.content?.errCode !== ErrorCode.Message"
                                 :reportIndex="index"
                                 :conclusion="msg.content.values[index].conclusion"
                                 :is="answerTypeMapCom[msg.content.values[index].content.type]"
@@ -131,10 +109,30 @@
                        :originData="msg"
                        :isTalking="isTalking && isLast"
                     />
                  </template>
                  <!-- #endregion -->
                  <!-- </template> -->
                  <!-- #region ====================== 报错信息 ======================-->
                  <div v-if="msg.content?.errCode === ErrorCode.Message" class="flex-column w-full">
                     <p class="text-danger">
                        {{ msg.content.errMsg }}
                     </p>
                     <div class="mt-3 flex" v-if="showFixQuestion(msg)">
                        <div class="text-gray-600 flex-0 mb-auto py-3">
                           {{ '猜你想问:' }}
                        </div>
                        <div class="flex-auto space-x-2 space-y-1 inline-flex flex-wrap items-center">
                           <div
                              v-for="fixItem in msg.content.origin?.sample_question"
                              :key="fixItem"
                              class="bg-gray-200 p-3 hover:bg-[#c5e0ff] hover:text-[#1c86ff] cursor-pointer rounded-lg first-of-type:ml-2 first-of-type:mt-1"
                              @click="fixQuestionClick(fixItem, msg.content.origin)"
                           >
                              {{ fixItem }}
                           </div>
                        </div>
                     </div>
                  </div>
                  <!-- #endregion -->
                  <!-- #endregion -->
                  <!-- #region ====================== 附加内容 ======================-->
                  <!-- #region ====================== 停止 ======================-->