Browse Source

语言转义示例暂存

noToken
安虹睿 1 year ago
parent
commit
c52e39ef4e
  1. 5
      PC/InterFace.Dash/src/components/umyTable/index.vue
  2. 30
      PC/InterFace.Dash/src/lang/en.js
  3. 3
      PC/InterFace.Dash/src/lang/index.js
  4. 14
      PC/InterFace.Dash/src/lang/zh.js
  5. 18
      PC/InterFace.Dash/src/utils/defaultButtons.js

5
PC/InterFace.Dash/src/components/umyTable/index.vue

@ -4,7 +4,6 @@
:id="_uid"
:key="isUpdate"
v-loading="tableLoading"
element-loading-text="拼命加载中..."
@sort-change="sortChange"
@selection-change="handleSelectionChange"
ref="multipleTable"
@ -29,7 +28,7 @@
:header-align="'center'"
>
<template #header>
<span>操作</span>
<span>{{ $t('common.handle') }}</span>
</template>
<template slot-scope="scope">
<el-button
@ -51,7 +50,7 @@
:header-align="'center'"
>
<template #header>
<span>操作</span>
<span>{{ $t('common.handle') }}</span>
</template>
<template slot-scope="scope">
<el-button

30
PC/InterFace.Dash/src/lang/en.js

@ -1,5 +1,33 @@
export default {
// todo:后期做语言时候统一处理,暂时都使用中文
// common: {
// home:'Home',
// handle:'Operate',
// },
// btns:{
// add:'Create',
// filter:'Filtrate',
// fresh:'Refresh',
// field:'Field Setting',
// export:'Export File',
// import:'Import File',
// edit:'Edit',
// delete:'Delete',
// DetailedQuery:'Detailed Query'
// },
common: {
home:'home'
home:'Home',
handle:'操作',
},
btns:{
add:'新增',
filter:'筛选',
fresh:'刷新',
field:'字段设置',
export:'导出',
import:'导入',
edit:'编辑',
delete:'删除',
DetailedQuery:'明细查询'
}
}

3
PC/InterFace.Dash/src/lang/index.js

@ -35,6 +35,7 @@ const i18n = new VueI18n({
locale: InitLanguage(),
})
locale.i18n((key, value) => i18n.t(key, value))
// todo:element的i18n语言转义,开始使用i18n时候打开下方代码
// locale.i18n((key, value) => i18n.t(key, value))
export default i18n

14
PC/InterFace.Dash/src/lang/zh.js

@ -1,5 +1,17 @@
export default {
common: {
home:'系统首页'
home:'系统首页',
handle:'操作',
},
btns:{
add:'新增',
filter:'筛选',
fresh:'刷新',
field:'字段设置',
export:'导出',
import:'导入',
edit:'编辑',
delete:'删除',
DetailedQuery:'明细查询'
}
}

18
PC/InterFace.Dash/src/utils/defaultButtons.js

@ -1,4 +1,5 @@
// 页面基础按钮样式
import i18n from "@/lang"
/**
* 如果需要更改配置格式如defaultExportBtn({label:'自定义'})
* @param {*} option
@ -10,7 +11,7 @@ export function defaultAddBtn(option) {
return __defaultBtnOption(option,{
type: "primary",
icon: "el-icon-plus",
label: "新增",
label: i18n.t('btns.add'),
name: "newly",
size: "mini",
background:"#31bb99"
@ -22,7 +23,7 @@ export function defaultImportBtn(option) {
return __defaultBtnOption(option,{
type: "primary",
icon: "el-icon-bottom-left",
label: "导入",
label: i18n.t('btns.import'),
name: "import",
size: "mini",
})
@ -33,7 +34,7 @@ export function defaultExportBtn(option) {
return __defaultBtnOption(option,{
type: "primary",
icon: "el-icon-top-right",
label: "导出",
label: i18n.t('btns.export'),
name: "export",
size: "mini",
})
@ -62,7 +63,7 @@ export function defaultFieldSettingBtn(option,source) {
// type: _type,//暂不处理颜色
plain: true,
icon: "el-icon-setting",
label: "字段设置",
label: i18n.t('btns.field'),
name: "field",
size: "mini",
float: 'right',
@ -74,7 +75,7 @@ export function defaultFieldSettingBtn(option,source) {
export function defaultFreshBtn(option) {
return __defaultBtnOption(option,{
icon: "el-icon-refresh",
label: "刷新",
label: i18n.t('btns.fresh'),
name: "refresh",
size: "mini",
float: 'right'
@ -86,7 +87,7 @@ export function defaultFilterBtn(option) {
return __defaultBtnOption(option,{
type: "primary",
icon: "el-icon-finished",
label: "筛选",
label: i18n.t('btns.filter'),
name: "filter",
size: "mini",
float: 'right'
@ -98,7 +99,7 @@ export function defaultFilterForDetailBtn(option) {
return __defaultBtnOption(option,{
type: "warning",
icon: "el-icon-finished",
label: "明细查询",
label: i18n.t('btns.DetailedQuery'),
name: "filterForDetail",
size: "mini",
float: 'right',
@ -121,5 +122,4 @@ function __defaultBtnOption(option,specific){
isDetailExport:option && option.isDetailExport ? option.isDetailExport : false,
isRedundance:option && option.isRedundance ? option.isRedundance : false,
}
}
}
Loading…
Cancel
Save