fix: resolve all TypeScript build errors in admin
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 11s

- DataPages.tsx: add any type annotation to all onRow callbacks
  (ReadingEvent/Session/Anomaly/Record/Progress)
- ReplayPage.tsx: remove unused dayjs import

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-06-15 21:50:47 +08:00
parent 42c3a604ab
commit c2f9c376d0
2 changed files with 9 additions and 9 deletions

View File

@ -70,7 +70,7 @@ export function ReadingEventPage() {
</Space> </Space>
<Table rowKey="eventId" columns={columns} dataSource={data?.items || []} <Table rowKey="eventId" columns={columns} dataSource={data?.items || []}
loading={isLoading} pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small" loading={isLoading} pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small"
onRow={(record) => ({ onClick: () => setDetailId(record.eventId), style: { cursor: 'pointer' } })} /> onRow={(record: any) => ({ onClick: () => setDetailId(record.eventId), style: { cursor: 'pointer' } })} />
<Drawer title="事件详情" open={!!detailId} onClose={() => setDetailId(null)} width={640} loading={detailLoading}> <Drawer title="事件详情" open={!!detailId} onClose={() => setDetailId(null)} width={640} loading={detailLoading}>
{detail && ( {detail && (
@ -144,7 +144,7 @@ export function SessionPage() {
</Space> </Space>
<Table rowKey="id" columns={columns} dataSource={data?.items || []} scroll={{ x: 1200 }} <Table rowKey="id" columns={columns} dataSource={data?.items || []} scroll={{ x: 1200 }}
loading={isLoading} pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small" loading={isLoading} pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small"
onRow={(r) => ({ onClick: () => setDetailId(r.id), style: { cursor: 'pointer' } })} /> onRow={(r: any) => ({ onClick: () => setDetailId(r.id), style: { cursor: 'pointer' } })} />
<Drawer title="会话详情" open={!!detailId} onClose={() => setDetailId(null)} width={680} loading={detailLoading}> <Drawer title="会话详情" open={!!detailId} onClose={() => setDetailId(null)} width={680} loading={detailLoading}>
{detail && ( {detail && (
@ -215,7 +215,7 @@ export function ProgressPage() {
</Space> </Space>
<Table rowKey="id" columns={columns} dataSource={data?.items || []} scroll={{ x: 1000 }} <Table rowKey="id" columns={columns} dataSource={data?.items || []} scroll={{ x: 1000 }}
loading={isLoading} pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small" loading={isLoading} pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small"
onRow={(r) => ({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} /> onRow={(r: any) => ({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} />
<Drawer title="进度详情" open={!!detail} onClose={() => setDetail(null)} width={600}> <Drawer title="进度详情" open={!!detail} onClose={() => setDetail(null)} width={600}>
{detail && ( {detail && (
@ -283,7 +283,7 @@ export function DailyActivityPage() {
</Space> </Space>
<Table rowKey="id" columns={columns} dataSource={data?.items || []} scroll={{ x: 750 }} <Table rowKey="id" columns={columns} dataSource={data?.items || []} scroll={{ x: 750 }}
loading={isLoading} pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small" loading={isLoading} pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small"
onRow={(r) => ({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} /> onRow={(r: any) => ({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} />
<Drawer title="活动详情" open={!!detail} onClose={() => setDetail(null)} width={520}> <Drawer title="活动详情" open={!!detail} onClose={() => setDetail(null)} width={520}>
{detail && ( {detail && (
@ -334,7 +334,7 @@ export function RecordPage() {
</Space> </Space>
<Table rowKey="id" columns={columns} dataSource={data?.items || []} scroll={{ x: 700 }} <Table rowKey="id" columns={columns} dataSource={data?.items || []} scroll={{ x: 700 }}
loading={isLoading} pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small" loading={isLoading} pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small"
onRow={(r) => ({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} /> onRow={(r: any) => ({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} />
<Drawer title="记录详情" open={!!detail} onClose={() => setDetail(null)} width={500}> <Drawer title="记录详情" open={!!detail} onClose={() => setDetail(null)} width={500}>
{detail && ( {detail && (
@ -397,15 +397,15 @@ export function AnomalyPage() {
{ key: 'failed', label: <span> <Tag color="red">{data?.total || 0}</Tag></span>, { key: 'failed', label: <span> <Tag color="red">{data?.total || 0}</Tag></span>,
children: <Table rowKey="eventId" columns={columns} dataSource={data?.items || []} loading={isLoading} children: <Table rowKey="eventId" columns={columns} dataSource={data?.items || []} loading={isLoading}
pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small" pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small"
onRow={(r) => ({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> }, onRow={(r: any) => ({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> },
{ key: 'warning', label: <span> <Tag color="orange">{data?.total || 0}</Tag></span>, { key: 'warning', label: <span> <Tag color="orange">{data?.total || 0}</Tag></span>,
children: <Table rowKey="eventId" columns={columns} dataSource={data?.items || []} loading={isLoading} children: <Table rowKey="eventId" columns={columns} dataSource={data?.items || []} loading={isLoading}
pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small" pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small"
onRow={(r) => ({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> }, onRow={(r: any) => ({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> },
{ key: 'duplicate', label: <span> <Tag color="blue">{data?.total || 0}</Tag></span>, { key: 'duplicate', label: <span> <Tag color="blue">{data?.total || 0}</Tag></span>,
children: <Table rowKey="eventId" columns={columns} dataSource={data?.items || []} loading={isLoading} children: <Table rowKey="eventId" columns={columns} dataSource={data?.items || []} loading={isLoading}
pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small" pagination={{ current: page, total: data?.total || 0, onChange: setPage }} size="small"
onRow={(r) => ({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> }, onRow={(r: any) => ({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> },
]} /> ]} />
<Drawer title="事件详情" open={!!detailId} onClose={() => setDetailId(null)} width={640} loading={detailLoading}> <Drawer title="事件详情" open={!!detailId} onClose={() => setDetailId(null)} width={640} loading={detailLoading}>

View File

@ -2,7 +2,7 @@ import { useState } from 'react';
import { Card, Input, Button, Space, message, Modal, Form, DatePicker, Select, Descriptions, Alert, Tag } from 'antd'; import { Card, Input, Button, Space, message, Modal, Form, DatePicker, Select, Descriptions, Alert, Tag } from 'antd';
import { ThunderboltOutlined, WarningOutlined } from '@ant-design/icons'; import { ThunderboltOutlined, WarningOutlined } from '@ant-design/icons';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import dayjs from 'dayjs';
import { learningAdminAPI } from '../../services/learningAdmin'; import { learningAdminAPI } from '../../services/learningAdmin';
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;