liudong
2024-08-20 00a3929fe7003715bb4d48f72a3ac2a0550f5588
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;
                "
@@ -94,7 +95,7 @@
  getDialogListApi,
  getSessionDetailsApi,
  deleteSessionApi,
  sessionListApi
  sessionListApiPage
} from "@/api/session";
import { queryCanvasList } from "@/api/Agent";
@@ -112,6 +113,7 @@
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 () => {
@@ -163,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 {
@@ -239,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('');
@@ -251,6 +281,23 @@
    querySessionList('');
  });
//   给元素添加滚动事件监听
//   if (scrollRef.value) {
//     // 给元素添加滚动监听器
//
//     scrollRef.value.addEventListener('scroll', handleScroll, true)
//
//     // 如果你需要在组件卸载时移除监听器,可以返回一个清理函数
//     return () => {
//       scrollRef.value.removeEventListener('scroll', handleScroll, true)
//     }
//   }
})
onBeforeUnmount(() => {
  EventBus.off("history");