登录车辆模块

This commit is contained in:
2023-12-15 16:49:40 +08:00
parent 5f78407bb3
commit 2cc425f64b
8 changed files with 28 additions and 5 deletions

View File

@@ -101,6 +101,7 @@ module.exports = {
resetbutton: 'Reset Button', resetbutton: 'Reset Button',
obstacleavoidanceparking: 'Obstacle Avoidance Parking', obstacleavoidanceparking: 'Obstacle Avoidance Parking',
safetyedgesensor: 'Safety Edge Sensor', safetyedgesensor: 'Safety Edge Sensor',
sensorinducedparking: 'Sensor Induced Parking',
run: 'Run', run: 'Run',
abnormal: 'Abnormal' abnormal: 'Abnormal'
}, },

View File

@@ -101,6 +101,7 @@ module.exports = {
resetbutton: '复位按钮', resetbutton: '复位按钮',
obstacleavoidanceparking: '避障停车', obstacleavoidanceparking: '避障停车',
safetyedgesensor: '安全触边', safetyedgesensor: '安全触边',
sensorinducedparking: '传感器停车',
run: '运行', run: '运行',
abnormal: '异常' abnormal: '异常'
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -71,8 +71,8 @@ export default {
return { return {
selectType: '', selectType: '',
tab: 0, tab: 0,
username: 'admin', username: this.$store.getters.defaultUsername,
password: '123456', password: this.$store.getters.defaultPassword,
baseUrl: this.$store.getters.baseUrl, baseUrl: this.$store.getters.baseUrl,
setTime: this.$store.getters.setTime / 1000, setTime: this.$store.getters.setTime / 1000,
disabled: false, disabled: false,
@@ -155,6 +155,7 @@ export default {
let obj = {} let obj = {}
obj = Object.assign({}, res.result) obj = Object.assign({}, res.result)
this.$store.dispatch('userInfo', JSON.stringify(obj)) this.$store.dispatch('userInfo', JSON.stringify(obj))
this.$store.dispatch('setLoginInfo', {username: this.username, password: this.password})
this.hide() this.hide()
this.$router.push('/index/home') this.$router.push('/index/home')
} else { } else {

View File

@@ -16,7 +16,7 @@
</div> </div>
<div class="state_item_wrap"> <div class="state_item_wrap">
<div class="state_item_label">{{ $t('vehiclecontrol.updatestatus') }}:</div> <div class="state_item_label">{{ $t('vehiclecontrol.updatestatus') }}:</div>
<div class="state_item_val" :class="{'state_item_val_disabled': status.UpdateStatus === '0'}">{{$i18n.locale === 'en-us' ? status.en_UpdateStatus_name : status.zh_UpdateStatus_name }}</div> <div class="state_item_val" :class="{'state_item_val_disabled': status.UpdateStatus === '1'}">{{$i18n.locale === 'en-us' ? status.en_UpdateStatus_name : status.zh_UpdateStatus_name }}</div>
</div> </div>
</div> </div>
<div class="state_title-wrap"> <div class="state_title-wrap">
@@ -279,7 +279,7 @@ export default {
padding-left 66px padding-left 66px
background left center url(../../../images/new/state_btn.png) no-repeat background left center url(../../../images/new/state_btn.png) no-repeat
.state_item_val_disabled .state_item_val_disabled
background-image url(../../../images/new/state_btn_disable.png) background-image url(../../../images/new/state_btn_yellow.png)
.agv_wrap .agv_wrap
width 100% width 100%
_fj() _fj()

View File

@@ -75,7 +75,7 @@
<div class="state_left_wrap"> <div class="state_left_wrap">
<div class="state_item_wrap"> <div class="state_item_wrap">
<div class="agv_item_label">{{ $t('vehiclestatus.vehiclestatus') }}:</div> <div class="agv_item_label">{{ $t('vehiclestatus.vehiclestatus') }}:</div>
<div class="agv_item_val agv_item_val_1" :class="{'state_item_val_disabled': result.vehicle_status !== '运行'}">{{$i18n.locale === 'en-us' ? result.en_vehicle_status : result.zh_vehicle_status}}</div> <div class="agv_item_val agv_item_val_1" :class="{'state_item_val_disabled_1': result.vehicle_status !== '待机'}">{{$i18n.locale === 'en-us' ? result.en_vehicle_status : result.zh_vehicle_status}}</div>
</div> </div>
<div class="state_item_wrap"> <div class="state_item_wrap">
<div class="agv_item_label">{{ $t('vehiclestatus.workingstatus') }}:</div> <div class="agv_item_label">{{ $t('vehiclestatus.workingstatus') }}:</div>
@@ -91,6 +91,7 @@
<div class="state_item_val" :class="{'state_item_val_disabled': result1.resetButton_status === '1'}">{{ $t('vehiclestatus.resetbutton') }}</div> <div class="state_item_val" :class="{'state_item_val_disabled': result1.resetButton_status === '1'}">{{ $t('vehiclestatus.resetbutton') }}</div>
<div class="state_item_val" :class="{'state_item_val_disabled': result1.speedStop_status === '1'}">{{ $t('vehiclestatus.obstacleavoidanceparking') }}</div> <div class="state_item_val" :class="{'state_item_val_disabled': result1.speedStop_status === '1'}">{{ $t('vehiclestatus.obstacleavoidanceparking') }}</div>
<div class="state_item_val" :class="{'state_item_val_disabled': result1.securityTentacle_status === '1'}">{{ $t('vehiclestatus.safetyedgesensor') }}</div> <div class="state_item_val" :class="{'state_item_val_disabled': result1.securityTentacle_status === '1'}">{{ $t('vehiclestatus.safetyedgesensor') }}</div>
<div class="state_item_val" :class="{'state_item_val_disabled': result1.ultrasonic_status === '1'}">{{ $t('vehiclestatus.sensorinducedparking') }}</div>
</div> </div>
</div> </div>
</div> </div>
@@ -225,6 +226,8 @@ export default {
background left center url(../../../images/new/state_btn.png) no-repeat background left center url(../../../images/new/state_btn.png) no-repeat
.state_item_val_disabled .state_item_val_disabled
background-image url(../../../images/new/state_btn_disable.png) background-image url(../../../images/new/state_btn_disable.png)
.state_item_val_disabled_1
background-image url(../../../images/new/state_btn_yellow.png)
.enClass .enClass
.agv_item_wrap .agv_item_wrap
&:nth-child(1), &:nth-child(5) &:nth-child(1), &:nth-child(5)

View File

@@ -3,9 +3,13 @@ import { getStore, setStore } from '@config/utils.js'
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://43.139.166.161:8018' : 'http://localhost:8018' const baseUrl = process.env.NODE_ENV === 'development' ? 'http://43.139.166.161:8018' : 'http://localhost:8018'
const setTime = '1000' const setTime = '1000'
const username = 'admin'
const password = '123456'
const state = { const state = {
baseUrl: getStore('baseUrl') || baseUrl, baseUrl: getStore('baseUrl') || baseUrl,
setTime: getStore('setTime') || setTime, setTime: getStore('setTime') || setTime,
defaultUsername: getStore('defaultUsername') || username,
defaultPassword: getStore('defaultPassword') || password,
loading: false, loading: false,
showToast: false, showToast: false,
showAlert: false, showAlert: false,
@@ -18,6 +22,8 @@ const state = {
const getters = { const getters = {
baseUrl: state => state.baseUrl, baseUrl: state => state.baseUrl,
setTime: state => state.setTime, setTime: state => state.setTime,
defaultUsername: state => state.defaultUsername,
defaultPassword: state => state.defaultPassword,
loading: state => state.loading, loading: state => state.loading,
showToast: state => state.showToast, showToast: state => state.showToast,
showAlert: state => state.showAlert showAlert: state => state.showAlert
@@ -29,6 +35,11 @@ const actions = {
setStore('setTime', res.setTime) setStore('setTime', res.setTime)
commit(types.COM_CONFIG, res) commit(types.COM_CONFIG, res)
}, },
setLoginInfo ({commit}, res) {
setStore('defaultUsername', res.username)
setStore('defaultPassword', res.password)
commit(types.COM_LOGIN_INFO, res)
},
setLoadingState ({ commit }, status) { setLoadingState ({ commit }, status) {
commit(types.COM_LOADING_STATUS, status) commit(types.COM_LOADING_STATUS, status)
}, },
@@ -58,6 +69,11 @@ const mutations = {
state.setTime = res.setTime state.setTime = res.setTime
}, },
[types.COM_LOGIN_INFO] (state, res) {
state.defaultUsername = res.username
state.defaultPassword = res.password
},
[types.COM_LOADING_STATUS] (state, status) { [types.COM_LOADING_STATUS] (state, status) {
state.loading = status state.loading = status
}, },

View File

@@ -7,6 +7,7 @@ export const COM_SHOW_FAIL = 'COM_SHOW_FAIL' // 显示失败toast
export const COM_TOAST_MSG = 'COM_TOAST_MSG' // 显示toast文字 export const COM_TOAST_MSG = 'COM_TOAST_MSG' // 显示toast文字
export const COM_SHOW_ALERT = 'COM_SHOW_ALERT' export const COM_SHOW_ALERT = 'COM_SHOW_ALERT'
export const COM_ALERT_MSG = 'COM_ALERT_MSG' export const COM_ALERT_MSG = 'COM_ALERT_MSG'
export const COM_LOGIN_INFO = 'COM_LOGIN_INFO'
// 用户 // 用户
export const SET_USER_INFO = 'SET_USER_INFO' export const SET_USER_INFO = 'SET_USER_INFO'