refactor: 整理国际化

This commit is contained in:
taojinlong 2022-09-26 17:47:32 +08:00
parent a843a01b77
commit 87d7b56a8e
4 changed files with 57 additions and 64 deletions

View File

@ -498,7 +498,6 @@ export default {
folder_name: 'Folder Name', folder_name: 'Folder Name',
folder: 'Folder', folder: 'Folder',
edit_folder: 'Edit Folder', edit_folder: 'Edit Folder',
new_folder: 'New Folder',
name_already_exists: 'Folder name already exists', name_already_exists: 'Folder name already exists',
data_preview: 'Data preview', data_preview: 'Data preview',
original_name: 'Original Name', original_name: 'Original Name',
@ -512,8 +511,6 @@ export default {
expression_syntax_error: 'Field expression syntax error', expression_syntax_error: 'Field expression syntax error',
create_dashboard: 'Create Dashboard', create_dashboard: 'Create Dashboard',
cannot_be_empty: 'SQL cannot be empty', cannot_be_empty: 'SQL cannot be empty',
to_run_query: 'Click to run query',
the_running_results: 'You can view the running results',
data_reference: 'Data Reference', data_reference: 'Data Reference',
want_to_replace: 'Replacement may affect custom dataset, associated dataset, dashboard, etc. Do you want to replace?', want_to_replace: 'Replacement may affect custom dataset, associated dataset, dashboard, etc. Do you want to replace?',
replace_the_data: 'Are you sure to replace the data?', replace_the_data: 'Are you sure to replace the data?',
@ -1793,7 +1790,7 @@ export default {
driver_name: 'Driver name:', driver_name: 'Driver name:',
drive_type: 'Drive type', drive_type: 'Drive type',
add_driver: 'Add driver', add_driver: 'Add driver',
on_the_left: 'Please select drive on the left', diver_on_the_left: 'Please select drive on the left',
no_data_table: 'No data table', no_data_table: 'No data table',
on_the_left: 'Please select the data source on the left', on_the_left: 'Please select the data source on the left',
table_name: 'Table name:', table_name: 'Table name:',

View File

@ -498,7 +498,6 @@ export default {
folder_name: '資料夾名稱', folder_name: '資料夾名稱',
folder: '所屬資料夾', folder: '所屬資料夾',
edit_folder: '編輯資料夾', edit_folder: '編輯資料夾',
new_folder: '新建資料夾',
name_already_exists: '資料夾名稱已存在', name_already_exists: '資料夾名稱已存在',
data_preview: '數據預覽', data_preview: '數據預覽',
original_name: '原始名稱', original_name: '原始名稱',
@ -512,8 +511,6 @@ export default {
expression_syntax_error: '欄位運算式語法錯誤', expression_syntax_error: '欄位運算式語法錯誤',
create_dashboard: '創建儀表板', create_dashboard: '創建儀表板',
cannot_be_empty: 'SQL不能為空', cannot_be_empty: 'SQL不能為空',
to_run_query: '點擊運行査詢',
the_running_results: '即可查看運行結果',
data_reference: '數據參攷', data_reference: '數據參攷',
want_to_replace: '替換可能會影響自定義數据集、關聯數据集、儀表板等,是否替換?', want_to_replace: '替換可能會影響自定義數据集、關聯數据集、儀表板等,是否替換?',
replace_the_data: '確定替換數據嗎?', replace_the_data: '確定替換數據嗎?',
@ -1793,7 +1790,7 @@ export default {
driver_name: '驅動名稱', driver_name: '驅動名稱',
drive_type: '驅動類型', drive_type: '驅動類型',
add_driver: '添加驅動', add_driver: '添加驅動',
on_the_left: '請在左側選擇驅動', diver_on_the_left: '請在左側選擇驅動',
no_data_table: '暫無資料表', no_data_table: '暫無資料表',
on_the_left: '請在左側選擇資料來源', on_the_left: '請在左側選擇資料來源',
table_name: '表名稱', table_name: '表名稱',

View File

@ -497,7 +497,6 @@ export default {
folder_name: '文件夹名称', folder_name: '文件夹名称',
folder: '所属文件夹', folder: '所属文件夹',
edit_folder: '编辑文件夹', edit_folder: '编辑文件夹',
new_folder: '新建文件夹',
name_already_exists: '文件夹名称已存在', name_already_exists: '文件夹名称已存在',
data_preview: '数据预览', data_preview: '数据预览',
original_name: '原始名称', original_name: '原始名称',
@ -511,8 +510,6 @@ export default {
expression_syntax_error: '字段表达式语法错误', expression_syntax_error: '字段表达式语法错误',
create_dashboard: '创建仪表板', create_dashboard: '创建仪表板',
cannot_be_empty: 'SQL不能为空', cannot_be_empty: 'SQL不能为空',
to_run_query: '点击运行查询',
the_running_results: '即可查看运行结果',
data_reference: '数据参考', data_reference: '数据参考',
want_to_replace: '替换可能会影响自定义数据集、关联数据集、仪表板等,是否替换?', want_to_replace: '替换可能会影响自定义数据集、关联数据集、仪表板等,是否替换?',
replace_the_data: '确定替换数据吗?', replace_the_data: '确定替换数据吗?',
@ -1792,7 +1789,7 @@ export default {
driver_name: '驱动名称', driver_name: '驱动名称',
drive_type: '驱动类型', drive_type: '驱动类型',
add_driver: '添加驱动', add_driver: '添加驱动',
on_the_left: '请在左侧选择驱动', diver_on_the_left: '请在左侧选择驱动',
no_data_table: '暂无数据表', no_data_table: '暂无数据表',
on_the_left: '请在左侧选择数据源', on_the_left: '请在左侧选择数据源',
table_name: '表名称', table_name: '表名称',

View File

@ -1,16 +1,19 @@
<template> <template>
<div <div
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
class="de-ds-container" class="de-ds-container"
:class="[{ 'is-driver-mgm': currentMgm === 'driverMgm' }]" :class="[{ 'is-driver-mgm': currentMgm === 'driverMgm' }]"
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
> >
<div v-if="currentMgm === 'driverMgm'" class="dsr-route-title"> <div v-if="currentMgm === 'driverMgm'" class="dsr-route-title">
<div> <div>
<i class="el-icon-arrow-left back-button" @click="jump" /> <i class="el-icon-arrow-left back-button" @click="jump" />
<span>{{ $t('driver.mgm') }}</span> <span>{{ $t('driver.mgm') }}</span>
</div> </div>
<deBtn type="primary" @click="addDriver" icon="el-icon-plus" <deBtn
>{{ $t("driver.add") }} type="primary"
icon="el-icon-plus"
@click="addDriver"
>{{ $t("driver.add") }}
</deBtn> </deBtn>
</div> </div>
<de-aside-container <de-aside-container
@ -18,14 +21,13 @@
type="datasource" type="datasource"
> >
<ds-tree <ds-tree
@switch-mgm="switchMgm"
ref="dsTree" ref="dsTree"
:datasource="datasource" :datasource="datasource"
@switch-mgm="switchMgm"
@switch-main="switchMain" @switch-main="switchMain"
/> />
</de-aside-container> </de-aside-container>
<de-main-container <de-main-container>
>
<component <component
:is="component" :is="component"
v-if="!!component" v-if="!!component"
@ -35,20 +37,20 @@
@refresh-type="refreshType" @refresh-type="refreshType"
@switch-component="switchMain" @switch-component="switchMain"
/> />
<el-empty v-else :image-size="125" :description="$t(`datasource.${swTips}`)" :image="image"></el-empty> <el-empty v-else :image-size="125" :description="$t(`datasource.${swTips}`)" :image="image" />
</de-main-container> </de-main-container>
</div> </div>
</template> </template>
<script> <script>
import DeMainContainer from "@/components/dataease/DeMainContainer"; import DeMainContainer from '@/components/dataease/DeMainContainer'
import DeAsideContainer from "@/components/dataease/DeAsideContainer"; import DeAsideContainer from '@/components/dataease/DeAsideContainer'
import DsTree from "./DsTree"; import DsTree from './DsTree'
import DsForm from "./DsForm"; import DsForm from './DsForm'
import dsTable from "./dsTable"; import dsTable from './dsTable'
import DriverForm from "./DriverFormDetail"; import DriverForm from './DriverFormDetail'
export default { export default {
name: "DsMain", name: 'DsMain',
components: { DeMainContainer, DeAsideContainer, DsTree }, components: { DeMainContainer, DeAsideContainer, DsTree },
data() { data() {
return { return {
@ -57,65 +59,65 @@ export default {
datasource: {}, datasource: {},
param: null, param: null,
tData: null, tData: null,
currentMgm: "dsMgm", currentMgm: 'dsMgm',
dsTypes: [], dsTypes: []
}; }
}, },
computed: { computed: {
swTips() { swTips() {
return this.currentMgm === 'driverMgm' ? 'on_the_left' : 'on_the_left'; return this.currentMgm === 'driverMgm' ? 'diver_on_the_left' : 'on_the_left'
} }
}, },
methods: { methods: {
jump() { jump() {
this.$refs.dsTree.dsMgm(); this.$refs.dsTree.dsMgm()
this.switchMgm('dsMgm'); this.switchMgm('dsMgm')
}, },
switchMgm(type) { switchMgm(type) {
this.currentMgm = type; this.currentMgm = type
}, },
addDriver() { addDriver() {
this.$refs.dsTree.addDriver(); this.$refs.dsTree.addDriver()
}, },
// main // main
switchMain(param) { switchMain(param) {
const { component, componentParam, tData, dsTypes } = param; const { component, componentParam, tData, dsTypes } = param
this.component = ''; this.component = ''
this.param = null; this.param = null
this.$nextTick(() => { this.$nextTick(() => {
switch (component) { switch (component) {
case "DsForm": case 'DsForm':
this.component = DsForm; this.component = DsForm
this.param = componentParam; this.param = componentParam
this.tData = tData; this.tData = tData
this.dsTypes = dsTypes; this.dsTypes = dsTypes
break; break
case "DriverForm": case 'DriverForm':
this.component = DriverForm; this.component = DriverForm
this.param = componentParam; this.param = componentParam
this.tData = tData; this.tData = tData
this.dsTypes = dsTypes; this.dsTypes = dsTypes
break; break
case "dsTable": case 'dsTable':
this.component = dsTable; this.component = dsTable
this.param = componentParam; this.param = componentParam
break; break
default: default:
this.component = ''; this.component = ''
this.param = null; this.param = null
break; break
} }
}); })
}, },
refreshType(datasource) { refreshType(datasource) {
this.datasource = datasource; this.datasource = datasource
this.$refs.dsTree && this.$refs.dsTree.refreshType(datasource); this.$refs.dsTree && this.$refs.dsTree.refreshType(datasource)
}, },
msg2Current(sourceParam) { msg2Current(sourceParam) {
this.$refs.dsTree && this.$refs.dsTree.markInvalid(sourceParam); this.$refs.dsTree && this.$refs.dsTree.markInvalid(sourceParam)
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -160,4 +162,4 @@ export default {
padding: 24px 0 70px 24px; padding: 24px 0 70px 24px;
} }
} }
</style> </style>