feat: 添加@types/jest依赖并优化类型安全
refactor: 重构代码减少any类型使用,增加类型定义 fix: 修复TypeScript编译错误和类型不匹配问题 docs: 更新代码审查修复总结文档 style: 优化代码格式和注释 perf: 添加性能优化工具函数和虚拟滚动组件 test: 完善测试相关配置和类型定义 build: 更新package-lock.json文件
This commit is contained in:
@@ -158,8 +158,8 @@ export const MaterialUpload: React.FC = () => {
|
||||
type: file.type?.startsWith('image') ? 'image' :
|
||||
file.type?.startsWith('video') ? 'video' : 'document',
|
||||
size: file.size || 0,
|
||||
url: URL.createObjectURL(file as any),
|
||||
thumbnail: file.type?.startsWith('image') ? URL.createObjectURL(file as any) : undefined,
|
||||
url: URL.createObjectURL(file.originFileObj || file as Blob),
|
||||
thumbnail: file.type?.startsWith('image') ? URL.createObjectURL(file.originFileObj || file as Blob) : undefined,
|
||||
uploadedAt: new Date().toISOString(),
|
||||
uploadedBy: 'Current User',
|
||||
status: 'READY',
|
||||
@@ -210,7 +210,7 @@ export const MaterialUpload: React.FC = () => {
|
||||
dataIndex: 'thumbnail',
|
||||
key: 'thumbnail',
|
||||
width: 80,
|
||||
render: (_: any, record: MaterialFile) => (
|
||||
render: (_: unknown, record: MaterialFile) => (
|
||||
record.type === 'image' ? (
|
||||
<Image
|
||||
src={record.thumbnail}
|
||||
@@ -279,7 +279,7 @@ export const MaterialUpload: React.FC = () => {
|
||||
title: 'Actions',
|
||||
key: 'actions',
|
||||
width: 120,
|
||||
render: (_: any, record: MaterialFile) => (
|
||||
render: (_: unknown, record: MaterialFile) => (
|
||||
<Space>
|
||||
<Tooltip title="Preview">
|
||||
<Button type="text" icon={<EyeOutlined />} onClick={() => handlePreview(record)} />
|
||||
|
||||
Reference in New Issue
Block a user