fix(data-process): 收准结构化预处理能力文案

This commit is contained in:
caoxiaozhu
2026-07-27 14:36:16 +08:00
parent d8a11e4949
commit 97cdb5cc68
3 changed files with 23 additions and 7 deletions

View File

@@ -352,8 +352,16 @@ assert.match(viewSource, /function resetSourceDataForProcessTypeChange\(\)[\s\S]
assert.match(taskSetupSource, /v-if="processType === 'structured'"/, '结构化配置必须仅在结构化数据类型下显示') assert.match(taskSetupSource, /v-if="processType === 'structured'"/, '结构化配置必须仅在结构化数据类型下显示')
const expectedStructuredOptions = [ const expectedStructuredOptions = [
['clean_invalid', '清理无效数据', '清理全空列,并剔除关键字段残缺的数据行'], ['clean_invalid', '清理无效数据', '清理全空列,并剔除关键字段残缺的数据行'],
['detect_structure', '识别表格结构', '识别多级表头与合并单元格,并将嵌套字段展平'], [
['deduplicate', '重复数据去重', '基于整行精确匹配和关键字段组合删除重复记录'], 'detect_structure',
'嵌套结构展平',
'展平嵌套对象和可解析的 JSON 字段Excel 表头与合并单元格在上传时自动解析',
],
[
'deduplicate',
'重复记录去重',
'按整行内容或 id、uuid、key、code、*_id 等身份字段去重,暂不支持自定义组合字段',
],
['normalize_format', '数据格式标准化', '按所选规则统一编码、空白、字段名及 JSON 序列化格式'], ['normalize_format', '数据格式标准化', '按所选规则统一编码、空白、字段名及 JSON 序列化格式'],
['filter_anomaly', '异常数据过滤', '使用 IQR 识别数值离群值,并过滤乱码等异常记录'], ['filter_anomaly', '异常数据过滤', '使用 IQR 识别数值离群值,并过滤乱码等异常记录'],
['desensitize', '敏感信息脱敏', '识别并脱敏姓名、手机号、邮箱和身份证号'], ['desensitize', '敏感信息脱敏', '识别并脱敏姓名、手机号、邮箱和身份证号'],
@@ -363,7 +371,7 @@ for (const [value, label, description] of expectedStructuredOptions) {
assert.ok(structuredOptionsSource.includes(`label: '${label}'`), `结构化预处理缺少标签:${label}`) assert.ok(structuredOptionsSource.includes(`label: '${label}'`), `结构化预处理缺少标签:${label}`)
assert.ok(structuredOptionsSource.includes(`description: '${description}'`), `结构化预处理语义不准确:${value}`) assert.ok(structuredOptionsSource.includes(`description: '${description}'`), `结构化预处理语义不准确:${value}`)
} }
const structuredOptionValues = [...structuredOptionsSource.matchAll(/\{ value: '([^']+)', label:/g)] const structuredOptionValues = [...structuredOptionsSource.matchAll(/\{\s*value: '([^']+)',\s*label:/g)]
.map((match) => match[1]) .map((match) => match[1])
assert.deepEqual(structuredOptionValues, expectedStructuredOptions.map(([value]) => value), '结构化预处理值集合不准确') assert.deepEqual(structuredOptionValues, expectedStructuredOptions.map(([value]) => value), '结构化预处理值集合不准确')
assert.equal(new Set(structuredOptionValues).size, structuredOptionValues.length, '结构化预处理 value 必须唯一') assert.equal(new Set(structuredOptionValues).size, structuredOptionValues.length, '结构化预处理 value 必须唯一')

View File

@@ -99,8 +99,8 @@ const chunkMethodLabelMap: Record<string, string> = {
const preprocessOptionLabelMap: Record<string, string> = { const preprocessOptionLabelMap: Record<string, string> = {
clean_invalid: '清理无效数据', clean_invalid: '清理无效数据',
detect_structure: '识别表格结构', detect_structure: '嵌套结构展平',
deduplicate: '重复数据去重', deduplicate: '重复记录去重',
normalize_format: '数据格式标准化', normalize_format: '数据格式标准化',
filter_anomaly: '异常数据过滤', filter_anomaly: '异常数据过滤',
desensitize: '敏感信息脱敏', desensitize: '敏感信息脱敏',

View File

@@ -27,8 +27,16 @@ const PREPROCESS_OPTIONS: Array<{
description: string description: string
}> = [ }> = [
{ value: 'clean_invalid', label: '清理无效数据', description: '清理全空列,并剔除关键字段残缺的数据行' }, { value: 'clean_invalid', label: '清理无效数据', description: '清理全空列,并剔除关键字段残缺的数据行' },
{ value: 'detect_structure', label: '识别表格结构', description: '识别多级表头与合并单元格,并将嵌套字段展平' }, {
{ value: 'deduplicate', label: '重复数据去重', description: '基于整行精确匹配和关键字段组合删除重复记录' }, value: 'detect_structure',
label: '嵌套结构展平',
description: '展平嵌套对象和可解析的 JSON 字段Excel 表头与合并单元格在上传时自动解析',
},
{
value: 'deduplicate',
label: '重复记录去重',
description: '按整行内容或 id、uuid、key、code、*_id 等身份字段去重,暂不支持自定义组合字段',
},
{ value: 'normalize_format', label: '数据格式标准化', description: '按所选规则统一编码、空白、字段名及 JSON 序列化格式' }, { value: 'normalize_format', label: '数据格式标准化', description: '按所选规则统一编码、空白、字段名及 JSON 序列化格式' },
{ value: 'filter_anomaly', label: '异常数据过滤', description: '使用 IQR 识别数值离群值,并过滤乱码等异常记录' }, { value: 'filter_anomaly', label: '异常数据过滤', description: '使用 IQR 识别数值离群值,并过滤乱码等异常记录' },
{ value: 'desensitize', label: '敏感信息脱敏', description: '识别并脱敏姓名、手机号、邮箱和身份证号' }, { value: 'desensitize', label: '敏感信息脱敏', description: '识别并脱敏姓名、手机号、邮箱和身份证号' },