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

fix: '日志管理优化'

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