perf: Optimize translation
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
wangdan-fit2cloud 2025-12-02 21:02:41 +08:00
parent d39a27f360
commit 39d4ebc49c
10 changed files with 123 additions and 103 deletions

View File

@ -1114,7 +1114,9 @@
</div>
<div class="card-never border-r-6 mt-8">
<h5 class="p-8-12">
{{ $t('common.param.outputParam') }}{{ $t('chat.executionDetails.documentSplitTip') }}
{{ $t('common.param.outputParam') }}{{
$t('chat.executionDetails.documentSplitTip')
}}
</h5>
<div class="p-8-12 border-t-dashed lighter">
<el-radio-group v-model="currentParagraph" class="app-radio-button-group mb-8">
@ -1150,12 +1152,14 @@
{{ $t('common.param.inputParam') }}
</h5>
<div class="p-8-12 border-t-dashed lighter">
<span class="color-secondary">{{$t('chat.executionDetails.subBlockLength')}}:</span>
<span class="color-secondary"
>{{ $t('views.workflow.nodes.documentSplitNode.chunk_length.label') }}:</span
>
{{ data.size }}
</div>
</div>
<div class="card-never border-r-6 mt-8">
<h5 class="p-8-12">{{$t('chat.executionDetails.writeContent')}}</h5>
<h5 class="p-8-12">{{ $t('chat.executionDetails.writeContent') }}</h5>
<div class="p-8-12 border-t-dashed lighter">
<el-radio-group v-model="currentWriteContent" class="app-radio-button-group mb-8">
<template

View File

@ -108,7 +108,6 @@ export default {
knowedMessage: 'Known Information',
documentSplitTip: 'Each document can preview only the first five segments',
paragraphRules: 'Segmentation Rules',
subBlockLength: 'Sub-block Length',
writeContent: 'Content Written',
},
KnowledgeSource: {

View File

@ -81,7 +81,6 @@ export default {
},
nodes: {
knowledgeWriteNode: {
chunk_length: 'Chunk length',
text: 'Knowledge write',
label: 'Knowledge write',
},
@ -94,6 +93,16 @@ export default {
label: 'Local File',
text: 'Local File',
fileList: 'File List',
fileFormat: {
label: 'Supported File Formats',
requiredMessage: 'Please select file formats',
},
maxFileNumber: {
label: 'Maximum Number of Files per Upload',
},
maxFileCountNumber: {
label: 'Maximum Size per File (MB)',
},
},
classify: {
aiCapability: 'AI capability',
@ -265,6 +274,16 @@ You are a master of problem optimization, adept at accurately inferring user int
placeholder: 'Please select a splitting strategy',
requiredMessage: 'Please select a splitting strategy',
},
chunk_length: {
label: 'Chunk length',
tooltip1: 'Core objective is to balance retrieval precision and recall efficiency',
tooltip2:
'Avoid excessively short segmentation: A single segment <50 characters may lead to semantic fragmentation, potentially failing to match query intent during retrieval due to lack of context.',
tooltip3:
'Avoid excessive segmentation: A single block exceeding 500 characters increases redundant information, reduces retrieval accuracy, and consumes more storage and computing resources.',
},
title1: 'Segment title set as the associated question of the segment',
title2: 'Document name set as the associated question of the segment',
},
imageUnderstandNode: {
label: 'Image Understanding',
@ -410,7 +429,6 @@ You are a master of problem optimization, adept at accurately inferring user int
placeholder: 'Please choose a classification option',
classify: {
label: 'Intent classify',
placeholder: 'Please input',
},
input: {
label: 'Input',

View File

@ -106,7 +106,6 @@ export default {
knowedMessage: '已知信息',
documentSplitTip: '每个文档仅能预览前五个分段',
paragraphRules: '分段规则',
subBlockLength: '子分块长度',
writeContent: '写入内容',
},
KnowledgeSource: {

View File

@ -1,3 +1,6 @@
import tool from '@/api/tool/tool'
import type { title } from 'process'
export default {
node: '节点',
nodeName: '节点名称',
@ -82,7 +85,6 @@ export default {
},
nodes: {
knowledgeWriteNode: {
chunk_length: '子分块长度',
text: '知识库写入',
label: '知识库写入',
},
@ -95,6 +97,16 @@ export default {
label: '本地文件',
text: '本地文件',
fileList: '文件列表',
fileFormat: {
label: '支持的文件格式',
requiredMessage: '请选择文件格式',
},
maxFileNumber: {
label: '每次上传最大文件数',
},
maxFileCountNumber: {
label: '上传的每个文档最大(MB)',
},
},
classify: {
aiCapability: 'AI能力',
@ -270,6 +282,16 @@ export default {
placeholder: '请选择分段策略',
requiredMessage: '请选择分段策略',
},
chunk_length: {
label: '子分块长度',
tooltip1: '核心目标是平衡检索精度与召回效率',
tooltip2:
'避免过短拆分单块50 字易导致语义碎片化,检索时可能因缺少上下文无法匹配查询意图',
tooltip3:
'避免过长拆分单块500 字会增加冗余信息,降低检索精准度,且占用更多存储和计算资源',
},
title1: '分段标题设置为分段的关联问题',
title2: '文档名称设置为分段的关联问题',
},
imageUnderstandNode: {
label: '图片理解',
@ -421,7 +443,6 @@ export default {
placeholder: '请选择分类项',
classify: {
label: '意图分类',
placeholder: '请输入',
},
input: {
label: '输入',

View File

@ -106,7 +106,6 @@ export default {
knowedMessage: '已知資訊',
documentSplitTip: '每個文件僅能預覽前五個段落',
paragraphRules: '分段規則',
subBlockLength: '子分塊長度',
writeContent: '寫入內容',
},
KnowledgeSource: {

View File

@ -81,7 +81,6 @@ export default {
},
nodes: {
knowledgeWriteNode: {
chunk_length: '子分塊長度',
text: '知識庫寫入',
label: '知識庫寫入',
},
@ -94,6 +93,16 @@ export default {
label: '本地文件',
text: '本地文件',
fileList: '文件列表',
fileFormat: {
label: '支持的文件格式',
requiredMessage: '請選擇文件格式',
},
maxFileNumber: {
label: '每次上傳最大文件數',
},
maxFileCountNumber: {
label: '上傳的每個文檔最大(MB)',
},
},
classify: {
aiCapability: 'AI能力',
@ -264,6 +273,16 @@ export default {
placeholder: '請選擇分段策略',
requiredMessage: '請選擇分段策略',
},
chunk_length: {
label: '子分塊長度',
tooltip1: '核心目標是平衡檢索精度與召回效率',
tooltip2:
'避免過短拆分單塊50 字易導致語義碎片化,檢索時可能因缺少上下文無法匹配查詢意圖',
tooltip3:
'避免過長拆分單塊500 字會增加冗餘信息,降低檢索精准度,且佔用更多存儲和計算資源',
},
title1: '分段標題設置為分段的關聯問題',
title2: '文檔名稱設置為分段的關聯問題',
},
imageUnderstandNode: {
label: '圖片理解',
@ -402,7 +421,6 @@ export default {
placeholder: '請選擇分類項',
classify: {
label: '意圖分類',
placeholder: '請輸入',
},
input: {
label: '輸入',
@ -438,13 +456,13 @@ export default {
loopIndex: '下標',
loopItem: '循環元素',
},
loopBodyNode: {label: '循環體', text: '循環體'},
loopBodyNode: { label: '循環體', text: '循環體' },
loopContinueNode: {
label: 'Continue',
text: '用於終止當前循環,執行下次循環',
isContinue: 'Continue',
},
loopBreakNode: {label: 'Break', text: '終止當前循環,跳出循環體', isBreak: 'Break'},
loopBreakNode: { label: 'Break', text: '終止當前循環,跳出循環體', isBreak: 'Break' },
variableSplittingNode: {
label: '變量拆分',
text: '通過配置 JSON Path 表達式,對輸入的 JSON 格式變量進行解析和拆分',

View File

@ -10,25 +10,17 @@
label-width="auto"
>
<el-form-item
:label="$t('views.workflow.nodes.dataSourceLocalNode.fileFormat.label', '支持的文件格式')"
:label="$t('views.workflow.nodes.dataSourceLocalNode.fileFormat.label')"
:rules="{
type: 'array',
required: true,
message: $t(
'views.workflow.nodes.dataSourceLocalNode.fileFormat.message',
'请选择文件格式',
),
message: $t('views.workflow.nodes.dataSourceLocalNode.fileFormat.requiredMessage'),
trigger: 'change',
}"
>
<el-select
v-model="form_data.file_type_list"
:placeholder="
$t(
'views.workflow.nodes.dataSourceLocalNode.fileFormat.placeholder',
'请选择文件格式',
)
"
:placeholder="$t('views.workflow.nodes.dataSourceLocalNode.fileFormat.requiredMessage')"
class="w-240"
clearable
multiple
@ -48,16 +40,11 @@
</el-select>
</el-form-item>
<el-form-item
:label="
$t('views.workflow.nodes.dataSourceLocalNode.maxFileNumber.label', '每次上传最大文件数')
"
:label="$t('views.workflow.nodes.dataSourceLocalNode.maxFileNumber.label')"
:rules="{
type: 'array',
required: true,
message: $t(
'views.workflow.nodes.dataSourceLocalNode.maxFileNumber.placeholder',
'请输入最大文件数',
),
message: $t('common.inputPlaceholder'),
trigger: 'change',
}"
>
@ -73,19 +60,11 @@
/>
</el-form-item>
<el-form-item
:label="
$t(
'views.workflow.nodes.dataSourceLocalNode.maxFileNumber.label',
'上传的每个文档最大(MB)',
)
"
:label="$t('views.workflow.nodes.dataSourceLocalNode.maxFileCountNumber.label')"
:rules="{
type: 'array',
required: true,
message: $t(
'views.workflow.nodes.dataSourceLocalNode.maxFileNumber.placeholder',
'上传的每个文档最大(MB) 必填',
),
message: $t('common.inputPlaceholder'),
trigger: 'change',
}"
>

View File

@ -10,11 +10,13 @@
require-asterisk-position="right"
label-width="auto"
>
<el-form-item :label="$t('views.problem.relateParagraph.selectDocument')" :rules="{
<el-form-item
:label="$t('views.problem.relateParagraph.selectDocument')"
:rules="{
type: 'array',
required: true,
message: $t('views.chatLog.documentPlaceholder'),
trigger: 'change'
trigger: 'change',
}"
>
<NodeCascader
@ -30,39 +32,28 @@
:rules="{
required: true,
message: $t('views.workflow.nodes.documentSplitNode.splitStrategy.requiredMessage'),
trigger: 'change'
trigger: 'change',
}"
>
<el-select
v-model="form_data.split_strategy"
:placeholder="$t('views.workflow.nodes.documentSplitNode.splitStrategy.placeholder')">
<el-option
:label="$t('views.document.setRules.intelligent.label')"
value="auto"
/>
<el-option
:label="$t('views.document.setRules.advanced.label')"
value="custom"
/>
<el-option
:label="$t('views.document.fileType.QA.label')"
value="qa"
/>
:placeholder="$t('views.workflow.nodes.documentSplitNode.splitStrategy.placeholder')"
>
<el-option :label="$t('views.document.setRules.intelligent.label')" value="auto" />
<el-option :label="$t('views.document.setRules.advanced.label')" value="custom" />
<el-option :label="$t('views.document.fileType.QA.label')" value="qa" />
</el-select>
</el-form-item>
<el-form-item>
<template #label>
<div class="flex-between">
<span>
<span>子分块长度</span>
<el-tooltip
effect="dark"
placement="right"
>
<span class="flex align-center">
<span>{{ $t('views.workflow.nodes.documentSplitNode.chunk_length.label') }}</span>
<el-tooltip effect="dark" placement="right">
<template #content>
核心目标是平衡检索精度与召回效率 <br/>
避免过短拆分单块50 字易导致语义碎片化检索时可能因缺少上下文无法匹配查询意图<br/>
避免过长拆分单块500 字会增加冗余信息降低检索精准度且占用更多存储和计算资源
{{ $t('views.workflow.nodes.documentSplitNode.chunk_length.tooltip1') }}<br />
{{ $t('views.workflow.nodes.documentSplitNode.chunk_length.tooltip2') }}<br />
{{ $t('views.workflow.nodes.documentSplitNode.chunk_length.tooltip3') }}
</template>
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
</el-tooltip>
@ -72,10 +63,7 @@
:label="$t('views.workflow.nodes.searchDocumentNode.custom')"
value="custom"
/>
<el-option
:label="$t('views.workflow.variable.Referencing')"
value="referencing"
/>
<el-option :label="$t('views.workflow.variable.Referencing')" value="referencing" />
</el-select>
</div>
</template>
@ -200,7 +188,11 @@
/>
</el-select>
</div>
<el-switch v-if="form_data.with_filter_type === 'custom'" size="small" v-model="form_data.with_filter" />
<el-switch
v-if="form_data.with_filter_type === 'custom'"
size="small"
v-model="form_data.with_filter"
/>
<NodeCascader
v-else
ref="nodeCascaderRef7"
@ -212,8 +204,7 @@
<div style="margin-top: 4px">
<el-text type="info">
{{ $t('views.document.setRules.with_filter.text') }}
</el-text
>
</el-text>
</div>
</div>
</div>
@ -221,17 +212,17 @@
<el-form-item v-if="form_data.split_strategy !== 'qa'">
<template #label>
<div class="flex-between">
<span>分段标题设置为分段的关联问题</span>
<el-select v-model="form_data.paragraph_title_relate_problem_type" size="small"
style="width: 100px">
<span> {{ $t('views.workflow.nodes.documentSplitNode.title1') }}</span>
<el-select
v-model="form_data.paragraph_title_relate_problem_type"
size="small"
style="width: 100px"
>
<el-option
:label="$t('views.workflow.nodes.searchDocumentNode.custom')"
value="custom"
/>
<el-option
:label="$t('views.workflow.variable.Referencing')"
value="referencing"
/>
<el-option :label="$t('views.workflow.variable.Referencing')" value="referencing" />
</el-select>
</div>
</template>
@ -252,17 +243,17 @@
<el-form-item>
<template #label>
<div class="flex-between">
<span>文档名称设置为分段的关联问题</span>
<el-select v-model="form_data.document_name_relate_problem_type" size="small"
style="width: 100px">
<span>{{ $t('views.workflow.nodes.documentSplitNode.title2') }}</span>
<el-select
v-model="form_data.document_name_relate_problem_type"
size="small"
style="width: 100px"
>
<el-option
:label="$t('views.workflow.nodes.searchDocumentNode.custom')"
value="custom"
/>
<el-option
:label="$t('views.workflow.variable.Referencing')"
value="referencing"
/>
<el-option :label="$t('views.workflow.variable.Referencing')" value="referencing" />
</el-select>
</div>
</template>
@ -297,7 +288,7 @@ import { useRoute } from 'vue-router'
const route = useRoute()
const {
query: { id } // idknowledgeID
query: { id }, // idknowledgeID
} = route as any
const apiType = computed(() => {
@ -333,10 +324,9 @@ const form = {
patterns_reference: [],
with_filter: false,
with_filter_type: 'custom',
with_filter_reference: []
with_filter_reference: [],
}
const form_data = computed({
get: () => {
if (props.nodeModel.properties.node_data) {
@ -348,10 +338,9 @@ const form_data = computed({
},
set: (value) => {
set(props.nodeModel.properties, 'node_data', value)
}
},
})
const aiChatNodeFormRef = ref<FormInstance>()
const nodeCascaderRef = ref()
const nodeCascaderRef2 = ref()
@ -362,7 +351,7 @@ const validate = () => {
nodeCascaderRef.value ? nodeCascaderRef.value.validate() : Promise.resolve(''),
nodeCascaderRef2.value ? nodeCascaderRef2.value.validate() : Promise.resolve(''),
nodeCascaderRef3.value ? nodeCascaderRef3.value.validate() : Promise.resolve(''),
aiChatNodeFormRef.value?.validate()
aiChatNodeFormRef.value?.validate(),
]).catch((err: any) => {
return Promise.reject({ node: props.nodeModel, errMessage: err })
})
@ -377,15 +366,11 @@ const initSplitPatternList = () => {
})
}
onMounted(() => {
initSplitPatternList()
set(props.nodeModel, 'validate', validate)
})
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@ -108,7 +108,7 @@
<el-form-item
:prop="`branch.${index}.content`"
:rules="{
message: $t('views.workflow.nodes.intentNode.classify.placeholder'),
message: $t('common.inputPlaceholder'),
trigger: 'change',
required: true,
}"
@ -119,9 +119,7 @@
v-model="item.content"
style="width: 210px"
:disabled="item.isOther"
:placeholder="
$t('views.workflow.nodes.intentNode.classify.placeholder')
"
:placeholder="$t('common.inputPlaceholder')"
/>
</el-col>
<el-col :span="3">