Sfoglia il codice sorgente

完善停车区域

2545307760@qq.com 3 mesi fa
parent
commit
c5866d6ae7

+ 81 - 6
web/src/lang/en.js

@@ -2,10 +2,85 @@ export default {
   park: 'Parking Area',
   booth: 'Guard Booth',
   access: 'Passage',
-  device: 'Equipment',
-  modify: 'edit',
-  remove: 'delete',
-  new: 'add',
-  reload: 'refresh',
-  coding: 'code'
+  device: 'Device',
+  modify: 'Edit',
+  remove: 'Delete',
+  new: 'Add',
+  reload: 'Refresh',
+  coding: 'Code',
+  Name: 'Name',
+  IpAddress: 'IP Address',
+  Remarks: 'Remarks',
+  Action: 'Operation',
+  Direction: 'In/Out Direction',
+  Allow: 'Allow temporary vehicles entry and exit',
+  Type: 'Category',
+  Port: 'Port',
+  Enable: 'Enable',
+  Connect: 'Connect',
+  GuardAdd: 'Add Guard Booth',
+  GuardEdit: 'Edit Guard Booth',
+  BoothCode: 'Booth Code',
+  BoothName: 'Booth Name',
+  ip_address: 'IP Address',
+  Passage_Booth: 'Passage Booth',
+  Passage_Code: 'Channel Code',
+  Passage_Name: 'Channel Name',
+  Entry_Exit: 'Entry Exit Direction',
+  Cancel: 'Cancel',
+  Confirm: 'Confirm',
+  Device_Channel: 'Device Channel',
+  Device_Name: 'Device Name',
+  Device_Code: 'Device Code',
+  Connection_Mode: 'Connection Mode',
+  Area_Code: 'Area Code',
+  Surname: 'Surname',
+  Mobile_Phone: 'Mobile Phone',
+  Email: 'Email',
+  Expire_Time: 'Expire Time',
+  Black_White: 'Black & White List',
+  Search: 'Search',
+  LicensePlateNo: 'License Plate No',
+  RFID_Tag: 'RFID Tag',
+  List_Type: 'List Type',
+  Reset: 'Reset',
+  WhiteList: 'White List',
+  BlackList: 'Black List',
+  SelectVehicle: 'Select Vehicle',
+  CarOwner: 'Car Owner',
+  ElectronicTag: 'Electronic Tag',
+  VehicleType: 'Vehicle Type',
+  VehicleBrand: 'Vehicle Brand',
+  VehicleColor: 'Vehicle Color',
+  ManageVehicleType: 'Manage Vehicle Type',
+  AddNewType: 'Add New Type',
+  BindOwner: 'Bind Owner',
+  InitialFee: 'Initial Fee',
+  UnitFee: 'Unit Fee',
+  IsVipFree: 'VIP Free',
+  DailyMaxFee: 'Daily Max Fee',
+  VipDiscount: 'VIP Discount',
+  FreeDuration: 'Free Duration (Min)',
+  StartFee: 'Start Fee',
+  UnitTime: 'Unit Time (Min)',
+  AddChargeConfig: 'Add Charge Config',
+  EditChargeConfig: 'Edit Charge Config',
+  EntryTime: 'Entry Time',
+  ExitTime: 'Exit Time',
+  StayDuration: 'Stay Duration',
+  Fee: 'Fee',
+  PayStatus: 'Payment Status',
+  ExitBooth: 'Exit Booth',
+  ExitPassage: 'Exit Passage',
+  ParkManage: 'Parking Lot Manage',
+  ParkInfoManage: 'Parking Info Manage',
+  OwnerManage: 'Owner Manage',
+  BlackWhiteList: 'Black White List',
+  VehicleInfo: 'Vehicle Info',
+  ChargeConfig: 'Charge Config',
+  ReportInfoQuery: 'Report Info Query',
+  InOutRecord: 'In Out Record',
+  AbnormalReport: 'Abnormal Report',
+  StatisticsQuery: 'Statistics Query',
+  OnlineVehicleStats: 'Online Vehicle Statistics'
 }

+ 28 - 12
web/src/lang/index.js

@@ -1,17 +1,33 @@
-import { createI18n } from 'vue-i18n'
-import zh from './zh-CN'
+import { reactive, computed } from 'vue'
+import zhCN from './zh-CN'
+import zhHK from './zh-HK'
+import zhTW from './zh-TW'
 import en from './en'
 
-// 从本地缓存获取语言,默认中文
-const savedLang = localStorage.getItem('lang') || 'zh'
+// 语言包
+const messages = {
+  'zh-CN': zhCN,
+  'zh-HK': zhHK,
+  'zh-TW': zhTW,
+  'en': en
+}
 
-const i18n = createI18n({
-  legacy: false, // Vue3 组合式API必须关闭
-  locale: savedLang, // 当前语言
-  messages: {
-    zh,
-    en
-  }
+// 当前语言(持久化到本地)
+const locale = reactive({
+  lang: localStorage.getItem('lang') || 'zh-CN'
 })
 
-export default i18n
+// 切换语言
+const setLang = (lang) => {
+  locale.lang = lang
+  localStorage.setItem('lang', lang)
+}
+
+// 当前使用的翻译文本
+const t = computed(() => messages[locale.lang])
+
+export {
+  locale,
+  t,
+  setLang
+}

+ 75 - 31
web/src/lang/zh-CN.js

@@ -8,35 +8,79 @@ export default {
   new: '新增',
   reload: '刷新',
   coding: '编码',
-  Name: '名称', // 名稱 名稱 name
-  IpAddress: 'ip地址', // ip地址 ip地址 ipAddress
-  Remarks: '备注', // 備註 備註 remark
-  Action: '操作', // 操作 備註 action
-  Direction: '进出方向', // 進出方向 進出方向 InOutDirection
-  Allow: '是否允许临时车进出', // 是否容許臨時車輛進出 是否容許臨時車輛進出 Allow temporary vehicles entry and exit
-  Type: '类别', // 類別 類別 Category
-  Port: '端口', // 埠口 連接埠 port
-  Enable: '是否启用', // 是否啟用 是否啟用 Enable or not
-  Connect: '连接', // 連接 連線 Connect
-  GuardAdd: '岗亭新增', // 崗亭新增 崗亭新增 Add Guard booth,
-  GuardEdit: '岗亭编辑', // 編輯崗亭 編輯崗亭 Edit Guard Booth
-  BoothCode: '岗亭编码', // 崗亭編碼 崗亭編碼 Booth Code
-  BoothName: '岗亭名称', // 崗亭名稱 崗亭名稱 Guard Booth Name
-  ip_address: 'ip地址', // IP 位址 IP 位址 IP Address
-  Passage_Booth: '通道岗亭', // 通道崗亭 通道崗亭 Passage Guard Booth
-  Passage_Code: '通道编码', // 通道編碼 通道編碼 Channel Code
-  Passage_Name: '通道名称', // 通道名稱 通道名稱 Channel Name
-  Entry_Exit: '进出方向', // 進出方向 進出方向 Entry Exit Direction
-  Cancel: '取消', // 取消 取消 Cancel
-  Confirm: '确认', // 確認 確認 Confirm
-  Device_Channel: '设备通道', // 裝置通道 裝置通道 Device Channel
-  Device_Name: '设备名称', // 裝置名稱 裝置名稱 Device Name
-  Device_Code: '设备编码', // 裝置編碼 裝置編號 Device Code
-  Connection_Mode: '连接方式', // 連接方式 連線方式 Connection Mode
-  Area_Code: '区域编码', // 區域編碼 區域代碼 Area Code
-  Surname: '姓氏', // 姓氏 姓氏 Surname
-  Mobile_Phone: '手机', // 手提電話 行動電話
-  Email: '邮箱', // 電郵 電子信箱 email
-  Expire_Time: '过期时间', // 過期時間 到期時間 Expire Time
-  Black_White: '黑白名单', // 黑白名單 黑白名單 Black and White List
+  Name: '名称',
+  IpAddress: 'ip地址',
+  Remarks: '备注',
+  Action: '操作',
+  Direction: '进出方向',
+  Allow: '是否允许临时车进出',
+  Type: '类别',
+  Port: '端口',
+  Enable: '是否启用',
+  Connect: '连接',
+  GuardAdd: '岗亭新增',
+  GuardEdit: '岗亭编辑',
+  BoothCode: '岗亭编码',
+  BoothName: '岗亭名称',
+  ip_address: 'ip地址',
+  Passage_Booth: '通道岗亭',
+  Passage_Code: '通道编码',
+  Passage_Name: '通道名称',
+  Entry_Exit: '进出方向',
+  Cancel: '取消',
+  Confirm: '确认',
+  Device_Channel: '设备通道',
+  Device_Name: '设备名称',
+  Device_Code: '设备编码',
+  Connection_Mode: '连接方式',
+  Area_Code: '区域编码',
+  Surname: '姓氏',
+  Mobile_Phone: '手机',
+  Email: '邮箱',
+  Expire_Time: '过期时间',
+  Black_White: '黑白名单',
+  Search: '搜索',
+  LicensePlateNo: '车牌号码',
+  RFID_Tag: 'RFID标签',
+  List_Type: '名单类型',
+  Reset: '重置',
+  WhiteList: '白名单',
+  BlackList: '黑名单',
+  SelectVehicle: '选择车辆',
+  CarOwner: '车主',
+  ElectronicTag: '电子标签',
+  VehicleType: '车辆类型',
+  VehicleBrand: '车辆品牌',
+  VehicleColor: '车辆颜色',
+  ManageVehicleType: '管理车辆类型',
+  AddNewType: '新增类型',
+  BindOwner: '绑定车主',
+  InitialFee: '初始费用',
+  UnitFee: '单位费用',
+  IsVipFree: '是否为VIP免费',
+  DailyMaxFee: '每日最大费用',
+  VipDiscount: 'vip折扣',
+  FreeDuration: '免费时长(分钟)',
+  StartFee: '起步费用',
+  UnitTime: '单位时间(分钟)',
+  AddChargeConfig: '新增收费配置',
+  EditChargeConfig: '编辑收费配置',
+  EntryTime: '入场时间',
+  ExitTime: '出场时间',
+  StayDuration: '停留时长',
+  Fee: '费用',
+  PayStatus: '支付状态',
+  ExitBooth: '出场岗亭',
+  ExitPassage: '出场通道',
+  ParkManage: '停车场管理',
+  ParkInfoManage: '停车信息管理',
+  OwnerManage: '车主管理',
+  BlackWhiteList: '黑白名单',
+  VehicleInfo: '车辆信息',
+  ChargeConfig: '收费配置',
+  ReportInfoQuery: '报表信息查询',
+  InOutRecord: '进出记录',
+  AbnormalReport: '异常报表',
+  StatisticsQuery: '统计信息查询',
+  OnlineVehicleStats: '在线车辆统计'
 }

+ 77 - 2
web/src/lang/zh-HK.js

@@ -6,6 +6,81 @@ export default {
   modify: '編輯',
   remove: '刪除',
   new: '新增',
-  reload: '刷新',
-  coding: '編碼'
+  reload: '重新整理',
+  coding: '編碼',
+  Name: '名稱',
+  IpAddress: 'IP位址',
+  Remarks: '備註',
+  Action: '操作',
+  Direction: '進出方向',
+  Allow: '是否容許臨時車輛進出',
+  Type: '類別',
+  Port: '埠口',
+  Enable: '是否啟用',
+  Connect: '連接',
+  GuardAdd: '崗亭新增',
+  GuardEdit: '編輯崗亭',
+  BoothCode: '崗亭編碼',
+  BoothName: '崗亭名稱',
+  ip_address: 'IP位址',
+  Passage_Booth: '通道崗亭',
+  Passage_Code: '通道編碼',
+  Passage_Name: '通道名稱',
+  Entry_Exit: '進出方向',
+  Cancel: '取消',
+  Confirm: '確認',
+  Device_Channel: '裝置通道',
+  Device_Name: '裝置名稱',
+  Device_Code: '裝置編碼',
+  Connection_Mode: '連接方式',
+  Area_Code: '區域編碼',
+  Surname: '姓氏',
+  Mobile_Phone: '手提電話',
+  Email: '電郵',
+  Expire_Time: '過期時間',
+  Black_White: '黑白名單',
+  Search: '搜尋',
+  LicensePlateNo: '車牌號碼',
+  RFID_Tag: 'RFID標籤',
+  List_Type: '名單類型',
+  Reset: '重設',
+  WhiteList: '白名單',
+  BlackList: '黑名單',
+  SelectVehicle: '選擇車輛',
+  CarOwner: '車主',
+  ElectronicTag: '電子標籤',
+  VehicleType: '車輛類型',
+  VehicleBrand: '車輛品牌',
+  VehicleColor: '車輛顏色',
+  ManageVehicleType: '管理車輛類型',
+  AddNewType: '新增類型',
+  BindOwner: '綁定車主',
+  InitialFee: '初始費用',
+  UnitFee: '單位費用',
+  IsVipFree: '是否為VIP免費',
+  DailyMaxFee: '每日最大費用',
+  VipDiscount: 'VIP折扣',
+  FreeDuration: '免費時長(分鐘)',
+  StartFee: '起步費用',
+  UnitTime: '單位時間(分鐘)',
+  AddChargeConfig: '新增收費配置',
+  EditChargeConfig: '編輯收費配置',
+  EntryTime: '入場時間',
+  ExitTime: '出場時間',
+  StayDuration: '停留時長',
+  Fee: '費用',
+  PayStatus: '支付狀態',
+  ExitBooth: '出場崗亭',
+  ExitPassage: '出場通道',
+  ParkManage: '停車場管理',
+  ParkInfoManage: '停車資訊管理',
+  OwnerManage: '車主管理',
+  BlackWhiteList: '黑白名單',
+  VehicleInfo: '車輛資訊',
+  ChargeConfig: '收費配置',
+  ReportInfoQuery: '報表資訊查詢',
+  InOutRecord: '進出紀錄',
+  AbnormalReport: '異常報表',
+  StatisticsQuery: '統計資訊查詢',
+  OnlineVehicleStats: '線上車輛統計'
 }

+ 78 - 3
web/src/lang/zh-TW.js

@@ -2,10 +2,85 @@ export default {
   park: '停車區域',
   booth: '崗亭',
   access: '通道',
-  device: '設備',
+  device: '裝置',
   modify: '編輯',
-  remove: '除',
+  remove: '除',
   new: '新增',
-  reload: '刷新',
+  reload: '重新整理',
   coding: '編碼',
+  Name: '名稱',
+  IpAddress: 'IP位址',
+  Remarks: '備註',
+  Action: '操作',
+  Direction: '進出方向',
+  Allow: '是否允許臨時車輛進出',
+  Type: '類別',
+  Port: '連接埠',
+  Enable: '是否啟用',
+  Connect: '連線',
+  GuardAdd: '崗亭新增',
+  GuardEdit: '編輯崗亭',
+  BoothCode: '崗亭編號',
+  BoothName: '崗亭名稱',
+  ip_address: 'IP位址',
+  Passage_Booth: '通道崗亭',
+  Passage_Code: '通道代碼',
+  Passage_Name: '通道名稱',
+  Entry_Exit: '進出方向',
+  Cancel: '取消',
+  Confirm: '確認',
+  Device_Channel: '裝置通道',
+  Device_Name: '裝置名稱',
+  Device_Code: '裝置編號',
+  Connection_Mode: '連線方式',
+  Area_Code: '區域代碼',
+  Surname: '姓氏',
+  Mobile_Phone: '行動電話',
+  Email: '電子信箱',
+  Expire_Time: '到期時間',
+  Black_White: '黑白名單',
+  Search: '搜尋',
+  LicensePlateNo: '車牌號碼',
+  RFID_Tag: 'RFID標籤',
+  List_Type: '名單類型',
+  Reset: '重設',
+  WhiteList: '白名單',
+  BlackList: '黑名單',
+  SelectVehicle: '選擇車輛',
+  CarOwner: '車主',
+  ElectronicTag: '電子標籤',
+  VehicleType: '車輛類型',
+  VehicleBrand: '車輛品牌',
+  VehicleColor: '車輛顏色',
+  ManageVehicleType: '管理車輛類型',
+  AddNewType: '新增類型',
+  BindOwner: '綁定車主',
+  InitialFee: '初始費用',
+  UnitFee: '單位費用',
+  IsVipFree: '是否為VIP免費',
+  DailyMaxFee: '每日最大費用',
+  VipDiscount: 'VIP折扣',
+  FreeDuration: '免費時長(分鐘)',
+  StartFee: '起步費用',
+  UnitTime: '單位時間(分鐘)',
+  AddChargeConfig: '新增收費設定',
+  EditChargeConfig: '編輯收費設定',
+  EntryTime: '入場時間',
+  ExitTime: '出場時間',
+  StayDuration: '停留時長',
+  Fee: '費用',
+  PayStatus: '付款狀態',
+  ExitBooth: '出場崗亭',
+  ExitPassage: '出場通道',
+  ParkManage: '停車場管理',
+  ParkInfoManage: '停車資訊管理',
+  OwnerManage: '車主管理',
+  BlackWhiteList: '黑白名單',
+  VehicleInfo: '車輛資訊',
+  ChargeConfig: '收費設定',
+  ReportInfoQuery: '報表資訊查詢',
+  InOutRecord: '進出紀錄',
+  AbnormalReport: '異常報表',
+  StatisticsQuery: '統計資訊查詢',
+  OnlineVehicleStats: '線上車輛統計'
 }

+ 5 - 3
web/src/main.js

@@ -14,7 +14,7 @@ import auth from '@/directive/auth'
 import { store } from '@/pinia'
 import App from './App.vue'
 import { initDom } from './utils/positionToCode'
-import i18n from './lang'
+import { t, setLang, locale } from './lang'
 // import en from 'element-plus/es/locale/lang/en'
 initDom()
 /**
@@ -32,12 +32,14 @@ Nprogress.start()
 
 const app = createApp(App)
 app.config.productionTip = false
-
+app.config.globalProperties.$t = t
+app.config.globalProperties.$setLang = setLang
+app.config.globalProperties.$locale = locale
 app
   .use(run)
   .use(store)
   .use(auth)
-  .use(router).use(i18n)
+  .use(router)
   .mount('#app')
 
 export default app

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

@@ -32,13 +32,7 @@
 import Screenfull from '@/view/layout/screenfull/index.vue'
 import { emitter } from '@/utils/bus.js'
 import { ref } from 'vue'
-import { useI18n } from 'vue-i18n'
-import zhCn from 'element-plus/es/locale/lang/zh-cn'
-import en from 'element-plus/es/locale/lang/en'
-
 // 导入 i18n 实例
-const { locale } = useI18n()
-
 defineOptions({
   name: 'BtnBox',
 })

+ 6 - 18
web/src/view/parking/carOwner.vue

@@ -44,22 +44,10 @@
         >新增</el-button>
       </el-form-item>
       <el-form-item>
-        <el-button icon="Delete">删除</el-button>
+        <el-button @click="$setLang('en')">English</el-button>
       </el-form-item>
       <el-form-item>
-        <el-button icon="Download">导入</el-button>
-      </el-form-item>
-      <el-form-item>
-        <el-button icon="Download">导入模板</el-button>
-      </el-form-item>
-      <el-form-item>
-        <el-button icon="Upload">导出</el-button>
-      </el-form-item>
-      <el-form-item>
-        <el-button icon="Memo">操作记录</el-button>
-      </el-form-item>
-      <el-form-item>
-        <el-button icon="ChatLineRound">其他</el-button>
+        <el-button @click="$setLang('zh-CN')">简体中文</el-button>
       </el-form-item>
     </el-form>
     <el-table
@@ -67,24 +55,24 @@
       height="605"
     >
       <el-table-column
-        label="名字"
+        :label="$t.value.Name"
         align="center"
         width="180"
         prop="owner_name"
       />
       <el-table-column
-        label="姓氏"
+        :label="$t.value.Surname"
         align="center"
         width="180"
         prop="owner_surname"
       />
       <el-table-column
-        label="手机"
+        :label="$t.value.Mobile_Phone"
         align="center"
         prop="owner_phone"
       />
       <el-table-column
-        label="邮箱"
+        :label="$t.value.Email"
         align="center"
       />
       <el-table-column