czt
2025-05-27 833d9320af935dd6e5033c0a91bcc91bb7bb5807
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,9 +36,35 @@
}
/**
 * 显示当前时间(年月日时分秒)
 */
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
 */
function toPage(tag) {
    if(tag == "security"){
        layer.msg("暂未对接!");
        return;
    }
    if(tag == "grain-check"){
        layer.msg("暂未对接!");
        return;
    }
    if(tag == "grain-handle"){
        layer.msg("暂未对接!");
        return;
    }
    window.location.href = "../dzhwk/" + tag;
}