diff --git a/apps/desktop/src/components/MaterialSegmentView.tsx b/apps/desktop/src/components/MaterialSegmentView.tsx index 484b39f..b08c8a1 100644 --- a/apps/desktop/src/components/MaterialSegmentView.tsx +++ b/apps/desktop/src/components/MaterialSegmentView.tsx @@ -1,15 +1,10 @@ import React, { useEffect, useState, useMemo } from 'react'; import { - Search, Filter, - Clock, Tag, Users, - Play, - Image, Video, RefreshCw, - MoreHorizontal, Eye, Edit, Trash2 @@ -31,7 +26,9 @@ interface SegmentWithDetails { duration: number; file_path: string; }; - classification_info?: { + material_name: string; + material_type: string; + classification?: { category: string; confidence: number; reasoning: string; @@ -39,19 +36,11 @@ interface SegmentWithDetails { product_match: boolean; quality_score: number; }; - model_info?: { + model?: { id: string; name: string; model_type: string; }; - material_info: { - id: string; - name: string; - file_type: string; - file_size: number; - duration: number; - thumbnail_path?: string; - }; } interface ClassificationGroup { @@ -183,14 +172,14 @@ export const MaterialSegmentView: React.FC = ({ projec // 应用分类过滤 if (selectedClassification !== '全部') { segments = segments.filter(segment => - segment.classification_info?.category === selectedClassification + segment.classification?.category === selectedClassification ); } // 应用模特过滤 if (selectedModel !== '全部') { segments = segments.filter(segment => - segment.model_info?.name === selectedModel + segment.model?.name === selectedModel ); } @@ -198,9 +187,9 @@ export const MaterialSegmentView: React.FC = ({ projec if (searchTerm.trim()) { const searchLower = searchTerm.toLowerCase(); segments = segments.filter(segment => - segment.material_info.name.toLowerCase().includes(searchLower) || - segment.classification_info?.category?.toLowerCase().includes(searchLower) || - segment.model_info?.name?.toLowerCase().includes(searchLower) + segment.material_name.toLowerCase().includes(searchLower) || + segment.classification?.category?.toLowerCase().includes(searchLower) || + segment.model?.name?.toLowerCase().includes(searchLower) ); } @@ -210,7 +199,7 @@ export const MaterialSegmentView: React.FC = ({ projec // 渲染片段卡片 const renderSegmentCard = (segment: SegmentWithDetails) => { // 安全检查 - if (!segment || !segment.segment || !segment.material_info) { + if (!segment || !segment.segment || !segment.material_name) { return null; } @@ -219,15 +208,7 @@ export const MaterialSegmentView: React.FC = ({ projec
{/* 缩略图 */}
- {segment.material_info?.thumbnail_path ? ( - 缩略图 - ) : ( -
{/* 内容信息 */} @@ -235,7 +216,7 @@ export const MaterialSegmentView: React.FC = ({ projec

- {segment.material_info?.name || '未知素材'} + {segment.material_name || '未知素材'}

{formatDuration(segment.segment.start_time)} - {formatDuration(segment.segment.end_time)} @@ -259,23 +240,23 @@ export const MaterialSegmentView: React.FC = ({ projec {/* 标签信息 */}

- {segment.classification_info && ( + {segment.classification && ( - {segment.classification_info.category} + {segment.classification.category} )} - - {segment.model_info && ( + + {segment.model && ( - {segment.model_info.name} + {segment.model.name} )} - - {segment.classification_info?.confidence && ( + + {segment.classification?.confidence && ( - 置信度: {Math.round(segment.classification_info.confidence * 100)}% + 置信度: {Math.round(segment.classification.confidence * 100)}% )}