<%@ 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;
|
}
|
|
/* .drop {
|
width:300px;
|
height:auto;
|
margin:100px auto;
|
} */
|
.drop-header {
|
width:100%;
|
padding:5px 10px;
|
border:#1b2e4b 1px solid;
|
border-radius:6px;
|
word-wrap:break-word;
|
min-height:37px;
|
background: #1b2e4b;
|
}
|
.drop-header span {
|
position:relative;
|
display:inline-block;
|
padding-right:5px;
|
padding-left:5px;
|
margin:1px 5px 1px;
|
line-height:20px;
|
background-color:#a9a9a9;
|
color:#fff;
|
cursor:pointer;
|
}
|
.drop-dwon {
|
position:absolute;
|
width:100%;
|
height:auto;
|
line-height:25px;
|
border:#c7c7c7 1px solid;
|
box-shadow:#c7c7c7 1px 1px 4px;
|
max-height:200px;
|
overflow-y:auto;
|
overflow-x:hidden;
|
}
|
.drop-dwon li {
|
padding:5px 10px;
|
cursor:pointer;
|
/* color: #F0F0F0;
|
background-color: black; */
|
}
|
.drop-dwon li:hover,.drop-dwon li.active:hover {
|
color:#fff;
|
background-color:#18717b;
|
}
|
.drop-dwon li.active {
|
color:#fff;
|
background-color:#07a4b5;
|
}
|
</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 -->
|
<!-- 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="width: 60%;margin:0 auto;">
|
<label for="exampleFormControlInput1">任务名称:</label>
|
<input type="text" id="name" class="form-control"
|
aria-label="Username" aria-describedby="basic-addon1"
|
style="width: 50%">
|
<br>
|
<label for="exampleFormControlInput1">地图选择:</label>
|
<select id="mapname" class="form-control form-control-lg"
|
style="width: 50%;font-size: 15px; padding: 0.25rem 1.25rem;" onchange="mapselection(value)">
|
<c:forEach items="${mapList}" var="map">
|
<option value="${map.floor}">${map.mapname}</option>
|
</c:forEach>
|
</select>
|
<br>
|
<label for="exampleFormControlInput1" id="fencelabel" style="display: none;">围栏选择:</label>
|
<div class="drop" id="drop" style="width:50%;height:auto;"></div>
|
<br>
|
<label for="exampleFormControlInput1">紧急联系电话:</label>
|
<input type="text" id="phone" class="form-control"
|
aria-label="Username" aria-describedby="basic-addon1"
|
style="width: 50%;">
|
<br>
|
<button type="button" class="btn btn-secondary initModify"
|
data-toggle="modal" data-target=".modifyNew"
|
id="modifyButton">下一步</button>
|
<br>
|
</div>
|
</table>
|
</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"); 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%>">
|
<!-- END MAIN CONTAINER -->
|
<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");
|
var superuser = document.getElementById("superuser").value;
|
var deleteq = document.getElementById("deleteq").value;
|
var alertq = document.getElementById("alertq").value;
|
var deleteall = document.getElementById("deleteall").value;
|
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');
|
// 修改功能初始化
|
$('.initModify').on('click', function () {
|
var name = $("#name").val();
|
var phone = $("#phone").val();
|
var span = document.getElementsByTagName("span");
|
var texts = []
|
for (let i = 0; i < span.length; i++) {
|
var text = span[i].innerText;
|
texts.push(text)
|
}
|
$.ajax({
|
url: "/hxzkoa/saveFence3.do",
|
type: "POST",
|
dataType: "JSON",
|
data: {
|
floor: floor,
|
type: type,
|
baoliu2: baoliu2,
|
name: name,
|
zuobiao: zuobiao,
|
shape: shape,
|
start: start,
|
stop: stop,
|
color: color,
|
baoliu3: baoliu3,
|
baoliu4: baoliu4,
|
baoliu1: baoliu1,
|
bumen: bumen
|
}
|
})
|
});
|
|
//地图选择事件
|
function mapselection(value){
|
$("#mapname").attr("disabled","disabled");
|
$("#fencelabel").css({"display":""})
|
$.ajax({
|
url:"/hxzkoa/getMapFence.do",
|
type:"POST",
|
dataType:"JSON",
|
data:{
|
value:value
|
},
|
success:function(data){
|
var myData = {};
|
for (var k in data.fenceList) {
|
var str = {val:data.fenceList[k].name};
|
myData.k = str;
|
}
|
dropDwon({id:"drop",myData:myData})
|
}
|
})
|
}
|
|
//围栏多选框
|
function dropDwon(option) {
|
function drop(def) {
|
this.name = def.id;
|
this.init();
|
};
|
drop.prototype = {
|
init: function() {
|
this.list();
|
this.myClick();
|
this.callBack();
|
},
|
//添加下拉框到页面中
|
list: function() {
|
var id = '#' + this.name;
|
var header = '<div class="drop-header" type="' + def.type + '"></div>';
|
//默认下拉框选项
|
$(id).append(header);
|
if (def.type == 'single') {
|
for (var key in def.myData) {
|
if (def.myData[key].selected == true) {
|
var headerTxt = def.myData[key].val;
|
$(id).find('.drop-header').text(headerTxt)
|
};
|
};
|
};
|
var newPo = $(id).offset();
|
var newW = parseInt($(id).css('width'));
|
var newH = parseInt($(id).css('height'));
|
$('.drop-dwon').css({
|
width: newW + 'px',
|
top: newPo.top + newH + 'px',
|
left: newPo.left + 'px'
|
});
|
},
|
//下拉框点击事件
|
myClick: function() {
|
var self = this;
|
var name = this.name;
|
var id = '#' + this.name;
|
$(id).click(function(e) {
|
e.stopPropagation();
|
$('.drop-dwon').remove();
|
var _this = $(this);
|
var lists, drop;
|
lists = '';
|
for (var key in def.myData) {
|
lists += '<li value="' + key + '" sel="">' + def.myData[key].val + '</li>';
|
};
|
var drop = '<ul class="drop-dwon" id="' + name + 'con" style="background-color: black;color: #F0F0F0;">' + lists + '</ul>';
|
$('body').append(drop);
|
self.position('.drop-dwon');
|
//改变屏幕宽度的时候,重新计算下拉框内容的位置
|
window.onresize = function() {
|
self.position('.drop-dwon');
|
};
|
if (def.type == 'sigle') {
|
self.sinClick();
|
} else if (def.type == 'multi') {
|
self.mltClick();
|
}
|
});
|
},
|
//计算下拉框内容的位置
|
position: function(obj) {
|
var id = '#' + this.name;
|
var myPo = $(id).offset();
|
var myW = parseInt($(id).css('width'));
|
var myH = parseInt($(id).css('height')) - 1;
|
$(obj).css({
|
top: myPo.top + myH + 'px',
|
left: myPo.left + 'px',
|
width: myW + 'px',
|
});
|
},
|
sinClick: function() {
|
var name = this.name;
|
var id = '#' + name + 'con';
|
$(id).on('click', 'li', function(e) {
|
e.stopPropagation();
|
$('#' + name).find('.drop-header').text($(this).text())
|
});
|
$(document).click(function() {
|
$(id).remove();
|
});
|
},
|
mltClick: function() {
|
var self = this;
|
var name = this.name;
|
var id = '#' + name + 'con';
|
var header = $('#' + name).find('.drop-header');
|
$(id).on('click', 'li', function(e) {
|
e.stopPropagation();
|
var sel = $(this).attr('sel');
|
if (sel == 'true') {
|
$(this).removeClass('active');
|
$(this).attr('sel', false);
|
var rem = $(this).attr('value');
|
header.find('span').each(function() {
|
if ($(this).attr('vel') == rem) {
|
$(this).remove();
|
};
|
});
|
} else {
|
$(this).addClass('active');
|
$(this).attr('sel', true);
|
var txt = '<span vel="' + $(this).attr('value') + '">' + $(this).text() + '</span>';
|
header.append(txt);
|
};
|
self.position('.drop-dwon');
|
self.mtlRemove();
|
});
|
$(document).click(function() {
|
$(id).remove();
|
});
|
},
|
mtlRemove: function() {
|
var self = this;
|
var name = this.name;
|
var id = '#' + name;
|
$(id + ' ' + 'span').click(function(e) {
|
e.stopPropagation();
|
var _this = $(this);
|
var vle = _this.attr('vel');
|
_this.remove();
|
$(id + 'con li').each(function() {
|
var vleLi = $(this).attr('value');
|
console.log(vleLi)
|
if (vleLi == vle) {
|
$(this).removeClass('active');
|
$(this).attr('sel', false);
|
};
|
});
|
self.position('.drop-dwon');
|
});
|
},
|
callBack: function() {
|
def.callBack();
|
}
|
};
|
var def = {
|
type: 'multi', //multi:多选;sigle:单选
|
myData: {
|
name1: {
|
val: '默认选中',
|
selected: true,
|
},
|
name2: {
|
val: '下拉1',
|
},
|
name3: {
|
val: '下拉2'
|
},
|
name4: {
|
val: '下拉3'
|
},
|
},
|
};
|
def = $.extend(def, option);
|
new drop(def);
|
}
|
|
$(".table tbody").on('click', 'tr', function (e) {
|
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>
|