@@ -3,7 +3,9 @@ import { useQuery } from '@tanstack/react-query';
33import {
44 MonitorOutlined ,
55 BookOutlined ,
6- SettingOutlined
6+ SettingOutlined ,
7+ ClockCircleOutlined ,
8+ RightOutlined
79} from '@ant-design/icons' ;
810import type { RecentVisit } from '../../mockData' ;
911
@@ -17,19 +19,22 @@ const fetchRecentVisitsData = async (): Promise<RecentVisit[]> => {
1719 icon : React . createElement ( MonitorOutlined , { className : "text-blue-500" } ) ,
1820 title : '流程监控' ,
1921 description : '实时监控页面' ,
20- link : '/workflow/monitor'
22+ link : '/workflow/monitor' ,
23+ visitTime : '2分钟前'
2124 } ,
2225 {
2326 icon : React . createElement ( BookOutlined , { className : "text-green-500" } ) ,
2427 title : '流程模板库' ,
2528 description : '模板管理页面' ,
26- link : '/workflow/templates'
29+ link : '/workflow/templates' ,
30+ visitTime : '15分钟前'
2731 } ,
2832 {
2933 icon : React . createElement ( SettingOutlined , { className : "text-orange-500" } ) ,
3034 title : '节点管理' ,
3135 description : '节点配置页面' ,
32- link : '/workflow/nodes'
36+ link : '/workflow/nodes' ,
37+ visitTime : '1小时前'
3338 }
3439 ] ;
3540} ;
@@ -43,10 +48,10 @@ export const RecentVisits: React.FC = () => {
4348
4449 if ( isLoading ) {
4550 return (
46- < div className = "space-y-3 " >
51+ < div className = "space-y-4 " >
4752 { [ 1 , 2 , 3 ] . map ( ( index ) => (
4853 < div key = { index } className = "animate-pulse" >
49- < div className = "h-16 bg-gray-200 rounded-lg " > </ div >
54+ < div className = "h-20 bg-gray-200 rounded-xl " > </ div >
5055 </ div >
5156 ) ) }
5257 </ div >
@@ -55,26 +60,60 @@ export const RecentVisits: React.FC = () => {
5560
5661 if ( ! recentVisits || recentVisits . length === 0 ) {
5762 return (
58- < div className = "text-center py-8 text-gray-500" >
59- 暂无最近访问数据
63+ < div className = "text-center py-12 text-gray-500" >
64+ < div className = "text-4xl mb-3" > 📋</ div >
65+ < div className = "text-sm" > 暂无最近访问数据</ div >
6066 </ div >
6167 ) ;
6268 }
6369
6470 return (
65- < div className = "space-y-3 " >
71+ < div className = "space-y-4 " >
6672 { recentVisits . map ( ( item , index ) => (
6773 < div
6874 key = { `recent-${ item . title } -${ index } ` }
69- className = "flex items-center p-3 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors duration-200 "
75+ className = "group relative overflow-hidden rounded-xl border border-gray-200 bg-white hover:border-blue-300 hover:shadow-lg transition-all duration-300 cursor-pointer "
7076 >
71- < div className = "text-lg mr-3" >
72- { item . icon }
73- </ div >
74- < div className = "flex-1" >
75- < div className = "font-medium text-gray-800 text-sm" > { item . title } </ div >
76- < div className = "text-xs text-gray-500" > { item . description } </ div >
77+ { /* 左侧渐变装饰条 */ }
78+ < div className = "absolute left-0 top-0 bottom-0 w-1 bg-gradient-to-b from-blue-400 via-purple-400 to-pink-400 opacity-0 group-hover:opacity-100 transition-opacity duration-300" > </ div >
79+
80+ { /* 主要内容 */ }
81+ < div className = "flex items-center p-4 relative" >
82+ { /* 图标容器 */ }
83+ < div className = "relative mr-4" >
84+ < div className = "w-12 h-12 rounded-xl bg-gradient-to-br from-blue-50 to-blue-100 flex items-center justify-center group-hover:from-blue-100 group-hover:to-blue-200 transition-all duration-300" >
85+ < div className = "text-xl" >
86+ { item . icon }
87+ </ div >
88+ </ div >
89+ { /* 访问时间指示器 */ }
90+ < div className = "absolute -top-1 -right-1 w-5 h-5 bg-blue-500 rounded-full flex items-center justify-center" >
91+ < ClockCircleOutlined className = "text-white text-xs" />
92+ </ div >
93+ </ div >
94+
95+ { /* 内容区域 */ }
96+ < div className = "flex-1 min-w-0" >
97+ < div className = "flex items-center justify-between mb-2" >
98+ < h3 className = "font-semibold text-gray-800 text-base group-hover:text-blue-600 transition-colors duration-200 truncate" >
99+ { item . title }
100+ </ h3 >
101+ < div className = "opacity-0 group-hover:opacity-100 transition-opacity duration-300" >
102+ < RightOutlined className = "text-blue-400 text-sm" />
103+ </ div >
104+ </ div >
105+ < p className = "text-sm text-gray-600 mb-2 leading-relaxed" >
106+ { item . description }
107+ </ p >
108+ < div className = "flex items-center text-xs text-gray-400" >
109+ < ClockCircleOutlined className = "mr-1" />
110+ < span > { item . visitTime || '刚刚' } </ span >
111+ </ div >
112+ </ div >
77113 </ div >
114+
115+ { /* 悬停时的背景光效 */ }
116+ < div className = "absolute inset-0 bg-gradient-to-r from-blue-50/30 to-purple-50/30 opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none" > </ div >
78117 </ div >
79118 ) ) }
80119 </ div >
0 commit comments