Commit 6cd25fc0 authored by 陈前坚's avatar 陈前坚

perf: 日志表格固定表头

parent a8db7171
Pipeline #21613 skipped with stages
......@@ -132,7 +132,7 @@ const LoginLog = () => {
return (
<>
<div className={styles.serviceLog}>
<div className={styles.loginLog}>
<Row className={styles.head}>
<Col span={24}>
<span style={{ lineHeight: 2 }}>时间:</span>
......@@ -169,7 +169,7 @@ const LoginLog = () => {
bordered
columns={columns}
dataSource={data0}
scroll={{ x: 'max-content' }}
scroll={{ x: 'max-content', y: 'calc(100vh - 208px)' }}
pagination={{
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`,
......
.serviceLog{
.loginLog{
.head{
padding: 10px;
background: white;
......@@ -16,8 +16,8 @@
font-weight: 600;
color:rgba(0,0,0,0.85);
}
.ant-table-content{
height:calc(100vh - 172px);
.ant-table-body{
height:calc(100vh - 208px);
border-right: white;
overflow: auto !important;
}
......
......@@ -31,6 +31,7 @@ const OmsLog = () => {
title: '操作时间',
dataIndex: 'logTime',
key: 'logTime',
width: 200,
// defaultSortOrder: 'descend',
sortDirections: ['descend', 'ascend'],
sorter: (a, b) =>
......@@ -40,6 +41,7 @@ const OmsLog = () => {
title: '接口名称',
dataIndex: 'functionName',
key: 'functionName',
width: 300,
// filters: functionNameFilters,
// onFilter: (value, record) => record.functionName === value,
},
......@@ -47,13 +49,13 @@ const OmsLog = () => {
title: '标签',
dataIndex: 'label',
key: 'label',
// width: 300,
width: 300,
},
{
title: '优先级',
dataIndex: 'level',
key: 'level',
// width: 100,
width: 100,
filters: levelFilters,
onFilter: (value, record) => record.level === value,
},
......@@ -61,7 +63,7 @@ const OmsLog = () => {
title: '详情',
dataIndex: 'shortInfo',
key: 'shortInfo',
// ellipsis: 'true',
ellipsis: 'true',
// width: 300,
},
];
......@@ -188,7 +190,7 @@ const OmsLog = () => {
bordered
columns={columns}
dataSource={data}
scroll={{ x: 'max-content' }}
scroll={{ x: 'max-content', y: 'calc(100vh - 208px)' }}
pagination={{
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`,
......
......@@ -16,13 +16,13 @@
font-weight: 600;
color:rgba(0,0,0,0.85);
}
.ant-table-content{
height:calc(100vh - 172px);
.ant-table-body{
height:calc(100vh - 208px);
border-right: white;
overflow: auto !important;
.ant-table-tbody{
overflow: scroll !important;
}
// .ant-table-tbody{
// overflow: scroll !important;
// }
}
.ant-pagination{
z-index: 999;
......
......@@ -62,44 +62,25 @@ const ServiceLog = () => {
dataIndex: 'Path',
key: 'Path',
fixed: 'left',
width: 340,
},
{
title: '调用时间',
dataIndex: 'CallTime',
key: 'CallTime',
width: 160,
},
{
title: 'IP',
dataIndex: 'DownstreamRequest',
key: 'DownstreamRequest',
width: 120,
},
{
title: '返回状态',
dataIndex: 'Result',
key: 'Result',
render: record => {
let value = '';
switch (record.toString().charAt(0)) {
case '1':
value = '继续请求';
break;
case '2':
value = '请求成功';
break;
case '3':
value = '重定向';
break;
case '4':
value = '客户端错误';
break;
case '5':
value = '服务器错误';
break;
default:
break;
}
return value;
},
width: 80,
},
{
title: '错误信息',
......@@ -116,6 +97,7 @@ const ServiceLog = () => {
title: '请求方法',
dataIndex: 'Method',
key: 'Method',
width: 100,
},
{
title: '耗时/ms',
......@@ -132,7 +114,7 @@ const ServiceLog = () => {
dataIndex: 'ResponseSize',
key: 'ResponseSize',
fixed: 'right',
width: 150,
width: 140,
sortDirections: ['descend', 'ascend'],
sorter: (a, b) => a.ResponseSize - b.ResponseSize,
},
......@@ -366,7 +348,8 @@ const ServiceLog = () => {
bordered
columns={columns}
dataSource={dataTable}
scroll={{ x: 'max-content' }}
// scroll={{ x: 'max-content'}}
scroll={{ x: 'max-content', y: 'calc(100vh - 562px)' }}
pagination={{
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`,
......
......@@ -17,7 +17,7 @@
color:rgba(0,0,0,0.85);
}
.ant-table-content{
height:calc(100vh - 520px);
height:calc(100vh - 562px);
border-right: white;
overflow: auto !important;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment