Browse Source

fix:ws修正

master
guoapeng 5 months ago
parent
commit
57389ca5c2
  1. 11
      src/views/spray/index.vue

11
src/views/spray/index.vue

@ -49,6 +49,8 @@ const submitParam = async () => {
const infoVisible = ref(false) const infoVisible = ref(false)
onMounted(async () => { onMounted(async () => {
socket.init(sprayPointReceiveMessage, 'spray_point')
socket.init(finishMessage, 'cmd_response')
await getMatrixList() await getMatrixList()
console.log(222, systemStore.systemStatus.spraying) console.log(222, systemStore.systemStatus.spraying)
await getDeviceStatus().then((res: any) => { await getDeviceStatus().then((res: any) => {
@ -82,8 +84,8 @@ const getSpraying = async () => {
drawLine(task.index, { x: task.sprayedPoints.x * 5, y: task.sprayedPoints.y * 5 }, task.number) drawLine(task.index, { x: task.sprayedPoints.x * 5, y: task.sprayedPoints.y * 5 }, task.number)
}) })
}) })
socket.init(sprayPointReceiveMessage, 'spray_point')
socket.init(finishMessage, 'cmd_response')
// socket.init(sprayPointReceiveMessage, 'spray_point')
// socket.init(finishMessage, 'cmd_response')
}) })
} }
@ -168,8 +170,8 @@ const startWork = async () => {
}, },
} }
console.log(params) console.log(params)
socket.init(sprayPointReceiveMessage, 'spray_point')
socket.init(finishMessage, 'cmd_response')
// socket.init(sprayPointReceiveMessage, 'spray_point')
// socket.init(finishMessage, 'cmd_response')
maskVisible.value = true maskVisible.value = true
await sendControl(params) await sendControl(params)
currentSpeed = Number(form.value.movingSpeed) currentSpeed = Number(form.value.movingSpeed)
@ -218,7 +220,6 @@ const sprayPointReceiveMessage = (data: any) => {
} }
let cmdId = '' let cmdId = ''
const finishMessage = (data: any) => { const finishMessage = (data: any) => {
console.log(data)
if (data.cmdId === cmdId && data.status === 'spray_task_finish') { if (data.cmdId === cmdId && data.status === 'spray_task_finish') {
form.value.position.forEach((item, index) => { form.value.position.forEach((item, index) => {
if (item.select) { if (item.select) {

Loading…
Cancel
Save