加功能

This commit is contained in:
2025-09-16 18:01:49 +08:00
parent 3ac1d5f49c
commit 1a1ddd256f
14 changed files with 682 additions and 2710 deletions

View File

@@ -30,7 +30,7 @@
<div class="error-tips-t">{{$t('ErrorPrompt')}}{{ exception }}</div>
</div>
</div>
<el-row type="flex" class="relative main-conatiner" :style="{'paddingTop': exception !== '' ? '.3rem' : '0', 'paddingBottom': taskSeq.length > 0 ? '.6rem': '0'}">
<el-row type="flex" class="relative main-conatiner" :style="{'paddingTop': exception !== '' ? '.4rem' : '0', 'paddingBottom': taskSeq.length > 0 ? '.6rem': '0'}">
<div class="absolute hud_left"></div>
<div class="absolute hud_left hud_right"></div>
<router-view></router-view>
@@ -107,7 +107,9 @@ export default {
// "en_error_description": null,
// "error_type": 1}
// ],
// forkTipObstacles: '1'
// forkTipObstacles: '1',
// auto_loop_enable: '0',
// auto_back_enable: ''
// },
taskSeq: [],
currentStep: null,
@@ -184,6 +186,11 @@ export default {
},
// 初始化WebSocket连接
initWebSocket () {
this.loading = this.$loading({
lock: true,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.6)'
})
if (this.reconnectTimer) clearTimeout(this.reconnectTimer)
const wsHost = this.serverUrl.replace(/^https?:\/\//, '')
const lang = this.$i18n.locale.slice(0, 2)
@@ -194,6 +201,16 @@ export default {
this.websocket.onmessage = (event) => {
try {
const res = JSON.parse(event.data)
if (!res.data.rcsConnected && !res.data.vehicleConnected) {
this.$message.error(this.$t('Dispatchvehiclenotconnected'))
} else if (!res.data.rcsConnected && res.data.vehicleConnected) {
this.$message.error(this.$t('Dispatchnotconnected'))
} else if (!res.data.vehicleConnected && res.data.rcsConnected) {
this.$message.error(this.$t('Vehiclenotconnected'))
}
if (res.data.rcsConnected && res.data.vehicleConnected) {
this.loading.close()
}
this.handleWebSocketMessage(res)
} catch (error) {
console.error('WebSocket消息解析失败:', error)
@@ -203,6 +220,7 @@ export default {
this.$message.error(this.$t('WebSocketerror') + ':', error)
}
this.websocket.onclose = () => {
this.loading.close()
this.topInfo = {}
this.taskSeq = []
this.currentStep = null
@@ -233,7 +251,7 @@ export default {
this.reconnectTimer = setTimeout(() => {
this.$message.error(this.$t('AttreconnectWebSocket'))
this.initWebSocket()
}, 5000) // 5秒后重连
}, 3000) // 3秒后重连
}
}
}
@@ -295,8 +313,8 @@ export default {
top .48rem
left 0
width 100%
height .3rem
line-height .3rem
height .4rem
line-height .4rem
overflow hidden
white-space nowrap
background-color rgba(253, 246, 236, .4)
@@ -310,7 +328,7 @@ export default {
margin-right .05rem
.error-tips-t
display inline-block
font-size .16rem
font-size .24rem
color #e6bb3c
.task_wraper
position fixed