Explorar el Código

完善停车区域

2545307760@qq.com hace 3 meses
padre
commit
4a54096a1d

+ 28 - 19
web/src/lang/en.js

@@ -121,24 +121,24 @@ export default {
   saveFail: 'Save failed',
   addSuccess: 'Added successfully',
   confirmDelete: 'Confirm delete?',
-  parking: 'ParkingLotManagement',
-  parkingInfo: 'ParkingInformationManagement',
-  carOwner: 'CarOwnerManagement',
-  carInfo: 'VehicleInformation',
-  pricing: 'FeeConfiguration',
-  report: 'ReportInformationQuery',
-  enter: 'Entry&ExitRecords',
-  sheet: 'ExceptionReports',
-  statistics: 'StatisticsQuery',
-  vehicle: 'On-siteVehicleStatistics',
-  dashboard: 'Dashboard',
-  superAdmin: 'SuperAdmin',
-  authority: 'RoleManagement',
-  menu: 'MenuManagement',
-  api: 'APIManagement',
-  user: 'UserManagement',
-  dictionary: 'DictionaryManagement',
-  operation: 'OperationHistory',
+  parking: 'ParkingManage', // 车场管理
+  parkingInfo: 'ParkingInfoManage', // 车场信息管理
+  carOwner: 'OwnerManage', // 车主管理
+  carInfo: 'VehicleInfo', // 车辆信息
+  pricing: 'FeeConfig', // 收费配置
+  report: 'ReportQuery', // 报表查询
+  enter: 'AccessRecord', // 进出记录
+  sheet: 'ExceptionReport', // 异常报表
+  statistics: 'StatQuery', // 统计查询
+  vehicle: 'VehicleStat', // 场内车辆统计
+  dashboard: 'Dashboard', // 数据看板
+  superAdmin: 'SuperAdmin', // 超级管理员
+  authority: 'RoleManage', // 角色管理
+  menu: 'MenuManage', // 菜单管理
+  api: 'APIManage', // 接口管理
+  user: 'UserManage', // 用户管理
+  dictionary: 'DictManage', // 字典管理
+  operation: 'OperHistory', // 操作日志
   person: 'PersonalInformation',
   areaName: 'Area Name',
   areaCapacity: 'Area Capacity',
@@ -148,5 +148,14 @@ export default {
   editPassage: 'Edit Passage',
   addDevice: 'Add Device',
   editDevice: 'Edit Device',
-  smartBarrier: 'SmartBarrierGate'
+  smartBarrier: 'SmartBarrier',
+  language: 'Language',
+  currRole: 'CurrentRole',
+  menuCmd: 'MenuCommand',
+  personalInfo: 'PersonalInfo',
+  logout: 'Logout',
+  barrierSystem: 'Smart Barrier System',
+  placeholderUser: 'Please enter username',
+  placeholderPwd: 'Please enter password',
+  placeholderCode: 'Please enter verification code'
 }

+ 10 - 1
web/src/lang/zh-CN.js

@@ -148,5 +148,14 @@ export default {
   editPassage: '通道编辑',
   addDevice: '新增设备',
   editDevice: '编辑设备',
-  smartBarrier: '智慧道闸'
+  smartBarrier: '智慧道闸',
+  language: '语言',
+  currRole: '当前角色',
+  menuCmd: '菜单指令',
+  personalInfo: '个人信息',
+  logout: '登出',
+  barrierSystem: '智慧道闸系统',
+  placeholderUser: '请输入用户名',
+  placeholderPwd: '请输入密码',
+  placeholderCode: '请输入验证码'
 }

+ 10 - 1
web/src/lang/zh-HK.js

@@ -148,5 +148,14 @@ export default {
   editPassage: '通道編輯',
   addDevice: '新增設備',
   editDevice: '編輯設備',
-  smartBarrier: '智慧閘機'
+  smartBarrier: '智慧閘機',
+  language: '語言',
+  currRole: '當前角色',
+  menuCmd: '選單指令',
+  personalInfo: '個人資訊',
+  logout: '登出',
+  barrierSystem: '智慧閘機系統',
+  placeholderUser: '請輸入用戶名',
+  placeholderPwd: '請輸入密碼',
+  placeholderCode: '請輸入驗證碼'
 }

+ 10 - 1
web/src/lang/zh-TW.js

@@ -148,5 +148,14 @@ export default {
   editPassage: '通道編輯',
   addDevice: '新增設備',
   editDevice: '編輯設備',
-  smartBarrier: '智慧閘門'
+  smartBarrier: '智慧閘門',
+  language: '語言',
+  currRole: '目前角色',
+  menuCmd: '選單指令',
+  personalInfo: '個人資訊',
+  logout: '登出',
+  barrierSystem: '智慧閘門系統',
+  placeholderUser: '請輸入使用者名稱',
+  placeholderPwd: '請輸入密碼',
+  placeholderCode: '請輸入驗證碼'
 }

+ 6 - 1
web/src/utils/fmtRouterTitle.js

@@ -1,3 +1,5 @@
+import {t} from "@/lang";
+
 export const fmtTitle = (title, now) => {
   const reg = /\$\{(.+?)\}/
   const reg_g = /\$\{(.+?)\}/g
@@ -9,5 +11,8 @@ export const fmtTitle = (title, now) => {
       title = title.replace(item, value)
     })
   }
-  return title
+  console.log('面包屑', title, now)
+  if (!title) return ''
+  // 从语言包找,找不到就返回原来的中文(不报错、不空白)
+  return t.value[title] || title
 }

+ 9 - 3
web/src/view/layout/aside/historyComponent/history.vue

@@ -29,11 +29,11 @@
                  activeValue === getFmtString(item) ? userStore.activeColor : '#ddd',
              }"
            />
-            {{ fmtTitle(item.meta.title,item) }}</span>
+            {{ getText(item.name) }}</span>
         </template>
       </el-tab-pane>
     </el-tabs>
-
+<!--    {{ fmtTitle(item.meta.title,item) }}-->
     <!--自定义右键菜单html代码-->
     <ul
       v-show="contextMenuVisible"
@@ -53,7 +53,8 @@ import { emitter } from '@/utils/bus.js'
 import { computed, onUnmounted, ref, watch, nextTick } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import { useUserStore } from '@/pinia/modules/user'
-import { fmtTitle } from '@/utils/fmtRouterTitle'
+// import { fmtTitle } from '@/utils/fmtRouterTitle'
+import { t } from '@/lang/index.js'
 
 defineOptions({
   name: 'HistoryComponent',
@@ -340,6 +341,11 @@ const initPage = () => {
 }
 initPage()
 
+const getText = (title) => {
+  if (!title) return ''
+  // 从语言包找,找不到就返回原来的中文(不报错、不空白)
+  return t.value[title] || title
+}
 onUnmounted(() => {
   emitter.off('collapse')
   emitter.off('mobile')

+ 5 - 5
web/src/view/layout/index.vue

@@ -80,7 +80,7 @@
                         <el-breadcrumb-item
                           v-for="item in matched.slice(1,matched.length)"
                           :key="item.path"
-                        >{{ fmtTitle(item.meta.title,route) }}</el-breadcrumb-item>
+                        >{{ fmtTitle(item.name,route) }}</el-breadcrumb-item>
                       </el-breadcrumb>
                     </el-col>
                     <el-col
@@ -110,7 +110,7 @@
                             <el-dropdown-menu>
                               <el-dropdown-item>
                                 <span class="font-bold">
-                                  当前角色:{{ userStore.userInfo.authority.authorityName }}
+                                  {{ $t.value.currRole }}:{{ userStore.userInfo.authority.authorityName }}
                                 </span>
                               </el-dropdown-item>
                               <template v-if="userStore.userInfo.authorities">
@@ -130,7 +130,7 @@
                                   style="display: flex"
                                   @click="handleCommand"
                                 >
-                                  <div>指令菜单</div>
+                                  <div>{{ $t.value.menuCmd }}</div>
                                   <div style="margin-left: 8px">
                                     <span class="button">{{ first }}</span>
                                     +
@@ -141,11 +141,11 @@
                               <el-dropdown-item
                                 icon="avatar"
                                 @click="toPerson"
-                              >个人信息</el-dropdown-item>
+                              >{{ $t.value.personalInfo }}</el-dropdown-item>
                               <el-dropdown-item
                                 icon="reading-lamp"
                                 @click="userStore.LoginOut"
-                              >登 出</el-dropdown-item>
+                              >{{ $t.value.logout }}</el-dropdown-item>
                             </el-dropdown-menu>
                           </template>
                         </el-dropdown>

+ 1 - 0
web/src/view/layout/search/search.vue

@@ -4,6 +4,7 @@
       <el-select
         v-model="languageType"
         @change="changeLanguageType"
+        :placeholder="$t.value.language"
       >
         <el-option
           label="zh-CN"