From 2f18d90c8cf0400b01a45814d31e55dafc330c30 Mon Sep 17 00:00:00 2001 From: xiangxy Date: Fri, 1 Dec 2023 18:10:50 +0800 Subject: [PATCH] lang --- src/main.js | 7 ++++ src/pages/modules/errormanage/ErrorInfo.vue | 19 ---------- src/pages/modules/home/home.vue | 40 ++++++++++++--------- 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/main.js b/src/main.js index d5c72f2..3c76d9a 100644 --- a/src/main.js +++ b/src/main.js @@ -32,6 +32,13 @@ Vue.prototype.Dialog = Dialog Vue.prototype.toast = toast Vue.config.productionTip = false +Vue.prototype.$langPre = { + computedProp (suffix) { + // return localstorage.getItem( key: 'lang') + '_' + suffix + return localStorage.getItem('locale').slice(0, 2) + '_' + suffix + } +} + const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' + '2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ==' diff --git a/src/pages/modules/errormanage/ErrorInfo.vue b/src/pages/modules/errormanage/ErrorInfo.vue index b2a8f7a..1261734 100644 --- a/src/pages/modules/errormanage/ErrorInfo.vue +++ b/src/pages/modules/errormanage/ErrorInfo.vue @@ -164,23 +164,4 @@ export default { width .4rem height .4rem border-radius .2rem -.grid_wrapper table th - color #ffffff - font-size 30px - background rgba(31,46,73,0.5) - line-height 80px - border-right none - padding 0 - padding-left 30px - text-align left -.grid_wrapper table td - color #ffffff - font-size 30px - background rgba(31,46,73,0.5) - line-height 80px - border-bottom 1px solid #20395D - border-right none - padding 0 - padding-left 30px - text-align left diff --git a/src/pages/modules/home/home.vue b/src/pages/modules/home/home.vue index c5d6485..da0e0dc 100644 --- a/src/pages/modules/home/home.vue +++ b/src/pages/modules/home/home.vue @@ -15,18 +15,22 @@
{{ $t('homeinfo.task') }} - {{dataInfo.task_name}} - {{dataInfo.task_info}} + + {{ dataInfo[$langPre.computedProp('task_name')] }} + {{ dataInfo[$langPre.computedProp('task_info')] }}
{{ $t('homeinfo.status') }} - {{dataInfo.task_status}} + + {{ dataInfo[$langPre.computedProp('task_status')] }}
{{ $t('homeinfo.tasknum') }} - {{dataInfo.task_num}} + + {{ dataInfo[$langPre.computedProp('task_num')] }}
@@ -37,9 +41,11 @@
{{ $t('homeinfo.error') }} - {{dataInfo.error_name}} + + {{ dataInfo[$langPre.computedProp('error_name')] }}
- + + @@ -57,7 +63,7 @@ export default { return { interTime: this.$store.getters.setTime, timer: null, - // dataInfo: {} + dataInfo: {} // dataInfo: { // device_info: 'NobleLiftPS10LMT_HuaHai', // task_name: '无', @@ -67,16 +73,16 @@ export default { // error_name: '障碍物告警', // button_name: '继续搬运' // } - dataInfo: { - device_info: 'NobleLiftPS10LMT_HuaHai', - task_name: '任务号:11322', - task_info: '目标点:5', - task_status: '执行中', - task_num: '待执行0/2', - speed: '0.0m/s', - error_name: '正常运行', - button_name: '确认完成继续下个任务' - } + // dataInfo: { + // device_info: 'NobleLiftPS10LMT_HuaHai', + // task_name: '任务号:11322', + // task_info: '目标点:5', + // task_status: '执行中', + // task_num: '待执行0/2', + // speed: '0.0m/s', + // error_name: '正常运行', + // button_name: '确认完成继续下个任务' + // } } }, created () {