Commit 08d43429 authored by 皮倩雯's avatar 皮倩雯

fix: '日志管理优化'

parent 8af63e57
Pipeline #81950 passed with stages
......@@ -351,7 +351,7 @@ const HomePage = () => {
dateFrom: allTime[0].format('YYYY-MM-DD HH:mm:ss'),
dateTo: allTime[1].format('YYYY-MM-DD HH:mm:ss'),
info: '',
isSuccess: false,
state: -2,
}).then(res => {
setLoadingApi(false);
if (res.code === 0) {
......
......@@ -88,17 +88,23 @@ const LogCenter = () => {
let successState = '';
if (success) {
if (success === '成功') {
successState = true;
successState = 0;
} else if (success === '警告') {
successState = -1;
} else if (success === '失败') {
successState = false;
successState = -2;
} else if (success === '全部') {
successState = null;
}
} else {
if (selectState === '全部') {
successState = '';
successState = null;
} else if (selectState === '成功') {
successState = true;
successState = 0;
} else if (selectState === '警告') {
successState = -1;
} else if (selectState === '失败') {
successState = false;
successState = -2;
}
}
let newUrl = url ? url : requestUrl;
......@@ -114,7 +120,7 @@ const LogCenter = () => {
info: flag ? '' : newUrl,
methodType: 0,
sortFieldsAndDirection: `${filterSorter.current} ${timeSorter.current}`,
isSuccess: successState,
state: successState,
}).then(res => {
setLoading(false);
if (res.code === 0) {
......@@ -252,15 +258,17 @@ const LogCenter = () => {
},
{
title: '调用结果',
dataIndex: 'errorMsg',
key: 'errorMsg',
dataIndex: 'code',
key: 'code',
width: 100,
align: 'center',
render: record => {
if (record) {
if (record === -2) {
return <span style={{ color: 'red', fontWeight: 'bold' }}>失败</span>;
} else {
} else if (record === 0) {
return <span style={{ color: '#6ecd3d', fontWeight: 'bold' }}>成功</span>;
} else if (record === -1) {
return <span style={{ color: '#efd341', fontWeight: 'bold' }}>警告</span>;
}
},
},
......@@ -751,6 +759,7 @@ const LogCenter = () => {
<Select style={{ width: '180px' }} value={selectState} onSelect={e => changeSuccess(e)}>
<Option value="全部">全部</Option>
<Option value="成功">成功</Option>
<Option value="警告">警告</Option>
<Option value="失败">失败</Option>
</Select>
<span style={{ marginLeft: '20px' }}>接口名称:</span>
......
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