mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 12:03:05 +08:00
fix(数据集): 国际化
This commit is contained in:
parent
a298652d65
commit
c1d4683eb8
@ -27,26 +27,26 @@ const msg = ref('')
|
||||
const exportDatasetLoading = ref(false)
|
||||
const activeName = ref('ALL')
|
||||
const multipleSelection = ref([])
|
||||
const description = ref('暂无任务')
|
||||
const description = ref(t('data_set.no_tasks_yet'))
|
||||
const tabList = ref([
|
||||
{
|
||||
label: '导出中(0)',
|
||||
label: t('data_set.exporting') + '(0)',
|
||||
name: 'IN_PROGRESS'
|
||||
},
|
||||
{
|
||||
label: '成功(0)',
|
||||
label: t('data_set.success') + '(0)',
|
||||
name: 'SUCCESS'
|
||||
},
|
||||
{
|
||||
label: '失败(0)',
|
||||
label: t('data_set.fail') + '(0)',
|
||||
name: 'FAILED'
|
||||
},
|
||||
{
|
||||
label: '等待中(0)',
|
||||
label: t('data_set.waiting') + '(0)',
|
||||
name: 'PENDING'
|
||||
},
|
||||
{
|
||||
label: '全部(0)',
|
||||
label: t('data_set.all') + '(0)',
|
||||
name: 'ALL'
|
||||
}
|
||||
])
|
||||
@ -77,26 +77,35 @@ const handleClick = tab => {
|
||||
.then(res => {
|
||||
tabList.value.forEach(item => {
|
||||
if (item.name === 'ALL') {
|
||||
item.label = '全部' + '(' + res.data.length + ')'
|
||||
item.label = t('data_set.all') + '(' + res.data.length + ')'
|
||||
}
|
||||
if (item.name === 'IN_PROGRESS') {
|
||||
item.label =
|
||||
'导出中' +
|
||||
t('data_set.exporting') +
|
||||
'(' +
|
||||
res.data.filter(task => task.exportStatus === 'IN_PROGRESS').length +
|
||||
')'
|
||||
}
|
||||
if (item.name === 'SUCCESS') {
|
||||
item.label =
|
||||
'成功' + '(' + res.data.filter(task => task.exportStatus === 'SUCCESS').length + ')'
|
||||
t('data_set.success') +
|
||||
'(' +
|
||||
res.data.filter(task => task.exportStatus === 'SUCCESS').length +
|
||||
')'
|
||||
}
|
||||
if (item.name === 'FAILED') {
|
||||
item.label =
|
||||
'失败' + '(' + res.data.filter(task => task.exportStatus === 'FAILED').length + ')'
|
||||
t('data_set.fail') +
|
||||
'(' +
|
||||
res.data.filter(task => task.exportStatus === 'FAILED').length +
|
||||
')'
|
||||
}
|
||||
if (item.name === 'PENDING') {
|
||||
item.label =
|
||||
'等待中' + '(' + res.data.filter(task => task.exportStatus === 'PENDING').length + ')'
|
||||
t('data_set.waiting') +
|
||||
'(' +
|
||||
res.data.filter(task => task.exportStatus === 'PENDING').length +
|
||||
')'
|
||||
}
|
||||
})
|
||||
if (activeName.value === 'ALL') {
|
||||
@ -121,26 +130,35 @@ const init = params => {
|
||||
exportTasks(activeName.value).then(res => {
|
||||
tabList.value.forEach(item => {
|
||||
if (item.name === 'ALL') {
|
||||
item.label = '全部' + '(' + res.data.length + ')'
|
||||
item.label = t('data_set.all') + '(' + res.data.length + ')'
|
||||
}
|
||||
if (item.name === 'IN_PROGRESS') {
|
||||
item.label =
|
||||
'导出中' +
|
||||
t('data_set.exporting') +
|
||||
'(' +
|
||||
res.data.filter(task => task.exportStatus === 'IN_PROGRESS').length +
|
||||
')'
|
||||
}
|
||||
if (item.name === 'SUCCESS') {
|
||||
item.label =
|
||||
'成功' + '(' + res.data.filter(task => task.exportStatus === 'SUCCESS').length + ')'
|
||||
t('data_set.success') +
|
||||
'(' +
|
||||
res.data.filter(task => task.exportStatus === 'SUCCESS').length +
|
||||
')'
|
||||
}
|
||||
if (item.name === 'FAILED') {
|
||||
item.label =
|
||||
'失败' + '(' + res.data.filter(task => task.exportStatus === 'FAILED').length + ')'
|
||||
t('data_set.fail') +
|
||||
'(' +
|
||||
res.data.filter(task => task.exportStatus === 'FAILED').length +
|
||||
')'
|
||||
}
|
||||
if (item.name === 'PENDING') {
|
||||
item.label =
|
||||
'等待中' + '(' + res.data.filter(task => task.exportStatus === 'PENDING').length + ')'
|
||||
t('data_set.waiting') +
|
||||
'(' +
|
||||
res.data.filter(task => task.exportStatus === 'PENDING').length +
|
||||
')'
|
||||
}
|
||||
})
|
||||
if (activeName.value === 'ALL') {
|
||||
@ -160,7 +178,7 @@ const taskExportTopicCall = task => {
|
||||
if (!linkStore.getLinkToken && !isDataEaseBi.value && !appStore.getIsIframe) {
|
||||
if (JSON.parse(task).exportStatus === 'SUCCESS') {
|
||||
openMessageLoading(
|
||||
JSON.parse(task).exportFromName + ' 导出成功,前往',
|
||||
JSON.parse(task).exportFromName + ` ${t('data_set.successful_go_to')}`,
|
||||
'success',
|
||||
callbackExportSuc
|
||||
)
|
||||
@ -168,7 +186,7 @@ const taskExportTopicCall = task => {
|
||||
}
|
||||
if (JSON.parse(task).exportStatus === 'FAILED') {
|
||||
openMessageLoading(
|
||||
JSON.parse(task).exportFromName + ' 导出失败,前往',
|
||||
JSON.parse(task).exportFromName + ` ${t('data_set.failed_go_to')}`,
|
||||
'error',
|
||||
callbackExportError
|
||||
)
|
||||
@ -432,11 +450,16 @@ defineExpose({
|
||||
<el-table-column prop="exportFromName" :label="$t('data_export.export_obj')" width="200" />
|
||||
<el-table-column prop="exportFromType" width="120" :label="$t('data_export.export_from')">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.exportFromType === 'dataset'">数据集</span>
|
||||
<span v-if="scope.row.exportFromType === 'chart'">视图</span>
|
||||
<span v-if="scope.row.exportFromType === 'dataset'">{{ t('data_set.data_set') }}</span>
|
||||
<span v-if="scope.row.exportFromType === 'chart'">{{ t('data_set.view') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-show="xpack" prop="orgName" label="所属组织" width="200" />
|
||||
<el-table-column
|
||||
v-show="xpack"
|
||||
prop="orgName"
|
||||
:label="t('data_set.organization')"
|
||||
width="200"
|
||||
/>
|
||||
<el-table-column prop="exportTime" width="180" :label="$t('data_export.export_time')">
|
||||
<template #default="scope">
|
||||
<span>{{ timestampFormatDate(scope.row.exportTime) }}</span>
|
||||
@ -444,7 +467,7 @@ defineExpose({
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" prop="operate" width="90" :label="$t('commons.operating')">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" content="下载" placement="top">
|
||||
<el-tooltip effect="dark" :content="t('data_set.download')" placement="top">
|
||||
<el-button
|
||||
v-if="scope.row.exportStatus === 'SUCCESS'"
|
||||
text
|
||||
@ -458,7 +481,7 @@ defineExpose({
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip effect="dark" content="重新导出" placement="top">
|
||||
<el-tooltip effect="dark" :content="t('data_set.re_export')" placement="top">
|
||||
<el-button v-if="scope.row.exportStatus === 'FAILED'" text @click="retry(scope.row)">
|
||||
<template #icon>
|
||||
<Icon name="icon_refresh_outlined"></Icon>
|
||||
@ -466,7 +489,7 @@ defineExpose({
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip effect="dark" content="删除" placement="top">
|
||||
<el-tooltip effect="dark" :content="t('data_set.delete')" placement="top">
|
||||
<el-button text @click="deleteField(scope.row)">
|
||||
<template #icon>
|
||||
<Icon name="de-delete"></Icon>
|
||||
@ -482,11 +505,13 @@ defineExpose({
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
||||
<el-dialog title="失败原因" v-model="msgDialogVisible" width="30%">
|
||||
<el-dialog :title="t('data_set.reason_for_failure')" v-model="msgDialogVisible" width="30%">
|
||||
<span>{{ msg }}</span>
|
||||
<template v-slot:footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="msgDialogVisible = false">关闭</el-button>
|
||||
<el-button type="primary" @click="msgDialogVisible = false">{{
|
||||
t('data_set.closure')
|
||||
}}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
@ -142,13 +142,13 @@ const allFieldsColumns = [
|
||||
{
|
||||
key: 'name',
|
||||
dataKey: 'name',
|
||||
title: '字段名称',
|
||||
title: t('data_set.field_name'),
|
||||
width: 250
|
||||
},
|
||||
{
|
||||
key: 'deType',
|
||||
dataKey: 'deType',
|
||||
title: '字段类型',
|
||||
title: t('data_set.field_type'),
|
||||
width: 250,
|
||||
cellRenderer: ({ cellData: deType }) => (
|
||||
<div style={{ width: '100%', display: 'flex', alignItems: 'center' }}>
|
||||
@ -166,7 +166,7 @@ const allFieldsColumns = [
|
||||
{
|
||||
key: 'description',
|
||||
dataKey: 'description',
|
||||
title: '字段备注',
|
||||
title: t('data_set.field_notes'),
|
||||
width: 250
|
||||
}
|
||||
]
|
||||
@ -379,13 +379,15 @@ const operation = (cmd: string, data: BusiTreeNode, nodeType: string) => {
|
||||
}
|
||||
|
||||
if (!!data.children?.length) {
|
||||
options.tip = '删除后,此文件夹下的所有资源都会被删除,请谨慎操作。'
|
||||
options.tip = t('data_set.operate_with_caution')
|
||||
} else {
|
||||
delete options.tip
|
||||
}
|
||||
|
||||
ElMessageBox.confirm(
|
||||
nodeType === 'folder' ? '确定删除该文件夹吗' : t('datasource.delete_this_dataset'),
|
||||
nodeType === 'folder'
|
||||
? t('data_set.delete_this_folder')
|
||||
: t('datasource.delete_this_dataset'),
|
||||
options as ElMessageBoxOptions
|
||||
).then(() => {
|
||||
delDatasetTree(data.id).then(() => {
|
||||
@ -444,7 +446,7 @@ const nodeCollapse = data => {
|
||||
const datasetTypeList = computed(() => {
|
||||
return [
|
||||
{
|
||||
label: '新建数据集',
|
||||
label: t('data_set.a_new_dataset'),
|
||||
svgName: 'icon_dataset',
|
||||
command: 'dataset'
|
||||
},
|
||||
@ -468,27 +470,27 @@ const defaultTab = [
|
||||
name: 'dataPreview'
|
||||
},
|
||||
{
|
||||
title: '结构预览',
|
||||
title: t('data_set.structure_preview'),
|
||||
name: 'structPreview'
|
||||
}
|
||||
]
|
||||
|
||||
const sortList = [
|
||||
{
|
||||
name: '按创建时间升序',
|
||||
name: t('data_set.by_creation_time'),
|
||||
value: 'time_asc'
|
||||
},
|
||||
{
|
||||
name: '按创建时间降序',
|
||||
name: t('data_set.by_creation_time_de'),
|
||||
value: 'time_desc',
|
||||
divided: true
|
||||
},
|
||||
{
|
||||
name: '按照名称升序',
|
||||
name: t('data_set.by_name_ascending'),
|
||||
value: 'name_asc'
|
||||
},
|
||||
{
|
||||
name: '按照名称降序',
|
||||
name: t('data_set.order_by_name'),
|
||||
value: 'name_desc'
|
||||
}
|
||||
]
|
||||
@ -585,7 +587,12 @@ const getMenuList = (val: boolean) => {
|
||||
<Icon name="dv-new-folder" />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
<el-tooltip class="box-item" effect="dark" content="新建数据集" placement="top">
|
||||
<el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
:content="t('data_set.a_new_dataset')"
|
||||
placement="top"
|
||||
>
|
||||
<el-icon class="custom-icon btn" @click="createDataset">
|
||||
<Icon name="icon_file-add_outlined" />
|
||||
</el-icon>
|
||||
@ -693,7 +700,7 @@ const getMenuList = (val: boolean) => {
|
||||
}"
|
||||
>
|
||||
<template v-if="!state.datasetTree.length && mounted">
|
||||
<empty-background description="暂无数据集" img-type="none">
|
||||
<empty-background :description="t('data_set.data_set_yet')" img-type="none">
|
||||
<el-button v-if="rootManage" @click="() => createDataset()" type="primary">
|
||||
<template #icon>
|
||||
<Icon name="icon_add_outlined"></Icon>
|
||||
@ -731,7 +738,7 @@ const getMenuList = (val: boolean) => {
|
||||
</el-button>
|
||||
<el-button secondary @click="createPanel('dvCanvas')" v-permission="['screen']">
|
||||
<template #icon> <Icon name="icon_operation-analysis_outlined"></Icon> </template
|
||||
>新建数据大屏
|
||||
>{{ t('data_set.new_data_screen') }}
|
||||
</el-button>
|
||||
<el-button type="primary" @click="editorDataset" v-if="nodeInfo.weight >= 7">
|
||||
<template #icon>
|
||||
@ -774,7 +781,10 @@ const getMenuList = (val: boolean) => {
|
||||
:height="height"
|
||||
fixed
|
||||
><template #empty>
|
||||
<empty-background description="暂无数据" img-type="noneWhite" /> </template
|
||||
<empty-background
|
||||
:description="t('data_set.no_data')"
|
||||
img-type="noneWhite"
|
||||
/> </template
|
||||
></el-table-v2>
|
||||
</template>
|
||||
</el-auto-resizer>
|
||||
@ -810,7 +820,7 @@ const getMenuList = (val: boolean) => {
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #empty>
|
||||
<empty-background description="暂无数据" img-type="noneWhite" />
|
||||
<empty-background :description="t('data_set.no_data')" img-type="noneWhite" />
|
||||
</template>
|
||||
</el-table>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user