liuxiaolong
2019-11-02 046305f178960ad0024f111e7f042e54befc66c7
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!DOCTYPE html>
<html>
<head>
    <script src="/static/js/easyui/jquery.min.js" type="text/javascript"></script>
    <script src="/static/js/easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <link href="/static/js/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="/static/js/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="/static/js/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
    <title>修改</title>
</head>
<style type="text/css">
    .button {
        width: 140px;
        line-height: 38px;
        text-align: center;
        font-weight: bold;
        color: #fff;
        text-shadow: 1px 1px 1px #333;
        border-radius: 5px;
        margin: 0 20px 20px 0;
        position: relative;
        overflow: hidden;
    }
 
    .button.blue {
        border: 1px solid #1e7db9;
        box-shadow: 0 1px 2px #8fcaee inset, 0 -1px 0 #497897 inset, 0 -2px 3px #8fcaee inset;
        background: -webkit-linear-gradient(top, #42a4e0, #2e88c0);
        background: -moz-linear-gradient(top, #42a4e0, #2e88c0);
        background: linear-gradient(top, #42a4e0, #2e88c0);
    }
</style>
<body style="margin:0" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" oncopy=document.selection.empty() onselect=document.selection.empty()>
 
<hr style="margin:0px;height:1px;border:0px;background-color:black;color:#D5D5D5;"/>
 
<div style="position: absolute;left: 10px;top: 680px; width: 95%">
    <div style="background-color:#1e7db9;position: absolute;left: 10px;top: -100px; width: 99%;text-align: center"><a href="index.html"><h1 >返回</h1></a></div>
    <hr style="margin:0px;height:1px;border:0px;background-color:black;color:#D5D5D5;"/>
    <div style="width:800px;float:left;height:200px;">
        <br>人数配置:</br>
        <br><input type="checkbox" name="checkbox1" id="checkbox1">初始值配置&nbsp;&nbsp;&nbsp; 初始时间:<input id="initialTime"
                                                                                                       class="easyui-timespinner"
                                                                                                       style="width:150px;height: 120px">&nbsp;&nbsp;初始值:<input
            id="initialPeople" value="" class="easyui-numberspinner" style="width:150px;height: 120px ;"
            data-options="min:-9999,max:9999,editable:false">人
        <br><input type="checkbox" name="checkbox2" id="checkbox2">校正值配置 &nbsp;&nbsp;&nbsp;校正值:<input
            id="correctionPeople" value="" class="easyui-numberspinner" style="width:150px;height: 120px"
            data-options="min:-9999,max:9999,editable:false">人
        <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" class="button blue" onclick="saveInfo()">保存
    </button>
    </div>
 
    <div style="width:600px;float:left;height:200px;">
        <br>
        <br>统计图设置:
        <br>
        <br>
        <br>统计图起始时间&nbsp;&nbsp;&nbsp;<input id="countStartTime" class="easyui-timespinner"
                                            style="width:150px;height: 120px">
        <br>
        <div style="height: 30px"></div>
        <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" class="button blue" onclick="saveStart()">保存
    </button>
 
    </div>
 
    <!--<div style="border:1px solid ;float:left;height:200px;"></div>&lt;!&ndash;这个div模拟垂直分割线&ndash;&gt;-->
    <div style="width:400px;float:left;height:200px;">
        <br>数据清零:
        <br>
        <br><span style="background-color: red"> 数据将被清零请谨慎操作!</span>
        <br>
        <br><br><br><br><br><br><br>
 
 
        <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" class="button blue" onclick="reset1()">清零</button>
    </div>
</div>
<!--<br>密码修改</br>-->
<!--<br>&nbsp;&nbsp;&nbsp;旧密码:<input type="password" id="old">-->
<!--<br>&nbsp;&nbsp;&nbsp;新密码:<input type="password" id="new">-->
<!--<br>确认密码:<input type="password" id="renew">-->
<!--<br>-->
<!--<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" class="button blue"onclick="savePw()">保存</button>-->
</body>
<script type="text/javascript">
    var datavalue = {};
    $.get("/api-count/getConfig/",
        function (data) {
            $('#initialTime').timespinner('setValue', data.initialTime);
            document.getElementById("checkbox1").checked = ('1' == data.init);
            document.getElementById("checkbox2").checked = ('1' == data.cor);
            datavalue.initialTime = data.initialTime;
            $('#initialPeople').numberspinner('setValue', data.initialPeople);
            datavalue.initialPeople = data.initialPeople;
            $('#correctionPeople').numberspinner('setValue', data.correctionPeople);
            datavalue.correctionPeople = data.correctionPeople;
            $('#countStartTime').timespinner('setValue', data.countStartTime);
        });
 
    function reset1() {
        $.get("/api-count/reset/", function (data) {
            $.messager.alert(' ', '<font size="4" color="#666666"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;清除成功!</strong></font>', 'infoSunnyIcon', function () {
                //alert('点击确定按钮才关闭');//
            });
            setTimeout(function () {
                $(".messager-body").window('close');
            }, 1500);
        });
    }
 
    function saveStart() {
        var configStartTime = {};
        configStartTime.configStartTime = $('#countStartTime').timespinner('getValue');
        $.post("/api-count/configStartTime/", configStartTime,
            function (data) {
                if (data.msg == true) {
                    $.messager.alert(' ', '<font size="4" color="#666666"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;保存成功!</strong></font>', 'infoSunnyIcon', function () {
                        //alert('点击确定按钮才关闭');//
                    });
                    setTimeout(function () {
                        location.reload();
                    }, 1500);
                }
 
            }, "json");
    }
 
    // function savePw() {
    //     var old =document.getElementById("old").value;
    //     var ne = document.getElementById("new").value;
    //     var renew = document.getElementById("renew").value;
    //     if( ne !=renew){
    //         $.messager.alert(' ','<font size=\"2\" color=\"#666666\"><strong>两次密码输入不一致!请重新输入。</strong></font>','infoSunnyIcon',function(){
    //             //alert('点击确定按钮才关闭');//
    //         });
    //         setTimeout(function(){
    //             $(".messager-body").window('close');
    //         },1000);
    //         document.getElementById("new").value="";
    //         document.getElementById("renew").value="";
    //         return;
    //     }
    //
    //     var pw={};
    //     pw.old = old;
    //     pw.password=ne;
    //     $.get("/api-count/configPassword/",pw,
    //         function(data){
    //             console.log(data);
    //             if(data.msg==true){
    //                 $.messager.alert(' ','<font size=\"2\" color=\"#666666\"><strong>修改成功!</strong></font>','infoSunnyIcon',function(){
    //                     //alert('点击确定按钮才关闭');//
    //                 });
    //                 setTimeout(function(){
    //                     $(".messager-body").window('close');
    //                 },2000);
    //                 document.getElementById("new").value="";
    //                 document.getElementById("renew").value="";
    //                 document.getElementById("old").value="";
    //             }else {
    //                 alert("原密码错误!");
    //                 $.messager.alert(' ','<font size=\"2\" color=\"#666666\"><strong>保存成功!</strong></font>','infoSunnyIcon',function(){
    //                     //alert('点击确定按钮才关闭');//
    //                 });
    //                 setTimeout(function(){
    //                     $(".messager-body").window('close');
    //                 },2000);
    //                 document.getElementById("old").value="";
    //             }
    //
    //
    //         },"json");
    // }
    function saveInfo() {
        if ($("#checkbox1").get(0).checked) {
            datavalue.init = 1;
            datavalue.initialTime = $('#initialTime').timespinner('getValue');//document.getElementById("initialTime").value;
            datavalue.initialPeople = $('#initialPeople').numberspinner('getValue');  //document.getElementById("initialPeople").value;
        } else {
            datavalue.init = 0;
        }
        if ($("#checkbox2").get(0).checked) {
            datavalue.cor = 1;
            datavalue.correctionPeople = $('#correctionPeople').numberspinner('getValue');//document.getElementById("correctionPeople").value;
        } else {
            datavalue.cor = 0;
        }
 
        $.post("/api-count/configInfo/", datavalue,
            function (data) {
                if (data.msg == true) {
                    $.messager.alert(' ', '<font size="4" color="#666666"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;保存成功!</strong></font>', 'infoSunnyIcon', function () {
                        //alert('点击确定按钮才关闭');//
                    });
                    setTimeout(function () {
                        location.reload();
                    }, 1500);
                }
            }, "json");
    }
</script>
</html>