nowLocation.jsp 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  6. <title>当前定位</title>
  7. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  8. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  9. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  10. <link href="${pageContext.request.contextPath}/main.css"
  11. rel="stylesheet" type="text/css" />
  12. <script type="text/javascript" src="/shares/js/constant.js"></script>
  13. <script type="text/javascript" src="/shares/js/common.js"></script>
  14. <script type="text/javascript">
  15. $(function() {
  16. $("#end_time").ligerDateEditor({labelAlign : 'left',width : 100,height : 21});
  17. $("#start_time").ligerDateEditor({labelAlign : 'left',width : 100,height : 21});
  18. });
  19. $(function() {
  20. loadNowLocationList();
  21. });
  22. var grid = null;
  23. function loadNowLocationList(params1,params2) {
  24. grid = $("#nowLocation")
  25. .ligerGrid({columns : [
  26. {display : '操作',isAllowHide : false,width : 100,
  27. render : function(row) {
  28. var html = '<a href=\"#\" style=\"color: blue;\" onclick=\"viewDriver('
  29. + row.universalid
  30. + ')\">单点登录到GPS</a>&nbsp;';
  31. return html;
  32. }
  33. },
  34. {display : '车牌号',name : 'vehicleNO',width : 80},
  35. {display : '所属车队',name : 'nameCar',width : 90},
  36. {display : '车辆颜色',name : 'nameColor',width : 60},
  37. //{display : '状态',name : 'status',width :50},
  38. {display : '所在位置',
  39. name : 'latitude',
  40. width : 350,
  41. render : function(row){
  42. if(null !=row.latitude){
  43. var place = "";
  44. $.ajax({
  45. url:'carStateAction.do?task=toPlace',
  46. async: false,
  47. type: 'post',
  48. data: {"latitude":row.latitude,"longitude":row.longitude},
  49. cache: false,
  50. error: function(obj){
  51. },
  52. success: function(obj){
  53. if(obj!=""){
  54. place = obj;
  55. }
  56. }
  57. });
  58. return place;
  59. }
  60. }},
  61. {display : '纬度',name : 'latitude',width : 70},
  62. {display : '经度',name : 'longitude',width : 70},
  63. {display : '时速',name : 'speed',width : 60},
  64. {display : '方向',name : 'direction',width : 60,
  65. render :function(a,b){
  66. var s = parseInt(a["direction"]);
  67. if(s>=337.5 && s<=360){
  68. return '正北';
  69. }else if(s>=0 && s<=22.5){
  70. return '正北';
  71. }else if(s>22.5 && s<67.5){
  72. return '东北';
  73. }else if(s>=67.5 && s<=112.5){
  74. return '正东';
  75. }else if(s>112.5 && s<=157.55){
  76. return '东南';
  77. }else if(s>=157.55 && s<=202.5){
  78. return '正南';
  79. }else if(s>202.5 && s<247.5){
  80. return '西南';
  81. }else if(s>=247.5 && s<=292.5){
  82. return '正西';
  83. }else if(s>292.5 && s<337.5){
  84. return '西北';
  85. } }},
  86. {display : '海拔',name : 'elevation',width : 70},
  87. {display : '总里程',name : 'mileage',width : 70},
  88. {display : '卫星时间',name : 'GPSTime',width : 150},
  89. {display : '记录仪时速',name : 'recorderSpeed',width : 60},
  90. {display : '油耗',name : 'fuelAmount',width : 60}],
  91. pageSizeOptions: [5,10, 20, 30, 40, 50, 100],
  92. url : 'carStateAction.do?task=toNowLocationList&time='
  93. + new Date().getTime() + params1 +params2,
  94. pageParmName : 'p', //页索引参数名,(提交给服务器)
  95. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  96. width : '99.8%',
  97. height : '99%',
  98. rownumbers: true});
  99. $("#pageloading").hide();
  100. }
  101. function searchByKword() {
  102. grid.set("newPage","1");
  103. var plate_number= document.getElementById("plate_number");//驾驶员姓名
  104. var s1 = "";
  105. if (plate_number.value != "" && typeof (plate_number.value) != "undefined") {
  106. s1 += "&plate_number=" + encodeURI(encodeURI(plate_number.value));
  107. }
  108. var motorcade= document.getElementById("motorcade");//开始时间
  109. var s2 = "";
  110. if (motorcade.value != "" && typeof (motorcade.value) != "undefined") {
  111. s2 += "&motorcade=" + encodeURI(encodeURI(motorcade.value));
  112. }
  113. $(function() {
  114. loadNowLocationList(s1,s2);
  115. });
  116. }
  117. function viewDriver() {
  118. //window.parent.f_addTab('addDevice', '新增驾驶员',
  119. // 'carDriverAction.do?task=addDriver&tabid=' + getCurrentTabId());
  120. }
  121. $(document).ready(function() {
  122. $("[name='plate_number']").focus();
  123. });
  124. </script>
  125. </head>
  126. <body>
  127. <%@ include file="/include/message.jsp"%>
  128. <form action="carDeclarationAction.do" method="post">
  129. <input type="hidden" id="tabid" name="tabid" value="getCurrentTabId()">
  130. <input type="hidden" id="user_id" name="user_id" value="">
  131. <input type="hidden" id="task" name="task" value="exportExcel">
  132. <div class="container">
  133. <!--
  134. <div id="title" class="form-button">
  135. <input type="button" class="l-button" value="新增驾驶员" onclick="addDriver()">
  136. <input type="button" value="关闭" class="l-button" onclick="closeWindow();" />
  137. </div>
  138. <div class="default_search" style="margin: 0; height:30px;">
  139. </div>
  140. -->
  141. <div class="default_search" style="margin: 0;">
  142. <ul class="list_search">
  143. <li class="title">车牌号:</li>
  144. <li class="text"><input type="text" name="plate_number" id="plate_number">
  145. </li>
  146. </ul>
  147. <ul class="list_search">
  148. <li class="title">车队:</li>
  149. <li class="text">
  150. <select name="motorcade" id="motorcade" style="width: 100px;">
  151. <option value="">-选择-</option>
  152. <c:forEach items="${motorcades}" var="inforpubdict">
  153. <option value="${inforpubdict.universalid}" >${inforpubdict.motorcade_name}</option>
  154. </c:forEach>
  155. </select>
  156. </li>
  157. </ul>
  158. <ul>
  159. <li class="search-button"><input type="button" class='l-button'
  160. name="search" onclick="searchByKword()" value="查询" /></li>
  161. </ul>
  162. </div>
  163. <div style="clear:both;"></div>
  164. <div style="overflow: hidden; clear: both;">
  165. <div id="nowLocation" style="margin: 0; padding: 0"></div>
  166. </div>
  167. </div>
  168. </form>
  169. </body>
  170. </html>