Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 66823d876d |
@@ -43,8 +43,6 @@ import type {
|
||||
import UserAdRevenueDrawer from './UserAdRevenueDrawer';
|
||||
|
||||
const { RangePicker } = DatePicker;
|
||||
const DEFAULT_PAGE_SIZE = 50;
|
||||
const ALL_FILTER_VALUE = '__all__';
|
||||
|
||||
// 广告类型标签
|
||||
const TYPE_TAG: Record<string, { color: string; label: string }> = {
|
||||
@@ -389,13 +387,13 @@ export default function AdRevenueReportPage() {
|
||||
const [scene, setScene] = useState<string | undefined>();
|
||||
const [granularity, setGranularity] = useState<'day' | 'hour'>('day');
|
||||
const [sortBy, setSortBy] = useState<'time' | 'ecpm'>('time'); // 明细排序:time=时间倒序 / ecpm=eCPM 倒序
|
||||
const [limit, setLimit] = useState<number>(DEFAULT_PAGE_SIZE);
|
||||
const [limit, setLimit] = useState<number>(1000); // 默认拉满接口单页上限,供单次流程广告数分位统计
|
||||
const [page, setPage] = useState<number>(1); // 当前页码(后端分页;1 起)
|
||||
const [queriedGranularity, setQueriedGranularity] = useState<'day' | 'hour'>('day'); // 本次结果对应的粒度,决定是否显示「小时」列
|
||||
const [queriedMultiDay, setQueriedMultiDay] = useState(false); // 本次结果是否跨多天,决定显示「日期」列 + 按天/按小时图
|
||||
const [data, setData] = useState<AdRevenueReport | null>(null);
|
||||
const [allFlowItems, setAllFlowItems] = useState<AdRevenueRow[]>([]);
|
||||
const [queriedLimit, setQueriedLimit] = useState<number>(DEFAULT_PAGE_SIZE);
|
||||
const [queriedLimit, setQueriedLimit] = useState<number>(1000);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [formulaOpen, setFormulaOpen] = useState(false);
|
||||
// 点用户手机号弹出的「用户广告收益详情」半屏抽屉(userId + 手机号;null=关闭)
|
||||
@@ -777,11 +775,12 @@ export default function AdRevenueReportPage() {
|
||||
<Space size={6}>
|
||||
<Typography.Text type="secondary">类型</Typography.Text>
|
||||
<Select
|
||||
value={adType ?? ALL_FILTER_VALUE}
|
||||
onChange={(value) => setAdType(value === ALL_FILTER_VALUE ? undefined : value)}
|
||||
placeholder="全部"
|
||||
value={adType}
|
||||
onChange={setAdType}
|
||||
allowClear
|
||||
style={{ width: 150 }}
|
||||
options={[
|
||||
{ value: ALL_FILTER_VALUE, label: '全部' },
|
||||
{ value: 'reward_video', label: '看视频' },
|
||||
{ value: 'draw', label: 'Draw 信息流' },
|
||||
{ value: 'withdrawal_video', label: '提现看视频' },
|
||||
@@ -791,11 +790,12 @@ export default function AdRevenueReportPage() {
|
||||
<Space size={6}>
|
||||
<Typography.Text type="secondary">场景</Typography.Text>
|
||||
<Select
|
||||
value={scene ?? ALL_FILTER_VALUE}
|
||||
onChange={(value) => setScene(value === ALL_FILTER_VALUE ? undefined : value)}
|
||||
placeholder="全部"
|
||||
value={scene}
|
||||
onChange={setScene}
|
||||
allowClear
|
||||
style={{ width: 130 }}
|
||||
options={[
|
||||
{ value: ALL_FILTER_VALUE, label: '全部' },
|
||||
{ value: 'comparison', label: '比价' },
|
||||
{ value: 'coupon', label: '领券' },
|
||||
{ value: 'welfare', label: '福利' },
|
||||
|
||||
@@ -91,6 +91,7 @@ const NAV_GROUPS: NavGroup[] = [
|
||||
{ key: '/users', icon: <UserOutlined />, label: '用户管理' },
|
||||
],
|
||||
},
|
||||
{ key: '/admins', icon: <TeamOutlined />, label: '权限管理' },
|
||||
{
|
||||
key: 'monitoring-audit',
|
||||
icon: <FileSearchOutlined />,
|
||||
@@ -103,7 +104,6 @@ const NAV_GROUPS: NavGroup[] = [
|
||||
{ key: '/audit-logs', icon: <FileSearchOutlined />, label: '审计日志' },
|
||||
],
|
||||
},
|
||||
{ key: '/admins', icon: <TeamOutlined />, label: '权限管理' },
|
||||
];
|
||||
|
||||
// 导航项 key(/dashboard)→ 权限页 key(dashboard),与后端 permissions.py 目录对齐
|
||||
@@ -223,8 +223,7 @@ export default function MainLayout({ children }: { children: React.ReactNode })
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
height: '100vh',
|
||||
overflowY: 'auto',
|
||||
overflowX: 'hidden',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
<nav className={`side-nav${collapsed ? ' side-nav-collapsed' : ''}`} aria-label="后台导航">
|
||||
@@ -314,8 +313,19 @@ export default function MainLayout({ children }: { children: React.ReactNode })
|
||||
.side-nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
gap: 4px;
|
||||
padding: 0 10px 14px;
|
||||
height: calc(100vh - 48px);
|
||||
min-height: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
padding: 0 10px 20px;
|
||||
scrollbar-gutter: stable;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.side-nav:focus-within {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
.nav-group {
|
||||
padding: 6px 0 8px;
|
||||
|
||||
Reference in New Issue
Block a user