Browse Source

完善喷涂参数

feature/debug
zhangjiming 5 months ago
parent
commit
8879eacc98
  1. 11
      src/views/SprayView.vue

11
src/views/SprayView.vue

@ -3,8 +3,8 @@
<div class="w-full">
<div class="flex items-center mb-3 gap-5">
<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-light px-8 py-2 text-lg" @click="stopSpray">停止喷涂</button>
</div>
@ -160,8 +160,15 @@ function onSelectArea(area: GridArea) {
function needPower(need: boolean) {
dto.needPower = need;
}
function sprayDirection(direction: "h" | "v") {
dto.direction = direction === "h" ? 1 : 2;
}
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 };
console.log(params);
//

Loading…
Cancel
Save