feat: 添加数据任务 mock 数据
This commit is contained in:
@@ -99,12 +99,16 @@ export const mockLocalModels = {
|
||||
|
||||
// ============ 数据集 ============
|
||||
export const mockDatasets: DatasetItem[] = [
|
||||
{ id: 1, name: '金融问答-训练集', type: 'train', storage_type: 'local', size: '128 MB', count: 8560, description: '金融领域问答对', create_time: '2025-12-20T08:00:00Z' },
|
||||
{ id: 2, name: '法律文书-训练集', type: 'train', storage_type: 'local', size: '256 MB', count: 15230, description: '法律文书数据集', create_time: '2025-12-25T10:30:00Z' },
|
||||
{ id: 3, name: '客服对话-训练集', type: 'train', storage_type: 'minio', size: '512 MB', count: 24500, description: '客服对话记录', create_time: '2026-01-05T14:20:00Z' },
|
||||
{ id: 4, name: '金融评测集', type: 'eval', storage_type: 'local', size: '32 MB', count: 1200, description: '金融领域评测', create_time: '2026-01-10T09:15:00Z' },
|
||||
{ id: 5, name: '通用能力评测', type: 'eval', storage_type: 'local', size: '64 MB', count: 3500, description: '通用能力评测数据集', create_time: '2026-01-12T11:30:00Z' },
|
||||
{ id: 6, name: '医疗问答-训练集', type: 'train', storage_type: 'local', size: '180 MB', count: 9800, description: '医疗问答对', create_time: '2026-02-01T15:00:00Z' },
|
||||
{ id: 1, name: '金融问答-训练集', type: 'train', storage_type: 'local', source: 'upload', size: '128 MB', count: 8560, description: '金融领域问答对', create_time: '2025-12-20T08:00:00Z' },
|
||||
{ id: 2, name: '法律文书-训练集', type: 'train', storage_type: 'local', source: 'upload', size: '256 MB', count: 15230, description: '法律文书数据集', create_time: '2025-12-25T10:30:00Z' },
|
||||
{ id: 3, name: '客服对话-训练集', type: 'train', storage_type: 'minio', source: 'upload', size: '512 MB', count: 24500, description: '客服对话记录', create_time: '2026-01-05T14:20:00Z' },
|
||||
{ id: 4, name: '金融评测集', type: 'eval', storage_type: 'local', source: 'upload', size: '32 MB', count: 1200, description: '金融领域评测', create_time: '2026-01-10T09:15:00Z' },
|
||||
{ id: 5, name: '通用能力评测', type: 'eval', storage_type: 'local', source: 'upload', size: '64 MB', count: 3500, description: '通用能力评测数据集', create_time: '2026-01-12T11:30:00Z' },
|
||||
{ id: 6, name: '医疗问答-训练集', type: 'train', storage_type: 'local', source: 'upload', size: '180 MB', count: 9800, description: '医疗问答对', create_time: '2026-02-01T15:00:00Z' },
|
||||
{ id: 7, name: '客服对话清洗集', type: 'train', storage_type: 'minio', source: 'task', size: '96 MB', count: 18240, description: '由客服问答数据清洗任务生成', create_time: '2026-07-08T06:28:00Z' },
|
||||
{ id: 8, name: '通用指令构造集', type: 'train', storage_type: 'local', source: 'task', size: '148 MB', count: 12600, description: '由指令微调数据构造任务生成', create_time: '2026-07-09T01:42:00Z' },
|
||||
{ id: 9, name: '用户反馈脱敏集', type: 'test', storage_type: 'minio', source: 'task', size: '72 MB', count: 9340, description: '由敏感信息脱敏任务生成', create_time: '2026-07-09T09:18:00Z' },
|
||||
{ id: 10, name: '多轮对话增强集', type: 'eval', storage_type: 'local', source: 'task', size: '41 MB', count: 2780, description: '由多轮对话拼接任务生成', create_time: '2026-07-10T02:06:00Z' },
|
||||
]
|
||||
|
||||
// ============ 训练任务 ============
|
||||
|
||||
@@ -57,6 +57,7 @@ export interface ModelForm {
|
||||
// ============ 数据集 ============
|
||||
export type DatasetType = 'train' | 'test' | 'eval' | 'val' | 'other'
|
||||
export type DatasetStorage = 'local' | 'cloud' | 'minio'
|
||||
export type DatasetSource = 'upload' | 'task'
|
||||
|
||||
export interface DatasetFile {
|
||||
id?: string
|
||||
@@ -70,6 +71,7 @@ export interface DatasetItem {
|
||||
name: string
|
||||
type: DatasetType | string
|
||||
storage_type: DatasetStorage | string
|
||||
source?: DatasetSource
|
||||
size?: string | number
|
||||
count?: number
|
||||
description?: string
|
||||
|
||||
@@ -5,21 +5,20 @@ import { ElMessage } from 'element-plus'
|
||||
import DataTablePage from '@/components/DataTablePage.vue'
|
||||
import { getDatasetList, deleteDataset, downloadDatasetUrl } from '@/api/modules/dataset'
|
||||
import { DATASET_TYPE_MAP, STORAGE_MAP } from '@/constants'
|
||||
import type { DatasetItem } from '@/types'
|
||||
import type { DatasetItem, DatasetSource } from '@/types'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const loading = ref(false)
|
||||
const dataList = ref<DatasetItem[]>([])
|
||||
const activeTab = ref('upload')
|
||||
const activeTab = ref<DatasetSource>('upload')
|
||||
|
||||
const filteredDataList = computed(() => {
|
||||
if (activeTab.value === 'upload') {
|
||||
return dataList.value
|
||||
} else {
|
||||
// 假设数据任务产生的数据集可以通过某个字段区分,目前 mock 数据没有该字段,所以暂为空
|
||||
return []
|
||||
if (activeTab.value === 'task') {
|
||||
return dataList.value.filter((item) => item.source === 'task')
|
||||
}
|
||||
|
||||
return dataList.value.filter((item) => item.source !== 'task')
|
||||
})
|
||||
|
||||
async function loadData() {
|
||||
|
||||
Reference in New Issue
Block a user