From 6f9b2db708dce217fc81e642ac7e6c6094925c13 Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期四, 22 五月 2025 17:14:06 +0800 Subject: [PATCH] 电子货位卡-增加系统运维页面,设置定时锁屏及跳转 --- igds-dzhwk-web/src/main/resources/static/dzhwk/common.js | 31 ++++++++++++++++++++++++++++++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/igds-dzhwk-web/src/main/resources/static/dzhwk/common.js b/igds-dzhwk-web/src/main/resources/static/dzhwk/common.js index 08ffb13..e89a984 100644 --- a/igds-dzhwk-web/src/main/resources/static/dzhwk/common.js +++ b/igds-dzhwk-web/src/main/resources/static/dzhwk/common.js @@ -1,4 +1,19 @@ -//鏄剧ず褰撳墠鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 +var timeout; +/** + * 娌℃湁鎿嶄綔鍒欒烦杞攣灞� + */ +function resetTimeout() { + clearTimeout(timeout); + timeout = setTimeout(function() { + console.log('鐢ㄦ埛娌℃湁鎿嶄綔'); + // 濡傛灉娌℃湁鎿嶄綔瓒呰繃1鍒嗛挓锛岃烦杞埌閿佸睆椤甸潰 + window.location.href = "../dzhwk/lock?flag=" + flag; + }, 1000*60); // 1鍒嗛挓 +} + +/** + * 鏄剧ず褰撳墠鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 + */ function timeFormate() { let that = this let year = new Date().getFullYear(); @@ -21,6 +36,20 @@ } /** + * 鏄剧ず褰撳墠鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 + */ +function getNowTime() { + let that = this + let year = new Date().getFullYear(); + let month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1; + let date = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate(); + let hh = new Date().getHours() < 10 ? '0' + new Date().getHours() : new Date().getHours(); + let mm = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes(); + let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds(); + return year + '-' + month + '-' + date + ' ' + hh + ':' + mm + ":" + ss; +} + +/** * 鍔熻兘椤甸潰璺宠浆 * @param tag */ -- Gitblit v1.9.3