Files
ruoyi-plus-vben5-h/apps/web-antd/src/views/monitor/online/data.tsx
dap 052d7d5cdd feat(monitor): 在浏览器列中同时显示图标和文本
重构浏览器图标渲染逻辑,使用 Iconify 图标集替代自定义 SVG 组件
- 修改 login-info-modal.vue 和 data.tsx 中的浏览器列显示,同时展示图标和浏览器名称
- 新增 online 监控页面的数据配置,包含浏览器和系统列
- 重写 render.tsx 中的 renderBrowserIcon 函数,支持 Iconify 在线/离线图标
- 清理 icons 包中已不再使用的浏览器相关离线图标定义
2026-01-23 10:49:39 +08:00

91 lines
1.8 KiB
TypeScript

import type { VNode } from 'vue';
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import dayjs from 'dayjs';
import { renderBrowserIcon, renderOsIcon } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'ipaddr',
label: 'IP地址',
},
{
component: 'Input',
fieldName: 'userName',
label: '用户账号',
},
];
export const columns: VxeGridProps['columns'] = [
{
title: '登录平台',
field: 'deviceType',
},
{
title: '登录账号',
field: 'userName',
},
{
title: '部门名称',
field: 'deptName',
},
{
title: 'IP地址',
field: 'ipaddr',
},
{
title: '登录地址',
field: 'loginLocation',
},
{
title: '浏览器',
field: 'browser',
slots: {
default: ({ row }) => {
return (
<div class="flex items-center justify-center gap-[6px]">
{renderBrowserIcon(row.browser, 'shrink-0')}
{row.browser}
</div>
);
},
},
},
{
title: '系统',
field: 'os',
slots: {
default: ({ row }) => {
// Windows 10 or Windows Server 2016 太长了 分割一下 详情依旧能看到详细的
let value = row.os;
if (value) {
const split = value.split(' or ');
if (split.length === 2) {
value = split[0];
}
}
return renderOsIcon(value, true) as VNode;
},
},
},
{
title: '登录时间',
field: 'loginTime',
formatter: ({ cellValue }) => {
return dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss');
},
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
resizable: false,
width: 'auto',
},
];