fix(dataset): 展示训练任务名称

This commit is contained in:
caoxiaozhu
2026-07-27 12:44:40 +08:00
parent b82897ca3a
commit ecafb7eb13
6 changed files with 93 additions and 10 deletions

View File

@@ -18,6 +18,7 @@ const [typesSource, dataSource, viewSource, tablePageSource] = await Promise.all
assert.match(typesSource, /export type DatasetSource = 'upload' \| 'task'/)
assert.match(typesSource, /source\?: DatasetSource/)
assert.match(typesSource, /task_name\?: string/)
assert.equal((dataSource.match(/source: 'upload'/g) || []).length, 6)
assert.equal((dataSource.match(/source: 'task'/g) || []).length, 4)
@@ -31,6 +32,7 @@ for (const name of [
const datasetLine = dataSource.split('\n').find((line) => line.includes(`name: '${name}'`))
assert.ok(datasetLine, `缺少数据任务 Mock${name}`)
assert.match(datasetLine, /source: 'task'/, `${name} 必须标记为数据任务来源`)
assert.match(datasetLine, /task_name: '/, `${name} 必须提供来源任务名称`)
}
assert.match(viewSource, /route\.query\.tab === 'task' \? 'task' : 'upload'/)
@@ -42,7 +44,9 @@ assert.match(
)
assert.match(viewSource, /return dataList\.value\.filter\(\(item\) => item\.source !== 'task'\)/)
assert.doesNotMatch(viewSource, /数据任务产生的数据集[\s\S]*?return \[\]/)
assert.match(viewSource, /:search-fields="\['task_id', 'name'\]"/, '数据任务搜索应支持任务 ID')
assert.match(viewSource, /:search-fields="activeTab === 'task' \? \['task_id', 'task_name'\] : \['name'\]"/, '搜索字段应与当前页签展示的名称一致')
assert.match(viewSource, /activeTab === 'task' \? '训练任务名称' : '数据集名称'/, '数据任务页应展示训练任务名称表头')
assert.match(viewSource, /activeTab === 'task' \? \(row\.task_name \|\| '-'\) : row\.name/, '数据任务页应展示接口返回的来源任务名称')
assert.match(viewSource, /formatMegabytes\(row\.size_bytes, row\.size\)/, '数据集大小应统一转换为 MB')
assert.match(viewSource, /<el-table-column label="版本"/, '描述列应替换为真实版本列')
assert.doesNotMatch(viewSource, /<el-table-column label="描述"/, '列表不应继续显示描述列')