3.7
fxl
2023-03-07 52cffc4ab8e9787a6f233295502c7c9788dddae1
src/main/webapp/hxzk/GPS/historicalgpsLocation.jsp
@@ -36,6 +36,33 @@
            <link href="https://fonts.googleapis.com/css?family=Quicksand:400,500,600,700&display=swap"
               rel="stylesheet">
            <style>
               body {
                  margin: 0px;
                  width: 100%;
                  min-width: 1500px;
                  max-width: 100%;
                  height: 100%;
                  background-color: #F0F0F0;
               }
               #head {
                  background-color: #FFFF00;
                  width: 100%;
                  height: 100px;
               }
               #center {
                  background-color: #00FFFF;
                  width: 100%;
                  min-height: 100%;
               }
               #foot {
                  background-color: #FF00FF;
                  width: 100%;
                  height: 100px;
               }
               .panel-head {
                  font-size: 1rem;
                  color: rgba(255, 255, 255, .7);
@@ -77,10 +104,13 @@
            </div>
            <!--  END LOADER -->
            <div class="border-left"
               style="opacity:0.4;float:left;position:absolute;z-index:1;left:120px;height:20px;"><img alt=""
                  src="/hxzkoa/resources/images/border.png" class="img-left"></div>
            <div class="border-right" style="opacity:0.4;float:right;position:absolute;z-index:2;right:120px;"><img
                  alt="" src="/hxzkoa/resources/images/border2.png" class="img-right"></div>
               style="opacity: 0.4; float: left; position: absolute; z-index: 1; left: 120px; height: 20px;">
               <img alt="" src="/hxzkoa/resources/images/border.png" class="img-left">
            </div>
            <div class="border-right"
               style="opacity: 0.4; float: right; position: absolute; z-index: 2; right: 120px;">
               <img alt="" src="/hxzkoa/resources/images/border2.png" class="img-right">
            </div>
            <!--  BEGIN NAVBAR  -->
            <div class="login-page"></div>
            <!--  END NAVBAR  -->
@@ -98,10 +128,10 @@
                        <div class="col-xl-12 col-lg-12 col-sm-12  layout-spacing">
                           <div class="widget-content widget-content-area br-6">
                              <div class="table-responsive mb-4 mt-4">
                                 <table id="html5-extension" class="table table-hover" style="width:100%">
                                 <table id="html5-extension" class="table table-hover" style="width: 100%">
                                    <div>
                                       <div class="search-input-group-style input-group mb-3"
                                          style="width:11%;float:left;margin-left:15px;margin-right:15px;">
                                          style="width: 11%; float: left; margin-left: 15px; margin-right: 15px;">
                                          <div class="input-group-prepend">
                                             <span class="input-group-text search" id="basic-addon1"><svg
                                                   xmlns="http://www.w3.org/2000/svg" width="24"
@@ -114,50 +144,50 @@
                                                </svg></span>
                                          </div>
                                          <input type="text" id="search_input" class="form-control"
                                             placeholder="请输入标签ID" aria-label="Username"
                                             placeholder="请输入设备编号" aria-label="Username"
                                             aria-describedby="basic-addon1">
                                       </div>
                                       <button style="float:left;margin-left:10px;" type="button"
                                       <button style="float: left; margin-left: 10px;" type="button"
                                          class="btn btn-secondary reset">刷新</button>
                                       <button style="float:left;margin-left:10px;" type="button"
                                       <button style="float: left; margin-left: 10px;" type="button"
                                          class="btn btn-secondary delete" id="deleteButton">删除</button>
                                       <button style="float:left;margin-left:10px;" type="button"
                                       <button style="float: left; margin-left: 10px;" type="button"
                                          class="btn btn-secondary deleteAll"
                                          id="deleteAllButton">全部删除</button>
                                       <div style="width:80px;float:left;margin-left:10px;">
                                       <div style="width: 100px; float: left; margin-left: 10px;">
                                          <input type="text" id="begin"
                                             class="form-control form-control-sm" style="font-size:12px;"
                                             placeholder="开始时间" />
                                             class="form-control form-control-sm"
                                             style="font-size: 12px;" placeholder="开始时间" />
                                       </div>
                                       <div style="width:80px;float:left;margin-left:10px;">
                                       <div style="width: 100px; float: left; margin-left: 10px;">
                                          <input type="text" id="end" class="form-control form-control-sm"
                                             style="font-size:12px;" placeholder="结束时间" />
                                             style="font-size: 12px;" placeholder="结束时间" />
                                       </div>
                                       <div style="width:60px;float:left;margin-left:10px;">
                                       <div style="width: 70px; float: left; margin-left: 10px;">
                                          <input type="text" id="tagida"
                                             class="form-control form-control-sm" style="font-size:12px;"
                                             placeholder="标签id" />
                                             class="form-control form-control-sm"
                                             style="font-size: 12px;" placeholder="姓名" />
                                       </div>
                                       <button style="float:left;margin-left:10px;" type="button"
                                       <button style="float: left; margin-left: 10px;" type="button"
                                          class="btn btn-secondary toAllExcel">导出Excel</button>
                                       <button style="float:left;margin-left:10px;" type="button"
                                       <button style="float: left; margin-left: 10px;" type="button"
                                          class="btn btn-secondary toAlltxt">导出txt</button>
                                       <label for="perPage"
                                          class="col-sm-2 col-form-label col-form-label-sm"
                                          style="float:left;margin-left:10px;width:auto;">每页行数:</label>
                                          style="float: left; margin-left: 10px; width: auto;">每页行数:</label>
                                       <div style="width:200px;float:left;margin-left:10px;">
                                       <div style="width: 100px; float: left; margin-left: 10px;">
                                          <input type="text" class="form-control form-control-sm"
                                             id="perPage" placeholder="${perPage}"
                                             style="font-size:14px;" onBlur="modifyPerPage()">
                                             style="font-size: 14px;" onBlur="modifyPerPage()">
                                       </div>
                                       <label for="dateList"
                                          class="col-sm-2 col-form-label col-form-label-sm"
                                          style="float:left;margin-left:10px;width:auto;">日期:</label>
                                          style="float: left; margin-left: 10px; width: auto;">日期:</label>
                                       <div style="width:200px;float:left;margin-left:10px;">
                                       <div style="width: 150px; float: left; margin-left: 10px;">
                                          <select class="form-control form-control-lg" id="dateList"
                                             onchange="page('')">
                                             <c:forEach items="${dateList}" var="list">
@@ -173,6 +203,11 @@
                                          <th>UTC时间</th>
                                          <th>纬度</th>
                                          <th>经度</th>
                                          <th>状态</th>
                                          <th>精度因子</th>
                                          <th>卫星颗数</th>
                                          <th>差分时间</th>
                                          <th>海拔高度</th>
                                          <th>设备id</th>
                                          <th>设备电量</th>
                                          <th>添加时间</th>
@@ -185,12 +220,17 @@
                                                   type="checkbox" class="custom-control-input"
                                                   id="${list.id}" name="selectIds"><label
                                                   class="custom-control-label" for="${list.id}"
                                                   style="position:raletive;left:20px;bottom:5px;"></label>
                                                   style="position: raletive; left: 20px; bottom: 5px;"></label>
                                             </td>
                                             <td>${list.id}</td>
                                             <td>${list.gps_utc_time}</td>
                                             <td>${list.gps_weidu}</td>
                                             <td>${list.gsp_jingdu}</td>
                                             <td>${list.gps_state}</td>
                                             <td>${list.gps_hdop}</td>
                                             <td>${list.gps_num}</td>
                                             <td>${list.gps_chafen_time}</td>
                                             <td>${list.gps_haiba_gao}</td>
                                             <td>${list.tagid}</td>
                                             <td>${list.gps_power}</td>
                                             <td>${list.addtime}</td>
@@ -217,131 +257,282 @@
               </div>
               <!--  END CONTENT PART  -->
            </div>
            <%
            String username=(String)session.getAttribute("username");
            if(username==null || username.equals("")){
            request.getRequestDispatcher("/hxzk/login.jsp").forward(request,response);
            return;
            }
            %>
            <!-- END MAIN CONTAINER -->
            <script>
               //执行一个laydate实例
               laydate.render({
                  elem: '#begin' //指定元素'
                  , type: 'datetime'
                  , done: function (value, date) {
                     var end = document.getElementById("end").value;
                     if (end) {
                        if (end <= value) {
                           alert("结束时间必须大于开始时间");
                           document.getElementById("end").value = "";
                        }
                     }
                  }
               });
               //执行一个laydate实例
               laydate.render({
                  elem: '#end' //指定元素'
                  , type: 'datetime'
                  , done: function (value, date) {
                     var begin = document.getElementById("begin").value;
                     if (begin) {
                        if (begin >= value) {
                           alert("结束时间必须大于开始时间");
                           document.getElementById("begin").value = "";
                        }
                     }
                  }
               });
            </script>
            <script>
               // 页面初始化
               $(document).ready(function () {
                  App.init(); $.ajax({ async: false, type: "POST", url: "/hxzkoa/getSysSetting_list.do", data: {}, dataType: "json", success: function (data) { /* title = data[0].title; document.title = title;  */}, });
                  $("#page_1").addClass("active");
               });
               // 加载head复用页面
               $('.header-page').load('/hxzkoa/hxzk/top.html'); $('.login-page').load('/hxzkoa/hxzk/head.html');
               // 刷新功能
               $(".reset").click(function () {
                  setTimeout("window.location.reload()", 1000);
               });
               // 搜索功能
               $(".search").click(function () {
                  var input = $("#search_input").val();
                  var datea = $("#dateList").val();
                  if (input == "") {
                     swal('输入有误', '输入不能为空!', 'error'); return;
                  }
                  if (isNaN(input)) {
                     //swal('输入有误','请输入数字!','error');return;
                  }
                  $.ajax({
                     async: false, //同步的
                     type: "POST",
                     url: "/hxzkoa/historicalgpsLocation_search.do",
                     data: {
                        input: input,
                        tttt: datea
                     },
                     dataType: "json",
                     success: function (data) {
                        //搜索完成后刷新页面,只显示查到的部分
                        var str = "";
                        for (var k in data.dataList) {
                           str += "<tr align=\"center\"><td class=\"noExl custom-control custom-checkbox\"><input type=\"checkbox\" class=\"custom-control-input\" id=" + data.dataList[k].id + " name=\"selectIds\"><label class=\"custom-control-label\" for=" + data.dataList[k].id + " style=\"position:raletive;left:20px;bottom:5px;\"></label></td><td>" + data.dataList[k].id + "</td><td>" + data.dataList[k].gps_utc_time + "</td><td>" + data.dataList[k].gps_weidu + "</td><td>" + data.dataList[k].gsp_jingdu + "</td><td>" + data.dataList[k].tagid + "</td><td>" + data.dataList[k].gps_power + "</td><td>" + data.dataList[k].addtime + "</td></tr>";
                        }
                        $("#nr").html(str);
                        if (!data.pageList.length == 0) {
                           str = "";
                           str += "<li><a href=\"javascript:page('pre');\">上一页</a></li>";
                           for (var k = 0; k < data.pageList.length; k++) {
                              str += "<li id=\"page_" + data.pageList[k] + "\"><a href=\"javascript:page('" + data.pageList[k] + "');\">" + data.pageList[k] + "</a></li>";
            <% String superuser=(String) session.getAttribute("superuser"); String deleteq=(String)
               session.getAttribute("deleteq"); String alertq=(String) session.getAttribute("alertq"); String
               deleteall=(String) session.getAttribute("deleteall"); String username=(String)
               session.getAttribute("username"); if (username==null || username.equals("")) {
               request.getRequestDispatcher("/hxzk/login.jsp").forward(request, response); return; } %>
               <input type="hidden" name="superuser" id="superuser" value="<%=superuser%>"> <input type="hidden"
                  name="deleteq" id="deleteq" value="<%=deleteq%>"> <input type="hidden" name="alertq" id="alertq"
                  value="<%=alertq%>"> <input type="hidden" name="deleteall" id="deleteall"
                  value="<%=deleteall%>">
               <input type="hidden" name="xianusera" id="xianusera" value="<%=username%>">
               <!-- END MAIN CONTAINER -->
               <script>
                  //执行一个laydate实例
                  laydate.render({
                     elem: '#begin' //指定元素'
                     ,
                     type: 'datetime',
                     done: function (value, date) {
                        var end = document.getElementById("end").value;
                        if (end) {
                           if (end <= value) {
                              alert("结束时间必须大于开始时间");
                              document.getElementById("end").value = "";
                           }
                           str += "<li><a href=\"javascript:page('next');\">下一页</a></li>";
                           $("#pageListId").html(str);
                        }
                        $("#pageListId>li.active").removeClass("active");
                        $("#page_" + data.curPage).addClass("active");
                        $("#curPage").val(data.curPage);
                     },
                     error: function () {
                        //console.log('error');
                     }
                  });
               });
               // 删除功能
               $('.delete').on('click', function () {
                  swal({
                     title: '确定要删除么?',
                     text: "删除之后无法恢复!",
                     type: 'warning',
                     showCancelButton: true,
                     confirmButtonText: '删除',
                     cancelButtonText: '取消',
                     padding: '2em'
                  }).then(function (result) {
                     if (result.value) {
                        //获取选中数据
                        var checkVal = [];
                        var datea = $("#dateList").val();
                        var obj = document.getElementsByName("selectIds");
                        for (var k in obj) {
                           if (obj[k].checked) {
                              checkVal.push(obj[k].id);
                  //执行一个laydate实例
                  laydate.render({
                     elem: '#end' //指定元素'
                     ,
                     type: 'datetime',
                     done: function (value, date) {
                        var begin = document.getElementById("begin").value;
                        if (begin) {
                           if (begin >= value) {
                              alert("结束时间必须大于开始时间");
                              document.getElementById("begin").value = "";
                           }
                        }
                        if (checkVal.length > 0) {
                     }
                  });
               </script>
               <script>
                  // 页面初始化
                  window.onload = function () {
                     App.init();
                     $.ajax({
                        async: false,
                        type: "POST",
                        url: "/hxzkoa/getSysSetting_list2.do",
                        data: {},
                        dataType: "json",
                        success: function (data) {
                           /* title = data[0].title; document.title = title;  */
                           if (data.dataList2[0].label == 0) {
                              $("#labela").css({ 'display': 'none' });
                           };
                           if (data.dataList2[0].achor == 0) {
                              $("#anchora").css({ 'display': 'none' });
                           };
                           if (data.dataList2[0].gps == 0) {
                              $("#gpsa").css({ 'display': 'none' });
                           };
                           if (data.dataList2[0].fence == 0) {
                              $("#fencea").css({ 'display': 'none' });
                           };
                           if (data.dataList2[0].warning == 0) {
                              $("#warninga").css({ 'display': 'none' });
                           };
                           if (data.dataList2[0].history == 0) {
                              $("#historya").css({ 'display': 'none' });
                           };
                           if (data.dataList2[0].attendance == 0) {
                              $("#attendancea").css({ 'display': 'none' });
                           };
                           if (data.dataList2[0].basiclnfo == 0) {
                              $("#basiclnfoa").css({ 'display': 'none' });
                           };
                           if (data.dataList2[0].video == 0) {
                              $("#videoa").css({ 'display': 'none' });
                           };
                           if (data.dataList2[0].gas == 0) {
                              $("#gasa").css({ 'display': 'none' });
                           };
                        },
                     });
                     $("#page_1").addClass("active");
                     var superuser = document.getElementById("superuser").value;
                     var deleteq = document.getElementById("deleteq").value;
                     var alertq = document.getElementById("alertq").value;
                     var deleteall = document.getElementById("deleteall").value;
                     document.getElementById("xianuser").innerHTML = document.getElementById("xianusera").value
                     //console.log(superuser)
                     if (superuser == "访客") {
                        $("#addButton").attr("disabled", "true");
                        $("#deleteButton").attr("disabled", "true");
                        $("#modifyButton").attr("disabled", "true");
                        $("#deleteAllButton").attr("disabled", "true");
                        $("#modifyAllButton").attr("disabled", "true");
                        $("#importButton").attr("disabled", "true");
                     }
                     if (deleteq == "否") {
                        $("#deleteButton").attr("disabled", "true");
                     }
                     if (alertq == "否") {
                        $("#modifyButton").attr("disabled", "true");
                        $("#modifyAllButton").attr("disabled", "true");
                     }
                     if (deleteall == "否") {
                        $("#deleteAllButton").attr("disabled", "true");
                     }
                  };
                  // 加载head复用页面
                  $('.header-page').load('/hxzkoa/hxzk/top.html');
                  $('.login-page').load('/hxzkoa/hxzk/head.html');
                  // 刷新功能
                  $(".reset").click(function () {
                     setTimeout("window.location.reload()", 1000);
                  });
                  // 搜索功能
                  $(".search")
                     .click(
                        function () {
                           var input = $("#search_input").val();
                           var datea = $("#dateList").val();
                           if (input == "") {
                              swal('输入有误', '输入不能为空!', 'error');
                              return;
                           }
                           if (isNaN(input)) {
                              //swal('输入有误','请输入数字!','error');return;
                           }
                           $
                              .ajax({
                                 async: false, //同步的
                                 type: "POST",
                                 url: "/hxzkoa/historicalgpsLocation_search.do",
                                 data: {
                                    input: input,
                                    tttt: datea
                                 },
                                 dataType: "json",
                                 success: function (data) {
                                    //搜索完成后刷新页面,只显示查到的部分
                                    var str = "";
                                    for (var k in data.dataList) {
                                       str += "<tr align=\"center\"><td class=\"noExl custom-control custom-checkbox\"><input type=\"checkbox\" class=\"custom-control-input\" id=" + data.dataList[k].id + " name=\"selectIds\"><label class=\"custom-control-label\" for=" + data.dataList[k].id + " style=\"position:raletive;left:20px;bottom:5px;\"></label></td><td>"
                                          + data.dataList[k].id
                                          + "</td><td>"
                                          + data.dataList[k].gps_utc_time
                                          + "</td><td>"
                                          + data.dataList[k].gps_weidu
                                          + "</td><td>"
                                          + data.dataList[k].gsp_jingdu
                                          + "</td><td>"
                                          + data.dataList[k].gps_state
                                          + "</td><td>"
                                          + data.dataList[k].gps_hdop
                                          + "</td><td>"
                                          + data.dataList[k].gps_num
                                          + "</td><td>"
                                          + data.dataList[k].gps_chafen_time
                                          + "</td><td>"
                                          + data.dataList[k].gps_haiba_gao
                                          + "</td><td>"
                                          + data.dataList[k].tagid
                                          + "</td><td>"
                                          + data.dataList[k].gps_power
                                          + "</td><td>"
                                          + data.dataList[k].addtime
                                          + "</td></tr>";
                                    }
                                    $("#nr").html(str);
                                    if (!data.pageList.length == 0) {
                                       str = "";
                                       str += "<li><a href=\"javascript:page2('pre');\">上一页</a></li>";
                                       for (var k = 0; k < data.pageList.length; k++) {
                                          str += "<li id=\"page_" + data.pageList[k] + "\"><a href=\"javascript:page2('"
                                             + data.pageList[k]
                                             + "');\">"
                                             + data.pageList[k]
                                             + "</a></li>";
                                       }
                                       str += "<li><a href=\"javascript:page2('next');\">下一页</a></li>";
                                       console.log(str)
                                       $("#pageListId").html(str);
                                    }
                                    $("#pageListId>li.active")
                                       .removeClass("active");
                                    $("#page_" + data.curPage)
                                       .addClass("active");
                                    $("#curPage").val(data.curPage);
                                 },
                                 error: function () {
                                    //console.log('error');
                                 }
                              });
                        });
                  // 删除功能
                  $('.delete').on('click', function () {
                     swal({
                        title: '确定要删除么?',
                        text: "删除之后无法恢复!",
                        type: 'warning',
                        showCancelButton: true,
                        confirmButtonText: '删除',
                        cancelButtonText: '取消',
                        padding: '2em'
                     }).then(function (result) {
                        if (result.value) {
                           //获取选中数据
                           var checkVal = [];
                           var datea = $("#dateList").val();
                           var obj = document.getElementsByName("selectIds");
                           for (var k in obj) {
                              if (obj[k].checked) {
                                 checkVal.push(obj[k].id);
                              }
                           }
                           if (checkVal.length > 0) {
                              $.ajax({
                                 async: false, //同步的
                                 type: "POST",
                                 url: "/hxzkoa/historicalgpsLocation_delete.do",
                                 data: {
                                    checkVal: checkVal.toString(),
                                    datea: datea
                                 },
                                 dataType: "json"
                              });
                              swal({
                                 title: "Deleted!",
                                 text: "删除成功!",
                                 type: "success",
                                 showCancelButton: false,
                                 showConfirmButton: false,
                                 buttons: false
                              })
                              setTimeout("window.location.reload()", 1000);
                           } else {
                              swal('删除失败!', '请先选择删除的内容', 'error')
                           }
                        }
                     })
                  });
                  // 全部删除
                  $('.deleteAll').on('click', function () {
                     swal({
                        title: '确定要全部删除么?',
                        text: "删除之后无法恢复!",
                        type: 'warning',
                        showCancelButton: true,
                        confirmButtonText: '删除',
                        cancelButtonText: '取消',
                        padding: '2em'
                     }).then(function (result) {
                        if (result.value) {
                           //获取选中数据
                           var checkVal = [];
                           var datea = $("#dateList").val();
                           var obj = document.getElementsByName("selectIds");
                           for (var k in obj) {
                              if (obj[k].checked) {
                                 checkVal.push(obj[k].id);
                              }
                           }
                           $.ajax({
                              async: false, //同步的
                              type: "POST",
                              url: "/hxzkoa/historicalgpsLocation_delete.do",
                              url: "/hxzkoa/historicalgpsLocation_deleteAll.do",
                              data: {
                                 checkVal: checkVal.toString(),
                                 datea: datea
                                 aaaa: datea
                              },
                              dataType: "json"
                           });
@@ -354,194 +545,246 @@
                              buttons: false
                           })
                           setTimeout("window.location.reload()", 1000);
                        } else {
                           swal(
                              '删除失败!',
                              '请先选择删除的内容',
                              'error'
                           )
                        }
                     }
                     })
                  });
                  $(".toAlltxt").click(function () {
                     var dateaa = $("#dateList").val();
                     window.location.href = "/hxzkoa/totxt.do?date=" + dateaa;
                     // swal({
                     //    title: "Exported!",
                     //    text: "导出成功!",
                     //    type: "success",
                     //    showCancelButton: false,
                     //    showConfirmButton: false,
                     //    buttons: false
                     // })
                     // setTimeout("window.location.reload()", 1000);
                     /* $.ajax({
                        async: false,
                        type: 'POST',
                        url: "/hxzkoa/totxt.do",
                        dataType: 'json',
                        success: function(data){
                           console.log(data)
                        }
                     }) */
                  })
               });
               // 全部删除
               $('.deleteAll').on('click', function () {
                  swal({
                     title: '确定要全部删除么?',
                     text: "删除之后无法恢复!",
                     type: 'warning',
                     showCancelButton: true,
                     confirmButtonText: '删除',
                     cancelButtonText: '取消',
                     padding: '2em'
                  }).then(function (result) {
                     if (result.value) {
                        //获取选中数据
                        var checkVal = [];
                        var datea = $("#dateList").val();
                        var obj = document.getElementsByName("selectIds");
                        for (var k in obj) {
                           if (obj[k].checked) {
                              checkVal.push(obj[k].id);
                           }
                        }
                        $.ajax({
                  // 导出表格
                  $(".toAllExcel")
                     .click(
                        function () {
                           var tag = document.getElementById("tagida").value;
                           var begin = document.getElementById("begin").value;
                           var end = document.getElementById("end").value;
                           var datea = $("#dateList").val();
                           window.location.href = "/hxzkoa/historicalgpsLocation_export.do?tagid="
                              + tag
                              + "&begintime="
                              + begin
                              + "&endtime="
                              + end + "&date=" + datea;
                           // $.ajax({
                           //    async: false,
                           //    type: "POST",
                           //    url: "/hxzkoa/historicalgpsLocation_export.do",
                           //    data: {
                           //       tagid : tag,
                           //       begintime : begin,
                           //       endtime : end,
                           //       datebb : datea
                           //    },
                           //    dataType: "json"
                           // })
                           swal({
                              title: "Exported!",
                              text: "导出成功!",
                              type: "success",
                              showCancelButton: false,
                              showConfirmButton: false,
                              buttons: false
                           })
                           setTimeout("window.location.reload()", 1000);
                        });
                  // 分页跳转
                  function page(page) {
                     var curPage = $("#curPage").val();
                     var date = $("#dateList").val();
                     $
                        .ajax({
                           async: false, //同步的
                           type: "POST",
                           url: "/hxzkoa/historicalgpsLocation_deleteAll.do",
                           url: "/hxzkoa/historicalgpsLocation_page.do",
                           data: {
                              checkVal: checkVal.toString(),
                              aaaa: datea
                              page: page,
                              curPage: curPage,
                              date: date
                           },
                           dataType: "json"
                        });
                        swal({
                           title: "Deleted!",
                           text: "删除成功!",
                           type: "success",
                           showCancelButton: false,
                           showConfirmButton: false,
                           buttons: false
                        })
                        setTimeout("window.location.reload()", 1000);
                     }
                  })
               });
               $(".toAlltxt").click(function () {
                  var dateaa = $("#dateList").val();
                  window.location.href = "/hxzkoa/totxt.do?date=" + dateaa;
                  // swal({
                  //    title: "Exported!",
                  //    text: "导出成功!",
                  //    type: "success",
                  //    showCancelButton: false,
                  //    showConfirmButton: false,
                  //    buttons: false
                  // })
                  // setTimeout("window.location.reload()", 1000);
                  /* $.ajax({
                     async: false,
                     type: 'POST',
                     url: "/hxzkoa/totxt.do",
                     dataType: 'json',
                     success: function(data){
                        console.log(data)
                     }
                  }) */
               })
               // 导出表格
               $(".toAllExcel").click(function () {
                  var tag = document.getElementById("tagida").value;
                  var begin = document.getElementById("begin").value;
                  var end = document.getElementById("end").value;
                  var datea = $("#dateList").val();
                  window.location.href = "/hxzkoa/historicalgpsLocation_export.do?tagid=" + tag + "&begintime=" + begin + "&endtime=" + end + "&date=" + datea;
                  // $.ajax({
                  //    async: false,
                  //    type: "POST",
                  //    url: "/hxzkoa/historicalgpsLocation_export.do",
                  //    data: {
                  //       tagid : tag,
                  //       begintime : begin,
                  //       endtime : end,
                  //       datebb : datea
                  //    },
                  //    dataType: "json"
                  // })
                  swal({
                     title: "Exported!",
                     text: "导出成功!",
                     type: "success",
                     showCancelButton: false,
                     showConfirmButton: false,
                     buttons: false
                  })
                  setTimeout("window.location.reload()", 1000);
               });
               // 分页跳转
               function page(page) {
                  var curPage = $("#curPage").val();
                  var date = $("#dateList").val();
                  $.ajax({
                     async: false, //同步的
                     type: "POST",
                     url: "/hxzkoa/historicalgpsLocation_page.do",
                     data: {
                        page: page,
                        curPage: curPage,
                        date: date
                     },
                     dataType: "json",
                     success: function (data) {
                        var str = "";
                        for (var k in data.dataList) {
                           str += "<tr align=\"center\"><td class=\"noExl custom-control custom-checkbox\"><input type=\"checkbox\" class=\"custom-control-input\" id=" + data.dataList[k].id + " name=\"selectIds\"><label class=\"custom-control-label\" for=" + data.dataList[k].id + " style=\"position:raletive;left:20px;bottom:5px;\"></label></td><td>" + data.dataList[k].id + "</td><td>" + data.dataList[k].gps_utc_time + "</td><td>" + data.dataList[k].gps_weidu + "</td><td>" + data.dataList[k].gsp_jingdu + "</td><td>" + data.dataList[k].tagid + "</td><td>" + data.dataList[k].gps_power + "</td><td>" + data.dataList[k].addtime + "</td></tr>";
                        }
                        $("#nr").html(str);
                        if (!data.pageList.length == 0) {
                           str = "";
                           str += "<li><a href=\"javascript:page('pre');\">上一页</a></li>";
                           for (var k = 0; k < data.pageList.length; k++) {
                              str += "<li id=\"page_" + data.pageList[k] + "\"><a href=\"javascript:page('" + data.pageList[k] + "');\">" + data.pageList[k] + "</a></li>";
                           dataType: "json",
                           success: function (data) {
                              var str = "";
                              for (var k in data.dataList) {
                                 str += "<tr align=\"center\"><td class=\"noExl custom-control custom-checkbox\"><input type=\"checkbox\" class=\"custom-control-input\" id=" + data.dataList[k].id + " name=\"selectIds\"><label class=\"custom-control-label\" for=" + data.dataList[k].id + " style=\"position:raletive;left:20px;bottom:5px;\"></label></td><td>"
                                    + data.dataList[k].id
                                    + "</td><td>"
                                    + data.dataList[k].gps_utc_time
                                    + "</td><td>"
                                    + data.dataList[k].gps_weidu
                                    + "</td><td>"
                                    + data.dataList[k].gsp_jingdu
                                    + "</td><td>"
                                    + data.dataList[k].gps_state
                                    + "</td><td>"
                                    + data.dataList[k].gps_hdop
                                    + "</td><td>"
                                    + data.dataList[k].gps_num
                                    + "</td><td>"
                                    + data.dataList[k].gps_chafen_time
                                    + "</td><td>"
                                    + data.dataList[k].gps_haiba_gao
                                    + "</td><td>"
                                    + data.dataList[k].tagid
                                    + "</td><td>"
                                    + data.dataList[k].gps_power
                                    + "</td><td>"
                                    + data.dataList[k].addtime
                                    + "</td></tr>";
                              }
                              $("#nr").html(str);
                              if (!data.pageList.length == 0) {
                                 str = "";
                                 str += "<li><a href=\"javascript:page('pre');\">上一页</a></li>";
                                 for (var k = 0; k < data.pageList.length; k++) {
                                    str += "<li id=\"page_" + data.pageList[k] + "\"><a href=\"javascript:page('"
                                       + data.pageList[k]
                                       + "');\">"
                                       + data.pageList[k] + "</a></li>";
                                 }
                                 str += "<li><a href=\"javascript:page('next');\">下一页</a></li>";
                                 $("#pageListId").html(str);
                              }
                              $("#pageListId>li.active").removeClass("active");
                              $("#page_" + data.curPage).addClass("active");
                              $("#curPage").val(data.curPage);
                           },
                           error: function () {
                              //console.log('error');
                           }
                           str += "<li><a href=\"javascript:page('next');\">下一页</a></li>";
                           console.log(str)
                           $("#pageListId").html(str);
                        });
                  }
                  // 分页跳转2
                  function page2(page) {
                     var curPage = $("#curPage").val();
                     var date = $("#dateList").val();
                     var input = $("#search_input").val();
                     $.ajax({
                        async: false, //同步的
                        type: "POST",
                        url: "/hxzkoa/historicalgpsLocation_search2.do",
                        data: {
                           page: page,
                           curPage: curPage,
                           date: date,
                           input: input
                        },
                        dataType: "json",
                        success: function (data) {
                           var str = "";
                           for (var k in data.dataList) {
                              str += "<tr align=\"center\"><td class=\"noExl custom-control custom-checkbox\"><input type=\"checkbox\" class=\"custom-control-input\" id=" + data.dataList[k].id + " name=\"selectIds\"><label class=\"custom-control-label\" for=" + data.dataList[k].id + " style=\"position:raletive;left:20px;bottom:5px;\"></label></td><td>"
                                 + data.dataList[k].id
                                 + "</td><td>"
                                 + data.dataList[k].gps_utc_time
                                 + "</td><td>"
                                 + data.dataList[k].gps_weidu
                                 + "</td><td>"
                                 + data.dataList[k].gsp_jingdu
                                 + "</td><td>"
                                 + data.dataList[k].gps_state
                                 + "</td><td>"
                                 + data.dataList[k].gps_hdop
                                 + "</td><td>"
                                 + data.dataList[k].gps_num
                                 + "</td><td>"
                                 + data.dataList[k].gps_chafen_time
                                 + "</td><td>"
                                 + data.dataList[k].gps_haiba_gao
                                 + "</td><td>"
                                 + data.dataList[k].tagid
                                 + "</td><td>"
                                 + data.dataList[k].gps_power
                                 + "</td><td>"
                                 + data.dataList[k].addtime
                                 + "</td></tr>";
                           }
                           $("#nr").html(str);
                           if (!data.pageList.length == 0) {
                              str = "";
                              str += "<li><a href=\"javascript:page2('pre');\">上一页</a></li>";
                              for (var k = 0; k < data.pageList.length; k++) {
                                 str += "<li id=\"page_" + data.pageList[k] + "\"><a href=\"javascript:page2('"
                                    + data.pageList[k]
                                    + "');\">"
                                    + data.pageList[k] + "</a></li>";
                              }
                              str += "<li><a href=\"javascript:page2('next');\">下一页</a></li>";
                              $("#pageListId").html(str);
                           }
                           $("#pageListId>li.active").removeClass("active");
                           $("#page_" + data.curPage).addClass("active");
                           $("#curPage").val(data.curPage);
                        },
                        error: function () {
                           //console.log('error');
                        }
                        $("#pageListId>li.active").removeClass("active");
                        $("#page_" + data.curPage).addClass("active");
                        $("#curPage").val(data.curPage);
                     },
                     error: function () {
                        //console.log('error');
                     }
                  });
               }
               $(".table tbody").on('click', 'tr', function (e) {
                  //console.log(e.target.type)
                  if (e.target.type != 'checkbox') {
                     if ($(this).find(":checkbox").prop("checked") == true) {
                        $(this).find(":checkbox").prop("checked", false);
                     });
                  }
                  $(".table tbody").on('click', 'tr', function (e) {
                     //console.log(e.target.type)
                     if (e.target.type != 'checkbox') {
                        if ($(this).find(":checkbox").prop("checked") == true) {
                           $(this).find(":checkbox").prop("checked", false);
                        } else {
                           $(this).find(":checkbox").prop("checked", true);
                        }
                     } else {
                        $(this).find(":checkbox").prop("checked", true);
                     }
                  } else {
                     return false;
                  }
               });
               //修改行数
               function modifyPerPage() {
                  var perPage = $("#perPage").val();
                  if (isNaN(perPage)) {
                     swal('输入有误', '请输入数字!', 'error'); return;
                  }
                  $.ajax({
                     async: false, //同步的
                     type: "POST",
                     url: "/hxzkoa/modifyPerPage.do",
                     data: {
                        perPage: perPage
                     },
                     dataType: "json",
                     success: function (data) {
                        //console.log("data:"+data.result)
                        $("#perPage").val(data.result);
                        swal({
                           title: "Modified!",
                           text: "修改成功!",
                           type: "success",
                           showCancelButton: false,
                           showConfirmButton: false,
                           buttons: false
                        })
                        setTimeout("window.location.reload()", 1000);
                     },
                     error: function () {
                        //console.log('error');
                        return false;
                     }
                  });
               }
            </script>
                  //修改行数
                  function modifyPerPage() {
                     var perPage = $("#perPage").val();
                     if (isNaN(perPage)) {
                        swal('输入有误', '请输入数字!', 'error');
                        return;
                     }
                     $.ajax({
                        async: false, //同步的
                        type: "POST",
                        url: "/hxzkoa/modifyPerPage.do",
                        data: {
                           perPage: perPage
                        },
                        dataType: "json",
                        success: function (data) {
                           //console.log("data:"+data.result)
                           $("#perPage").val(data.result);
                           swal({
                              title: "Modified!",
                              text: "修改成功!",
                              type: "success",
                              showCancelButton: false,
                              showConfirmButton: false,
                              buttons: false
                           })
                           setTimeout("window.location.reload()", 1000);
                        },
                        error: function () {
                           //console.log('error');
                        }
                     });
                  }
               </script>
         </body>
         </html>