| | |
| | | <script> |
| | | import LanguageMixin from '../../lang/LanguageMixin' |
| | | import data from '../../configuration/ServoManualone' |
| | | import { throttle } from 'lodash'; |
| | | |
| | | let socket; |
| | | export default { |
| | |
| | | } |
| | | |
| | | 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) { |
| | | |
| | | //启动按钮 |
| | | |
| | |
| | | |
| | | |
| | | } |
| | | }, 50); |
| | | |
| | | document.addEventListener('mouseover', handleMouseMove); |
| | | } |
| | | |
| | | } |
| | | // console.log(jsonData2); |
| | | setInterval(() => handleMouseMove(event), 1000); // 每隔 1000ms 检测一次鼠标位置 |
| | | |
| | | document.addEventListener('mousemove', event => handleMouseMove(event)); |
| | | |
| | | if (obj.qidong){ |
| | | |