From 3313467ddc324d3e19610142756423c8355dc82d Mon Sep 17 00:00:00 2001
From: zhangxiao <898441624@qq.com>
Date: 星期五, 30 八月 2024 15:13:58 +0800
Subject: [PATCH] fix: 更新聊天展示

---
 src/views/sessionManager/index.vue |   45 ++++++++++++++++++++++++++-------------------
 1 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/src/views/sessionManager/index.vue b/src/views/sessionManager/index.vue
index 973d7fa..03de01b 100644
--- a/src/views/sessionManager/index.vue
+++ b/src/views/sessionManager/index.vue
@@ -291,18 +291,20 @@
                   />
                 </template>
                 <template #content>
-                  <a-textarea
-                    readonly
-                    auto-size
-                    v-model="displayedText"
-                    :class="{ chatItemAnswer: theme === 'light' }"
-                    :style="{
-                      backgroundColor:
-                        theme === 'light' ? '#ffffff' : '#000000',
-                    }"
-                    style="border: none"
-                  >
-                  </a-textarea>
+                  <a-spin :loading="chartLoading" dot style="width: 100%">
+                    <a-textarea
+                      readonly
+                      auto-size
+                      v-model="displayedText"
+                      :class="{ chatItemAnswer: theme === 'light' }"
+                      :style="{
+                        backgroundColor:
+                          theme === 'light' ? '#ffffff' : '#000000',
+                      }"
+                      style="border: none"
+                    >
+                    </a-textarea>
+                  </a-spin>
                 </template>
 
                 <template #actions>
@@ -574,6 +576,7 @@
   const modalObj = reactive({ add: false });
   const dialogId = ref('');
   const chatDis = ref(false);
+  const chartLoading = ref(false);
   const loading = ref(false);
   const agentType = ref('1');
   const agentTitle = ref('鏈懡鍚嶄細璇�');
@@ -766,8 +769,6 @@
   };
 
   const selectFileCallback = (data) => {
-    debugger;
-    console.log(data, 'selectFileCallback');
     uploaditemList.value = [...uploaditemList.value, ...data];
   };
 
@@ -926,6 +927,7 @@
   const startChat = async (valMsg) => {
     chatDis.value = true;
     loading.value = true;
+    chartLoading.value = true;
     toStop = false;
     sessionDetailList.value.push({
       content: valMsg,
@@ -969,6 +971,7 @@
           if (typeof d !== 'boolean') {
             // console.info("data:", d);
             streamStr.value = d.content;
+            chartLoading.value = false;
             startDisplayStr();
           }
         } catch (e) {
@@ -977,6 +980,7 @@
         if (done) {
           console.info('done');
           displayedText.value = '';
+          chartLoading.value = false;
           if (isStopChat.value) {
             setChatDataMeg(chatDataMeg);
           } else {
@@ -1227,11 +1231,11 @@
         }
       }
     }
-    .uploadFileDis {
-      :deep(.arco-upload-list-type-text) {
-        display: none;
-      }
-    }
+    // .uploadFileDis {
+    //   :deep(.arco-upload-list-type-text) {
+    //     display: none;
+    //   }
+    // }
     .prompt {
       ul {
         margin: 0;
@@ -1428,6 +1432,9 @@
           margin-left: 10px;
         }
       }
+      :deep(.arco-spin-loading .arco-spin-mask-icon) {
+        left: 10%;
+      }
     }
 
     .right {

--
Gitblit v1.8.0