Browse Source

显示出推出托盘

master
LiLongLong 5 months ago
parent
commit
04279da2a0
  1. 19
      src/components/FooterBar.vue
  2. 2
      src/services/globalCmd/cmdTypes.ts
  3. 22
      src/views/debug/index.vue

19
src/components/FooterBar.vue

@ -6,14 +6,19 @@
</section> </section>
<section class="bg-[#335AA5] ml-6 px-4 py-2 rounded flex items-center gap-4"> <section class="bg-[#335AA5] ml-6 px-4 py-2 rounded flex items-center gap-4">
<span>当前设备{{ workStatusDescMap[statusStore.workStatus] }}</span>
<span>设备状态{{ workStatusDescMap[statusStore.workStatus] }}</span>
<!-- <span>当前温度18</span> --> <!-- <span>当前温度18</span> -->
</section> </section>
<!--:disabled="!statusStore.equipmentStatus.yAxisMovementEnded"-->
<button <button
:disabled="!statusStore.equipmentStatus.yAxisMovementEnded"
class="ml-auto btn-light px-8 py-1 text-lg" class="ml-auto btn-light px-8 py-1 text-lg"
@click="onPushTrayClick">
{{ pushBtnText }}
@click="onPushTrayClick('into')">
推入托盘
</button>
<button
class="ml-[1rem] mr-[1rem] btn-light px-8 py-1 text-lg"
@click="onPushTrayClick('out')">
推出托盘
</button> </button>
<!-- <Time class="ml-auto text-lg"></Time> --> <!-- <Time class="ml-auto text-lg"></Time> -->
@ -61,8 +66,8 @@ const isTrayOutside = computed(() => {
const isTrayInside = computed(() => { const isTrayInside = computed(() => {
return statusStore.equipmentStatus.yAxisMovementEnded && statusStore.equipmentStatus.yAxisAtOrigin; return statusStore.equipmentStatus.yAxisMovementEnded && statusStore.equipmentStatus.yAxisAtOrigin;
}); });
function onPushTrayClick() {
if (isTrayOutside.value) {
function onPushTrayClick(type:string) {
if (type === 'into') {
pushInTray({}).then(res => { pushInTray({}).then(res => {
if (res.success) { if (res.success) {
ElMessage.success("正在推入"); ElMessage.success("正在推入");
@ -70,7 +75,7 @@ function onPushTrayClick() {
ElMessage.error(res.msg); ElMessage.error(res.msg);
} }
}); });
} else if (isTrayInside.value) {
} else if (type === 'out') {
pushOutTray({}).then(res => { pushOutTray({}).then(res => {
if (res.success) { if (res.success) {
ElMessage.success("正在推出"); ElMessage.success("正在推出");

2
src/services/globalCmd/cmdTypes.ts

@ -8,7 +8,7 @@ export type ControlType = {
export type SyringeParams = { export type SyringeParams = {
rotationSpeed: number; rotationSpeed: number;
direction: string;
direction: number;
// time: number; // time: number;
} }
export type SyringeType = { export type SyringeType = {

22
src/views/debug/index.vue

@ -52,8 +52,8 @@
<div class="debug_left"> <div class="debug_left">
<div> <div>
<el-row> <el-row>
<el-col :span="6" >电机回原点</el-col>
<el-col :span="14">
<el-col :span="6" class="text-right">电机回原点</el-col>
<el-col :span="14" class="ml-[10px]">
<el-radio-group v-model="initForm.axis"> <el-radio-group v-model="initForm.axis">
<el-radio value="X">X</el-radio> <el-radio value="X">X</el-radio>
<el-radio value="Y">Y</el-radio> <el-radio value="Y">Y</el-radio>
@ -61,13 +61,13 @@
</el-radio-group> </el-radio-group>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<el-button type="primary" @click="onMotorMoveToHome">回原点</el-button>
<el-button type="primary" @click="onMotorMoveToHome">回原点:</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-row class="mt-[10px]"> <el-row class="mt-[10px]">
<el-col :span="6" >电机转速</el-col>
<el-col :span="14">
<el-col :span="6" class="text-right">电机转速</el-col>
<el-col :span="14" class="ml-[10px]">
<el-radio-group v-model="rotateForm.axis"> <el-radio-group v-model="rotateForm.axis">
<el-radio value="X">X</el-radio> <el-radio value="X">X</el-radio>
<el-radio value="Y">Y</el-radio> <el-radio value="Y">Y</el-radio>
@ -122,8 +122,8 @@
</div> --> </div> -->
<div class="ml-[20px] mt-[10px]"> <div class="ml-[20px] mt-[10px]">
方向 方向
<el-radio v-model="syringeForm.direction" value="0">后退</el-radio>
<el-radio v-model="syringeForm.direction" value="1">前进</el-radio>
<el-radio v-model="syringeForm.direction" :value="0">后退</el-radio>
<el-radio v-model="syringeForm.direction" :value="1">前进</el-radio>
<br /> <br />
<el-button type="primary" @click="onTurnOnSyringePump">开始</el-button> <el-button type="primary" @click="onTurnOnSyringePump">开始</el-button>
<el-button type="primary" class="ml-[20px]" @click="onTurnOffSyringePump">停止</el-button> <el-button type="primary" class="ml-[20px]" @click="onTurnOffSyringePump">停止</el-button>
@ -156,7 +156,7 @@
placeholder="亮度" placeholder="亮度"
type="number" type="number"
class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" /> --> class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" /> -->
<el-button class="ml-[20px]" type="primary" @click="onTurnOnLightPanel">开启照明灯</el-button>
<el-button type="primary" @click="onTurnOnLightPanel">开启照明灯</el-button>
<el-button @click="onTurnOffLightPanel">关闭照明灯</el-button> <el-button @click="onTurnOffLightPanel">关闭照明灯</el-button>
</div> </div>
</div> </div>
@ -354,7 +354,7 @@ const activeName = ref("debug");
const voltageValue = ref(); const voltageValue = ref();
const syringeForm = ref<SyringeParams>({ const syringeForm = ref<SyringeParams>({
rotationSpeed: 1, rotationSpeed: 1,
direction: "1",
direction: 1,
}); });
const workForm = ref<WorkType>({ const workForm = ref<WorkType>({
routeType: 1, routeType: 1,
@ -479,7 +479,7 @@ const onTurnOnSyringePump = () => {
const params = <SyringeType>{ const params = <SyringeType>{
params: { params: {
rotationSpeed: syringeForm.value.rotationSpeed, rotationSpeed: syringeForm.value.rotationSpeed,
// direction: syringeForm.value.direction,
direction: syringeForm.value.direction,
// time: syringeForm.value.time, // time: syringeForm.value.time,
}, },
}; };
@ -604,7 +604,7 @@ div {
.debug_main { .debug_main {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 4rem;
margin-left: 3.5rem;
margin-top: 0.5rem; margin-top: 0.5rem;
.debug_left { .debug_left {
background: #fbfbfb; background: #fbfbfb;

Loading…
Cancel
Save