fix: 修复 TypeScript 编译错误
修复以下问题: - QuestionManagement.tsx: 修复 label 类型转换错误,使用 String() 确保类型安全 - UserDetail.tsx: 移除未使用的 Space 导入 - WrongQuestions.tsx: 显式声明 onChange 回调参数类型 - WrongQuestions.tsx: 使用空值合并运算符处理可能为 undefined 的值 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
344ccd7a44
commit
77bd709613
@ -439,7 +439,7 @@ const QuestionManagement: React.FC = () => {
|
||||
allowClear
|
||||
showSearch
|
||||
filterOption={(input, option) =>
|
||||
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
||||
String(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
@ -4,7 +4,6 @@ import {
|
||||
Card,
|
||||
Button,
|
||||
Typography,
|
||||
Space,
|
||||
message,
|
||||
Tag,
|
||||
Row,
|
||||
|
||||
@ -239,7 +239,7 @@ const WrongQuestions: React.FC = () => {
|
||||
placeholder="排序方式"
|
||||
style={{ width: 140 }}
|
||||
defaultValue="time"
|
||||
onChange={(value) => setFilter({ ...filter, sort: value })}
|
||||
onChange={(value: 'time' | 'wrong_count' | 'mastery_level') => setFilter({ ...filter, sort: value })}
|
||||
>
|
||||
<Option value="time">按时间排序</Option>
|
||||
<Option value="wrong_count">按错误次数</Option>
|
||||
@ -251,7 +251,7 @@ const WrongQuestions: React.FC = () => {
|
||||
type="primary"
|
||||
icon={<PlayCircleOutlined />}
|
||||
onClick={handlePractice}
|
||||
disabled={!wrongQuestions.length || (stats?.total_wrong === stats?.mastered && stats?.total_wrong > 0)}
|
||||
disabled={!wrongQuestions.length || (stats?.total_wrong === stats?.mastered && (stats?.total_wrong ?? 0) > 0)}
|
||||
className={styles.primaryButton}
|
||||
>
|
||||
开始练习
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user