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. 16
      PC/InterFace.Dash/src/utils/defaultButtons.js

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

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

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

@ -1,5 +1,33 @@
export default { 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: { 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: InitLanguage(),
}) })
locale.i18n((key, value) => i18n.t(key, value)) // todo:element的i18n语言转义,开始使用i18n时候打开下方代码
// locale.i18n((key, value) => i18n.t(key, value))
export default i18n export default i18n

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

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

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

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

Loading…
Cancel
Save