You've already forked DataMate
refactor(annotation): 优化段落切片配置的显示逻辑
- 移除非文本数据集的段落切片配置选项 - 简化条件渲染逻辑,仅在文本数据集时显示段落切片配置 - 统一两个组件中的段落切片配置显示规则 - 移除冗余的数据集选择和类型检查提示信息 - 优化编辑模式下的禁用状态处理
This commit is contained in:
@@ -186,25 +186,20 @@ export default function AnnotationTaskCreate() {
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="段落切片"
|
||||
name="segmentationEnabled"
|
||||
initialValue={DEFAULT_SEGMENTATION_ENABLED}
|
||||
extra={
|
||||
!selectedDatasetId
|
||||
? "请选择数据集后配置"
|
||||
: isTextDataset
|
||||
? "仅文本数据集可配置该项"
|
||||
: "非文本数据集不支持切片段"
|
||||
}
|
||||
>
|
||||
<Radio.Group
|
||||
options={SEGMENTATION_OPTIONS}
|
||||
optionType="button"
|
||||
buttonStyle="solid"
|
||||
disabled={!isTextDataset}
|
||||
/>
|
||||
</Form.Item>
|
||||
{isTextDataset && (
|
||||
<Form.Item
|
||||
label="段落切片"
|
||||
name="segmentationEnabled"
|
||||
initialValue={DEFAULT_SEGMENTATION_ENABLED}
|
||||
extra="仅文本数据集可配置该项"
|
||||
>
|
||||
<Radio.Group
|
||||
options={SEGMENTATION_OPTIONS}
|
||||
optionType="button"
|
||||
buttonStyle="solid"
|
||||
/>
|
||||
</Form.Item>
|
||||
)}
|
||||
|
||||
<div className="flex items-center justify-between mt-6 mb-2">
|
||||
<h2 className="font-medium text-gray-900 text-lg flex items-center gap-2">
|
||||
|
||||
Reference in New Issue
Block a user