<%@ 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/structure.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/table/datatable/dt-global_style.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>
|
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);
|
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);
|
}
|
|
.table-bordered td, .table-bordered th {
|
border: 1px solid #ebedf2;
|
}
|
</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>
|
<body class="alt-menu sidebar-noneoverflow">
|
|
<!-- BEGIN LOADER -->
|
<div id="load_screen">
|
<div class="loader">
|
<div class="loader-content">
|
<div class="spinner-grow align-self-center"></div>
|
</div>
|
</div>
|
</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>
|
<!-- BEGIN NAVBAR -->
|
<div class="login-page"></div>
|
<!-- END NAVBAR -->
|
|
<!-- BEGIN MAIN CONTAINER -->
|
<div class="main-container" id="container">
|
|
<div class="overlay"></div>
|
<div class="search-overlay"></div>
|
|
<!-- BEGIN TOPBAR -->
|
<div class="header-page"></div>
|
<!-- END TOPBAR -->
|
|
<!-- BEGIN MODAL -->
|
<div class="modal fade addNew" tabindex="-1" role="dialog"
|
aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
|
<div class="modal-dialog modal-xl" role="document"
|
style="width: 30%;">
|
<div class="modal-content">
|
<div class="modal-header">
|
<h5 class="modal-title" id="myExtraLargeModalLabel">新增</h5>
|
<button type="button" class="close" data-dismiss="modal"
|
aria-label="Close">
|
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
stroke-linejoin="round" class="feather feather-x">
|
<line x1="18" y1="6" x2="6" y2="18"></line>
|
<line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
</button>
|
</div>
|
<div class="modal-body">
|
<form action="/hxzkoa/uploadIcon.do" method="post"
|
enctype="multipart/form-data">
|
<div class="form-group mb-4 mt-3"
|
style="width: 60%; margin-left: 25%; overflow: auto; _display: inline-block;">
|
<label for="exampleFormControlFile1">选择图片:</label> <input
|
type="file" class="form-control-file" name="file" id="addIcon"
|
required="required" style="font-size: 14px; color: white"
|
onchange="getIconName()">
|
</div>
|
<div
|
style="width: 90%; margin-left: 5%; overflow: auto; _display: inline-block;">
|
<div style="width: 60%; margin-left: 20%; float: left;"
|
class="form-group row mb-4">
|
<label for="exampleFormControlInput1"
|
class="col-sm-4 col-form-label col-form-label-sm">图标名称:</label>
|
<input class="form-control col-sm-8" type="text" id="addName"
|
required="required" />
|
</div>
|
</div>
|
<div
|
style="width: 90%; margin-left: 5%; overflow: auto; _display: inline-block;">
|
<div style="width: 60%; margin-left: 20%; float: left;"
|
class="form-group row mb-4">
|
<label for="exampleFormControlInput1"
|
class="col-sm-4 col-form-label col-form-label-sm">备注:</label>
|
<input class="form-control col-sm-8" type="text" id="addBeizhu" />
|
</div>
|
</div>
|
<div class="modal-footer"
|
style="margin-top: 10%; margin-left: 10%; float: left;">
|
<button type="submit" class="btn btn-primary add">保存</button>
|
<a><c:forEach var="i" begin="1" end="28"> </c:forEach></a>
|
<button class="btn" data-dismiss="modal">
|
<i class="flaticon-cancel-12"></i> 取消
|
</button>
|
</div>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
<!-- END MODAL -->
|
|
<!-- BEGIN CONTENT PART -->
|
<div id="content" class="main-content">
|
<div class="layout-px-spacing">
|
|
<div class="row layout-top-spacing" id="cancel-row">
|
|
<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%">
|
<div style="margin-bottom: 15px;">
|
<button type="button" class="btn btn-secondary"
|
data-toggle="modal" data-target=".addNew" id="addButton">新增</button>
|
<button type="button" class="btn btn-secondary reset">刷新</button>
|
<button type="button" class="btn btn-secondary delete"
|
id="deleteButton">删除</button>
|
</div>
|
<thead>
|
<tr align="center">
|
<th class="noExl">选择</th>
|
<th>图标名称</th>
|
<th>图标预览</th>
|
<th>添加时间</th>
|
<th>备注</th>
|
</tr>
|
</thead>
|
<tbody id="nr">
|
<c:forEach items="${iconManagementList}" var="list">
|
<tr align="center">
|
<td class="noExl custom-control custom-checkbox"><input
|
type="checkbox" class="custom-control-input"
|
id="${list.serial_number}" name="selectIds"><label
|
class="custom-control-label" for="${list.serial_number}"
|
style="position: raletive; left: 20px; top: 3px;"></label></td>
|
<td>${list.icon_name}</td>
|
<td><img src="hxzk/${list.icon_adress}" /></td>
|
<td>${list.add_time}</td>
|
<td>${list.beizhu}</td>
|
</tr>
|
</c:forEach>
|
</tbody>
|
</table>
|
</div>
|
<div class="paginating-container pagination-solid">
|
<input type="hidden" id="curPage" value="${curPage}"></input>
|
<ul class="pagination" id="pageListId">
|
<li><a href="javascript:page('pre');">上一页</a></li>
|
<c:forEach items="${pageList}" var="list">
|
<li id="page_${list}"><a
|
href="javascript:page('${list}');">${list}</a></li>
|
</c:forEach>
|
<li><a href="javascript:page('next');">下一页</a></li>
|
</ul>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
|
</div>
|
<!-- END CONTENT PART -->
|
|
</div>
|
<%
|
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");
|
}
|
};
|
$('.header-page').load('/hxzkoa/hxzk/top.html');
|
$('.login-page').load('/hxzkoa/hxzk/head.html');
|
function page(page) {
|
// pre next pos:1,2,3
|
var curPage = $("#curPage").val();
|
$
|
.ajax({
|
async : false,//同步的
|
type : "POST",
|
url : "/hxzkoa/iconManagement_page.do",
|
data : {
|
page : page,
|
curPage : curPage
|
},
|
dataType : "json",
|
success : function(data) {
|
//console.log(data.curPage,data.pageList.length)
|
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].serial_number + "\" name=\"selectIds\"><label class=\"custom-control-label\" for=\"" +
|
data.dataList[k].serial_number +"\" style=\"position:raletive;left:20px;top:3px;\"></label></td><td>"
|
+ data.dataList[k].icon_name
|
+ "</td><td><img src=\"hxzk\/" + data.dataList[k].icon_adress + "\"\/></td><td>"
|
+ data.dataList[k].add_time
|
+ "</td><td>"
|
+ data.dataList[k].beizhu
|
+ "</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 < Math.min(10,
|
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>";
|
//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');
|
}
|
});
|
};
|
// 新增功能
|
//自动获取上传文件名称
|
function getIconName() {
|
document.getElementById("addName").value = document
|
.getElementById('addIcon').files[0].name;
|
};
|
$('.add')
|
.on(
|
'click',
|
function() {
|
var name = $("#addName").val();
|
var filePath = document
|
.getElementById('addIcon').files[0].name;
|
var beizhu = $("#addBeizhu").val();
|
$
|
.ajax({
|
async : false, //同步的
|
type : "POST",
|
url : "/hxzkoa/iconManagement_check.do",
|
data : {
|
name : name,
|
},
|
dataType : "json",
|
success : function(data) {
|
//console.log("data:",data)
|
if (data == "0") {
|
$
|
.ajax({
|
async : false, //同步的
|
type : "POST",
|
url : "/hxzkoa/iconManagement_add.do",
|
data : {
|
name : name,
|
filePath : filePath,
|
beizhu : beizhu,
|
},
|
dataType : "json"
|
});
|
swal({
|
title : "Saved!",
|
text : "保存成功!",
|
type : "success",
|
showCancelButton : false,
|
showConfirmButton : false,
|
buttons : false
|
})
|
setTimeout(
|
"window.location.reload()",
|
1000);
|
} else {
|
swal('新增失败!', '图标名重复',
|
'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);
|
} else {
|
$(this).find(":checkbox").prop("checked", true);
|
}
|
} else {
|
return false;
|
}
|
});
|
// 删除功能
|
$('.delete').on('click', function() {
|
swal({
|
title : '确定要删除么?',
|
text : "删除之后无法恢复!",
|
type : 'warning',
|
showCancelButton : true,
|
confirmButtonText : '删除',
|
cancelButtonText : '取消',
|
padding : '2em'
|
}).then(function(result) {
|
if (result.value) {
|
//获取选中数据
|
var checkVal = [];
|
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/iconManagement_delete.do",
|
data : {
|
checkVal : checkVal.toString()
|
},
|
dataType : "json"
|
});
|
swal({
|
title : "Deleted!",
|
text : "删除成功!",
|
type : "success",
|
showCancelButton : false,
|
showConfirmButton : false,
|
buttons : false
|
})
|
setTimeout("window.location.reload()", 1000);
|
} else {
|
swal('删除失败!', '请先选择删除的内容', 'error')
|
}
|
}
|
})
|
});
|
$(".reset").click(function() {
|
setTimeout("window.location.reload()", 1000);
|
});
|
</script>
|
</body>
|
</html>
|