Browse Source

fix:校验正在喷涂的任务

master
guoapeng 5 months ago
parent
commit
9142c4eab3
  1. 7
      src/components/home/Check/index.vue
  2. 2
      src/components/martix/Edit/index.vue
  3. 13
      src/components/spray/trayGraph/index.vue
  4. 38
      src/views/spray/index.vue

7
src/components/home/Check/index.vue

@ -139,8 +139,10 @@ const addTextToCheckList = async (text: string, id: number) => {
.mask-box {
display: flex;
font-size: 35px;
align-items: center;
margin-bottom: 40px;
.el-tag {
margin: 0 20px 10px 0;
margin-right: 20px;
width: 100%;
}
}
@ -158,4 +160,7 @@ const addTextToCheckList = async (text: string, id: number) => {
.el-icon.el-icon--loading {
animation: spin 1s linear infinite; // Loading spin
}
:deep(.el-tag) {
padding: 30px 0;
}
</style>

2
src/components/martix/Edit/index.vue

@ -58,7 +58,7 @@ const cancel = () => {
<template>
<FtDialog visible :title="form.id ? '编辑基质' : '新增基质'" width="40%" @ok="okHandle" @cancel="cancel">
<el-form ref="formRef" label-width="120" :model="form" :rules="rules">
<el-form-item label="基质名称">
<el-form-item label="基质名称" prop="name">
<el-input v-model="form.name" placeholder="" />
</el-form-item>
</el-form>

13
src/components/spray/trayGraph/index.vue

@ -140,6 +140,18 @@ const getSelection = () => {
return null
}
//
const updateSelection = (x: number, y: number, width: number, height: number) => {
if (rect.value) {
rect.value.position({ x, y })
rect.value.width(width)
rect.value.height(height)
newWidth = width
newHeight = height
layer.value.draw()
}
}
const formatNum = (num: number) => {
return Math.round(num * 100) / 100
}
@ -195,6 +207,7 @@ defineExpose({
hasLines, // :
hasLine,
clearLines, // : line
updateSelection, // :
})
</script>

38
src/views/spray/index.vue

@ -1,6 +1,7 @@
<script setup lang="ts">
import { list as listMatrix } from 'apis/matrix'
import { getListByMatrixId, update } from 'apis/matrixCraft'
import { getDeviceStatus, getSprayStatus } from 'apis/system'
import route from 'assets/images/route.png'
import route_active from 'assets/images/route_active.png'
import route_horizontal_active from 'assets/images/route_horizontal2.png'
@ -47,14 +48,41 @@ const submitParam = async () => {
const infoVisible = ref(false)
onMounted(() => {
getMatrixList()
systemStore.systemStatus.spraying && getSpraying()
onMounted(async () => {
await getMatrixList()
console.log(222, systemStore.systemStatus.spraying)
await getDeviceStatus().then((res: any) => {
systemStore.updateSystemStatus(res)
if (systemStore.systemStatus.spraying) {
getSpraying()
}
})
})
const getSpraying = async () => {
// const res = await getSprayStatus()
// const sprayTaskSprayedList = res.sprayTaskSprayedList
const res = await getSprayStatus()
const sprayTaskSprayedList = res.sprayTaskSprayedList
form.value = res.sprayParams
form.value.position = [{ select: false }, { select: false }, { select: false }, { select: false }]
sprayTaskSprayedList.forEach((item: any) => {
form.value.position[item.index] = {
select: true,
x1: item.x1,
y1: item.y1,
x2: item.x2,
y2: item.y2,
index: item.index,
}
nextTick(() => {
sprayRefs.value[item.index].updateSelection(item.x1 * 5, item.y1 * 5, (item.x1 + item.x2) * 5, (item.y1 + item.y2) * 5)
})
sprayTaskSprayedList.forEach((task: any) => {
nextTick(() => {
drawLine(task.index, { x: task.sprayedPoints.x * 5, y: task.sprayedPoints.y * 5 }, task.number)
})
})
socket.init(sprayPointReceiveMessage, 'spray_point')
})
}
const matrixList = ref([])

Loading…
Cancel
Save