|
@ -5,30 +5,30 @@ import './style.less'; |
|
|
import { ApiTable, useFsRequest } from '$utils'; |
|
|
import { ApiTable, useFsRequest } from '$utils'; |
|
|
function HotspotData(props) { |
|
|
function HotspotData(props) { |
|
|
|
|
|
|
|
|
const { data: restfulInfo = {} } = useFsRequest({ |
|
|
const { data: restfulInfo = [] } = useFsRequest({ |
|
|
url: 'homepage/restful/info', |
|
|
url: 'resource/count', |
|
|
pollingInterval: 1000 * 60, |
|
|
pollingInterval: 1000 * 60, |
|
|
cacheKey: 'restfulInfo', |
|
|
// cacheKey: 'restfulInfo',
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const top3 = restfulInfo?.top3 |
|
|
const top3 = restfulInfo?.sort((a, b) => b.count - a.count)?.slice(0, 3) |
|
|
return <Box title={"热点数据"} bodyPaddingTop={25} > |
|
|
return <Box title={"热点数据"} bodyPaddingTop={25} > |
|
|
{top3?.length > 0 ? |
|
|
{top3?.length > 0 ? |
|
|
<div className='hotspot_data_container'> |
|
|
<div className='hotspot_data_container'> |
|
|
<div className='_img'></div> |
|
|
<div className='_img'></div> |
|
|
<div className='_top1'> |
|
|
<div className='_top1'> |
|
|
<span className='hotspot_title' title={top3[0].name}>{top3[0].name?.length > 8 ? top3[0].name.substring(0, 8) + '...' : top3[0].name}</span> |
|
|
<span className='hotspot_title' title={top3[0].name}>{top3[0].name?.length > 6 ? top3[0].name.substring(0, 6) + '...' : top3[0].name}</span> |
|
|
<div className='hotspot_data_number'>{top3[0].count}</div> |
|
|
<div className='hotspot_data_number'>{top3[0].count}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div className='_top2'> |
|
|
<div className='_top2'> |
|
|
{top3?.length > 2 && <> |
|
|
{top3?.length > 2 && <> |
|
|
<span className='hotspot_title' title={top3[2].name}>{top3[2].name?.length > 8 ? top3[2].name.substring(0, 8) + '...' : top3[2].name}</span> |
|
|
<span className='hotspot_title' title={top3[2].name}>{top3[2].name?.length > 6 ? top3[2].name.substring(0, 6) + '...' : top3[2].name}</span> |
|
|
<div className='hotspot_data_number'>{top3[2].count}</div> |
|
|
<div className='hotspot_data_number'>{top3[2].count}</div> |
|
|
</>} |
|
|
</>} |
|
|
</div> |
|
|
</div> |
|
|
<div className='_top3'> |
|
|
<div className='_top3'> |
|
|
{top3?.length > 1 && <> |
|
|
{top3?.length > 1 && <> |
|
|
<span className='hotspot_title' title={top3[1].name}>{top3[1].name?.length > 8 ? top3[1].name.substring(0, 8) + '...' : top3[1].name}</span> |
|
|
<span className='hotspot_title' title={top3[1].name}>{top3[1].name?.length > 6 ? top3[1].name.substring(0, 6) + '...' : top3[1].name}</span> |
|
|
<div className='hotspot_data_number'>{top3[1].count}</div> |
|
|
<div className='hotspot_data_number'>{top3[1].count}</div> |
|
|
</>} |
|
|
</>} |
|
|
</div> |
|
|
</div> |
|
|