feat(data-process): 优化上传切分流程与PDF高亮预览

This commit is contained in:
caoxiaozhu
2026-07-24 11:28:02 +08:00
parent 33d0ed2e01
commit ad64e44860
18 changed files with 1940 additions and 395 deletions

View File

@@ -30,9 +30,8 @@ const SMART_PREPROCESS_OPTIONS: UnstructuredPreprocessOption[] = [
]
const CHUNK_METHODS: Array<{ value: ChunkMethod; label: string }> = [
{ value: 'semantic', label: '自动语义切分' },
{ value: 'heading', label: '按标题和段落' },
{ value: 'fixed', label: '按固定长度' },
{ value: 'structure', label: '文档结构' },
{ value: 'fixed', label: '固定 Token' },
{ value: 'custom', label: '自定义分隔符' },
]
@@ -70,9 +69,9 @@ function updateGenerationOptions(value: GenerationControlOptions) {
function updateSmartPreprocess(value: string | number | boolean) {
const enabled = Boolean(value)
const remainingOptions = props.options.preprocessOptions.filter(
const remainingOptions = Array.from(new Set(props.options.preprocessOptions.filter(
(option) => !SMART_PREPROCESS_OPTIONS.includes(option),
)
)))
updateField(
'preprocessOptions',
enabled ? [...SMART_PREPROCESS_OPTIONS, ...remainingOptions] : remainingOptions,
@@ -80,9 +79,11 @@ function updateSmartPreprocess(value: string | number | boolean) {
}
function updateDesensitize(value: string | number | boolean) {
const preprocessOptions: UnstructuredPreprocessOption[] = props.options.preprocessOptions.filter(
(option) => option !== 'desensitize',
)
const preprocessOptions: UnstructuredPreprocessOption[] = Array.from(new Set(
props.options.preprocessOptions.filter(
(option) => option !== 'desensitize',
),
))
if (Boolean(value)) preprocessOptions.push('desensitize')
updateField('preprocessOptions', preprocessOptions)
}
@@ -116,7 +117,7 @@ defineExpose({ revealValidation })
<div class="section-title-row">
<div>
<h3>预处理选项</h3>
<p>默认使用推荐策略只需决定是否需要脱敏</p>
<p>默认启用结构感知的推荐策略只需决定是否需要脱敏</p>
</div>
</div>
<div class="preprocess-option-grid">
@@ -127,7 +128,7 @@ defineExpose({ revealValidation })
/>
<span class="preprocess-option-copy">
<strong>智能预处理</strong>
<small>自动清理解析去重及保留上下文</small>
<small>清理无效内容感知文档结构合并短块预过滤低质量内容近重复去重并通过重叠保护上下文</small>
</span>
</label>
@@ -138,7 +139,7 @@ defineExpose({ revealValidation })
/>
<span class="preprocess-option-copy">
<strong>敏感信息脱敏</strong>
<small>处理姓名手机号等隐私信息</small>
<small>识别并脱敏姓名手机号邮箱和身份证号</small>
</span>
</label>
@@ -159,7 +160,7 @@ defineExpose({ revealValidation })
<div class="section-title-row">
<div>
<h3>切分选项</h3>
<p>以语义完整为优先将长文档拆成可独立生成问答的内容块</p>
<p>按文档结构固定 Token 或自定义分隔符拆分长文档</p>
</div>
</div>
@@ -178,7 +179,7 @@ defineExpose({ revealValidation })
:value="method.value"
/>
</el-select>
<small>推荐使用自动语义切分在长度限制内优先保留完整句段</small>
<small>推荐使用文档结构按标题段落和句子边界保留完整内容块</small>
</label>
<label class="config-field">