liudong
2024-08-19 7d1e44c728a8e436fede1ceb8a62b5c4fb848b09
src/views/sessionManager/components/historySession.vue
@@ -54,7 +54,7 @@
                      <img
                        :style="{ width: '16px' }"
                        alt="dessert"
                        :src="session.avatar || imgSrc"
                        :src="session.icon ? httpUrl + session.icon : imgSrc"
                      />
                      {{ session.name }}
                    </div>
@@ -101,6 +101,7 @@
const emit = defineEmits(["querySessionDetail","changeAgentType"]);
import logo from "@/assets/images/model.png";
import { deleteKnow } from "@/api/kbList";
import { getAgentSessionDetailsApi } from "@/api/agentSession";
const sessionList = ref([]); //会话列表
const activeSessionId = ref("");
const fieldNames = { value: "id", label: "name" };
@@ -111,6 +112,7 @@
const searchValue = ref("");
const selectValue = ref("");
const sectionList = ref({});
const httpUrl = localStorage.getItem('httpUrl');
const imgSrc = ref(logo);
const DialogList = async () => {
  const { code, data } = await getDialogListApi();
@@ -198,8 +200,34 @@
const querySessionDetail = async (session) => {
  console.log(session, 'session');
  emit('changeAgentType','1');
  emit('querySessionDetail',session);
  // 查询历史记录
  if (session.base == 'agent') {
    // agent对象数据封装
    // const { code, data } = await getAgentSessionDetailsApi(session.app_id);
    // if (code == 0) {
    //   console.log(data,'会话详情');
    //   let sessionObj = {
    //     id: session.app_id,
    //     dsl: data.dsl,
    //     title: session.name,
    //   }
    //
    // }
    EventBus.emit("queryAgentSessionDetail",{
      ...sessionObj,
      id: session.app_id,
    });
    emit('changeAgentType','2');
  } else {
    // 生成智能体新的对话
    emit('changeAgentType','1');
    emit('querySessionDetail',session);
  }
}