diff --git a/video-gen-app/src/pages/MaterialListPage.tsx b/video-gen-app/src/pages/MaterialListPage.tsx index ee3ad011..e3a033c5 100644 --- a/video-gen-app/src/pages/MaterialListPage.tsx +++ b/video-gen-app/src/pages/MaterialListPage.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; -import { Button, Table, Tag, Input, Pagination, Typography, Select, App, Image } from 'antd'; -import { FolderOpenOutlined } from '@ant-design/icons'; +import { Button, Table, Tag, Input, Pagination, Typography, Select, App } from 'antd'; +import { FolderOpenOutlined, EyeOutlined } from '@ant-design/icons'; import { getResourcesMaterialList } from '../api'; // 格式化时间 2026-06-12T03:47:28.542988Z -> 2026-06-12 03:47:28 @@ -164,13 +164,20 @@ const MaterialListPage: React.FC = () => { { title: '预览', key: 'preview', - width: 80, + width: 100, render: (_: unknown, record: MaterialData) => { - if (record.resourceType == 'image') { - const imageUrl = record.resource?.resourceUrl ? buildUrl(record.resource.resourceUrl) : ''; - if (imageUrl) { - return ; - } + const url = record.resource?.resourceUrl || record.resource?.remoteUrl; + if (url) { + return ( + + ); } return -; }, @@ -179,34 +186,46 @@ const MaterialListPage: React.FC = () => { title: '文件名', dataIndex: ['resource', 'fileName'], key: 'fileName', - width: 200, + width: 160, ellipsis: true, render: (text: string) => {text || '-'}, }, { - title: '来源模型', - dataIndex: ['resource', 'sourceModel'], - key: 'sourceModel', - width: 120, + title: '文件大小', + dataIndex: ['resource', 'fileSizeBytes'], + key: 'fileSizeBytes', ellipsis: true, - render: (text: string) => {text || '-'}, - }, - { - title: '供应商', - dataIndex: ['resource', 'provider'], - key: 'provider', - width: 100, - ellipsis: true, - render: (text: string) => {text || '-'}, - }, - { - title: '模型名称', - dataIndex: ['resource', 'modelName'], - key: 'modelName', - width: 120, - ellipsis: true, - render: (text: string) => {text || '-'}, + render: (text: number) =>{ + return `${(text / 1024 / 1024).toFixed(2)} MB` + // return `${text} 字` + // return `${text} 字节` + } + }, + // { + // title: '来源模型', + // dataIndex: ['resource', 'sourceModel'], + // key: 'sourceModel', + // width: 120, + // ellipsis: true, + // render: (text: string) => {text || '-'}, + // }, + // { + // title: '供应商', + // dataIndex: ['resource', 'provider'], + // key: 'provider', + // width: 100, + // ellipsis: true, + // render: (text: string) => {text || '-'}, + // }, + // { + // title: '模型名称', + // dataIndex: ['resource', 'modelName'], + // key: 'modelName', + // width: 120, + // ellipsis: true, + // render: (text: string) => {text || '-'}, + // }, { title: '前测状态', dataIndex: 'status',