From 46f29e79b43be98199d0727a71d85dddaa6e1fd4 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期五, 15 十二月 2023 10:00:23 +0800
Subject: [PATCH] 增加A01 A02行走伺服回零  输入密码才能点击

---
 CanadaMes-ui/src/views/Electrical/ServoManualone.vue |   31 ++++++++++++++++++++++++-------
 1 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/CanadaMes-ui/src/views/Electrical/ServoManualone.vue b/CanadaMes-ui/src/views/Electrical/ServoManualone.vue
index dbceb33..db99576 100644
--- a/CanadaMes-ui/src/views/Electrical/ServoManualone.vue
+++ b/CanadaMes-ui/src/views/Electrical/ServoManualone.vue
@@ -85,7 +85,6 @@
 <script>
 import LanguageMixin from '../../lang/LanguageMixin'
 import data from '../../configuration/ServoManualone'
-import { throttle } from 'lodash';
 
 let socket;
   export default {
@@ -432,14 +431,28 @@
   }
 
   let obj = JSON.parse(msg.data);
+
+
+
+
 // console.log(obj)
 const weihuiling=obj.weihuiling;
   const jsonData2 = this.jsonData;
+  const handleMouseMove = (event) => {
+    if (!event || !event.target) {
+      return; // 濡傛灉 event 鎴� event.target 涓嶅瓨鍦紝鍒欑洿鎺ヨ繑鍥烇紝涓嶆墽琛屽悗缁�昏緫
+    }
 
-  const handleMouseMove = throttle(function(event) {
-  const inputBox = document.querySelectorAll('.el-card__body');
-  const target = event.target;
-  if (obj.zuhe1 && inputBox && Array.from(inputBox).every(box => !box.contains(target))) {
+    const inputBox = document.querySelectorAll('.input-box');
+    const target = event.target;
+    // console.log(obj);
+   
+    const isMouseInInput = Array.from(inputBox).some(box => box.contains(target));
+ 
+
+    if (!isMouseInInput) {
+
+  if (obj.zuhe1) {
     
     //鍚姩鎸夐挳
  
@@ -479,10 +492,14 @@
 
 
   }
-}, 50);
 
-  document.addEventListener('mouseover', handleMouseMove);
+}
+        
+      }
+            // console.log(jsonData2);
+            setInterval(() => handleMouseMove(event), 1000); // 姣忛殧 1000ms 妫�娴嬩竴娆¢紶鏍囦綅缃�
 
+document.addEventListener('mousemove', event => handleMouseMove(event));
 
   if (obj.qidong){
 

--
Gitblit v1.8.0