fix(ui): 监控账号列表行 hover 反馈(主题 token)、强制同步按钮 loading(走查 P2-#7)
This commit is contained in:
@@ -2,11 +2,25 @@
|
||||
// 展示作者头像与粉丝/关注/作品/最近发布等账号画像属性(migration 038 字段 + work 聚合)。
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { history } from '@umijs/max';
|
||||
import { Alert, App, Avatar, Button, Card, Descriptions, Empty, Flex, Form, Listy, Modal, Popconfirm, Select, Space, Spin, Tag, Typography } from 'antd';
|
||||
import { Alert, App, Avatar, Button, Card, Descriptions, Empty, Flex, Form, Listy, Modal, Popconfirm, Select, Space, Spin, Tag, theme, Typography } from 'antd';
|
||||
import { CloudUploadOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||
import { getList, remove, creatorAction, creatorUpdate } from '@/services/api';
|
||||
import { conflictMessage, dateTime, platformLabel } from '@/utils/helpers';
|
||||
|
||||
const useRowHoverStyle = () => {
|
||||
const { token } = theme.useToken();
|
||||
return {
|
||||
padding: 16,
|
||||
borderBottom: `1px solid ${token.colorSplit}`,
|
||||
borderRadius: token.borderRadiusLG,
|
||||
cursor: 'pointer',
|
||||
transition: 'background-color 0.2s',
|
||||
['@media (hover: hover)']: {
|
||||
'&:hover': { backgroundColor: token.colorFillQuaternary },
|
||||
},
|
||||
} as const;
|
||||
};
|
||||
|
||||
interface CompetitorRow {
|
||||
id: string;
|
||||
platform: string;
|
||||
@@ -129,6 +143,8 @@ export default function MonitoringAccountList() {
|
||||
}
|
||||
}
|
||||
|
||||
const rowHoverStyle = useRowHoverStyle();
|
||||
|
||||
const syncMeta = syncStatusMeta[tagTarget?.sync_status ?? ''] || { label: tagTarget?.sync_status || '—' };
|
||||
|
||||
return (
|
||||
@@ -151,10 +167,7 @@ export default function MonitoringAccountList() {
|
||||
itemRender={(row) => {
|
||||
const meta = syncStatusMeta[row.sync_status ?? ''] || { label: row.sync_status || '—' };
|
||||
return (
|
||||
<div
|
||||
style={{ padding: '16px 0', borderBottom: '1px solid rgba(5,5,5,0.06)', cursor: 'pointer' }}
|
||||
onClick={() => history.push(`/accounts/monitoring/${row.id}`)}
|
||||
>
|
||||
<div style={rowHoverStyle} onClick={() => history.push(`/accounts/monitoring/${row.id}`)}>
|
||||
<Flex justify="space-between" align="flex-start" gap={16}>
|
||||
<Flex align="flex-start" gap={12}>
|
||||
<Avatar size={44} src={row.avatar_url || undefined}>
|
||||
@@ -178,7 +191,7 @@ export default function MonitoringAccountList() {
|
||||
<Button size="small" onClick={() => openTags(row)}>
|
||||
编辑标签
|
||||
</Button>
|
||||
<Button size="small" disabled={actionBusy === row.id} onClick={() => syncCompetitor(row)}>
|
||||
<Button size="small" loading={actionBusy === row.id} disabled={actionBusy === row.id} onClick={() => syncCompetitor(row)}>
|
||||
强制同步
|
||||
</Button>
|
||||
<Button size="small" disabled={actionBusy === row.id} onClick={() => toggleCompetitor(row)}>
|
||||
|
||||
Reference in New Issue
Block a user