zhangxiao
2024-08-27 fd15b2a99a4ebd476a54671c560b3a89f69b621e
src/views/sessionManager/components/historySession.vue
@@ -187,6 +187,10 @@
        showtype: 1
      }
    });
    isReached.value = false;
    setTimeout(()=>{
      isReached.value = true;
    },100)
    // total.value = sessionList.value.length;
@@ -216,28 +220,24 @@
const querySessionDetail = async (session) => {
  console.log(session, 'session');
  // 查询历史记录
  if (session.base == 'agent') {
    // agent对象数据封装
    const { code, data } = await getAgentSessionDetailsApi(session.id);
    if (code == 0) {
      console.log(data,'会话详情');
      // let sessionObj = {
      //   id: session.app_id,
      //   dsl: data.dsl,
      //   title: session.name,
      // }
    }
    EventBus.emit("queryAgentSessionDetail",{
      id: session.id,
      dsl: data.dsl,
      title: session.name,
    });
    emit('changeAgentType','2');
  } else {
  // 查询历史记录 app_type 1:智能体 2:agent
  if (!session.base) {
    // 生成智能体新的对话
    emit('changeAgentType','1');
    emit('querySessionDetail',session);
  } else  if (session.base == 'agent'){
    // agent对象数据封装
    // const { code, data } = await getAgentSessionDetailsApi(session.dialog_id);
    // if (code == 0) {
    //   console.log(data,'会话详情');
    //   // let sessionObj = {
    //   //   id: session.app_id,
    //   //   dsl: data.dsl,
    //   //   title: session.name,
    //   // }
    // }
    EventBus.emit("queryAgentSessionDetail",session);
    emit('changeAgentType','2');
  }
}
@@ -308,9 +308,11 @@
})
onMounted(() => {
  console.log(httpUrl,'当前地址');
  EventBus.on("history", () => {
    emit('changeAgentType','3');
    // DialogList()
    queryPage.page = 1;
    querySessionList('');
  });