From f1be1a3339bddda16aa7dfcef0ad4a55bddee2e2 Mon Sep 17 00:00:00 2001
From: liudong <liudong>
Date: 星期二, 20 八月 2024 16:08:03 +0800
Subject: [PATCH] 聊天临时智能体默认图标修改

---
 src/views/sessionManager/components/historySession.vue |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/src/views/sessionManager/components/historySession.vue b/src/views/sessionManager/components/historySession.vue
index f4d386e..24ef4e3 100644
--- a/src/views/sessionManager/components/historySession.vue
+++ b/src/views/sessionManager/components/historySession.vue
@@ -18,9 +18,10 @@
               </a-button>
 
               <a-scrollbar
+                ref="scrollRef"
                 class="left-list"
                 style="
-                  height: calc(100vh - 100px);
+                  height: calc(100vh - 160px);
                   overflow-y: auto;
                   overflow-x: hidden;
                 "
@@ -54,7 +55,7 @@
                       <img
                         :style="{ width: '16px' }"
                         alt="dessert"
-                        :src="session.avatar || imgSrc"
+                        :src="session.icon ? httpUrl + session.icon : imgSrc"
                       />
                       {{ session.name }}
                     </div>
@@ -94,7 +95,7 @@
   getDialogListApi,
   getSessionDetailsApi,
   deleteSessionApi,
-  sessionListApi
+  sessionListApiPage
 } from "@/api/session";
 
 import { queryCanvasList } from "@/api/Agent";
@@ -112,6 +113,8 @@
 const searchValue = ref("");
 const selectValue = ref("");
 const sectionList = ref({});
+const scrollRef = ref(null);
+const httpUrl = localStorage.getItem('httpUrl');
 const imgSrc = ref(logo);
 const DialogList = async () => {
   const { code, data } = await getDialogListApi();
@@ -162,7 +165,11 @@
 
 // 鏌ヨ浼氳瘽鍒楄〃
 const querySessionList = async (id) => {
-  const { code, data } = await sessionListApi(id);
+  const { code, data } = await sessionListApiPage({
+    dialog_id: id,
+    page: 1,
+    page_size: 100
+  });
   if (code === 200) {
     sessionList.value = data.map((item) => {
       return {
@@ -238,6 +245,30 @@
   session.showtype = 1;
 };
 
+
+const handleScroll = async (e: any) => {
+  // scrollTopVal.value = e.target.scrollTop
+  // let offsetHeight = e.target.offsetHeight
+  // let scrollHeight = e.target.scrollHeight
+  //
+  // if (scrollTopVal.value + offsetHeight >= scrollHeight) {
+  //   //婊氬姩鏉″埌杈惧簳閮�
+  //   if (cardData.value.length < total.value) {
+  //     //鏁版嵁涓哄姞杞藉畬锛岀户缁祴鍊�
+  //     serarchData.pageNum++
+  //
+  //
+  //
+  //   }
+  // }
+}
+
+const loading: any = computed(() => {
+  // cardData.value.length >= total.value
+})
+
+
+
 onBeforeMount(()=>{
   // DialogList()
   querySessionList('');
@@ -250,6 +281,23 @@
     querySessionList('');
 
   });
+
+//   缁欏厓绱犳坊鍔犳粴鍔ㄤ簨浠剁洃鍚�
+//   if (scrollRef.value) {
+//     // 缁欏厓绱犳坊鍔犳粴鍔ㄧ洃鍚櫒
+//
+//     scrollRef.value.addEventListener('scroll', handleScroll, true)
+//
+//     // 濡傛灉浣犻渶瑕佸湪缁勪欢鍗歌浇鏃剁Щ闄ょ洃鍚櫒锛屽彲浠ヨ繑鍥炰竴涓竻鐞嗗嚱鏁�
+//     return () => {
+//       scrollRef.value.removeEventListener('scroll', handleScroll, true)
+//     }
+//   }
+
+
+
+
+
 })
 onBeforeUnmount(() => {
   EventBus.off("history");

--
Gitblit v1.8.0