赣州市洪水风险预警系统二维版本
xiebin
2023-03-02 b39483c96ae572121d3c619c0b9d37634e682cc4
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/**
 * Created by Incredible on 2017-09-12 0012.
 */
 
 
$(function () {
    var button = $(".button");
    var buttonUrl = "../api/system/selectSitePage";
    var startIndex = 0;
    $.ajax({
        url:buttonUrl,
        type:'post',
        data:{
            startIndex:startIndex,
            pageSize:12,
        },
        dataType:'json',
        success:function(data){
            var str = "";
            for(var i = 0;i<data.length;i++){
                str+=' <div class="cont_toogle  col-md-2" id='+data[i].siteCode+'>';
                str+=data[i].siteName;
                str+='</div>';
            }
            button.html(str);
            button.find("div:first").addClass("active_");
            var toggle =$('.cont .cont_toogle');
            toggle.click(function () {
                toggle.removeClass("active_");
                $(this).addClass("active_");
              
            });
        }
    });
    var cont_icon = $(".cont_icon");
    cont_icon.click(function(){
        if($(this).attr("data-icon")=="right"){
                ++startIndex;
             $.ajax({
                    url:buttonUrl,
                    type:'post',
                    data:{
                        startIndex:startIndex,
                        pageSize:12,
                    },
                    dataType:'json',
                    success:function(data){
                        var str = "";
                        for(var i = 0;i<data.length;i++){
                            str+=' <div class="cont_toogle  col-md-2" id='+data[i].siteCode+'>';
                            str+=data[i].siteName;
                            str+='</div>';
                        }
                        button.html(str);
                        button.find("div:first").addClass("active_");
                        var toggle =$('.cont .cont_toogle');
                        toggle.click(function () {
                            toggle.removeClass("active_");
                            $(this).addClass("active_");
                          
                        });
                    }
                });
        }else{
            --startIndex;
             $.ajax({
                 url:buttonUrl,
                 type:'post',
                 data:{
                     startIndex:startIndex,
                     pageSize:12,
                 },
                 dataType:'json',
                 success:function(data){
                     var str = "";
                     for(var i = 0;i<data.length;i++){
                         str+=' <div class="cont_toogle  col-md-2" id='+data[i].siteCode+'>';
                         str+=data[i].siteName;
                         str+='</div>';
                     }
                     button.html(str);
                     button.find("div:first").addClass("active_");
                     var toggle =$('.cont .cont_toogle');
                     toggle.click(function () {
                         toggle.removeClass("active_");
                         $(this).addClass("active_");
                       
                     });
                 }
             });
        }
   
        
    });
   
/*    <div class="cont_toogle active_ col-md-2" id="62302661">
    车溪
</div>*/
 
 
 
    //
    // var iframes = document.getElementsByTagName('iframe');
    //
    // for (var i = 0, j = iframes.length; i < j; ++i) {
    //     // 放在闭包中,防止iframe触发load事件的时候下标不匹配
    //     (function(_i) {
    //         iframes[_i].onload = function() {
    //             this.style.visibility = 'hidden';
    //             // this.style.display = 'none';
    //
    //             // 提前还原高度
    //             this.setAttribute('height', 'auto'); // 或设为''
    //
    //             // 再在下一轮事件循环中设置新高度
    //             setTimeout(function() {
    //                 iframes[_i].setAttribute('height', iframes[_i].contentWindow.document.body.scrollHeight);
    //
    //                 iframes[_i].style.visibility = 'visible';
    //                 // iframes[_i].style.display = 'block';
    //             }, 0);
    //         }
    //     })(i);
    // }
})/**
 *实时显示系统时间
 */
function getLangDate(){
    var dateObj = new Date(); //表示当前系统时间的Date对象
    var year = dateObj.getFullYear(); //当前系统时间的完整年份值
    var month = dateObj.getMonth()+1; //当前系统时间的月份值
    var date = dateObj.getDate(); //当前系统时间的月份中的日
    var day = dateObj.getDay(); //当前系统时间中的星期值
    var weeks = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
    var week = weeks[day]; //根据星期值,从数组中获取对应的星期字符串
    var hour = dateObj.getHours(); //当前系统时间的小时值
    var minute = dateObj.getMinutes(); //当前系统时间的分钟值
    var second = dateObj.getSeconds(); //当前系统时间的秒钟值
//如果月、日、小时、分、秒的值小于10,在前面补0
    if(month<10){
        month = "0"+month;
    }
    if(date<10){
        date = "0"+date;
    }
    if(hour<10){
        hour = "0"+hour;
    }
    if(minute<10){
        minute = "0"+minute;
    }
    if(second<10){
        second = "0"+second;
    }
    var newDate = year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
    document.getElementById("dateStr").innerHTML = " "+newDate+" ";
    setTimeout("getLangDate()",1000);//每隔1秒重新调用一次该函数
}