whyclj
2018-12-19 252a0a6935c4e39d33745b2cdd84f1ba3c647fc5
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML123>
<html>
  <head>
      <!-- 默认使用最高内核 -->
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" >
    <base href="<%=basePath%>">
    <title><s:text name="User_Login">dsadgghh</s:text></title>
    <link href="css/basic.css" type="text/css" rel="stylesheet" />
    <link href="css/login_style.css" type="text/css" rel="stylesheet" />    
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="js/qrcode.js"></script>
    <link rel="stylesheet" type="text/css" href="css/btools.css">    
    </head>
  
  <body>
    <!--头部内容开始-->
    <div id="top">
        <div id="top_cont">
            <img src="image/tieta-logo.gif" alt="" title="福建福光有限公司" />
            <div class="international">
                <c:choose>
                    <c:when test="${sessionScope.WW_TRANS_I18N_LOCALE eq 'en_US'}">
                        <a href="javascript:;" value="CH">简体中文</a>
                        <span>|</span>
                        <a href="javascript:;" value="US"  class="inter_action">English</a>
                    </c:when>
                    <c:when test="${sessionScope.WW_TRANS_I18N_LOCALE != 'en_US'}">
                        <a href="javascript:;" value="CH" class="inter_action">简体中文</a>
                        <span>|</span>
                        <a href="javascript:;" value="US">English</a>
                    </c:when>
                </c:choose>
                
            </div>
        </div>
    </div>
    <div id="main">
        <div id="main_cont">
            <div id="main_top">
                <p><s:text name="User_Login"></s:text></p>
            </div>
            <form method="post" id="register">
                <p id="user_t"><s:text name="Username"></s:text>:</p>
                <i class="user-img"></i>
                <input id="user" name="user" placeholder="<s:text name='Enter_username'/>" type="text"  autofocus/> <br />
                <p id="password_t"><s:text name="Password"></s:text>:</p>
                <i class="psd-img"></i>
                <input id="password" name="password" placeholder="<s:text name='Enter_password'/>" type="password" /><br/> 
                <input id="check" name="check" type="checkbox" alt="" /><span style="color:#909090;"><s:text name="Remember_password"></s:text></span><br>
                <span id="msg"></span><br/> 
                <input id="sub" type="button" value="<s:text name="Enter"/>"/>
            </form>
        </div>
    </div>
    <div class="bottom-tools">
        <div class="qr-tool"></div>
        <div class="qr-img">
            <div class="qr-code"><a href="javascript:;"></a></div>
        </div>
    </div>
    <div class="audioContainer">
        <audio id="warnAudio" controls>
            <source src="" type="audio/ogg"></source>
            <source src="" type="audio/mpeg"></source>
            <source src="" type="audio/wav"></source>
        </audio>
    </div>
    <pre id="code"></pre>
</body>
<script type="text/javascript" src="js/base.js"></script>
<script type="text/javascript">
    var temp = {
        price:105.20
    };
    console.info(temp);
    
    
    var now = new Date();
    
    var test = new Date('2018-09-03 14:49:00');
    console.info((now.getTime()-test.getTime())/1000);
    
    
    var CMD_GETGPRSPARAM = 145;                    //发送命令给gprs
    var CMD_GETSTATIONSIGNAL = "CSQ";
    
    var CMD_GETDEVICETHREADINFO =    0x17;
 
    var temp = {
        num:CMD_GETDEVICETHREADINFO,
        dev_id:910000001
    };
    console.info(JSON.stringify(temp));
    SendDeviceThreadInfo(temp,function(data){
        console.info(data);
            
         searchDeviceThreadInfo({dev_id:910000001});
    });
    
    
    //给GPRS发送指定的命令,获取AT返回值
    function SendDeviceThreadInfo(param,callback){
        $.ajax({     
            type:"post",                                 
            url: "Bts_gprs_stateAction_action_update_bts_task_inf",                        
            async:true,                
            dataType:'json',
            data:'json='+JSON.stringify(param),        
            success: function(data){ 
                var model = eval('('+data.result+')');
                console.info(model);
                if(callback && typeof callback == 'function'){
                    callback(model);
                }
            },error:function(e){
                var model = {
                    code:0,
                    data:e,
                    msg:'通信失败'
                };
                if(callback && typeof callback == 'function'){
                    callback(model);
                }
            }                 
        });
    }
    
    //查询设备的进程信息
    function searchDeviceThreadInfo(param,callback){
        $.ajax({     
            type:"post",                                 
            url: "Bts_gprs_stateAction_action_serchByCondition",                        
            async:true,                
            dataType:'json',
            data:'json='+JSON.stringify(param),        
            success: function(data){ 
                var model = eval('('+data.result+')');
                console.info(model);
                $('#code').text(model.data[0].bts_task_inf);
                if(callback && typeof callback == 'function'){
                    callback(model);
                }
            },error:function(e){
                var model = {
                    code:0,
                    data:e,
                    msg:'通信失败'
                };
                if(callback && typeof callback == 'function'){
                    callback(model);
                }
            }                 
        });
    }
    
    
    //给GPRS发送指定的命令,获取AT返回值
    function searchStationSignal(param,callback){
        $.ajax({     
            type:"post",                                 
            url: "Bts_gprs_stateAction_action_update",                        
            async:true,                
            dataType:'json',
            data:'json='+JSON.stringify(param),        
            success: function(data){ 
                var model = eval('('+data.result+')');
                console.info(model);
                if(callback && typeof callback == 'function'){
                    callback(model);
                }
            },error:function(e){
                var model = {
                    code:0,
                    data:e,
                    msg:'通信失败'
                };
                if(callback && typeof callback == 'function'){
                    callback(model);
                }
            }                 
        });
    }
    
    
    //用户要设置的配置项
    var temp = {
        echarts1_enable:0,
        echarts2_enable:0,
        echarts3_enable:0,
        echarts4_enable:0,
        echarts5_enable:0,
        echarts6_enable:0,
        echarts7_enable:0,
        echarts8_enable:0,
        echarts9_enable:0,
        echarts10_enable:0
    };
    
    //updateUserBieState(temp);
    //查询当前用户设置饼状图的使能状态
    function updateUserBieState(temp){
        $.ajax({     
            type:"post",                                 
            url: "Echarts_usrAction!add",                        
            async:true,                
            dataType:'json',
            data:'json='+JSON.stringify(temp),        
            success: function(data){ 
                var model = eval('('+data.result+')');
                console.info(model);
            }                 
        });
    }    
    
    
    
    function setWarnAudio(filename) {
        var src = '../mediafiles/'+filename;
        $('#warnAudio source').prop('src', src);
        $('#warnAudio').get(0).load();
        $('#warnAudio').get(0).play();
    }
</script>
</html>