| | |
| | | <script> |
| | | import LanguageMixin from '../../lang/LanguageMixin' |
| | | import data from '../../configuration/AutomaticParameterSetting' |
| | | import { throttle } from 'lodash'; |
| | | |
| | | let socket; |
| | | |
| | | export default { |
| | |
| | | |
| | | let obj = JSON.parse(msg.data); |
| | | const jsonData2 = this.jsonData; |
| | | // console.log(obj); |
| | | const handleMouseMove = throttle(function (event) { |
| | | |
| | | const handleMouseMove = (event) => { |
| | | if (!event || !event.target) { |
| | | return; // 如果 event 或 event.target 不存在,则直接返回,不执行后续逻辑 |
| | | } |
| | | |
| | | const inputBox = document.querySelectorAll('.input-box'); |
| | | const target = event.target; |
| | | if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | const isMouseInInput = Array.from(inputBox).some(box => box.contains(target)); |
| | | |
| | | if (!isMouseInInput) { |
| | | const parms = obj.params; |
| | | const fanzhuan = obj.fanzhuan; |
| | | const xiaoche = obj.xiaoche; |
| | |
| | | const parms2 = obj.params2; |
| | | const fanzhuan2 = obj.fanzhuan2; |
| | | const xiaoche2 = obj.xiaoche2; |
| | | |
| | | // console.log('parms:', parms); |
| | | // console.log('fanzhuan:', fanzhuan); |
| | | // console.log('xiaoche:', xiaoche); |
| | | // console.log('dache:', dache); |
| | | |
| | | let index = 0; |
| | | for (let i = 0; i < jsonData2.length - 1; i++) { |
| | |
| | | jsonData2[2][0]['value'] = dache[0][0]; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | let index2 = 0; |
| | | for (let i =5; i < jsonData2.length; i++) { |
| | | let arr = jsonData2[i]; |
| | |
| | | if (Array.isArray(xiaoche2) && Array.isArray(xiaoche2[0]) && xiaoche2[0][0] !== undefined) { |
| | | jsonData2[9][0]['value'] = xiaoche2[0][0]; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, 50); |
| | | |
| | | document.addEventListener('mouseover', handleMouseMove); |
| | | }; |
| | | |
| | | setInterval(() => handleMouseMove(event), 1000); // 每隔 1000ms 检测一次鼠标位置 |
| | | |
| | | document.addEventListener('mousemove', event => handleMouseMove(event)); |
| | | }; |
| | | |
| | | |
| | | |
| | |
| | | }); |
| | | |
| | | |
| | | console.log(this.jsonData) |
| | | //console.log(this.jsonData) |
| | | |
| | | } |
| | | |