From 190d513442d130a270c8e0571e3b28f3403a5c05 Mon Sep 17 00:00:00 2001 From: duorameng <2997944583@qq.com> Date: Fri, 17 Apr 2026 09:32:53 +0800 Subject: [PATCH] chore: update message log paga style --- web/src/views/loginlogs/LoginLogs.vue | 180 ++++++++++++++++-- web/src/views/loginlogs/tabs/LoginLogTab.vue | 33 +--- .../views/loginlogs/tabs/SystemEventTab.vue | 97 +++------- web/src/views/notify/components/PushLog.vue | 115 ++++------- 4 files changed, 236 insertions(+), 189 deletions(-) diff --git a/web/src/views/loginlogs/LoginLogs.vue b/web/src/views/loginlogs/LoginLogs.vue index 700017a..1bb270d 100644 --- a/web/src/views/loginlogs/LoginLogs.vue +++ b/web/src/views/loginlogs/LoginLogs.vue @@ -1,42 +1,180 @@ diff --git a/web/src/views/loginlogs/tabs/LoginLogTab.vue b/web/src/views/loginlogs/tabs/LoginLogTab.vue index 18ac0c2..42b0a56 100644 --- a/web/src/views/loginlogs/tabs/LoginLogTab.vue +++ b/web/src/views/loginlogs/tabs/LoginLogTab.vue @@ -10,6 +10,10 @@ import { toast } from 'vue-sonner' import { useSiteSettings } from '@/composables/useSiteSettings' import BaihuDialog from '@/components/ui/BaihuDialog.vue' +const props = defineProps<{ + username: string +}>() + const { pageSize } = useSiteSettings() interface LoginLog { @@ -38,11 +42,9 @@ interface IpGeoInfo { } const logs = ref([]) -const filterUsername = ref('') const currentPage = ref(1) const total = ref(0) const loading = ref(false) -let searchTimer: ReturnType | null = null // IP 地理位置弹窗 const ipDialogOpen = ref(false) @@ -73,7 +75,7 @@ async function loadLogs() { const res = await api.settings.getLoginLogs({ page: currentPage.value, page_size: pageSize.value, - username: filterUsername.value || undefined + username: props.username || undefined }) logs.value = res.data total.value = res.total @@ -84,37 +86,20 @@ async function loadLogs() { } } -function handleSearch() { - if (searchTimer) clearTimeout(searchTimer) - searchTimer = setTimeout(() => { - currentPage.value = 1 - loadLogs() - }, 300) -} - function handlePageChange(page: number) { currentPage.value = page loadLogs() } onMounted(loadLogs) + +defineExpose({ + loadLogs +})