登录日志、操作日志列表样式

This commit is contained in:
陈红丽 2024-11-21 15:27:00 +08:00
parent b2a8770eae
commit 6b97736de8
2 changed files with 105 additions and 118 deletions

View File

@ -6,73 +6,69 @@ export const columns = [
title: 'ID', title: 'ID',
dataIndex: 'id', dataIndex: 'id',
fixed: 'left', fixed: 'left',
width: 50, width: 100
}, },
{ {
title: '操作用户', title: '访客',
dataIndex: 'username', align:'left',
width: 100, customRender({ record }) {
return h('div', [
h('div',{
style: {marginBottom:'5px'}
}, record.username),
h('div',{
style: { marginBottom:'5px'}
}, record.ip),
h('div', record.location),
])
}
}, },
{ {
title: '请求ip', title: '请求接口',
dataIndex: 'ip', align:'left',
width: 100, customRender({ record }) {
return h('div', [
h(Tag,
{
type: 'info',
style: {marginBottom:'5px'}
},
{
default: () => (record.requestMethod),
}),
h('div', '接口:'+record.url),
])
}
}, },
{ {
title: '浏览器', title: '接口响应',
dataIndex: 'browser', align:'left',
width: 100, customRender({ record }) {
}, return h('div', [
{ h('span', '状态:'),
title: '操作系统', h(Tag,
dataIndex: 'os', {
width: 100, color: record.status == 0 ? 'success' : 'error',
}, style: {marginBottom:'5px'}
{ },
title: '操作类型', {
dataIndex: 'typeText', default: () => (record.status == 0 ? '正常' : '异常'),
width: 100, }),
h('div', '请求耗时:'+record.consumeTime+'ms'),
])
}
}, },
{ {
title: '操作来源', title: '操作来源',
dataIndex: 'sourceText', align:'left',
width: 100,
},
{
title: '请求方式',
dataIndex: 'requestMethod',
width: 100,
},
{
title: '请求URL',
dataIndex: 'url',
width: 100,
},
{
title: '请求地区',
dataIndex: 'location',
width: 100,
},
{
title: '请求耗时',
dataIndex: 'consumeTime',
width: 100,
},
{
title: '状态',
dataIndex: 'status',
customRender({ record }) { customRender({ record }) {
return h( return h('div', [
Tag, h('div', '系统:'+record.os),
{ h('div', '类型:'+record.typeText),
color: record.status == 0 ? 'success' : 'error', h('div', '来源:'+record.sourceText),
}, ])
{ }
default: () => (record.status == 0 ? '正常' : '异常'),
},
);
},
width: 100,
}, },
{ {
title: '创建时间', title: '创建时间',

View File

@ -6,78 +6,69 @@ export const columns = [
title: 'ID', title: 'ID',
dataIndex: 'id', dataIndex: 'id',
fixed: 'left', fixed: 'left',
width: 50,
},
{
title: '日志标题',
dataIndex: 'title',
width: 100, width: 100,
}, },
{ {
title: '操作用户', title: '访客',
dataIndex: 'createUser', align:'left',
width: 100, customRender({ record }) {
return h('div', [
h('div',{
style: {marginBottom:'5px'}
}, record.createUser),
h('div',{
style: { marginBottom:'5px'}
}, record.ip),
h('div', record.location),
])
}
}, },
{ {
title: '请求ip', title: '请求接口',
dataIndex: 'ip', align:'left',
width: 140, customRender({ record }) {
return h('div', [
h(Tag,
{
type: 'info',
style: {marginBottom:'5px'}
},
{
default: () => (record.requestMethod),
}),
h('div', '接口:'+record.url),
h('div', '名称:'+record.title),
])
}
}, },
{ {
title: '浏览器', title: '接口响应',
dataIndex: 'browser', align:'left',
width: 100, customRender({ record }) {
}, return h('div', [
{ h('span', '状态:'),
title: '操作系统', h(Tag,
dataIndex: 'os', {
width: 100, color: record.status == 0 ? 'success' : 'error',
}, style: {marginBottom:'5px'}
{ },
title: '操作类型', {
dataIndex: 'typeText', default: () => (record.status == 0 ? '正常' : '异常'),
width: 100, }),
h('div', '请求耗时:'+record.consumeTime+'ms'),
])
}
}, },
{ {
title: '操作来源', title: '操作来源',
dataIndex: 'sourceText', align:'left',
width: 100,
},
{
title: '请求方式',
dataIndex: 'requestMethod',
width: 100,
},
{
title: '请求URL',
dataIndex: 'url',
width: 150,
},
{
title: '请求地区',
dataIndex: 'location',
width: 100,
},
{
title: '请求耗时',
dataIndex: 'consumeTime',
width: 100,
},
{
title: '状态',
dataIndex: 'status',
customRender({ record }) { customRender({ record }) {
return h( return h('div', [
Tag, h('div', '系统:'+record.os),
{ h('div', '类型:'+record.typeText),
color: record.status == 0 ? 'success' : 'error', h('div', '来源:'+record.sourceText),
}, ])
{ }
default: () => (record.status == 0 ? '正常' : '异常'),
},
);
},
width: 100,
}, },
{ {
title: '创建时间', title: '创建时间',