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

fix: '优化空数据展示'

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