fix(data-process): 补齐原文参照与详情统计
This commit is contained in:
@@ -57,6 +57,17 @@ assert.match(detailSource, /结果明细加载失败/, '结果加载失败缺少
|
||||
assert.match(detailSource, /width:\s*100%/, '详情页没有铺满内容区域')
|
||||
assert.doesNotMatch(detailSource, /^\s*max-width:\s*\d+px/m, '详情页不应使用固定最大宽度')
|
||||
assert.match(detailSource, /!\/\(\?:password\|secret\|token\|api_key\)\/i\.test\(key\)/, '处理配置没有过滤敏感凭据字段')
|
||||
assert.match(detailSource, /key !== 'generation_model_snapshot'/, '处理配置仍直接展示内部模型快照')
|
||||
assert.match(detailSource, /preprocessOptionLabelMap/, '处理配置没有把预处理内部枚举转换为中文')
|
||||
assert.match(detailSource, /const parsed = typeof value === 'number' \? value : Number\(value\)/, '详情页不兼容 PostgreSQL 数字字符串')
|
||||
assert.match(detailSource, /new Date\(startTime\.value\)\.getTime\(\)/, '详情页没有在后端耗时缺失时按开始、完成时间回算')
|
||||
assert.match(detailSource, /outputCount \+ numeric\(detail\.value\?\.filtered_count\)/, '结果保留率没有使用输出和过滤结果的同口径分母')
|
||||
assert.doesNotMatch(detailSource, /numeric\(detail\.value\?\.output_count\) \/ inputCount/, '结果保留率仍在用输出结果除以源文件记录数')
|
||||
assert.match(detailSource, /:percentage="retentionPercentage"/, '结果保留率进度条仍绑定任务执行进度')
|
||||
assert.match(detailSource, /preview_count/, '非结构化任务没有展示实际输入切片数')
|
||||
assert.match(detailSource, /const configExpanded = ref\(false\)/, '处理配置没有默认收起')
|
||||
assert.match(detailSource, /:aria-expanded="configExpanded"/, '处理配置折叠按钮缺少无障碍状态')
|
||||
assert.match(detailSource, /<el-collapse-transition>[\s\S]*?v-show="configExpanded"/, '处理配置没有折叠过渡或内容状态')
|
||||
assert.doesNotMatch(detailSource, /const (?:detailMap|completedResults)\b|TODO: 接入真实接口/, '详情页仍包含本地 Mock 数据')
|
||||
|
||||
for (const apiName of [
|
||||
|
||||
@@ -86,15 +86,17 @@ for (const component of expectedComponents) {
|
||||
const typesPath = path.join(createDir, 'types.ts')
|
||||
const modelPath = path.join(createDir, 'previewModel.ts')
|
||||
const pdfViewerPath = path.join(createDir, 'PdfSourceViewer.vue')
|
||||
const resultEditorPath = path.join(createDir, 'ResultEditorStep.vue')
|
||||
assert.ok(existsSync(typesPath), '缺少向导类型定义')
|
||||
assert.ok(existsSync(modelPath), '缺少来源映射模型')
|
||||
assert.ok(existsSync(pdfViewerPath), '缺少 PDF 原文件预览组件')
|
||||
|
||||
const [typesSource, modelSource, previewSource, pdfViewerSource] = await Promise.all([
|
||||
const [typesSource, modelSource, previewSource, pdfViewerSource, resultEditorSource] = await Promise.all([
|
||||
readFile(typesPath, 'utf8'),
|
||||
readFile(modelPath, 'utf8'),
|
||||
readFile(path.join(createDir, 'PreviewCompareStep.vue'), 'utf8'),
|
||||
readFile(pdfViewerPath, 'utf8'),
|
||||
readFile(resultEditorPath, 'utf8'),
|
||||
])
|
||||
|
||||
for (const field of ['sourceStart', 'sourceEnd', 'originalContent', 'editedContent']) {
|
||||
@@ -307,6 +309,14 @@ assert.match(viewSource, /function goToStep\(stepId: StepId\)[\s\S]*?WIZARD_STEP
|
||||
assert.match(viewSource, /currentStepId\.value === 'preview'[\s\S]*?goToStep\('generate'\)/, '数据预览步骤没有进入开始生成')
|
||||
assert.match(viewSource, /generation\.status === 'success'[\s\S]*?goToStep\('results'\)/, '生成成功后没有进入结果编辑与保存')
|
||||
assert.match(viewSource, /<ResultEditorStep\s+[\s\S]*?v-else-if="currentStepId === 'results'"/, '结果编辑器必须只在结果步骤渲染')
|
||||
assert.match(viewSource, /<ResultEditorStep[\s\S]*?:preview-items="previewItems"/, '结果编辑器没有接收已有预览原文')
|
||||
assert.match(typesSource, /previewItemId: string \| null/, '结果项缺少预览原文关联 ID')
|
||||
assert.match(generationSource, /previewItemId:\s*item\.preview_item_id == null \? null : String\(item\.preview_item_id\)/, '结果映射丢失 preview_item_id')
|
||||
assert.match(resultEditorSource, /previewItems: PreviewItem\[\]/, '结果编辑器缺少原文列表契约')
|
||||
assert.match(resultEditorSource, /props\.previewItems\.find\(\(item\) => item\.id === previewItemId\)/, '结果编辑器没有按 preview_item_id 关联原文')
|
||||
assert.match(resultEditorSource, /editedContent\.trim\(\)[\s\S]*?originalContent\.trim\(\)/, '原文参照没有优先展示实际用于生成的预处理内容')
|
||||
assert.match(resultEditorSource, /原文参照/, '结果编辑器缺少原文参照区域')
|
||||
assert.match(resultEditorSource, /实际送入模型的预处理后原文/, '结果编辑器没有说明原文参照口径')
|
||||
assert.match(viewSource, /watch\(processType,[\s\S]*?resetSourceDataForProcessTypeChange\(\)/, '切换处理类型后没有失效旧源数据')
|
||||
assert.match(viewSource, /function resetSourceDataForProcessTypeChange\(\)[\s\S]*?uploadedFiles\.value = \[\][\s\S]*?selectedPreviewFileId\.value = null/, '旧源数据失效没有同步清理文件与预览选择')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user