|
@ -3,8 +3,8 @@ |
|
|
<div class="w-full"> |
|
|
<div class="w-full"> |
|
|
<div class="flex items-center mb-3 gap-5"> |
|
|
<div class="flex items-center mb-3 gap-5"> |
|
|
<p class="font-medium text-primary">喷涂路线</p> |
|
|
<p class="font-medium text-primary">喷涂路线</p> |
|
|
<img :src="route_v" alt="icon" /> |
|
|
|
|
|
<img :src="route_h2" alt="icon" /> |
|
|
|
|
|
|
|
|
<img :src="dto.direction === 1 ? route_v : route_v2" alt="icon" @click="sprayDirection('v')" /> |
|
|
|
|
|
<img :src="dto.direction === 1 ? route_h2 : route_h" alt="icon" @click="sprayDirection('h')" /> |
|
|
<button class="btn-dark px-8 py-2 text-lg" @click="startSpray">开始喷涂</button> |
|
|
<button class="btn-dark px-8 py-2 text-lg" @click="startSpray">开始喷涂</button> |
|
|
<button class="btn-light px-8 py-2 text-lg" @click="stopSpray">停止喷涂</button> |
|
|
<button class="btn-light px-8 py-2 text-lg" @click="stopSpray">停止喷涂</button> |
|
|
</div> |
|
|
</div> |
|
@ -160,8 +160,15 @@ function onSelectArea(area: GridArea) { |
|
|
function needPower(need: boolean) { |
|
|
function needPower(need: boolean) { |
|
|
dto.needPower = need; |
|
|
dto.needPower = need; |
|
|
} |
|
|
} |
|
|
|
|
|
function sprayDirection(direction: "h" | "v") { |
|
|
|
|
|
dto.direction = direction === "h" ? 1 : 2; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function startSpray() { |
|
|
function startSpray() { |
|
|
|
|
|
dto.position = [ |
|
|
|
|
|
{ x: selectedArea.value?.xStart || 10, y: selectedArea.value?.yStart || 10 }, |
|
|
|
|
|
{ x: selectedArea.value?.xEnd || 20, y: selectedArea.value?.yEnd || 20 }, |
|
|
|
|
|
]; |
|
|
const params = dto.needPower ? dto : { ...dto, voltage: 0 }; |
|
|
const params = dto.needPower ? dto : { ...dto, voltage: 0 }; |
|
|
console.log(params); |
|
|
console.log(params); |
|
|
// 调用方法 |
|
|
// 调用方法 |
|
|