Commit e9e4fe05 authored by 皮倩雯's avatar 皮倩雯

fix: '优化空数据展示'

parent 81646cbf
Pipeline #78678 passed with stages
...@@ -93,6 +93,7 @@ const HomePage = () => { ...@@ -93,6 +93,7 @@ const HomePage = () => {
moment(new Date(), 'YYYY-MM-DD HH:mm:ss'), moment(new Date(), 'YYYY-MM-DD HH:mm:ss'),
]); ]);
const [activeKey, setActiveKey] = useState('1'); const [activeKey, setActiveKey] = useState('1');
const [title, setTitle] = useState('最近10条异常API');
useEffect(() => { useEffect(() => {
setLoading(true); setLoading(true);
...@@ -102,6 +103,7 @@ const HomePage = () => { ...@@ -102,6 +103,7 @@ const HomePage = () => {
} else { } else {
setShow(false); setShow(false);
} }
getDataBaseConfig();
getOMSDashboard(); getOMSDashboard();
newGetSolution(); newGetSolution();
getSiteCode(); getSiteCode();
...@@ -112,7 +114,6 @@ const HomePage = () => { ...@@ -112,7 +114,6 @@ const HomePage = () => {
onGetProduct(); onGetProduct();
getLimits(); getLimits();
getMapLayer(); getMapLayer();
getDataBaseConfig();
getApiCount(); getApiCount();
}, [flag]); }, [flag]);
...@@ -277,7 +278,7 @@ const HomePage = () => { ...@@ -277,7 +278,7 @@ const HomePage = () => {
}); });
} }
} else { } else {
setState(''); setState(false);
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 15, duration: 15,
...@@ -820,6 +821,13 @@ const HomePage = () => { ...@@ -820,6 +821,13 @@ const HomePage = () => {
const onChange = e => { const onChange = e => {
setActiveKey(e); setActiveKey(e);
if (e === '1') {
setTitle('最近10条异常API');
} else if (e === '2') {
setTitle('耗时排名前10的API');
} else if (e === '3') {
setTitle('调用频次前10的API');
}
}; };
return ( return (
...@@ -1065,6 +1073,7 @@ const HomePage = () => { ...@@ -1065,6 +1073,7 @@ const HomePage = () => {
</div> </div>
</div> </div>
<div className={styles.content}> <div className={styles.content}>
{!dashboardData.用户登录统计 && <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />}
<ReactEcharts style={{ width: '100%', height: '100%' }} option={option} /> <ReactEcharts style={{ width: '100%', height: '100%' }} option={option} />
</div> </div>
</Spin> </Spin>
...@@ -1121,6 +1130,9 @@ const HomePage = () => { ...@@ -1121,6 +1130,9 @@ const HomePage = () => {
</div> </div>
</div> </div>
)} )}
{!dashboardData.异常登录 && state === '' && (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
{dashboardData.异常登录 === 0 && dashboardData.消息数量 === 0 && state && ( {dashboardData.异常登录 === 0 && dashboardData.消息数量 === 0 && state && (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)} )}
...@@ -1134,7 +1146,7 @@ const HomePage = () => { ...@@ -1134,7 +1146,7 @@ const HomePage = () => {
<div className={styles.title}> <div className={styles.title}>
<div className={styles.titleLeft}> <div className={styles.titleLeft}>
<div className={styles.icon} /> <div className={styles.icon} />
<span className={styles.text}>API调用日志(最近10条</span> <span className={styles.text}>API调用日志({title}</span>
</div> </div>
<div className={styles.linkIcon}> <div className={styles.linkIcon}>
<span onClick={() => toLogCenter()} style={{ cursor: 'pointer' }}> <span onClick={() => toLogCenter()} style={{ cursor: 'pointer' }}>
...@@ -1149,7 +1161,7 @@ const HomePage = () => { ...@@ -1149,7 +1161,7 @@ const HomePage = () => {
tabPosition="left" tabPosition="left"
style={{ height: '100%' }} style={{ height: '100%' }}
> >
<TabPane tab="错误API" key="1"> <TabPane tab="异常API" key="1">
<Table <Table
size="small" size="small"
bordered bordered
......
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