feat: 新增可拖拽账户列表组件,支持账户拖拽排序、显示余额、同步时间及预警状态。

This commit is contained in:
2026-01-28 20:33:13 +08:00
parent 46e5e9db00
commit 2d84f66bdc
2 changed files with 12 additions and 9 deletions

View File

@@ -136,17 +136,17 @@
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 8px;
padding: 4px 8px;
background: rgba(245, 158, 11, 0.15);
/* Amber-100 equivalent with opacity */
color: #d97706;
color: #D97706;
/* Amber-600 */
font-size: 11px;
/* Slightly smaller for better fit */
font-weight: 600;
border-radius: 4px;
border-radius: 6px;
flex-shrink: 0;
line-height: 1.4;
line-height: 1.2;
}
/* Account Meta */

View File

@@ -73,7 +73,7 @@ interface SortableAccountItemProps {
* Format sync time to MM月DD日 HH:mm
*/
const formatSyncTime = (syncTime?: string): string => {
if (!syncTime) return '未同步';
if (!syncTime) return '';
const date = new Date(syncTime);
const month = date.getMonth() + 1;
@@ -167,6 +167,7 @@ const SortableAccountItem: React.FC<SortableAccountItemProps> = ({
<span className="draggable-account-item__name">{account.name}</span>
{showWarning && (
<span className="draggable-account-item__warning-badge">
<Icon icon="mdi:alert-circle-outline" width="12" />
</span>
)}
@@ -178,10 +179,12 @@ const SortableAccountItem: React.FC<SortableAccountItemProps> = ({
ID: {account.accountCode}
</span>
)}
{account.lastSyncTime && (
<span className="draggable-account-item__sync">
<Icon icon="mdi:sync" width="12" />
{formatSyncTime(account.lastSyncTime)}
</span>
)}
</div>
</div>