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