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 |  105 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 88 insertions(+), 17 deletions(-)

diff --git a/src/views/sessionManager/index.vue b/src/views/sessionManager/index.vue
index e0adb16..03de01b 100644
--- a/src/views/sessionManager/index.vue
+++ b/src/views/sessionManager/index.vue
@@ -224,10 +224,19 @@
                       style="border: none"
                     >
                     </a-textarea>
-                    <!-- <div v-html="chartText(sessionDetail.content)">
-
-                    </div> -->
                   </a-card>
+                  <!-- <div class="prompt">
+                    <ul>
+                      <li class="prompt-item" @click="copyText('43234')">
+                        <span>
+                          344343klsdjkjksdjkjksdjk灏卞紑濮嬪ぇ瀹剁湅鏁版嵁搴撶櫥璁板崱鍙楁墦鍑诲嚡鎾掔櫥璁板崱鍙楁墦鍑诲嚡鎾掔櫥璁板崱鍙楁墦鍑诲嚡鎾掔殑43</span
+                        >
+                        <span style="margin-left: 20px">
+                          <icon-right />
+                        </span>
+                      </li>
+                    </ul>
+                  </div> -->
                 </template>
                 <!-- <div>{{ sessionDetail.role === 'assistant' }}</div> -->
                 <template #actions>
@@ -282,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>
@@ -364,12 +375,18 @@
                   display: flex;
                   justify-content: space-between;
                 "
+                class="uploadFileDis"
               >
                 <updataFile
                   ref="fileInput"
                   :sessionId="activeSessionId"
                   @selectFileCallback="selectFileCallback"
                 ></updataFile>
+                <!-- <uploadFile
+                  ref="fileInput"
+                  :sessionId="activeSessionId"
+                  @selectFileCallback="selectFileCallback"
+                ></uploadFile> -->
                 <a-button
                   :disabled="chatDis"
                   @click="sentClick"
@@ -457,6 +474,11 @@
           ></smartAi>
         </div>
       </a-col>
+      <a-col :span="23" v-show="agentType == '5'">
+        <div class="center">
+          <seniorAgentSession :modalObj="agentObj"></seniorAgentSession>
+        </div>
+      </a-col>
     </a-row>
     <a-modal title=" " v-model:visible="fileVisible" :footer="false" fullscreen>
       <!--      <docx  previewSrc="http://192.168.20.116:1080/v1/document/get/405c3efa4d8c11ef97560242ac120006"></docx>-->
@@ -510,9 +532,11 @@
   import chatMenu from '@/views/sessionManager/components/chatMenu.vue';
   import AddSession from '@/views/sessionManager/components/addSession.vue';
   import agentSession from '@/views/sessionManager/components/agentSession.vue';
+  import seniorAgentSession from '@/views/sessionManager/components/seniorAgentSession.vue';
   import historySession from '@/views/sessionManager/components/historySession.vue';
   import smartAi from '@/views/sessionManager/components/smartAi.vue';
   import updataFile from '@/views/sessionManager/components/updataFile.vue';
+
   import EventBus from '@/utils/EventBus';
   import {
     addSessionApi,
@@ -537,6 +561,7 @@
   import excel from '@/views/dmx/knowledgeLib/components/excel.vue';
   import txtPdf from '@/views/dmx/knowledgeLib/components/txtPdf.vue';
   import { is } from 'immutable';
+  import uploadFile from './components/uploadFile.vue';
 
   // const url = ref('../../assets/session/PDF.png');
 
@@ -551,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('鏈懡鍚嶄細璇�');
@@ -577,7 +603,7 @@
   const uploadRef = ref();
   const files = ref([]);
   const file = ref('');
-  const fileInput = ref(null);
+  const fileInput = ref();
   const chatDataMeg = reactive({});
   const visible = ref(false);
   const fileVisible = ref(false);
@@ -743,7 +769,6 @@
   };
 
   const selectFileCallback = (data) => {
-    console.log(data, 'selectFileCallback');
     uploaditemList.value = [...uploaditemList.value, ...data];
   };
 
@@ -902,6 +927,7 @@
   const startChat = async (valMsg) => {
     chatDis.value = true;
     loading.value = true;
+    chartLoading.value = true;
     toStop = false;
     sessionDetailList.value.push({
       content: valMsg,
@@ -945,6 +971,7 @@
           if (typeof d !== 'boolean') {
             // console.info("data:", d);
             streamStr.value = d.content;
+            chartLoading.value = false;
             startDisplayStr();
           }
         } catch (e) {
@@ -953,6 +980,7 @@
         if (done) {
           console.info('done');
           displayedText.value = '';
+          chartLoading.value = false;
           if (isStopChat.value) {
             setChatDataMeg(chatDataMeg);
           } else {
@@ -1203,6 +1231,33 @@
         }
       }
     }
+    // .uploadFileDis {
+    //   :deep(.arco-upload-list-type-text) {
+    //     display: none;
+    //   }
+    // }
+    .prompt {
+      ul {
+        margin: 0;
+        padding: 0;
+        display: flex;
+      }
+      ul > li {
+        list-style-type: none;
+      }
+      .prompt-item {
+        display: flex;
+        justify-content: space-between;
+        background-color: #fff;
+        cursor: pointer;
+        border-radius: 8px;
+        padding: 10px;
+        border: #e5e5e5;
+        &:hover {
+          background-color: #eee;
+        }
+      }
+    }
 
     .card-btn-1 {
       margin: 8px 15px;
@@ -1346,6 +1401,19 @@
         color: #333;
         margin-top: 4px;
       }
+      :deep(.arco-card-body) {
+        padding: 0;
+        border-radius: 10px;
+      }
+      :deep(.arco-textarea) {
+        padding-top: 10px !important;
+      }
+      :deep(.arco-comment-inner-content) {
+        border-radius: 10px;
+      }
+      :deep(.arco-card-bordered) {
+        border-radius: 10px;
+      }
 
       .icon-user-jpg {
         border: 1px solid #d9d9d9;
@@ -1364,6 +1432,9 @@
           margin-left: 10px;
         }
       }
+      :deep(.arco-spin-loading .arco-spin-mask-icon) {
+        left: 10%;
+      }
     }
 
     .right {

--
Gitblit v1.8.0