This commit is contained in:
2023-12-04 17:04:28 +08:00
10 changed files with 171 additions and 109 deletions

View File

@@ -135,12 +135,14 @@ export default {
saveLogin () {
this.disabled = true
if (!this.username) {
this.toast('请输入用户名')
// this.toast('请输入用户名')
this.toast(this.$t('login.toast1'))
this.disabled = false
return
}
if (!this.password) {
this.toast('请输入密码')
// this.toast('请输入密码')
this.toast(this.$t('login.toast2'))
this.disabled = false
return
}

View File

@@ -49,9 +49,9 @@ export default {
},
computed: {
tabs () {
let arr = [{id: '1', label: 'ifconfig'}, {id: '2', label: '日志列表'}, {id: '3', label: 'ROS运行列表'}, {id: '4', label: '芯片温度/主频'}, {id: '5', label: '调试信息'}, {id: '6', label: '软/硬件版本'}]
let arr = [{id: '1', label: 'Ifconfig'}, {id: '2', label: '日志列表'}, {id: '3', label: 'ROS运行列表'}, {id: '4', label: '芯片温度/主频'}, {id: '5', label: '调试信息'}, {id: '6', label: '软/硬件版本'}]
if (this.$i18n.locale === 'en-us') {
arr = [{id: '1', label: 'ifconfig'}, {id: '2', label: 'Log list'}, {id: '3', label: 'ROS run list'}, {id: '4', label: 'Chip temperature/main frequency'}, {id: '5', label: 'Debugging information'}, {id: '6', label: 'Software/Hardware Version'}]
arr = [{id: '1', label: 'Ifconfig'}, {id: '2', label: 'Log List'}, {id: '3', label: 'ROS Run List'}, {id: '4', label: 'Chip Temperature/Main Frequency'}, {id: '5', label: 'Debugging Information'}, {id: '6', label: 'Software/Hardware Version'}]
}
return arr
}
@@ -163,7 +163,7 @@ export default {
z-index 2
.tabs_item
padding 0 10px
width 200px
width 202px
height 46px
box-sizing border-box
line-height 46px

View File

@@ -1,6 +1,5 @@
<template>
<div class="main-container">
{{ aa }}
<div class="right_side">
<div class="content_wrap">
<div class="title_wrap">
@@ -20,8 +19,8 @@
<!-- <td>
<div class="radio__input icon_radio_checked"><i class="icon_radio"></i></div>
</td> -->
<td @click="toCheck(e)">{{ e.name }}</td>
<td @click="toCheck(e)">{{ e.remark }}</td>
<td @click="toCheck(e)">{{ $i18n.locale === 'en-us' ? e.en_name : e.zh_name }}</td>
<td @click="toCheck(e)">{{ $i18n.locale === 'en-us' ? e.en_remark : e.zh_remark }}</td>
<td @click="toCheck(e)">{{ e.createTime }}</td>
<td width="330px">
<div class="row">
@@ -82,7 +81,7 @@
<div v-if="active1" class="dialog_wrapper">
<div class="dialog dialog_1">
<div class="dialog_header">
<span class="dialog_title">{{ pkObj.name }}</span>
<span class="dialog_title">{{ $i18n.locale === 'en-us' ? pkObj.en_name : pkObj.zh_name }}</span>
</div>
<div class="dialog_body dialog_body_1">
<div class="tree_wrapper">
@@ -153,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 = ''
@@ -199,8 +198,8 @@ export default {
break
case '2':
this.pkObj = e
this.rolename = e.name
this.remark = e.remark
this.rolename = this.$i18n.locale === 'en-us' ? e.en_name : e.zh_name
this.remark = this.$i18n.locale === 'en-us' ? e.en_remark : e.zh_remark
if (this.rolename === '') {
this.unclick = true
} else {
@@ -233,7 +232,8 @@ export default {
async _sysRoleAdd () {
this.$refs.child.disabled = true
if (!this.rolename) {
this.toast('角色名称不能为空')
// this.toast('角色名称不能为空')
this.toast(this.$t('role.toast1'))
this.$refs.child.disabled = false
return
}
@@ -253,7 +253,8 @@ export default {
async _sysRoleEdit () {
this.$refs.child.disabled = true
if (!this.rolename) {
this.toast('角色名称不能为空')
// this.toast('角色名称不能为空')
this.toast(this.$t('role.toast1'))
this.$refs.child.disabled = false
return
}

View File

@@ -17,11 +17,11 @@
<th>{{ $t('common.operate') }}</th>
</tr>
<tr v-for="(e, i) in datalist" :key="i">
<td>{{ e.id }}</td>
<td>{{ i + 1 }}</td>
<td>{{ e.code }}</td>
<td>{{ e.name }}</td>
<td>{{ e.value }}</td>
<td>{{ e.remark }}</td>
<td>{{ $i18n.locale === 'en-us' ? e.en_name : e.zh_name }}</td>
<td>{{ $i18n.locale === 'en-us' ? e.en_value : e.zh_value }}</td>
<td>{{ $i18n.locale === 'en-us' ? e.en_remark : e.zh_remark }}</td>
<td>
<div class="row">
<button class="button button--primary grid_button" @click="showDialog('2', e)">{{ $t('button.modify') }}</button>
@@ -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 = ''
@@ -185,9 +185,9 @@ export default {
break
case '2':
this.code = e.code
this.name = e.name
this.value = e.value
this.remark = e.remark
this.name = this.$i18n.locale === 'en-us' ? e.en_name : e.zh_name
this.value = this.$i18n.locale === 'en-us' ? e.en_value : e.zh_value
this.remark = this.$i18n.locale === 'en-us' ? e.en_remark : e.zh_remark
if (!this.code || !this.name || !this.value) {
this.unclick = true
} else {
@@ -221,17 +221,20 @@ export default {
async _paramAdd () {
this.$refs.child.disabled = true
if (!this.code) {
this.toast('编码不能为空')
// this.toast('编码不能为空')
this.toast(this.$t('system.toast1'))
this.$refs.child.disabled = false
return
}
if (!this.name) {
this.toast('名字不能为空')
// this.toast('名字不能为空')
this.toast(this.$t('system.toast2'))
this.$refs.child.disabled = false
return
}
if (!this.value) {
this.toast('数值不能为空')
// this.toast('数值不能为空')
this.toast(this.$t('system.toast3'))
this.$refs.child.disabled = false
return
}
@@ -251,17 +254,20 @@ export default {
async _paramEdit () {
this.$refs.child.disabled = true
if (!this.code) {
this.toast('编码不能为空')
// this.toast('编码不能为空')
this.toast(this.$t('system.toast1'))
this.$refs.child.disabled = false
return
}
if (!this.name) {
this.toast('名字不能为空')
// this.toast('名字不能为空')
this.toast(this.$t('system.toast2'))
this.$refs.child.disabled = false
return
}
if (!this.value) {
this.toast('数值不能为空')
// this.toast('数值不能为空')
this.toast(this.$t('system.toast3'))
this.$refs.child.disabled = false
return
}

View File

@@ -18,9 +18,9 @@
<th width="430px">{{ $t('common.operate')}}</th>
</tr>
<tr v-for="(e, i) in datalist" :key="i">
<td>{{ e.userId }}</td>
<td>{{ i + 1 }}</td>
<td>{{ e.username }}</td>
<td>{{ e.personName }}</td>
<td>{{ $i18n.locale === 'en-us' ? e.en_person_name : e.zh_person_name }}</td>
<td>{{ e.phone }}</td>
<td>{{ $i18n.locale === 'en-us' ? e.en_gender : e.zh_gender }}</td>
<td>{{ e.createTime }}</td>
@@ -111,7 +111,7 @@
<el-option
v-for="item in options"
:key="item.roleId"
:label="item.name"
:label="$i18n.locale === 'en-us' ? item.en_name : item.zh_name"
:value="item.roleId">
</el-option>
</el-select>
@@ -146,7 +146,6 @@ export default {
username: '',
phone: '',
name: '',
sexArr: [{label: '男', value: '男'}, {label: '女', value: '女'}],
sex: '',
password: '',
options: [],
@@ -163,14 +162,25 @@ export default {
}
}
},
computed: {
sexArr () {
let res = []
if (this.$i18n.locale === 'en-us') {
res = [{label: 'Male', value: 'Male'}, {label: 'Female', value: 'Female'}]
} else {
res = [{label: '男', value: '男'}, {zh_label: '女', value: '女'}]
}
return res
}
},
watch: {
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 = ''
@@ -229,8 +239,8 @@ export default {
this.pkObj = e
this.username = e.username
this.phone = e.phone
this.name = e.personName
this.sex = e.gender
this.name = this.$i18n.locale === 'en-us' ? e.en_person_name : e.zh_person_name
this.sex = this.$i18n.locale === 'en-us' ? e.en_gender : e.zh_gender
this.options.map(el => {
if (el.roleId === e.roles[0].roleId) {
this.value = el.roleId
@@ -278,12 +288,14 @@ export default {
async _usersAdd () {
this.$refs.child.disabled = true
if (!this.username) {
this.toast('用户名不能为空')
// this.toast('用户名不能为空')
this.toast(this.$t('user.toast1'))
this.$refs.child.disabled = false
return
}
if (!this.password) {
this.toast('密码不能为空')
// this.toast('密码不能为空')
this.toast(this.$t('user.toast2'))
this.$refs.child.disabled = false
return
}
@@ -309,7 +321,8 @@ export default {
async _usersEdit () {
this.$refs.child.disabled = true
if (!this.username) {
this.toast('用户名不能为空')
// this.toast('用户名不能为空')
this.toast(this.$t('user.toast1'))
this.$refs.child.disabled = false
return
}

View File

@@ -7,7 +7,7 @@
</div>
<div class="page_container">
<div class="state_title-wrap">
<h3>{{ $t('vehiclecontrol.Status') }}</h3>
<h3>{{ $t('vehiclecontrol.status') }}</h3>
</div>
<div class="state_wrap">
<div class="state_item_wrap">
@@ -41,7 +41,7 @@
<button class="switch_item switch_item_8" @click="switchDown('12', '0')" :disabled="disabled">{{ $t('vehiclecontrol.skipdetection') }}</button>
</div>
<div class="state_title-wrap">
<h3>{{ $t('vehiclecontrol.Control') }}</h3>
<h3>{{ $t('vehiclecontrol.control') }}</h3>
</div>
<div class="control_wrap">
<div class="control_item">
@@ -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
}
@@ -405,6 +408,9 @@ export default {
.enClass
.state_item_label
font-size 26px
width 200px
.state_item_val
width calc(100% - 200px)
.control_label
font-size 24px
.switch_item

View File

@@ -308,22 +308,26 @@ export default {
async _updatePass () {
this.$refs.child.disabled = true
if (!this.oldpassword) {
this.toast('旧密码不能为空')
// this.toast('旧密码不能为空')
this.toast(this.$t('common.toast1'))
this.$refs.child.disabled = false
return
}
if (!this.newpassword1) {
this.toast('新密码不能为空')
// this.toast('新密码不能为空')
this.toast(this.$t('common.toast2'))
this.$refs.child.disabled = false
return
}
if (!this.newpassword2) {
this.toast('输入新密码')
// this.toast('输入新密码')
this.toast(this.$t('common.toast3'))
this.$refs.child.disabled = false
return
}
if (this.newpassword1 !== this.newpassword2) {
this.toast('新密码输入不一致,请重新输入')
// this.toast('新密码输入不一致,请重新输入')
this.toast(this.$t('common.toast4'))
this.$refs.child.disabled = false
return
}