From 9b85a8b67aa6354ee9ea1a13c5799bf1c934922f Mon Sep 17 00:00:00 2001 From: IPC-610 <IPC-610@DESKTOP-6LEOOS3> Date: 星期四, 31 十月 2024 18:12:14 +0800 Subject: [PATCH] 修改问题 --- Web/src/views/device/deviceStartStop/index.vue | 39 ++++++++++++++++++++++++++++++--------- 1 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Web/src/views/device/deviceStartStop/index.vue b/Web/src/views/device/deviceStartStop/index.vue index a197f3c..eb04f31 100644 --- a/Web/src/views/device/deviceStartStop/index.vue +++ b/Web/src/views/device/deviceStartStop/index.vue @@ -33,24 +33,24 @@ <el-collapse-item title="浠撳簱浜屽眰" name="2"> <el-card class="box-card" shadow="hover"> <el-text style="margin-right: 15px;">鎵樼洏杈撻��</el-text> - <el-button @click="write('TwoPalletStart','2')">鍚姩</el-button> - <el-button @click="write('TwoPalletStop','2')">鍋滄</el-button> + <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-text style="margin-right: 15px;">鐮佽泛鏈哄櫒浜�1</el-text> - <el-button @click="write('TwoMaStart','2')">鍚姩</el-button> - <el-button @click="write('TwoMaStop','2')">鍋滄</el-button> + <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-text style="margin-right: 15px;">鐮佽泛鏈哄櫒浜�2</el-text> - <el-button @click="write('TwoMaTwoStart','2')">鍚姩</el-button> - <el-button @click="write('TwoMaTwoStop','2')">鍋滄</el-button> + <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-text style="margin-right: 15px;">浠剁杈撻��</el-text> - <el-button @click="write('TwoBoxStart','2')">鍚姩</el-button> - <el-button @click="write('TwoBoxStop','2')">鍋滄</el-button> + <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> @@ -97,7 +97,28 @@ 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