|
|
@ -44,16 +44,16 @@ const getSpraying = async () => { |
|
|
|
const sprayTaskSprayedList = res.sprayTaskSprayedList |
|
|
|
cmdId = res.cmdId |
|
|
|
|
|
|
|
form.value = { |
|
|
|
...res.sprayParams, |
|
|
|
position: [{ select: false }, { select: false }, { select: false }, { select: false }], |
|
|
|
} |
|
|
|
res.sprayParams.position.forEach((p: any) => { |
|
|
|
form.value.position[p.index] = p |
|
|
|
nextTick(() => { |
|
|
|
sprayRefs.value[p.index].updateSelection(p.x1 * 5, p.y1 * 5, (p.x2 - p.x1) * 5, (p.y2 - p.y1) * 5) |
|
|
|
}) |
|
|
|
}) |
|
|
|
// form.value = { |
|
|
|
// ...res.sprayParams, |
|
|
|
// position: [{ select: false }, { select: false }, { select: false }, { select: false }], |
|
|
|
// } |
|
|
|
// res.sprayParams.position.forEach((p: any) => { |
|
|
|
// form.value.position[p.index] = p |
|
|
|
// nextTick(() => { |
|
|
|
// sprayRefs.value[p.index].updateSelection(p.x1 * 5, p.y1 * 5, (p.x2 - p.x1) * 5, (p.y2 - p.y1) * 5) |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
sprayTaskSprayedList.forEach((task: any) => { |
|
|
|
nextTick(() => { |
|
|
|
drawLine(task.index, { x: task.sprayedPoints.x * 5, y: task.sprayedPoints.y * 5 }, task.number) |
|
|
@ -63,29 +63,30 @@ const getSpraying = async () => { |
|
|
|
|
|
|
|
const sprayRefs = ref<any>([]) |
|
|
|
|
|
|
|
const form = ref<SprayForm>({ |
|
|
|
matrixId: undefined, |
|
|
|
matrixCraftId: undefined, |
|
|
|
matrixPathType: 'horizontal', // 路径类型 |
|
|
|
motorZHeight: undefined, // 高度 |
|
|
|
gasPressure: undefined, // Mpa兆帕 |
|
|
|
volume: undefined, // 单位uL微升 |
|
|
|
highVoltage: true, // 是否打开高压 |
|
|
|
highVoltageValue: undefined, // 高压值 |
|
|
|
spacing: undefined, // 毫米 |
|
|
|
movingSpeed: undefined, // 移动速度 |
|
|
|
times: undefined, // 喷涂遍数 |
|
|
|
position: [ |
|
|
|
{ select: true, x1: 0, y1: 0, x2: 25, y2: 75, index: 0 }, |
|
|
|
{ select: false, x1: 0, y1: 0, x2: 25, y2: 75, index: 1 }, |
|
|
|
{ select: false, x1: 0, y1: 0, x2: 25, y2: 75, index: 2 }, |
|
|
|
{ select: false, x1: 0, y1: 0, x2: 25, y2: 75, index: 3 }, |
|
|
|
], |
|
|
|
}) |
|
|
|
|
|
|
|
const maskVisible = ref(false) |
|
|
|
|
|
|
|
const startWork = async () => { |
|
|
|
const data = sprayStore.sprayTaskParams.filter(item => item.select) |
|
|
|
if (!data.length) { |
|
|
|
FtMessage.error('至少选择一个喷涂玻片') |
|
|
|
return |
|
|
|
} |
|
|
|
const errIndex = [] |
|
|
|
data.forEach((item, index) => { |
|
|
|
if (!item.hasSet) { |
|
|
|
errIndex.push(index) |
|
|
|
FtMessage.error(`玻片${index + 1}: 请设置喷涂参数`) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (errIndex.length) { |
|
|
|
return |
|
|
|
} |
|
|
|
sprayStore.sprayTaskParams.forEach((item, index) => { |
|
|
|
if (item.select) { |
|
|
|
sprayRefs.value[index].clearLines() |
|
|
|
item.select = false |
|
|
|
} |
|
|
|
}) |
|
|
|
await setParams({ sprayTaskParams: sprayStore.sprayTaskParams.filter(item => item.select) }) |
|
|
|
cmdId = Date.now().toString() |
|
|
|
const params = { |
|
|
@ -97,7 +98,7 @@ const startWork = async () => { |
|
|
|
|
|
|
|
await sendControl(params) |
|
|
|
maskVisible.value = true |
|
|
|
currentSpeed = Number(form.value.movingSpeed) |
|
|
|
// currentSpeed = Number(form.value.movingSpeed) |
|
|
|
} |
|
|
|
|
|
|
|
const pauseWork = async () => { |
|
|
@ -116,7 +117,7 @@ const continueWork = async () => { |
|
|
|
}, |
|
|
|
} |
|
|
|
await sendControl(params) |
|
|
|
currentSpeed = Number(form.value.movingSpeed) |
|
|
|
// currentSpeed = Number(form.value.movingSpeed) |
|
|
|
} |
|
|
|
|
|
|
|
const stopWork = async () => { |
|
|
@ -133,8 +134,8 @@ const stopWork = async () => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
let currentSpeed = 0 |
|
|
|
console.log(currentSpeed) |
|
|
|
// let currentSpeed = 0 |
|
|
|
// console.log(currentSpeed) |
|
|
|
// let poll: ReturnType<typeof setInterval> |
|
|
|
|
|
|
|
let cmdId = '' |
|
|
@ -183,11 +184,11 @@ const finishMessage = (data: any) => { |
|
|
|
FtMessage.success('喷涂执行成功') |
|
|
|
} |
|
|
|
if (data.status === 'spray_task_finish') { |
|
|
|
form.value.position.forEach((item, index) => { |
|
|
|
if (item.select) { |
|
|
|
sprayRefs.value[index].clearLines() |
|
|
|
} |
|
|
|
}) |
|
|
|
// form.value.position.forEach((item, index) => { |
|
|
|
// if (item.select) { |
|
|
|
// sprayRefs.value[index].clearLines() |
|
|
|
// } |
|
|
|
// }) |
|
|
|
maskVisible.value = false |
|
|
|
} |
|
|
|
} |
|
|
@ -206,7 +207,6 @@ const drawLine = async (index: number, point: { x: number, y: number }, number: |
|
|
|
const selectCraftVisible = ref(false) |
|
|
|
const ok = async (data: any) => { |
|
|
|
selectCraftVisible.value = false |
|
|
|
console.log(1111) |
|
|
|
sprayStore.updateSprayForm(data, selectIndex.value) |
|
|
|
} |
|
|
|
|
|
|
@ -297,6 +297,7 @@ const viewParams = (index: number) => { |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
height: 120px; |
|
|
|
gap: 50px; |
|
|
|
} |
|
|
|
.spray-box { |
|
|
|
position: relative; |
|
|
@ -347,7 +348,7 @@ const viewParams = (index: number) => { |
|
|
|
width: 100%; |
|
|
|
top: 0; |
|
|
|
height: 50%; |
|
|
|
background: rgba(255, 255, 255, 0.1); |
|
|
|
background: rgba(255, 255, 255, 0.01); |
|
|
|
z-index: 2000; |
|
|
|
} |
|
|
|
.tray-name { |
|
|
@ -357,6 +358,9 @@ const viewParams = (index: number) => { |
|
|
|
justify-content: center; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
:deep(.ft-button) { |
|
|
|
margin: 0; |
|
|
|
} |
|
|
|
:deep(.el-drawer) { |
|
|
|
width: 33% !important; |
|
|
|
} |
|
|
|