feat(数据集): 国际化

This commit is contained in:
dataeaseShu 2024-10-10 10:39:11 +08:00
parent e783882b4d
commit fffc6e13fa
6 changed files with 97 additions and 37 deletions

View File

@ -66,6 +66,32 @@ export default {
'There is no business menu permission, please contact the administrator for authorization'
},
data_set: {
ten_wan: '100000',
can_go_to: 'Exporting in the background, you can go to',
progress_and_download: 'Check the progress and download',
this_data_set: 'Are you sure you want to delete this data set?',
to_delete_them:
'This data set has the following blood relationships. Deletion will cause the charts on the relevant dashboard to become invalid. Are you sure you want to delete them?',
check_blood_relationship: 'Check blood relationship',
dataset_export: 'Dataset export',
pieces_of_data: 'Tip: Supports exporting up to 1,000 pieces of data',
enter_parameter_name: 'Please enter parameter name',
enter_1_50_characters: 'Please enter 1-50 characters',
parameter_default_value: 'Please enter parameter default value',
edit_calculation_parameters: 'Edit calculation parameters',
add_calculation_parameters: 'Add calculation parameters',
parameter_is_supported: 'Only adding one calculation parameter is supported.',
enter_a_number: 'Please enter a number',
parameter_name: 'Parameter name',
parameter_default_value_de: 'Parameter default value',
confirm_the_deletion:
'If it is not checked, the calculated fields related to it will be deleted. Confirm the deletion?',
confirm_to_delete: 'Are you sure to delete {a}?',
also_be_deleted:
'After deletion, the associated table or sql fragment will be deleted, and its related calculated fields will also be deleted.',
deleted_confirm_deletion:
'If this field is deleted, its related calculated fields will be deleted. Confirm deletion?',
delete_field_a: 'Are you sure to delete field {a}?',
field_name: 'Field Name',
field_type: 'Field Type',
field_notes: 'Field notes',

View File

@ -89,6 +89,28 @@ export default {
administrator_for_authorization: '没有任何业务菜单权限请联系管理员授权'
},
data_set: {
ten_wan: '10万',
can_go_to: '后台导出中,可前往',
progress_and_download: '查看进度进行下载',
this_data_set: '确定删除该数据集吗',
to_delete_them: '该数据集存在如下血缘关系删除会造成相关仪表板的图表失效确定删除',
check_blood_relationship: '查看血缘关系',
dataset_export: '数据集导出',
pieces_of_data: '提示最多支持导出{limit}条数据',
enter_parameter_name: '请输入参数名称',
enter_1_50_characters: '请输入1-50个字符',
parameter_default_value: '请输入参数默认值',
edit_calculation_parameters: '编辑计算参数',
add_calculation_parameters: '添加计算参数',
parameter_is_supported: '仅支持添加一个计算参数',
enter_a_number: '请输入一个数字',
parameter_name: '参数名称',
parameter_default_value_de: '参数默认值',
confirm_the_deletion: '未被勾选, 与其相关的计算字段将被删除确认删除',
confirm_to_delete: '确定要删除{a}',
also_be_deleted: '删除后被关联的表或sql片段将被删除与其相关的计算字段也将被删除',
deleted_confirm_deletion: '如果该字段被删除与其相关的计算字段将被删除确认删除',
delete_field_a: '确认删除字段{a}',
field_name: '字段名称',
field_type: '字段类型',
field_notes: '字段备注',

View File

@ -83,10 +83,10 @@ const formQuota = reactive({
const dialogFormVisible = ref(false)
const formQuotaRules = {
name: [
{ required: true, message: '请输入参数名称', trigger: 'blur' },
{ min: 1, max: 50, message: '请输入1-50个字符', trigger: 'blur' }
{ required: true, message: t('data_set.enter_parameter_name'), trigger: 'blur' },
{ min: 1, max: 50, message: t('data_set.enter_1_50_characters'), trigger: 'blur' }
],
value: [{ required: true, message: '请输入参数默认值', trigger: 'blur' }]
value: [{ required: true, message: t('data_set.parameter_default_value'), trigger: 'blur' }]
}
const formQuotaClose = () => {
@ -271,7 +271,7 @@ defineExpose({
const parmasTitle = ref('')
const addParmasToQuota = () => {
if (disableCaParams.value) return
parmasTitle.value = '添加计算参数'
parmasTitle.value = t('data_set.add_calculation_parameters')
if (!fieldForm.params) {
fieldForm.params = []
}
@ -280,7 +280,7 @@ const addParmasToQuota = () => {
const updateParmasToQuota = () => {
const [o] = fieldForm.params
parmasTitle.value = '编辑计算参数'
parmasTitle.value = t('data_set.edit_calculation_parameters')
Object.assign(formQuota, o || {})
dialogFormVisible.value = true
}
@ -471,7 +471,11 @@ initFunction()
<span>{{ t('chart.quota') }}</span>
<el-tooltip
effect="dark"
:content="disableCaParams ? '仅支持添加一个计算参数。' : '添加计算参数'"
:content="
disableCaParams
? t('data_set.parameter_is_supported')
: t('data_set.add_calculation_parameters')
"
placement="top"
>
<el-icon class="hover-icon_quota" @click="addParmasToQuota">
@ -588,7 +592,7 @@ initFunction()
<el-dialog
:before-close="formQuotaClose"
v-model="dialogFormVisible"
title="添加计算参数"
:title="t('data_set.add_calculation_parameters')"
width="500"
>
<el-form
@ -598,22 +602,26 @@ initFunction()
:model="formQuota"
:rules="formQuotaRules"
>
<el-form-item label="参数名称" prop="name">
<el-input style="width: 100%" v-model="formQuota.name" placeholder="请输入1-50个字符" />
<el-form-item :label="t('data_set.parameter_name')" prop="name">
<el-input
style="width: 100%"
v-model="formQuota.name"
:placeholder="t('data_set.enter_1_50_characters')"
/>
</el-form-item>
<el-form-item label="参数默认值" prop="value">
<el-form-item :label="t('data_set.parameter_default_value_de')" prop="value">
<el-input-number
style="width: 100%"
v-model="formQuota.value"
placeholder="请输入一个数字"
:placeholder="t('data_set.enter_a_number')"
controls-position="right"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="formQuotaClose">取消</el-button>
<el-button type="primary" @click="formQuotaConfirm"> 确认 </el-button>
<el-button @click="formQuotaClose">{{ t('chart.cancel') }}</el-button>
<el-button type="primary" @click="formQuotaConfirm"> {{ t('chart.confirm') }} </el-button>
</div>
</template>
</el-dialog>

View File

@ -381,14 +381,14 @@ const confirmEditUnion = () => {
}, [])
if (!!idArr.length) {
ElMessageBox.confirm('字段选择', {
ElMessageBox.confirm(t('data_set.field_selection'), {
confirmButtonText: t('dataset.confirm'),
cancelButtonText: t('common.cancel'),
showCancelButton: true,
tip: `${t('data_set.field')}: ${allfields.value
.filter(ele => [...new Set(idArr)].includes(ele.id) && ele.extField !== 2)
.map(ele => ele.name)
.join(',')}, 未被勾选, 与其相关的计算字段将被删除确认删除`,
.join(',')}, ${t('data_set.confirm_the_deletion')}`,
confirmButtonType: 'danger',
type: 'warning',
autofocus: false,
@ -466,11 +466,11 @@ const handleCommand = (ele, command) => {
}, [])
fakeDelId = []
if (!!idArr.length) {
ElMessageBox.confirm(`确定要删除 ${ele.tableName}`, {
ElMessageBox.confirm(t('data_set.confirm_to_delete', { a: ele.tableName }), {
confirmButtonText: t('dataset.confirm'),
cancelButtonText: t('common.cancel'),
showCancelButton: true,
tip: '删除后被关联的表或sql片段将被删除与其相关的计算字段也将被删除。',
tip: t('data_set.also_be_deleted'),
confirmButtonType: 'danger',
type: 'warning',
autofocus: false,
@ -1105,7 +1105,7 @@ const emits = defineEmits([
></Icon>
</el-icon>
<span class="tableName">{{ ele.tableName }}</span>
<span class="placeholder">拖拽表或自定义SQL至此处</span>
<span class="placeholder">{{ t('data_set.custom_sql_here') }}</span>
<handle-more
style="margin-left: auto"
:iconName="icon_moreVertical_outlined"

View File

@ -508,8 +508,8 @@ const deleteField = item => {
pre = [...result, ...pre]
return pre
}, [])
tip = idArr.includes(item.id) ? `如果该字段被删除,与其相关的计算字段将被删除,确认删除?` : ''
ElMessageBox.confirm(`确认删除字段 ${item.name}`, {
tip = idArr.includes(item.id) ? t('data_set.deleted_confirm_deletion') : ''
ElMessageBox.confirm(t('data_set.delete_field_a', { a: item.name }), {
confirmButtonText: t('dataset.confirm'),
tip,
cancelButtonText: t('common.cancel'),
@ -917,14 +917,14 @@ const confirmEditUnion = () => {
return pre
}, [])
ElMessageBox.confirm('字段选择', {
ElMessageBox.confirm(t('data_set.field_selection'), {
confirmButtonText: t('dataset.confirm'),
cancelButtonText: t('common.cancel'),
showCancelButton: true,
tip: `${t('data_set.field')}: ${allfields.value
.filter(ele => [...new Set(idArr)].includes(ele.id) && ele.extField !== 2)
.map(ele => ele.name)
.join(',')}, 未被勾选, 与其相关的计算字段将被删除确认删除`,
.join(',')}, ${t('data_set.confirm_the_deletion')}`,
confirmButtonType: 'danger',
type: 'warning',
autofocus: false,
@ -1764,7 +1764,11 @@ const getDsIconName = data => {
</div>
</template>
</el-table-column>
<el-table-column prop="datasetTableId" label="表名" width="240">
<el-table-column
prop="datasetTableId"
:label="t('data_set.table_name_de')"
width="240"
>
<template #default="scope">
{{ scope.row.extField === 0 ? nameMap[scope.row.datasetTableId] : '' }}
</template>
@ -1949,7 +1953,11 @@ const getDsIconName = data => {
</template>
</el-table-column>
<el-table-column prop="datasetTableId" label="表名" width="240">
<el-table-column
prop="datasetTableId"
:label="t('data_set.table_name_de')"
width="240"
>
<template #default="scope">
{{ scope.row.extField === 0 ? nameMap[scope.row.datasetTableId] : '' }}
</template>

View File

@ -104,7 +104,7 @@ const rootManage = ref(false)
const showExport = ref(false)
const rowAuth = ref()
const exportDatasetLoading = ref(false)
const limit = ref('10万')
const limit = ref(t('data_set.ten_wan'))
const exportForm = ref({})
const table = ref({})
const exportFormRef = ref()
@ -405,7 +405,7 @@ const openMessageLoading = cb => {
const customClass = `de-message-loading de-message-export`
ElMessage({
message: h('p', null, [
'后台导出中,可前往',
t('data_set.can_go_to'),
h(
ElButton,
{
@ -418,7 +418,7 @@ const openMessageLoading = cb => {
},
t('data_export.export_center')
),
'查看进度,进行下载'
t('data_set.progress_and_download')
]),
iconClass,
icon: h(RefreshLeft),
@ -547,20 +547,16 @@ const operation = (cmd: string, data: BusiTreeNode, nodeType: string) => {
confirmButtonType: 'danger',
type: 'warning',
autofocus: false,
confirmButtonText: '确定',
confirmButtonText: t('userimport.sure'),
showClose: false,
dangerouslyUseHTMLString: true,
message: h('div', null, [
h('p', { style: 'margin-bottom: 8px;' }, '确定删除该数据集吗?'),
h(
'p',
{ class: 'tip' },
'该数据集存在如下血缘关系,删除会造成相关仪表板的图表失效,确定删除?'
),
h('p', { style: 'margin-bottom: 8px;' }, t('data_set.this_data_set')),
h('p', { class: 'tip' }, t('data_set.to_delete_them')),
h(
ElButton,
{ text: true, onClick: onClick, style: 'margin-left: -4px;' },
'查看血缘关系'
t('data_set.check_blood_relationship')
)
])
}).then(() => {
@ -956,7 +952,7 @@ const getMenuList = (val: boolean) => {
><icon_download_outlined class="svg-icon"
/></Icon>
</template>
数据集导出
{{ t('data_set.dataset_export') }}
</el-button>
<el-button type="primary" @click="editorDataset" v-if="nodeInfo.weight >= 7">
<template #icon>
@ -1103,7 +1099,7 @@ const getMenuList = (val: boolean) => {
</div>
</el-form-item>
</el-form>
<span class="tip">提示最多支持导出{{ limit }}条数据</span>
<span class="tip">{{ t('data_set.pieces_of_data', { limit: limit }) }}</span>
<template v-slot:footer>
<div class="dialog-footer">
<el-button secondary @click="closeExport">{{ $t('dataset.cancel') }} </el-button>