czt
2025-05-27 833d9320af935dd6e5033c0a91bcc91bb7bb5807
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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();
    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();
    let week = new Date().getDay();
    let weeks = ['日', '一', '二', '三', '四', '五', '六'];
    let getWeek = '星期' + weeks[week];
    /* that.datebox.date = year + ' ' + month + ' ' + date;
    that.datebox.time = hh + ':' + mm + ':' + ss;
    that.datebox.week = getWeek; */
    /*  $('.h-date .d').text(year + '-' + month + '-' + date);
     $('.date .time').text(hh + ':' + mm + ':' + ss);*/
    $('.date .d2').text(month + '月' + date + '日' + getWeek);
    $('.date .time2').text(hh + ':' + mm);
    $('.h-date').text(year + '-' + month + '-' + date + ' ' + hh + ':' + mm);
}
 
/**
 * 显示当前时间(年月日时分秒)
 */
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;
}