Browse Source

fix: 调整默认 router.config.js 的i18n翻译

Sendya 2 years ago
parent
commit
f629d5a353
3 changed files with 36 additions and 38 deletions
  1. 1 1
      package.json
  2. 1 3
      src/layouts/BasicLayout.vue
  3. 34 34
      src/mock/services/user.js

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "vue-antd-pro",
-  "version": "3.0.2",
+  "version": "3.0.4",
   "private": true,
   "scripts": {
     "serve": "vue-cli-service serve",

+ 1 - 3
src/layouts/BasicLayout.vue

@@ -21,7 +21,7 @@
     -->
     <template v-slot:menuHeaderRender>
       <div>
-        <logo-svg />
+        <img src="@/assets/logo.svg" />
         <h1>{{ title }}</h1>
       </div>
     </template>
@@ -62,7 +62,6 @@ import defaultSettings from '@/config/defaultSettings'
 import RightContent from '@/components/GlobalHeader/RightContent'
 import GlobalFooter from '@/components/GlobalFooter'
 import Ads from '@/components/Other/CarbonAds'
-import LogoSvg from '../assets/logo.svg?inline'
 
 export default {
   name: 'BasicLayout',
@@ -70,7 +69,6 @@ export default {
     SettingDrawer,
     RightContent,
     GlobalFooter,
-    LogoSvg,
     Ads
   },
   data () {

+ 34 - 34
src/mock/services/user.js

@@ -480,8 +480,8 @@ const userNav = options => {
       parentId: 0,
       id: 1,
       meta: {
+        title: 'menu.dashboard',
         icon: 'dashboard',
-        title: '仪表盘',
         show: true
       },
       component: 'RouteView',
@@ -492,7 +492,7 @@ const userNav = options => {
       parentId: 1,
       id: 7,
       meta: {
-        title: '工作台',
+        title: 'menu.dashboard.monitor',
         show: true
       },
       component: 'Workplace'
@@ -503,7 +503,7 @@ const userNav = options => {
       parentId: 1,
       id: 3,
       meta: {
-        title: '监控页(外部)',
+        title: 'menu.dashboard.workplace',
         target: '_blank',
         show: true
       }
@@ -513,7 +513,7 @@ const userNav = options => {
       parentId: 1,
       id: 2,
       meta: {
-        title: '分析页',
+        title: 'menu.dashboard.analysis',
         show: true
       },
       component: 'Analysis',
@@ -527,7 +527,7 @@ const userNav = options => {
       id: 10,
       meta: {
         icon: 'form',
-        title: '表单页'
+        title: 'menu.form'
       },
       redirect: '/form/base-form',
       component: 'RouteView'
@@ -537,7 +537,7 @@ const userNav = options => {
       parentId: 10,
       id: 6,
       meta: {
-        title: '基础表单'
+        title: 'menu.form.basic-form'
       },
       component: 'BasicForm'
     },
@@ -546,7 +546,7 @@ const userNav = options => {
       parentId: 10,
       id: 5,
       meta: {
-        title: '分步表单'
+        title: 'menu.form.step-form'
       },
       component: 'StepForm'
     },
@@ -555,7 +555,7 @@ const userNav = options => {
       parentId: 10,
       id: 4,
       meta: {
-        title: '高级表单'
+        title: 'menu.form.advanced-form'
       },
       component: 'AdvanceForm'
     },
@@ -567,7 +567,7 @@ const userNav = options => {
       id: 10010,
       meta: {
         icon: 'table',
-        title: '列表页',
+        title: 'menu.list',
         show: true
       },
       redirect: '/list/table-list',
@@ -579,7 +579,7 @@ const userNav = options => {
       id: 10011,
       path: '/list/table-list/:pageNo([1-9]\\d*)?',
       meta: {
-        title: '查询表格',
+        title: 'menu.list.table-list',
         show: true
       },
       component: 'TableList'
@@ -589,7 +589,7 @@ const userNav = options => {
       parentId: 10010,
       id: 10012,
       meta: {
-        title: '标准列表',
+        title: 'menu.list.basic-list',
         show: true
       },
       component: 'StandardList'
@@ -599,7 +599,7 @@ const userNav = options => {
       parentId: 10010,
       id: 10013,
       meta: {
-        title: '卡片列表',
+        title: 'menu.list.card-list',
         show: true
       },
       component: 'CardList'
@@ -609,7 +609,7 @@ const userNav = options => {
       parentId: 10010,
       id: 10014,
       meta: {
-        title: '搜索列表',
+        title: 'menu.list.search-list',
         show: true
       },
       redirect: '/list/search/article',
@@ -620,7 +620,7 @@ const userNav = options => {
       parentId: 10014,
       id: 10015,
       meta: {
-        title: '搜索列表(文章)',
+        title: 'menu.list.search-list.articles',
         show: true
       },
       component: 'SearchArticles'
@@ -630,7 +630,7 @@ const userNav = options => {
       parentId: 10014,
       id: 10016,
       meta: {
-        title: '搜索列表(项目)',
+        title: 'menu.list.search-list.projects',
         show: true
       },
       component: 'SearchProjects'
@@ -640,7 +640,7 @@ const userNav = options => {
       parentId: 10014,
       id: 10017,
       meta: {
-        title: '搜索列表(应用)',
+        title: 'menu.list.search-list.applications',
         show: true
       },
       component: 'SearchApplications'
@@ -652,7 +652,7 @@ const userNav = options => {
       parentId: 0,
       id: 10018,
       meta: {
-        title: '详情页',
+        title: 'menu.profile',
         icon: 'profile',
         show: true
       },
@@ -664,7 +664,7 @@ const userNav = options => {
       parentId: 10018,
       id: 10019,
       meta: {
-        title: '基础详情页',
+        title: 'menu.profile.basic',
         show: true
       },
       component: 'ProfileBasic'
@@ -674,7 +674,7 @@ const userNav = options => {
       parentId: 10018,
       id: 10020,
       meta: {
-        title: '高级详情页',
+        title: 'menu.profile.advanced',
         show: true
       },
       component: 'ProfileAdvanced'
@@ -686,7 +686,7 @@ const userNav = options => {
       parentId: 0,
       id: 10021,
       meta: {
-        title: '结果页',
+        title: 'menu.result',
         icon: 'check-circle-o',
         show: true
       },
@@ -698,7 +698,7 @@ const userNav = options => {
       parentId: 10021,
       id: 10022,
       meta: {
-        title: '成功',
+        title: 'menu.result.success',
         hiddenHeaderContent: true,
         show: true
       },
@@ -709,7 +709,7 @@ const userNav = options => {
       parentId: 10021,
       id: 10023,
       meta: {
-        title: '失败',
+        title: 'menu.result.fail',
         hiddenHeaderContent: true,
         show: true
       },
@@ -722,7 +722,7 @@ const userNav = options => {
       parentId: 0,
       id: 10024,
       meta: {
-        title: '异常页',
+        title: 'menu.exception',
         icon: 'warning',
         show: true
       },
@@ -734,7 +734,7 @@ const userNav = options => {
       parentId: 10024,
       id: 10025,
       meta: {
-        title: '403',
+        title: 'menu.exception.not-permission',
         show: true
       },
       component: 'Exception403'
@@ -744,7 +744,7 @@ const userNav = options => {
       parentId: 10024,
       id: 10026,
       meta: {
-        title: '404',
+        title: 'menu.exception.not-find',
         show: true
       },
       component: 'Exception404'
@@ -754,7 +754,7 @@ const userNav = options => {
       parentId: 10024,
       id: 10027,
       meta: {
-        title: '500',
+        title: 'menu.exception.server-error',
         show: true
       },
       component: 'Exception500'
@@ -766,7 +766,7 @@ const userNav = options => {
       parentId: 0,
       id: 10028,
       meta: {
-        title: '个人页',
+        title: 'menu.account',
         icon: 'user',
         show: true
       },
@@ -778,7 +778,7 @@ const userNav = options => {
       parentId: 10028,
       id: 10029,
       meta: {
-        title: '个人中心',
+        title: 'menu.account.center',
         show: true
       },
       component: 'AccountCenter'
@@ -789,7 +789,7 @@ const userNav = options => {
       parentId: 10028,
       id: 10030,
       meta: {
-        title: '个人设置',
+        title: 'menu.account.settings',
         hideHeader: true,
         hideChildren: true,
         show: true
@@ -803,7 +803,7 @@ const userNav = options => {
       parentId: 10030,
       id: 10031,
       meta: {
-        title: '基本设置',
+        title: 'account.settings.menuMap.basic',
         show: false
       },
       component: 'BasicSetting'
@@ -814,7 +814,7 @@ const userNav = options => {
       parentId: 10030,
       id: 10032,
       meta: {
-        title: '安全设置',
+        title: 'account.settings.menuMap.security',
         show: false
       },
       component: 'SecuritySettings'
@@ -825,7 +825,7 @@ const userNav = options => {
       parentId: 10030,
       id: 10033,
       meta: {
-        title: '个性化设置',
+        title: 'account.settings.menuMap.custom',
         show: false
       },
       component: 'CustomSettings'
@@ -836,7 +836,7 @@ const userNav = options => {
       parentId: 10030,
       id: 10034,
       meta: {
-        title: '账户绑定',
+        title: 'account.settings.menuMap.binding',
         show: false
       },
       component: 'BindingSettings'
@@ -847,7 +847,7 @@ const userNav = options => {
       parentId: 10030,
       id: 10034,
       meta: {
-        title: '新消息通知',
+        title: 'account.settings.menuMap.notification',
         show: false
       },
       component: 'NotificationSettings'