From 5f73de6b3530aed38ebea509dec6e50f2c879b89 Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Mon, 4 Dec 2023 15:36:23 +0800 Subject: [PATCH] toast --- src/i18n/langs/en.js | 7 +++++-- src/i18n/langs/zh.js | 7 +++++-- src/pages/modules/systemmanage/role.vue | 6 +++--- src/pages/modules/systemmanage/system.vue | 4 ++-- src/pages/modules/systemmanage/user.vue | 4 ++-- .../modules/vehicleinformation/vehiclecontrol.vue | 13 ++++++++----- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/i18n/langs/en.js b/src/i18n/langs/en.js index ae88d1d..6ced23b 100644 --- a/src/i18n/langs/en.js +++ b/src/i18n/langs/en.js @@ -107,7 +107,9 @@ module.exports = { poweroff: 'Power Off', softwarerestart: 'Software Restart', restart: 'Restart', - skipdetection: 'Skip Detection' + skipdetection: 'Skip Detection', + toast1: 'Please select coordinates', + toast2: 'RC control and Joy control cannot be turned on simultaneously' }, button: { cancel: 'Cancel', @@ -127,6 +129,7 @@ module.exports = { changepassword: 'Change Password', exit: 'Exit', oldpassword: 'Old Password', - newpassword: 'New Password' + newpassword: 'New Password', + operationfailed: 'Operation failed' } } diff --git a/src/i18n/langs/zh.js b/src/i18n/langs/zh.js index a47d46f..8f8b655 100644 --- a/src/i18n/langs/zh.js +++ b/src/i18n/langs/zh.js @@ -107,7 +107,9 @@ module.exports = { poweroff: '关机', softwarerestart: '软启动', restart: '重启', - skipdetection: '跳过检测' + skipdetection: '跳过检测', + toast1: '请选择坐标', + toast2: 'RC控制与Joy控制不能同时开启' }, button: { cancel: '取消', @@ -127,6 +129,7 @@ module.exports = { changepassword: '修改密码', exit: '退出', oldpassword: '旧的密码', - newpassword: '新的密码' + newpassword: '新的密码', + operationfailed: '操作失败' } } diff --git a/src/pages/modules/systemmanage/role.vue b/src/pages/modules/systemmanage/role.vue index 60a2314..1ec3263 100644 --- a/src/pages/modules/systemmanage/role.vue +++ b/src/pages/modules/systemmanage/role.vue @@ -81,7 +81,7 @@
- {{ pkObj.name }} + {{ $i18n.locale === 'en-us' ? pkObj.en_name : pkObj.zh_name }}
@@ -152,10 +152,10 @@ export default { type (val) { switch (val) { case '1': - this.title = '添加角色' + this.title = this.$i18n.locale === 'en-us' ? 'Add Role' : '添加角色' break case '2': - this.title = '修改角色' + this.title = this.$i18n.locale === 'en-us' ? 'Modify Role' : '修改角色' break case '3': this.title = '' diff --git a/src/pages/modules/systemmanage/system.vue b/src/pages/modules/systemmanage/system.vue index 7d8416d..dd3f24d 100644 --- a/src/pages/modules/systemmanage/system.vue +++ b/src/pages/modules/systemmanage/system.vue @@ -130,10 +130,10 @@ export default { type (val) { switch (val) { case '1': - this.title = '添加参数' + this.title = this.$i18n.locale === 'en-us' ? 'Add Parameter' : '添加参数' break case '2': - this.title = '修改参数' + this.title = this.$i18n.locale === 'en-us' ? 'Modify Parameter' : '修改参数' break case '3': this.title = '' diff --git a/src/pages/modules/systemmanage/user.vue b/src/pages/modules/systemmanage/user.vue index a922159..cf2ee4b 100644 --- a/src/pages/modules/systemmanage/user.vue +++ b/src/pages/modules/systemmanage/user.vue @@ -177,10 +177,10 @@ export default { type (val) { switch (val) { case '1': - this.title = '添加用户' + this.title = this.$i18n.locale === 'en-us' ? 'Add User' : '添加用户' break case '2': - this.title = '修改用户' + this.title = this.$i18n.locale === 'en-us' ? 'Modify User' : '修改用户' break case '3': this.title = '' diff --git a/src/pages/modules/vehicleinformation/vehiclecontrol.vue b/src/pages/modules/vehicleinformation/vehiclecontrol.vue index e4e658d..4083e06 100644 --- a/src/pages/modules/vehicleinformation/vehiclecontrol.vue +++ b/src/pages/modules/vehicleinformation/vehiclecontrol.vue @@ -123,7 +123,7 @@ export default { return { interTime: this.$store.getters.setTime, timer: null, - show: false, + show: true, result: [], obj: {}, status: {}, @@ -157,12 +157,14 @@ export default { switchDown (type, bool) { this.disabled = true if (type === '5' && this.switch4 === '0' && this.switch5 === '1') { - this.toast('RC控制与Joy控制不能同时开启') + // this.toast('RC控制与Joy控制不能同时开启') + this.toast(this.$t('vehiclecontrol.toast2')) this.disabled = false return } if (type === '6' && this.switch4 === '1' && this.switch5 === '0') { - this.toast('RC控制与Joy控制不能同时开启') + // this.toast('RC控制与Joy控制不能同时开启') + this.toast(this.$t('vehiclecontrol.toast2')) this.disabled = false return } @@ -197,7 +199,7 @@ export default { this.refresh() } catch (e) { this.disabled = false - this.toast('操作失败') + this.toast(this.$t('common.operationfailed')) this.refresh() } }, @@ -222,7 +224,8 @@ export default { async _restCoordinate () { this.disabled = true if (JSON.stringify(this.obj) === '{}') { - this.toast('请选择坐标') + // this.toast('请选择坐标') + this.toast(this.$t('vehiclecontrol.toast1')) this.disabled = false return }