feat: 新增可拖拽账户列表组件,支持账户拖拽排序、显示余额、同步时间及预警状态。
This commit is contained in:
@@ -136,17 +136,17 @@
|
|||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
padding: 2px 8px;
|
padding: 4px 8px;
|
||||||
background: rgba(245, 158, 11, 0.15);
|
background: rgba(245, 158, 11, 0.15);
|
||||||
/* Amber-100 equivalent with opacity */
|
/* Amber-100 equivalent with opacity */
|
||||||
color: #d97706;
|
color: #D97706;
|
||||||
/* Amber-600 */
|
/* Amber-600 */
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
/* Slightly smaller for better fit */
|
/* Slightly smaller for better fit */
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
border-radius: 4px;
|
border-radius: 6px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
line-height: 1.4;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Account Meta */
|
/* Account Meta */
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ interface SortableAccountItemProps {
|
|||||||
* Format sync time to MM月DD日 HH:mm
|
* Format sync time to MM月DD日 HH:mm
|
||||||
*/
|
*/
|
||||||
const formatSyncTime = (syncTime?: string): string => {
|
const formatSyncTime = (syncTime?: string): string => {
|
||||||
if (!syncTime) return '未同步';
|
if (!syncTime) return '';
|
||||||
|
|
||||||
const date = new Date(syncTime);
|
const date = new Date(syncTime);
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
@@ -167,6 +167,7 @@ const SortableAccountItem: React.FC<SortableAccountItemProps> = ({
|
|||||||
<span className="draggable-account-item__name">{account.name}</span>
|
<span className="draggable-account-item__name">{account.name}</span>
|
||||||
{showWarning && (
|
{showWarning && (
|
||||||
<span className="draggable-account-item__warning-badge">
|
<span className="draggable-account-item__warning-badge">
|
||||||
|
<Icon icon="mdi:alert-circle-outline" width="12" />
|
||||||
预警
|
预警
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@@ -178,10 +179,12 @@ const SortableAccountItem: React.FC<SortableAccountItemProps> = ({
|
|||||||
ID: {account.accountCode}
|
ID: {account.accountCode}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<span className="draggable-account-item__sync">
|
{account.lastSyncTime && (
|
||||||
<Icon icon="mdi:sync" width="12" />
|
<span className="draggable-account-item__sync">
|
||||||
{formatSyncTime(account.lastSyncTime)}
|
<Icon icon="mdi:sync" width="12" />
|
||||||
</span>
|
{formatSyncTime(account.lastSyncTime)}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user