From dbde3162fd361dcba4316b58754ccecf39a81a9f Mon Sep 17 00:00:00 2001 From: wxw <Administrator@DESKTOP-5BIMHQ3> Date: 星期一, 09 六月 2025 08:52:18 +0800 Subject: [PATCH] 修改问题 --- Web/src/views/device/deviceStartStop/index.vue | 88 +++++++++++++++++++++++++++++++++----------- 1 files changed, 66 insertions(+), 22 deletions(-) diff --git a/Web/src/views/device/deviceStartStop/index.vue b/Web/src/views/device/deviceStartStop/index.vue index a1d5f65..eb04f31 100644 --- a/Web/src/views/device/deviceStartStop/index.vue +++ b/Web/src/views/device/deviceStartStop/index.vue @@ -2,23 +2,27 @@ <el-row :gutter="10"> <el-col :span="8"> <el-collapse v-model="activeNames"> - <el-collapse-item title="浠撳簱浜屽眰" name="1"> + <el-collapse-item title="浠撳簱涓�灞�" name="1"> <el-card class="box-card" shadow="hover"> - <el-switch v-model="state.boRunningState" active-text="" inactive-text="鎵樼洏杈撻��" - @change=""></el-switch> + <el-text style="margin-right: 15px;">鎵樼洏杈撻��</el-text> + <el-button @click="write('OnePalletStart','1')">鍚姩</el-button> + <el-button @click="write('OnePalletStop','1')">鍋滄</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> - <el-switch active-text="" inactive-text="鎷嗚泛鏈哄櫒浜�1" - @change=""></el-switch> + <el-text style="margin-right: 15px;">鎷嗚泛鏈哄櫒浜�1</el-text> + <el-button @click="write('OneChaiStart','1')">鍚姩</el-button> + <el-button @click="write('OneChaiStop','1')">鍋滄</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> - <el-switch active-text="" inactive-text="鎷嗚泛鏈哄櫒浜�2" - @change=""></el-switch> + <el-text style="margin-right: 15px;">鎷嗚泛鏈哄櫒浜�2</el-text> + <el-button @click="write('OneChaiTwoStart','1')">鍚姩</el-button> + <el-button @click="write('OneChaiTwoStop','1')">鍋滄</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> - <el-switch active-text="" inactive-text="浠剁杈撻��" - @change=""></el-switch> + <el-text style="margin-right: 15px;">浠剁杈撻��</el-text> + <el-button @click="write('OneBoxStart','1')">鍚姩</el-button> + <el-button @click="write('OneBoxStop','1')">鍋滄</el-button> </el-card> </el-collapse-item> </el-collapse> @@ -28,21 +32,25 @@ <el-collapse v-model="activeNames2"> <el-collapse-item title="浠撳簱浜屽眰" name="2"> <el-card class="box-card" shadow="hover"> - <el-switch active-text="" inactive-text="鎵樼洏杈撻��" - @change=""></el-switch> + <el-text style="margin-right: 15px;">鎵樼洏杈撻��</el-text> + <el-button @mousedown="writeDown('TwoPalletStart','2')" @mouseup="writeUp('TwoPalletStart','2')">鍚姩</el-button> + <el-button @mousedown="writeDown('TwoPalletStop','2')" @mouseup="writeUp('TwoPalletStop','2')">鍋滄</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> - <el-switch active-text="" inactive-text="鐮佸灈鏈哄櫒浜�1" - @change=""></el-switch> + <el-text style="margin-right: 15px;">鐮佽泛鏈哄櫒浜�1</el-text> + <el-button @mousedown="writeDown('TwoMaStart','2')" @mouseup="writeUp('TwoMaStart','2')">鍚姩</el-button> + <el-button @mousedown="writeDown('TwoMaStop','2')" @mouseup="writeUp('TwoMaStop','2')">鍋滄</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> - <el-switch active-text="" inactive-text="鐮佸灈鏈哄櫒浜�2" - @change=""></el-switch> + <el-text style="margin-right: 15px;">鐮佽泛鏈哄櫒浜�2</el-text> + <el-button @mousedown="writeDown('TwoMaTwoStart','2')" @mouseup="writeUp('TwoMaTwoStart','2')">鍚姩</el-button> + <el-button @mousedown="writeDown('TwoMaTwoStop','2')" @mouseup="writeUp('TwoMaTwoStop','2')">鍋滄</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> - <el-switch active-text="" inactive-text="浠剁杈撻��" - @change=""></el-switch> + <el-text style="margin-right: 15px;">浠剁杈撻��</el-text> + <el-button @mousedown="writeDown('TwoBoxStart','2')" @mouseup="writeUp('TwoBoxStart','2')">鍚姩</el-button> + <el-button @mousedown="writeDown('TwoBoxStop','2')" @mouseup="writeUp('TwoBoxStop','2')">鍋滄</el-button> </el-card> </el-collapse-item> </el-collapse> @@ -52,8 +60,9 @@ <el-collapse v-model="activeNames3"> <el-collapse-item title="浠撳簱涓夊眰" name="3"> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> - <el-switch active-text="" inactive-text="鎵樼洏杈撻��" - @change=""></el-switch> + <el-text style="margin-right: 15px;">鎵樼洏杈撻��</el-text> + <el-button @click="write('ThreePalletStart','3')">鍚姩</el-button> + <el-button @click="write('ThreePalletStop','3')">鍋滄</el-button> </el-card> </el-collapse-item> </el-collapse> @@ -65,7 +74,11 @@ <script lang="ts" setup> -import { ref } from 'vue'; + +import { ref, reactive, onMounted } from 'vue'; +import { listStatus, listPosition } from '/@/api/wcs/wcsPlc'; +import { WriteStartStop } from '/@/api/wcs/wcsDevice'; +import { ElMessage } from "element-plus"; const activeNames = ref(['1']) const activeNames2 = ref(['2']) @@ -73,8 +86,39 @@ const state = ref<any>({}); - - +const write = async (type: string,layer: string) => { + + var data = { + Type:type, + Layer: layer + }; + + var res = await WriteStartStop(data); + console.log(res.data.result); + // ElMessage.success(res.data.result); +} +const writeDown = async (type: string,layer: string) => { + + var data={ + Type:type, + Layer: layer, + FuncName : "true" + } + var res = await WriteStartStop(data); + console.log(type+"鎸変笅浜嬩欢"); + +} +const writeUp = async (type: string,layer: string) => { + + var data={ + Type:type, + Layer: layer, + FuncName : "false" + } + var res = await WriteStartStop(data); + console.log(type+"鎶捣浜嬩欢"); + +} </script> -- Gitblit v1.8.0