feat: i18n

This commit is contained in:
wangdan-fit2cloud 2025-01-20 11:31:07 +08:00
parent d8995e996d
commit 765c24dd3f
6 changed files with 13 additions and 25 deletions

View File

@ -1,5 +1,5 @@
export enum SearchMode { export enum SearchMode {
embedding = '向量检索', embedding = 'views.application.applicationForm.dialog.vectorSearch',
keywords = '全文检索', keywords = 'views.application.applicationForm.dialog.fullTextSearch',
blend = '混合检索' blend = 'views.application.applicationForm.dialog.hybridSearch'
} }

View File

@ -1,16 +1,4 @@
export enum hitHandlingMethod { export enum hitHandlingMethod {
optimization = '模型优化', optimization = 'views.document.hitHandlingMethod.optimization',
directly_return = '直接回答' directly_return = 'views.document.hitHandlingMethod.directly_return'
}
export enum hitStatus {
waiting = '等待中',
processing = '处理中',
completed = '已完成',
failed = '失败'
}
export enum isActivated {
true = '启用',
false = '禁用'
} }

View File

@ -154,5 +154,9 @@ export default {
error: '向量化未成功的分段', error: '向量化未成功的分段',
all: '全部分段' all: '全部分段'
} }
},
hitHandlingMethod: {
optimization: '模型优化',
directly_return: '直接回答'
} }
} }

View File

@ -58,7 +58,7 @@
</template> </template>
<el-radio-group v-model="form.hit_handling_method" class="radio-block mt-4"> <el-radio-group v-model="form.hit_handling_method" class="radio-block mt-4">
<template v-for="(value, key) of hitHandlingMethod" :key="key"> <template v-for="(value, key) of hitHandlingMethod" :key="key">
<el-radio :value="key">{{ value }} </el-radio> <el-radio :value="key">{{ $t(value) }} </el-radio>
</template> </template>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>

View File

@ -86,11 +86,7 @@
:label="$t('views.document.table.paragraph')" :label="$t('views.document.table.paragraph')"
align="right" align="right"
/> />
<el-table-column <el-table-column prop="status" :label="$t('views.document.fileStatus.label')" width="130">
prop="status"
:label="$t('views.document.fileStatus.label')"
width="130"
>
<template #header> <template #header>
<div> <div>
<span>{{ $t('views.document.fileStatus.label') }}</span> <span>{{ $t('views.document.fileStatus.label') }}</span>
@ -241,7 +237,7 @@
</div> </div>
</template> </template>
<template #default="{ row }"> <template #default="{ row }">
{{ hitHandlingMethod[row.hit_handling_method as keyof typeof hitHandlingMethod] }} {{ $t(hitHandlingMethod[row.hit_handling_method as keyof typeof hitHandlingMethod]) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="create_time" :label="$t('common.createTime')" width="175"> <el-table-column prop="create_time" :label="$t('common.createTime')" width="175">

View File

@ -66,7 +66,7 @@
}}</el-col> }}</el-col>
<el-col :span="12" class="lighter"> <el-col :span="12" class="lighter">
{{ {{
SearchMode[form_data.dataset_setting.search_mode as keyof typeof SearchMode] $t(SearchMode[form_data.dataset_setting.search_mode as keyof typeof SearchMode])
}}</el-col }}</el-col
> >
<el-col :span="12" class="color-secondary lighter"> <el-col :span="12" class="color-secondary lighter">