From c2f9c376d0bccd126ee68dc42972cdc8e88572e3 Mon Sep 17 00:00:00 2001 From: wangdl Date: Mon, 15 Jun 2026 21:50:47 +0800 Subject: [PATCH] fix: resolve all TypeScript build errors in admin - 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 --- src/pages/learning/DataPages.tsx | 16 ++++++++-------- src/pages/learning/ReplayPage.tsx | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pages/learning/DataPages.tsx b/src/pages/learning/DataPages.tsx index 5e17dc1..f41310e 100644 --- a/src/pages/learning/DataPages.tsx +++ b/src/pages/learning/DataPages.tsx @@ -70,7 +70,7 @@ export function ReadingEventPage() { ({ onClick: () => setDetailId(record.eventId), style: { cursor: 'pointer' } })} /> + onRow={(record: any) => ({ onClick: () => setDetailId(record.eventId), style: { cursor: 'pointer' } })} /> setDetailId(null)} width={640} loading={detailLoading}> {detail && ( @@ -144,7 +144,7 @@ export function SessionPage() {
({ onClick: () => setDetailId(r.id), style: { cursor: 'pointer' } })} /> + onRow={(r: any) => ({ onClick: () => setDetailId(r.id), style: { cursor: 'pointer' } })} /> setDetailId(null)} width={680} loading={detailLoading}> {detail && ( @@ -215,7 +215,7 @@ export function ProgressPage() {
({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} /> + onRow={(r: any) => ({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} /> setDetail(null)} width={600}> {detail && ( @@ -283,7 +283,7 @@ export function DailyActivityPage() {
({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} /> + onRow={(r: any) => ({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} /> setDetail(null)} width={520}> {detail && ( @@ -334,7 +334,7 @@ export function RecordPage() {
({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} /> + onRow={(r: any) => ({ onClick: () => setDetail(r), style: { cursor: 'pointer' } })} /> setDetail(null)} width={500}> {detail && ( @@ -397,15 +397,15 @@ export function AnomalyPage() { { key: 'failed', label: 失败事件 {data?.total || 0}, children:
({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> }, + onRow={(r: any) => ({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> }, { key: 'warning', label: 警告事件 {data?.total || 0}, children:
({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> }, + onRow={(r: any) => ({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> }, { key: 'duplicate', label: 重复事件 {data?.total || 0}, children:
({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> }, + onRow={(r: any) => ({ onClick: () => setDetailId(r.eventId), style: { cursor: 'pointer' } })} /> }, ]} /> setDetailId(null)} width={640} loading={detailLoading}> diff --git a/src/pages/learning/ReplayPage.tsx b/src/pages/learning/ReplayPage.tsx index 05f35a4..a6c1b08 100644 --- a/src/pages/learning/ReplayPage.tsx +++ b/src/pages/learning/ReplayPage.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { Card, Input, Button, Space, message, Modal, Form, DatePicker, Select, Descriptions, Alert, Tag } from 'antd'; import { ThunderboltOutlined, WarningOutlined } from '@ant-design/icons'; import { useMutation } from '@tanstack/react-query'; -import dayjs from 'dayjs'; + import { learningAdminAPI } from '../../services/learningAdmin'; const { RangePicker } = DatePicker;