From c06bc710201d44b3a9e79cf3e8d723fdc7b18db3 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Wed, 15 May 2024 18:31:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BB=93=E5=BA=93=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/chat/role/index.vue | 55 ++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/src/views/ai/chat/role/index.vue b/src/views/ai/chat/role/index.vue index 9afc685a..d4b34a8d 100644 --- a/src/views/ai/chat/role/index.vue +++ b/src/views/ai/chat/role/index.vue @@ -3,13 +3,24 @@
- + + + + - + + @@ -24,10 +35,12 @@ import RoleList from './RoleList.vue' import RoleCategoryList from './RoleCategoryList.vue' import {ChatRoleApi, ChatRolePageReqVO, ChatRoleVO} from '@/api/ai/model/chatRole' import {TabsPaneContext} from "element-plus"; +import {Search} from "@element-plus/icons-vue"; // 属性定义 const activeRole = ref('my-role') // 选中的角色 const loadding = ref(true) // 加载中 +const search = ref('') // 加载中 const myPageNo = ref(1) // my 分页下标 const myPageSize = ref(50) // my 分页大小 const myRoleList = ref([]) // my 分页大小 @@ -47,11 +60,12 @@ const handleTabsClick = async (tab: TabsPaneContext) => { } // 获取 my role -const getMyRole = async (pageNo: number, pageSize: number, category?: string) => { +const getMyRole = async () => { const params:ChatRolePageReqVO = { - pageNo, - pageSize, - category, + pageNo: myPageNo.value, + pageSize: myPageSize.value, + category: activeCategory.value, + name: search.value, publicStatus: false } const { total, list } = await ChatRoleApi.getMyPage(params) @@ -59,11 +73,12 @@ const getMyRole = async (pageNo: number, pageSize: number, category?: string) => } // 获取 public role -const getPublicRole = async (pageNo: number, pageSize: number, category?: string) => { +const getPublicRole = async () => { const params:ChatRolePageReqVO = { - pageNo, - pageSize, - category, + pageNo: publicPageNo.value, + pageSize: publicPageSize.value, + category: activeCategory.value, + name: search.value, publicStatus: true } const { total, list } = await ChatRoleApi.getMyPage(params) @@ -71,11 +86,11 @@ const getPublicRole = async (pageNo: number, pageSize: number, category?: string } // 获取选中的 tabs 角色 -const getActiveTabsRole = async (category?: string) => { +const getActiveTabsRole = async () => { if (activeRole.value === 'my-role') { - await getMyRole(myPageNo.value, myPageSize.value, category) + await getMyRole() } else { - await getPublicRole(publicPageNo.value, publicPageSize.value, category) + await getPublicRole() } } @@ -91,7 +106,7 @@ const handlerCategoryClick = async (category: string) => { } else { activeCategory.value = category } - await getActiveTabsRole(activeCategory.value) + await getActiveTabsRole() } // @@ -122,7 +137,19 @@ onMounted( async () => { flex-direction: column; .role-main { + position: relative; + .search-input { + width: 240px; + position: absolute; + right: 20px; + top: 10px; + z-index: 100; + } + + .tabs { + position: relative; + } .role-pane { display: flex;