<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
<html lang="en">
|
|
<head>
|
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
|
<title>基站管理</title>
|
<link href="/hxzkoa/hxzk/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/assets/img/favicon.ico" rel="icon" type="image/x-icon" />
|
<link href="/hxzkoa/hxzk/assets/css/components/custom-modal.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/assets/css/components/custom-sweetalert.css" rel="stylesheet"
|
type="text/css" />
|
<link href="/hxzkoa/hxzk/assets/css/dashboard/dash_2.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/assets/css/elements/custom-pagination.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/assets/css/loader.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/assets/css/scrollspyNav.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/assets/css/main.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/assets/css/elements/search.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/plugins/apex/apexcharts.css" rel="stylesheet" type="text/css">
|
<link href="/hxzkoa/hxzk/plugins/animate/animate.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/plugins/highlight/styles/monokai-sublime.css" rel="stylesheet"
|
type="text/css" />
|
<link href="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert2.min.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert.css" rel="stylesheet" type="text/css" />
|
<link href="/hxzkoa/hxzk/plugins/table/datatable/datatables.css" rel="stylesheet" type="text/css">
|
<link href="/hxzkoa/hxzk/plugins/table/datatable/custom_dt_html5.css" rel="stylesheet" type="text/css">
|
|
<link href="/hxzkoa/hxzk/plugins/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet"
|
type="text/css" />
|
<link href="https://fonts.gstatic.com" rel="preconnect">
|
<link href="https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Quicksand:400,500,600,700&display=swap"
|
rel="stylesheet">
|
<style>
|
|
</style>
|
<script src="/hxzkoa/hxzk/assets/js/app.js"></script>
|
<script src="/hxzkoa/hxzk/assets/js/dashboard/dash_2.js"></script>
|
<script src="/hxzkoa/hxzk/assets/js/loader.js"></script>
|
<script src="/hxzkoa/hxzk/assets/js/libs/jquery-3.1.1.min.js"></script>
|
<script src="/hxzkoa/hxzk/bootstrap/js/bootstrap.min.js"></script>
|
<script src="/hxzkoa/hxzk/bootstrap/js/popper.min.js"></script>
|
<script src="/hxzkoa/hxzk/plugins/apex/apexcharts.min.js"></script>
|
<script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/jszip.min.js"></script>
|
<script src="/hxzkoa/hxzk/plugins/table/jquery.table2excel.js"></script>
|
<script src="/hxzkoa/hxzk/plugins/sweetalerts/promise-polyfill.js"></script>
|
<script src="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert2.min.js"></script>
|
<script src="/hxzkoa/hxzk/plugins/sweetalerts/custom-sweetalert.js"></script>
|
<script src="/hxzkoa/hxzk/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
|
</head>
|
<style>
|
tr:first-child,
|
tr:last-child{
|
position: sticky;
|
background: #F4F4F5;
|
border-left: 1px solid #DDDDDD ;
|
}
|
thead tr {
|
position: sticky;
|
top: 0;
|
background: #F4F4F5;
|
height: 30px;
|
}
|
|
tr:first-child {
|
z-index: 3;
|
/*左上角单元格z-index,切记要设置,不然表格纵向横向滚动时会被该单元格右方或者下方的单元格遮挡*/
|
background: #F4F4F5;
|
}
|
.panel-head {
|
font-size: 1rem;
|
color: rgba(255, 255, 255, .7);
|
line-height: 2rem;
|
text-align: center;
|
background: linear-gradient(rgb(0, 20, 30), rgb(0, 40, 70));
|
border: 2px solid rgba(0, 90, 120, .3);
|
}
|
</style>
|
<body>
|
|
<table id="html5-extension" class="table table-hover" style="width: 770px">
|
<thead>
|
<div class='panel-head'>在线:离线基站</div>
|
<tr align="center">
|
<th style="color: #029890" class="noExl">基站状态</th>
|
<th style="color: #029890">设备编号</th>
|
<th style="color: #029890">X坐标/cm</th>
|
<th style="color: #029890">Y坐标/cm</th>
|
<th style="color: #029890">Z坐标/cm</th>
|
<th style="color: #029890">层</th>
|
|
</tr>
|
</thead>
|
<tbody id="nr" style="background-color: #46535B;">
|
<c:forEach items="${achorManagementList}" var="list">
|
<tr align="center" class="d">
|
|
<td class="noExl">
|
<c:choose>
|
<c:when test="${list.anchormode == '0'}">
|
<img src="hxzk/image/anchor/基站离线.png" />
|
</c:when>
|
<c:otherwise>
|
<img src="hxzk/image/anchor/基站在线.png" />
|
</c:otherwise>
|
</c:choose>
|
</td>
|
<td style="color: white">${list.anchorid}</td>
|
<td style="color: white">${list.POSX}</td>
|
<td style="color: white">${list.POSY}</td>
|
<td style="color: white">${list.POSZ}</td>
|
<td style="color: white">${list.layer}</td>
|
</tr>
|
</c:forEach>
|
</tbody>
|
</table>
|
|
<% 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"); String fenceq=(String) session.getAttribute("fenceq"); 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%>">
|
<input type="hidden" name="fenceq" id="fenceq" value="<%=fenceq%>">
|
<!-- END MAIN CONTAINER -->
|
<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;
|
var fenceq = document.getElementById("fenceq").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");
|
}
|
if (fenceq == "否") {
|
$("#addButton").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);
|
});
|
// 新增功能
|
$('.add').on(
|
'click',
|
function () {
|
var anchorid = $("#anchorid_a").val();
|
var POSZ = $("#POSZ_a").val();
|
var result = "";
|
$.ajax({
|
async: false,
|
type: "POST",
|
url: "/hxzkoa/anchorid_search.do",
|
data: {
|
anchorid: anchorid
|
},
|
dataType: "json",
|
success: function (data) {
|
result = data
|
},
|
});
|
if (result == 1) {
|
swal('添加失败!', '该基站已存在', 'error')
|
return false;
|
}
|
var reg = /^[A-Za-z0-9]+$/;
|
var result = reg.test(anchorid);
|
//console.log("result", result);
|
var POSX = $("#POSX_a").val();
|
var POSY = $("#POSY_a").val();
|
//var reg2 = /^-?\\d+$/;
|
var reg2 = new RegExp("^[0-9][0-9]*$");
|
var result_x = reg2.test(POSX);
|
var result_y = reg2.test(POSY);
|
var result_z = reg2.test(POSZ);
|
var layer = $("#layer_a").val();
|
var result_l = reg2.test(layer);
|
var zu = $("#zu_a").val();
|
var result_y = reg2.test(zu);
|
var liangcheng = $("#liangcheng_a").val();
|
var result_lc = reg2.test(liangcheng);
|
var anchorip = $("#anchorip_a").val();
|
if (!anchorid || !result) {
|
swal('输入有误', '请输入正确的基站ID!', 'error');
|
return
|
}
|
if (POSX == "" || POSY == "" || POSZ == ""
|
|| layer == "") {
|
swal('输入有误', '输入不能为空!', 'error');
|
return
|
}
|
if ((!result_x && POSX != "")
|
|| (!result_y && POSY != "")
|
|| (!result_y && zu != "")
|
|| (!result_z && POSZ != "")
|
|| (!result_l && layer != "")
|
|| (!result_lc && liangcheng != "")) {
|
swal('输入有误', '不能输入小数!', 'error');
|
return
|
}
|
|
if (isNaN(anchorid)) {
|
//swal('输入有误','请输入数字!','error');return;
|
}
|
$.ajax({
|
async: false, //同步的
|
type: "POST",
|
dataType: "json",
|
url: "/hxzkoa/anchorManagement_add.do",
|
data: {
|
anchorid: anchorid,
|
POSX: POSX,
|
POSY: POSY,
|
POSZ: POSZ,
|
layer: layer,
|
zu: zu,
|
liangcheng: liangcheng,
|
anchorip: anchorip
|
},
|
dataType: "json"
|
});
|
swal({
|
title: "Saved!",
|
text: "保存成功!",
|
type: "success",
|
showCancelButton: false,
|
showConfirmButton: false,
|
buttons: false
|
})
|
setTimeout("window.location.reload()", 1000);
|
});
|
// 修改功能初始化
|
$('.initModify').on('click', function () {
|
var tr, state, firstId;
|
$('input[name="selectIds"]').each(function () {
|
state = $(this).prop('checked');
|
if (state) {
|
firstId = $(this).attr('id');
|
tr = $(this).parent().parent()[0];
|
$("#anchorid_m").val(tr.children[2].innerHTML);
|
$("#POSX_m").val(tr.children[3].innerHTML);
|
$("#POSY_m").val(tr.children[4].innerHTML);
|
$("#POSZ_m").val(tr.children[5].innerHTML);
|
$("#layer_m").val(tr.children[6].innerHTML);
|
$("#zu_m").val(tr.children[7].innerHTML);
|
$("#liangcheng_m").val(tr.children[8].innerHTML);
|
$("#anchorip_m").val(tr.children[10].innerHTML);
|
return false;
|
}
|
});
|
if (!state) {
|
$('input[name="selectIds"]').each(function () {
|
state = $(this).prop('checked');
|
if (!state) {
|
firstId = $(this).attr('id');
|
tr = $(this).parent().parent()[0];
|
$("#anchorid_m").val(tr.children[2].innerHTML);
|
$("#POSX_m").val(tr.children[3].innerHTML);
|
$("#POSY_m").val(tr.children[4].innerHTML);
|
$("#POSZ_m").val(tr.children[5].innerHTML);
|
$("#layer_m").val(tr.children[6].innerHTML);
|
$("#zu_m").val(tr.children[7].innerHTML);
|
$("#liangcheng_m").val(tr.children[8].innerHTML);
|
$("#anchorip_m").val(tr.children[10].innerHTML);
|
return false;
|
}
|
});
|
alert("请选中一条数据进行修改,当前默认第一条!");
|
}
|
});
|
// 修改功能
|
$('.modify').on('click', function () {
|
var anchorid = $("#anchorid_m").val();
|
var POSX = $("#POSX_m").val();
|
var POSY = $("#POSY_m").val();
|
var POSZ = $("#POSZ_m").val();
|
var layer = $("#layer_m").val();
|
var zu = $("#zu_m").val();
|
var liangcheng = $("#liangcheng_m").val();
|
var anchorip = $("#anchorip_m").val();
|
$.ajax({
|
async: false, //同步的
|
type: "POST",
|
url: "/hxzkoa/anchorManagement_modify.do",
|
data: {
|
anchorid: anchorid,
|
POSX: POSX,
|
POSY: POSY,
|
POSZ: POSZ,
|
layer: layer,
|
zu: zu,
|
liangcheng: liangcheng,
|
anchorip: anchorip
|
},
|
dataType: "json"
|
});
|
swal({
|
title: "Modified!",
|
text: "修改成功!",
|
type: "success",
|
showCancelButton: false,
|
showConfirmButton: false,
|
buttons: false
|
})
|
setTimeout("window.location.reload()", 1000);
|
});
|
// 删除功能
|
$('.delete')
|
.on(
|
'click',
|
function () {
|
swal({
|
title: '确定要删除么?',
|
text: "删除之后无法恢复!",
|
type: 'warning',
|
showCancelButton: true,
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
padding: '2em'
|
})
|
.then(
|
function (result) {
|
if (result.value) {
|
//获取选中数据
|
var checkVal = [];
|
var anchorid = [];
|
var obj = document
|
.getElementsByName("selectIds");
|
var anchorids = document
|
.getElementsByName("anchorids");
|
for (var k in obj) {
|
if (obj[k].checked) {
|
checkVal
|
.push(obj[k].id);
|
}
|
}
|
for (var k in anchorids) {
|
if (obj[k].checked) {
|
anchorid
|
.push(anchorids[k].value);
|
}
|
}
|
if (checkVal.length > 0) {
|
$
|
.ajax({
|
async: false, //同步的
|
type: "POST",
|
url: "/hxzkoa/anchorManagement_delete.do",
|
data: {
|
checkVal: checkVal
|
.toString(),
|
anchorids: anchorid
|
.toString()
|
},
|
dataType: "json"
|
});
|
swal({
|
title: "Deleted!",
|
text: "删除成功!",
|
type: "success",
|
showCancelButton: false,
|
showConfirmButton: false,
|
buttons: false
|
})
|
setTimeout(
|
"window.location.reload()",
|
1000);
|
} else {
|
swal(
|
'删除失败!',
|
'请先选择删除的内容',
|
'error')
|
}
|
}
|
})
|
});
|
|
// 导出表格
|
$(".toAllExcel").click(function () {
|
window.location.href = '/hxzkoa/anchorManagement_export.do';
|
swal({
|
title: "Exported!",
|
text: "导出成功!",
|
type: "success",
|
showCancelButton: false,
|
showConfirmButton: false,
|
buttons: false
|
})
|
setTimeout("window.location.reload()", 1000);
|
});
|
// 下载模板
|
$(".toExcel")
|
.click(
|
function () {
|
window.location.href = '/hxzkoa/anchorManagement_exportTemplate.do';
|
swal({
|
title: "Exported!",
|
text: "导出成功!",
|
type: "success",
|
showCancelButton: false,
|
showConfirmButton: false,
|
buttons: false,
|
timer: 1000
|
})
|
setTimeout("window.location.reload()", 1000);
|
});
|
// 导入标签
|
$(".importXls")
|
.click(
|
function () {
|
var path = $("#importXls").val();
|
if (path == "") {
|
swal('导入失败!', '未选择文件', 'error')
|
return;
|
} else {
|
//解决由于浏览器的安全机制,路径被fakepath代替,隐藏了真实物理路径问题
|
if (path.indexOf("fakepath") != -1) {
|
alert("由于浏览器的安全机制,请调整浏览器安全设置并使用Internet Explorer或者将导入文件放到C://hxzkoa/目录下,其他路径只能读取文件名!");
|
alert("浏览器安全设置方法:打开Windows附件->Internet Explorer->工具 -> Internet选项 ->安全 -> 自定义级别 -> 找到“其他”中的“将本地文件上载至服务器时包含本地目录路径”,选中“启用”即可。");
|
}
|
//var fileObj = document.getElementById("importXls").files[0];
|
//var url = window.URL.createObjectURL(fileObj);
|
$
|
.ajax({
|
async: false, //同步的
|
type: "POST",
|
url: "/hxzkoa/anchorManagement_import.do",
|
data: {
|
path: path
|
},
|
dataType: "json",
|
success: function (data) {
|
if (data.result == 1) {
|
swal({
|
title: "Imported!",
|
text: "导入成功!",
|
type: "success",
|
showCancelButton: false,
|
showConfirmButton: false,
|
buttons: false
|
})
|
setTimeout(
|
"window.location.reload()",
|
1000);
|
} else {
|
swal('导入失败!', '无法获取文件',
|
'error')
|
}
|
}
|
});
|
setTimeout("window.location.reload()", 1000);
|
}
|
});
|
// 导入标签
|
$(document).ready(function () {
|
var resultList = $("#resultList").val();
|
//console.log(resultList)
|
if (resultList == '1') {
|
swal({
|
title: "Imported!",
|
text: "导入成功!",
|
type: "success",
|
showCancelButton: false,
|
showConfirmButton: false,
|
buttons: false
|
})
|
setTimeout("history.go(-1)", 2000);
|
} else if (resultList == '0') {
|
swal('导入失败!', '无法获取文件', 'error')
|
setTimeout("history.go(-1)", 2000);
|
}
|
});
|
// 分页跳转
|
$(".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 {
|
return false;
|
}
|
});
|
</script>
|
</body>
|
|
</html>
|