更新支付传参&首页接口&菜单栏导航后tab切换

This commit is contained in:
Eamon-meng
2025-06-25 14:43:44 +08:00
parent 7a34aac581
commit b19b01f82c
8 changed files with 155 additions and 64 deletions

View File

@@ -23,7 +23,16 @@ export default async function DashboardPage(props: DashboardPageProps) {
)
}
const initData = resp.data
// 添加模拟的 usage 数据(如果 API 返回的 usage 为 null
// if (!initData.usage) {
// initData.usage = [
// {time: new Date('2025-03-01'), count: 100, count2: 80},
// {time: new Date('2025-03-02'), count: 150, count2: 120},
// {time: new Date('2025-03-03'), count: 80, count2: 64},
// {time: new Date('2025-03-04'), count: 200, count2: 160},
// {time: new Date('2025-03-05'), count: 120, count2: 96},
// ]
// }
return (
<Page className={merge(
`flex-auto grid`,
@@ -52,7 +61,7 @@ export default async function DashboardPage(props: DashboardPageProps) {
)}
{/* 图表 */}
<div className="col-start-1 row-start-3 col-span-3 row-span-2 hidden md:block"><Charts/></div>
<div className="col-start-1 row-start-3 col-span-3 row-span-2 hidden md:block"><Charts initialData={initData.usage}/></div>
{/* 信息 */}
<div className=" md:col-start-4 md:row-start-1 md:row-span-2">