From a8bbd82b4ea382633b8e8c4075290cd3eea50d45 Mon Sep 17 00:00:00 2001 From: yinbangzhong <zhongbangyin@126.com> Date: 星期五, 16 八月 2024 16:39:07 +0800 Subject: [PATCH] 角色 --- src/views/sessionManager/components/historySession.vue | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/views/sessionManager/components/historySession.vue b/src/views/sessionManager/components/historySession.vue index c355dce..1fc2d03 100644 --- a/src/views/sessionManager/components/historySession.vue +++ b/src/views/sessionManager/components/historySession.vue @@ -56,13 +56,22 @@ /> {{ session.name }} </div> - <div class="time" - >{{ - moment(new Date(session.create_time)).format( - 'YYYY-MM-DD HH:mm:ss' - ) - }} - </div> + <a-popover position="rt"> + <div class="time" + >{{ + moment(new Date(session.create_time)).format( + 'YYYY-MM-DD HH:mm:ss' + ) + }} + </div> + <template #content> + <span + style="cursor: pointer; color: #4977ba; font-size: 12px" + @click="deleteSession(session)" + ><icon-delete style="font-size: 14px" />鍒犻櫎</span + > + </template> + </a-popover> </div> </div> </a-scrollbar> @@ -85,8 +94,10 @@ chatApi, getDialogListApi, getSessionDetailsApi, + deleteSessionApi, sessionListApi } from "@/api/session"; + import { queryCanvasList } from "@/api/Agent"; const emit = defineEmits(["querySessionDetail","changeAgentType"]); import logo from "@/assets/images/model.png"; @@ -161,6 +172,14 @@ } }; +//鏍规嵁浼氳瘽id鍒犻櫎浼氳瘽 +const deleteSession = async (session) => { + const { code } = await deleteSessionApi([session.id]); + if (code === 200) { + Message.success('鍒犻櫎鎴愬姛'); + querySessionList(''); + } +}; const querySessionDetail = async (session) => { console.log(session, 'session'); @@ -168,13 +187,15 @@ emit('querySessionDetail',session); } onBeforeMount(()=>{ - DialogList() + // DialogList() + querySessionList(''); }) onMounted(() => { EventBus.on("history", () => { emit('changeAgentType','3'); - DialogList() + // DialogList() + querySessionList(''); }); }) @@ -221,19 +242,20 @@ display: flex; width: 70%; margin-left: 15%; - //border: 1px solid var(--color-text-4); + //border: 1px solid var(--color-neutral-3); padding: 16px; border-radius: 12px; - background: var(--color-bg-2); + background: var(--color-bg-1); margin-top: 10px; cursor: pointer; justify-content: space-between; align-items: center; + color: var(--color-text-2); } .historyCenter-box:hover{ - color: #2a2a2b; - border: 1px solid var(--color-neutral-3); - //background: #e8e8ea; + 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); } } -- Gitblit v1.8.0