feat(knowledgeBase): add media dataset support and improve file handling

- Add media dataset translations in English and Chinese locales
- Add "mediaDataSet" and "uploadMedia" i18n keys for UI labels
- Enable media dataset creation option in Private component by uncommenting menu item
- Import and display image icon for media dataset menu option
- Refactor file ID handling in CreateDataset to support both string and array types
- Improve fileIds initialization logic to handle mixed input types
- Update CreateImageDataset component to use file chunking workflow
- Add navigation to parameter settings step after file upload
- Pass file IDs to dataset creation flow for media processing
- Add message API and navigate hook for improved UX feedback
This commit is contained in:
yujiangping
2025-12-25 20:17:58 +08:00
parent 99c501f188
commit c00e164567
5 changed files with 115 additions and 35 deletions

View File

@@ -53,8 +53,8 @@ interface CreateDatasetLocationState {
knowledgeBaseId?: string;
parentId?: string;
startStep?: StepKey;
fileId?: string;
fileIds?: string[];
fileId?: string | string[];
fileIds?: string | string[];
}
const CreateDataset = () => {
@@ -67,7 +67,11 @@ const CreateDataset = () => {
const knowledgeBaseId = locationState.knowledgeBaseId || routeKnowledgeBaseId;
const parentId = locationState.parentId;
const initialStepKey = locationState.startStep ?? 'selectFile';
const initialFileIds = locationState.fileIds ?? (locationState.fileId ? [locationState.fileId] : []);
const initialFileIds = (() => {
const fileIds = locationState.fileIds || locationState.fileId;
if (!fileIds) return [];
return Array.isArray(fileIds) ? fileIds : [fileIds];
})();
const [current, setCurrent] = useState<number>(stepIndexMap[initialStepKey]);
const tableRef = useRef<TableRef>(null);