|
|
@ -29,12 +29,16 @@ |
|
|
|
<el-popover placement="bottom" :width="380" trigger="click"> |
|
|
|
<template #reference> |
|
|
|
<div class="text-primary underline flex items-center gap-1"> |
|
|
|
<span>详细参数</span> |
|
|
|
<span>{{ craftList.length === 0 ? "设置参数" : "详细参数" }}</span> |
|
|
|
<img src="@/assets/icon_info.svg" alt="info" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template #default> |
|
|
|
<SprayParam :sprayParam="selectCraft" @save="updateSprayParam" /> |
|
|
|
<SprayParam |
|
|
|
ref="sprayParamRef" |
|
|
|
:sprayParam="selectCraft" |
|
|
|
save-title="保存至工艺" |
|
|
|
@save="updateSprayParam" /> |
|
|
|
</template> |
|
|
|
</el-popover> |
|
|
|
</section> |
|
|
@ -107,7 +111,7 @@ |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import Spray, { type GridArea } from "@/components/Spray.vue"; |
|
|
|
import { onMounted, ref } from "vue"; |
|
|
|
import { onMounted, ref, useTemplateRef } from "vue"; |
|
|
|
import { startSpray, stopWork } from "@/services/globalCmd/globalCmd"; |
|
|
|
import { checkSprayParamValid, type PositionType, type WorkType } from "@/services/globalCmd/cmdTypes"; |
|
|
|
import { ElMessage } from "element-plus"; |
|
|
@ -196,14 +200,21 @@ function mapAreaToPosition() { |
|
|
|
return pos; |
|
|
|
}); |
|
|
|
} |
|
|
|
const sprayParamRef = ref(); |
|
|
|
|
|
|
|
function onStartSpray() { |
|
|
|
if (checked.value.length === 0) { |
|
|
|
ElMessage.error("请至少选择一个玻片"); |
|
|
|
return; |
|
|
|
} |
|
|
|
selectCraft.value.position = mapAreaToPosition(); |
|
|
|
const params = selectCraft.value.needPower ? selectCraft.value : { ...selectCraft.value, voltage: 0 }; |
|
|
|
console.log(params); |
|
|
|
|
|
|
|
// 把参数弹窗中的数据 应用过来 |
|
|
|
const params = { ...selectCraft.value, ...sprayParamRef.value.sprayParam }; |
|
|
|
params.position = mapAreaToPosition(); |
|
|
|
if (!params.needPower) { |
|
|
|
params.voltage = 0; |
|
|
|
} |
|
|
|
// console.log(params); |
|
|
|
|
|
|
|
const check = checkSprayParamValid(params); |
|
|
|
if (!check[0]) { |
|
|
|