add:菜单国际化

This commit is contained in:
zhangzq
2024-12-21 17:07:41 +08:00
parent c63404b718
commit 2d3fb1730e
40 changed files with 126 additions and 72 deletions

View File

@@ -37,7 +37,7 @@ export default {
const first = matched[0]
if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched)
matched = [{ path: '/dashboard', meta: { title: this.$t('auto.common.home') }}].concat(matched)
}
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)

View File

@@ -59,9 +59,14 @@ import customer2 from './basedata/customer/zh'
import supplier2 from './basedata/supplier/zh'
import measure2 from './basedata/measure/zh'
import classification2 from './basedata/classification/zh'
import ivtChange from './ivtChange/zh'
import eslog from './eslog/zh'
import elpage from './elpage/zh'
export default {
...elpage,
...eslog,
...ivtChange,
...vehicle2,
...material2,
...customer2,

View File

@@ -0,0 +1,8 @@
export default {
'el': {
'pagination': {
'total': 'total',
'pagesize': 'size',
}
}
}

View File

@@ -0,0 +1,8 @@
export default {
'el': {
'pagination': {
'total': 'total',
'pagesize': 'size',
}
}
}

View File

@@ -0,0 +1,8 @@
export default {
'el': {
'pagination': {
'total': 'total',
'pagesize': 'size',
}
}
}

View File

@@ -59,8 +59,14 @@ import customer2 from './basedata/customer/en'
import supplier2 from './basedata/supplier/en'
import measure2 from './basedata/measure/en'
import classification2 from './basedata/classification/en'
import ivtChange from './ivtChange/en'
import eslog from './eslog/en'
import elpage from './elpage/en'
export default {
...elpage,
...eslog,
...ivtChange,
...vehicle2,
...material2,
...customer2,

View File

@@ -16,7 +16,7 @@ import operation_log from './operationLog/vi'
import record from './record/vi'
import online from './online/vi'
import error_log from './errorLog/vi'
import menu from './menu/vi'
import menu from './menu/es'
import param from './param/vi'
import instruction from './instruction/in'
import task from './task/in'
@@ -33,8 +33,8 @@ import timing from './timing/vi'
import config from './config/in'
import customPolicy from './customPolicy/in'
import deviceErrorInfo from './deviceErrorInfo/in'
import user from './user/vi'
import role from './role/vi'
import user from './user/es'
import role from './role/es'
import department from './department/vi'
import dict from './dict/vi'
import angle from './angle/in'
@@ -54,8 +54,15 @@ import customer from './basedata/customer/es'
import supplier from './basedata/supplier/es'
import measure from './basedata/measure/es'
import classification from './basedata/classification/es'
import ivtChange from './ivtChange/en'
import eslog from './eslog/es'
import elpage from './elpage/es'
export default {
...elpage,
...eslog,
...ivtChange,
...vehicle,
...material,
...customer,

View File

@@ -69,7 +69,11 @@ Element.TableColumn.props.align = { type: String, default: 'center' }
Vue.use(Element, {
size: Cookies.get('size') || 'mini' // set element-ui default size
})
Vue.prototype.$langPre = {
computedProp(suffix) {
return localStorage.getItem('lang') + '_' + suffix
}
}
Vue.config.productionTip = false
// 全局方法挂载
Vue.prototype.parseTime = parseTime

View File

@@ -1,6 +1,7 @@
import Vue from 'vue'
import Router from 'vue-router'
import Layout from '../layout/index'
import i18n from '@/i18n'
Vue.use(Router)
@@ -41,7 +42,7 @@ export const constantRouterMap = [
path: 'dashboard',
component: (resolve) => require(['@/views/monitor/server/index'], resolve),
name: 'Dashboard',
meta: { title: '首页', icon: 'index', affix: true, noCache: true }
meta: { title: i18n.t('auto.common.home'), icon: 'index', affix: true, noCache: true }
}
]
},

View File

@@ -1,7 +1,7 @@
<template>
<div style="height:1000px">
<iframe
src="./src/assets/daping/index.html"
src="/static/daping/index.html"
width="100%"
height="100%"
frameborder="0"

View File

@@ -171,7 +171,7 @@
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column :label="$t('menu.table_title.menu_title')" prop="title" :min-width="100" />
<el-table-column :label="$t('menu.table_title.menu_title')" :prop="$langPre.computedProp('title')" :min-width="flexWidth($langPre.computedProp('title'),crud.data,$t('menu.table_title.menu_title'))" />
<el-table-column :label="$t('menu.table_title.system')" prop="systemType" :min-width="flexWidth('systemType',crud.data,$t('menu.table_title.system'))">
<template slot-scope="scope">
{{ dict.label.system_type[scope.row.systemType] }} : {{ scope.row.systemType }}