|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <div class="layoutHisCenter"> | 
|---|
|  |  |  | <div class="layoutAgentCenter"> | 
|---|
|  |  |  | <a-scrollbar | 
|---|
|  |  |  | class="left-list" | 
|---|
|  |  |  | style=" | 
|---|
|  |  |  | height: calc(100vh - 100px); | 
|---|
|  |  |  | overflow-y: auto; | 
|---|
|  |  |  | overflow-x: hidden; | 
|---|
|  |  |  | " | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <div class="historyCenter"> | 
|---|
|  |  |  | <div | 
|---|
|  |  |  | class="item historyCenter-box" | 
|---|
|  |  |  | v-for="item in dialogs" | 
|---|
|  |  |  | @click="querySessionDetail(item)" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <div class="text" > | 
|---|
|  |  |  | <img | 
|---|
|  |  |  | :style="{ width: '16px' }" | 
|---|
|  |  |  | alt="dessert" | 
|---|
|  |  |  | :src="item.avatar || imgSrc" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | {{ item.name }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="time" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="search"> | 
|---|
|  |  |  | <!--                  查询框--> | 
|---|
|  |  |  | <img src="@/assets/images/his.png" | 
|---|
|  |  |  | style="width: 100%" | 
|---|
|  |  |  | alt=""> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="agentMainCenter"> | 
|---|
|  |  |  | <a-row class="agentCenter"> | 
|---|
|  |  |  | <a-col :span="8" v-for="item in dialogs"> | 
|---|
|  |  |  | <div | 
|---|
|  |  |  | class="item agentCenter-box" | 
|---|
|  |  |  | @click="createNewSession(item)" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <div class="text" > | 
|---|
|  |  |  | <a-avatar> | 
|---|
|  |  |  | <img | 
|---|
|  |  |  | :style="{ width: '100%' }" | 
|---|
|  |  |  | alt="dessert" | 
|---|
|  |  |  | :src="item.avatar || imgSrc" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </a-avatar> | 
|---|
|  |  |  | <span style="margin-left: 10px;font-weight: 500;color: var(--color-text-1)"> | 
|---|
|  |  |  | {{ item.name }} | 
|---|
|  |  |  | </span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="time" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </a-col> | 
|---|
|  |  |  | </a-row> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </a-scrollbar> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | sessionListApi | 
|---|
|  |  |  | } from "@/api/session"; | 
|---|
|  |  |  | import { queryCanvasList } from "@/api/Agent"; | 
|---|
|  |  |  | const emit = defineEmits(["querySessionDetail","changeAgentType"]); | 
|---|
|  |  |  | const emit = defineEmits(["querySessionDetail","changeAgentType","createSession"]); | 
|---|
|  |  |  | import logo from "@/assets/images/model.png"; | 
|---|
|  |  |  | const sessionList = ref([]); //会话列表 | 
|---|
|  |  |  | const activeSessionId = ref(""); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const querySessionDetail = async (session) => { | 
|---|
|  |  |  | const createNewSession = async (session) => { | 
|---|
|  |  |  | console.log(session, 'session'); | 
|---|
|  |  |  | emit('changeAgentType','1'); | 
|---|
|  |  |  | emit('querySessionDetail',session); | 
|---|
|  |  |  | // 查询历史记录 | 
|---|
|  |  |  | // emit('querySessionDetail',session); | 
|---|
|  |  |  | if (session.type == '1') { | 
|---|
|  |  |  | // 生成智能体新的对话 | 
|---|
|  |  |  | emit('createSession',session.id); | 
|---|
|  |  |  | emit('changeAgentType','1'); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 生成agent新的对话 | 
|---|
|  |  |  | EventBus.emit("createAgent",session); | 
|---|
|  |  |  | emit('changeAgentType','2'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | onBeforeMount(()=>{ | 
|---|
|  |  |  | DialogList() | 
|---|
|  |  |  | 
|---|
|  |  |  | onMounted(() => { | 
|---|
|  |  |  | EventBus.on("smartAi", () => { | 
|---|
|  |  |  | emit('changeAgentType','4'); | 
|---|
|  |  |  | DialogList() | 
|---|
|  |  |  | DialogList(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | onBeforeUnmount(() => { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <style scoped lang="less"> | 
|---|
|  |  |  | .layoutHisCenter{ | 
|---|
|  |  |  | .layoutAgentCenter{ | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | //background: #999999; | 
|---|
|  |  |  | position: absolute; | 
|---|
|  |  |  | left: 0; | 
|---|
|  |  |  | top: 0; | 
|---|
|  |  |  | .historyTitle___F_iam { | 
|---|
|  |  |  | .agentTitle___F_iam { | 
|---|
|  |  |  | font-size: 36px; | 
|---|
|  |  |  | line-height: 50px; | 
|---|
|  |  |  | font-weight: 700; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .historyCenter{ | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | margin-top: 30px; | 
|---|
|  |  |  | .historyCenter-box{ | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | width: 70%; | 
|---|
|  |  |  | margin-left: 15%; | 
|---|
|  |  |  | //border: 1px solid var(--color-text-4); | 
|---|
|  |  |  | padding: 16px; | 
|---|
|  |  |  | border-radius: 12px; | 
|---|
|  |  |  | background: var(--color-bg-2); | 
|---|
|  |  |  | margin-top: 10px; | 
|---|
|  |  |  | cursor: pointer; | 
|---|
|  |  |  | justify-content: space-between; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .historyCenter-box:hover{ | 
|---|
|  |  |  | color: #2a2a2b; | 
|---|
|  |  |  | border: 1px solid var(--color-neutral-3); | 
|---|
|  |  |  | //background: #e8e8ea; | 
|---|
|  |  |  | box-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09); | 
|---|
|  |  |  | .agentMainCenter{ | 
|---|
|  |  |  | width: 70%; | 
|---|
|  |  |  | margin: 0 auto; | 
|---|
|  |  |  | .agentCenter{ | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | margin-top: 30px; | 
|---|
|  |  |  | .agentCenter-box{ | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | width: 90%; | 
|---|
|  |  |  | margin: 0 auto; | 
|---|
|  |  |  | //border: 1px solid var(--color-neutral-3); | 
|---|
|  |  |  | padding: 16px; | 
|---|
|  |  |  | border-radius: 12px; | 
|---|
|  |  |  | background: var(--color-bg-1); | 
|---|
|  |  |  | margin-top: 10px; | 
|---|
|  |  |  | cursor: pointer; | 
|---|
|  |  |  | justify-content: space-between; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | color: var(--color-text-2); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .agentCenter-box:hover{ | 
|---|
|  |  |  | color: var(--color-text-2); | 
|---|
|  |  |  | //border: 1px solid var(--color-neutral-3); | 
|---|
|  |  |  | background: var(--color-bg-3); | 
|---|
|  |  |  | box-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|