chore: 在线用户样式 开启虚拟滚动

This commit is contained in:
dap 2024-12-13 17:22:28 +08:00
parent 6f9a805f0c
commit 831696e275

View File

@ -38,6 +38,10 @@ const gridOptions: VxeGridProps = {
}, },
}, },
}, },
scrollY: {
enabled: true,
gt: 0,
},
rowConfig: { rowConfig: {
isHover: true, isHover: true,
keyField: 'tokenId', keyField: 'tokenId',
@ -51,11 +55,24 @@ async function handleForceOffline(row: Recordable<any>) {
await forceLogout(row.tokenId); await forceLogout(row.tokenId);
await tableApi.query(); await tableApi.query();
} }
function onlineCount() {
return tableApi?.grid?.getData?.()?.length ?? 0;
}
</script> </script>
<template> <template>
<Page :auto-content-height="true"> <Page :auto-content-height="true">
<BasicTable table-title="在线用户列表"> <BasicTable>
<template #toolbar-actions>
<div class="mr-1 pl-1 text-[1rem]">
<div>
在线用户列表 (
<span class="text-primary font-bold">{{ onlineCount() }}</span>
人在线)
</div>
</div>
</template>
<template #action="{ row }"> <template #action="{ row }">
<Popconfirm <Popconfirm
:get-popup-container="getVxePopupContainer" :get-popup-container="getVxePopupContainer"