Sfoglia il codice sorgente

feat: 只有在问答版块才展示think标签

sunxiao 1 settimana fa
parent
commit
7dcbe29c0c

+ 5 - 1
src/components/Chat/ChatAnswer.vue

@@ -43,6 +43,10 @@ const props = defineProps({
   isVisibleResetBtn: {
     type: Boolean,
     default: false
+  },
+  isNeedThink: {
+    type: Boolean,
+    default: false
   }
 })
 
@@ -81,7 +85,7 @@ const handleCopy = () => {
     <slot></slot>
     
     <template #text>
-      <ChatText :content="content"></ChatText>
+      <ChatText :content="content" :isNeedThink="isNeedThink"></ChatText>
     </template>
 
     <template #button>

+ 5 - 1
src/components/Chat/ChatText.vue

@@ -20,6 +20,10 @@ const props = defineProps({
   content: {
     type: String,
     default: ''
+  },
+  isNeedThink: {
+    type: Boolean,
+    default: false
   }
 })
 
@@ -285,7 +289,7 @@ const text = computed(() => {
 
 <template>
   <div class="markdown-body text-[15px] break-all" v-if="content">
-    <n-collapse arrow-placement="right" display-directive="show" class="collapse-wrapper" :default-expanded-names="['thinkTag']" v-if="thinkStr">
+    <n-collapse arrow-placement="right" display-directive="show" class="collapse-wrapper" :default-expanded-names="['thinkTag']" v-if="thinkStr && isNeedThink">
       <n-collapse-item title="已深度思考" name="thinkTag">
         <div class="think-container" v-html="thinkStr"></div>
       </n-collapse-item>

+ 1 - 0
src/views/answer/AnswerView.vue

@@ -272,6 +272,7 @@ onUnmounted(() => {
             @on-click-stop="onStopChatStream(item)"
             @on-click-icon="params => updateById(params)"
             @on-click-reset="onChatResetStream(item)"
+            isNeedThink
            >
           </ChatAnswer>
         </template>

+ 4 - 1
src/views/screen/components/dataBox.vue

@@ -33,7 +33,7 @@ defineProps({
       <div class="content">
         <h5 class="title">{{ reportData.showVal }}</h5>
         <div class="markdown-inner">
-          <ChatText :content="reportData.answer" class="html-box"></ChatText>
+          <ChatText :content="reportData.answer" class="html-box" ></ChatText>
         </div>
       </div>
     </div>
@@ -42,6 +42,9 @@ defineProps({
 
 <style scoped lang="scss">
 .data-box {
+:deep(.think-container) {
+  display: none !important;
+}
   &-main {
     padding: 18px 25px 16px 40px;
     display: flex;