From 34f95abfee9c268c1c53006b7974236182f9276f Mon Sep 17 00:00:00 2001 From: chuguofei <1633295391@qq.com> Date: Thu, 29 Jun 2023 18:59:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=9B=91=E6=8E=A7=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=8A=82=E6=B5=81=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/oss/iot/common/variable_js.jsp | 16 ++++++++++++++++ src/main/webapp/WEB-INF/oss/iot/monitor.jsp | 13 +++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/WEB-INF/oss/iot/common/variable_js.jsp b/src/main/webapp/WEB-INF/oss/iot/common/variable_js.jsp index bc19438..7da1fca 100644 --- a/src/main/webapp/WEB-INF/oss/iot/common/variable_js.jsp +++ b/src/main/webapp/WEB-INF/oss/iot/common/variable_js.jsp @@ -48,6 +48,22 @@ }, delay) } } + + function throttle(fn, delay) { + let _this, args; + let previous = 0; + return function () { + let now = +new Date(); + _this = this; + args = arguments; + if (now - previous > delay) { + fn.apply(_this, args); + previous = now; + } + } + } + +