|
|
@ -43,14 +43,13 @@ const getSpraying = async () => { |
|
|
|
const res: any = await getSprayStatus() |
|
|
|
cmdId = res.cmdId |
|
|
|
res.sprayTaskParams.forEach((item: any) => { |
|
|
|
sprayStore.updateSprayForm(item, item.index) |
|
|
|
sprayStore.updateSprayForm({ ...item, select: true }, item.index) |
|
|
|
}) |
|
|
|
res.sprayTaskSprayedList |
|
|
|
.forEach((task: any) => { |
|
|
|
nextTick(() => { |
|
|
|
drawLine(task.index, { x: task.sprayedPoints.x * 5, y: task.sprayedPoints.y * 5 }, task.number) |
|
|
|
}) |
|
|
|
res.sprayTaskSprayedList.forEach((task: any) => { |
|
|
|
nextTick(() => { |
|
|
|
drawLine(task.index, { x: task.sprayedPoints.x * 5, y: task.sprayedPoints.y * 5 }, task.number) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const sprayRefs = ref<any>([]) |
|
|
@ -83,8 +82,7 @@ const startWork = async () => { |
|
|
|
const params = { |
|
|
|
cmdCode: 'matrix_spray_start', |
|
|
|
cmdId, |
|
|
|
params: { |
|
|
|
}, |
|
|
|
params: {}, |
|
|
|
} |
|
|
|
|
|
|
|
await sendControl(params) |
|
|
@ -104,8 +102,7 @@ const continueWork = async () => { |
|
|
|
const params = { |
|
|
|
cmdCode: 'matrix_spray_continue', |
|
|
|
cmdId: '', |
|
|
|
params: { |
|
|
|
}, |
|
|
|
params: {}, |
|
|
|
} |
|
|
|
await sendControl(params) |
|
|
|
// currentSpeed = Number(form.value.movingSpeed) |
|
|
@ -167,7 +164,6 @@ const sprayPointReceiveMessage = (data: any) => { |
|
|
|
} |
|
|
|
|
|
|
|
const finishMessage = (data: any) => { |
|
|
|
console.log(data, cmdId) |
|
|
|
if (data.cmdId === cmdId) { |
|
|
|
if (data.status === 'fail') { |
|
|
|
FtMessage.error(data.title) |
|
|
@ -176,6 +172,7 @@ const finishMessage = (data: any) => { |
|
|
|
FtMessage.success('喷涂执行成功') |
|
|
|
} |
|
|
|
if (data.status === 'spray_task_finish') { |
|
|
|
console.log('------------------', data, cmdId, sprayStore.sprayTaskParams) |
|
|
|
sprayStore.sprayTaskParams.forEach((item, index) => { |
|
|
|
if (item.select) { |
|
|
|
sprayRefs.value[index].clearLines() |
|
|
@ -236,19 +233,23 @@ const viewParams = (index: number) => { |
|
|
|
<template> |
|
|
|
<div class="spray-container"> |
|
|
|
<div class="button-box"> |
|
|
|
<ft-button type="primary" :disabled="systemStore.systemStatus.spraying" @click="startWork"> |
|
|
|
<ft-button type="primary" :disabled="systemStore.systemStatus.spraying" :click-handle="startWork"> |
|
|
|
开始喷涂 |
|
|
|
</ft-button> |
|
|
|
<!-- <ft-button type="primary" :disabled="!systemStore.systemStatus.spraying" @click="updateParam"> --> |
|
|
|
<!-- 调整参数 --> |
|
|
|
<!-- </ft-button> --> |
|
|
|
<ft-button type="primary" :disabled="!systemStore.systemStatus.spraying || systemStore.systemStatus.paused" @click="pauseWork"> |
|
|
|
<ft-button |
|
|
|
type="primary" |
|
|
|
:disabled="!systemStore.systemStatus.spraying || systemStore.systemStatus.paused" |
|
|
|
:click-handle="pauseWork" |
|
|
|
> |
|
|
|
暂停喷涂 |
|
|
|
</ft-button> |
|
|
|
<ft-button type="primary" :disabled="!systemStore.systemStatus.paused" @click="continueWork"> |
|
|
|
<ft-button type="primary" :disabled="!systemStore.systemStatus.paused" :click-handle="continueWork"> |
|
|
|
继续喷涂 |
|
|
|
</ft-button> |
|
|
|
<ft-button type="primary" :disabled="!systemStore.systemStatus.spraying" @click="stopWork"> |
|
|
|
<ft-button type="primary" :disabled="!systemStore.systemStatus.spraying" :click-handle="stopWork"> |
|
|
|
结束喷涂 |
|
|
|
</ft-button> |
|
|
|
</div> |
|
|
|