522 lines
16 KiB
Plaintext
522 lines
16 KiB
Plaintext
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||
<%@page import="java.util.Date" %>
|
||
<%@page import="java.text.SimpleDateFormat" %>
|
||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||
<%
|
||
SessionManager sessionManager = new SessionManager();
|
||
%>
|
||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||
|
||
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<title></title>
|
||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
|
||
<style>
|
||
/* * {
|
||
padding: 0;
|
||
margin: 0;
|
||
list-style: none;
|
||
}
|
||
|
||
header {
|
||
background: #f7483b;
|
||
border-bottom: 1px solid #ccc
|
||
}
|
||
|
||
header h2 {
|
||
text-align: center;
|
||
line-height: 54px;
|
||
font-size: 16px;
|
||
color: #fff
|
||
} */
|
||
|
||
.list-ul {
|
||
overflow: hidden
|
||
}
|
||
|
||
.list-li {
|
||
line-height: 40px;
|
||
border-bottom: 1px solid #e1e1e1;
|
||
position: relative;
|
||
padding: 0 12px;
|
||
color: #666;
|
||
background: #ffffff;
|
||
-webkit-transform: translateX(0px);
|
||
}
|
||
|
||
.btn1 {
|
||
position: absolute;
|
||
top: 0;
|
||
bottom:0;
|
||
right: -80px;
|
||
text-align: center;
|
||
background: #ff0000;
|
||
color: #fff;
|
||
width: 80px
|
||
}
|
||
.main-header{display:none;}
|
||
.content-header{display:none;}
|
||
.main-footer{display:none;}
|
||
</style>
|
||
<script type="text/javascript">
|
||
let timer = null
|
||
let startTime = ''
|
||
let endTime = ''
|
||
var label = document.getElementById("listdiv");
|
||
|
||
var touchStart;
|
||
var touchMove;
|
||
var touchEnd;
|
||
label.oncontextmenu = function(e){
|
||
return false;
|
||
}
|
||
label.addEventListener('touchstart', function (event) {
|
||
//event.preventDefault();
|
||
startTime = +new Date()
|
||
var touch = event.targetTouches[0];
|
||
touchStart = touch.pageY;
|
||
timer = setTimeout(function () {
|
||
|
||
}, 1000)
|
||
});
|
||
label.addEventListener('touchmove', function (event) {
|
||
var touch = event.targetTouches[0];
|
||
touchMove = touch.pageY;//移动的距离
|
||
});
|
||
label.addEventListener("click", function (event) {
|
||
startTime = +new Date()
|
||
endTime = +new Date()
|
||
//alert(endTime-startTime);
|
||
clearTimeout(timer)
|
||
var obj = event.target;
|
||
var id = obj.id;
|
||
//alert(endTime-startTime);
|
||
/* if (endTime - startTime > 500) {
|
||
// 处理点击事件
|
||
deleteFun(id);
|
||
} */
|
||
if(endTime - startTime <100){
|
||
//滚动触摸不执行查看方法
|
||
if(touchMove>0){
|
||
|
||
}else{
|
||
|
||
if(obj.id=='next'){
|
||
next();
|
||
}
|
||
else if(obj.id=='last'){
|
||
last();
|
||
}
|
||
else if(obj.id=='loadmore'){
|
||
}else{
|
||
|
||
editFun(id);
|
||
}
|
||
}
|
||
|
||
}
|
||
touchMove=0;
|
||
});
|
||
label.addEventListener('touchend', function (event) {
|
||
endTime = +new Date()
|
||
clearTimeout(timer)
|
||
var obj = event.target;
|
||
var id = obj.id;
|
||
//alert(endTime-startTime);
|
||
if (endTime - startTime > 500) {
|
||
// 处理点击事件
|
||
event.preventDefault();
|
||
deleteFun(id);
|
||
}
|
||
/* if(endTime - startTime <500){
|
||
//滚动触摸不执行查看方法
|
||
if(touchMove>0){
|
||
|
||
}else{
|
||
if(obj.id=='next'){
|
||
next();
|
||
}
|
||
else if(obj.id=='last'){
|
||
last();
|
||
}
|
||
else if(obj.id=='loadmore'){
|
||
}else{
|
||
editFun(id);
|
||
}
|
||
}
|
||
|
||
}
|
||
touchMove=0; */
|
||
});
|
||
|
||
|
||
var init = function() {
|
||
$("#status").select2({
|
||
ajax: {
|
||
type:'POST',
|
||
url: ext.contextPath +'/msg/getListForSelect.do',
|
||
dataType: 'json',
|
||
delay: 250,
|
||
processResults: function (data) {
|
||
return {
|
||
results: data
|
||
}
|
||
},
|
||
cache: true
|
||
},
|
||
placeholder:'全部',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: -1,//禁用搜索框
|
||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||
});
|
||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||
|
||
};
|
||
$(function() {
|
||
var flag = IsApp();
|
||
if (flag==true){
|
||
|
||
}else{
|
||
$(".main-header").show();
|
||
$(".content-header").show();
|
||
$(".main-footer").show();
|
||
}
|
||
init();
|
||
dosearch();
|
||
});
|
||
/* var addFun = function() {
|
||
$.post(ext.contextPath + '/work/group/add.do', {} , function(data) {
|
||
$("#subDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
}; */
|
||
var editFun = function(id) {
|
||
$.post(ext.contextPath + '/msg/viewMsgRecv.do', {id:id} , function(data) {
|
||
$("#subDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
};
|
||
var deleteFun = function(id) {
|
||
swal({
|
||
text: "您确定要删除此记录?",
|
||
dangerMode: true,
|
||
buttons: {
|
||
cancel: {
|
||
text: "取消",
|
||
value: null,
|
||
visible: true,
|
||
className: "btn btn-default btn-sm",
|
||
closeModal: true,
|
||
},
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-danger btn-sm",
|
||
closeModal: true
|
||
}
|
||
}
|
||
})
|
||
.then(function(willDelete) {
|
||
if (willDelete) {
|
||
$.post(ext.contextPath + '/msg/deleteMsgRecv.do', {id : id}, function(data) {
|
||
if(data==1){
|
||
$.post(ext.contextPath + '/msg/getMsgrecv.do', {} , function(data) {
|
||
//alert(data);
|
||
if(data){
|
||
//closeModal('subModal');
|
||
document.getElementById("listdiv").innerHTML = data;
|
||
}
|
||
});
|
||
}else{
|
||
showAlert('d','删除失败','mainAlertdiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
};
|
||
|
||
|
||
var deletesFun = function() {
|
||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||
var datas="";
|
||
$.each(checkedItems, function(index, item){
|
||
if(datas!=""){
|
||
datas+=",";
|
||
}
|
||
datas+=item.id;
|
||
});
|
||
if(datas==""){
|
||
showAlert('d','请先选择记录','mainAlertdiv');
|
||
}else{
|
||
swal({
|
||
text: "您确定要删除此记录?",
|
||
dangerMode: true,
|
||
buttons: {
|
||
cancel: {
|
||
text: "取消",
|
||
value: null,
|
||
visible: true,
|
||
className: "btn btn-default btn-sm",
|
||
closeModal: true,
|
||
},
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-danger btn-sm",
|
||
closeModal: true
|
||
}
|
||
}
|
||
})
|
||
.then(function(willDelete) {
|
||
if (willDelete) {
|
||
$.post(ext.contextPath + '/msg/deleteMsgRecvs.do', {ids:datas} , function(data) {
|
||
if(data>0){
|
||
$("#table").bootstrapTable('refresh');
|
||
}else{
|
||
showAlert('d','删除失败','mainAlertdiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
}
|
||
};
|
||
//标记为已读
|
||
var updateStatusFun = function() {
|
||
swal({
|
||
text: "您确定要全部标记已读?",
|
||
dangerMode: true,
|
||
buttons: {
|
||
cancel: {
|
||
text: "取消",
|
||
value: null,
|
||
visible: true,
|
||
className: "btn btn-default btn-sm",
|
||
closeModal: true,
|
||
},
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-danger btn-sm",
|
||
closeModal: true
|
||
}
|
||
}
|
||
})
|
||
.then(function(willDelete) {
|
||
if (willDelete) {
|
||
viewAllMsgRecv();
|
||
}})
|
||
/* var checkedItems;
|
||
var datas="";
|
||
var nameattr = "";
|
||
var list = request.get
|
||
$("#listul li").each(function(i) {
|
||
var id = $(this).attr("id");
|
||
if(datas!=""){
|
||
datas+=",";
|
||
}
|
||
datas+=id;
|
||
});
|
||
if(datas==""){
|
||
showAlert('d','无记录','mainAlertdiv');
|
||
}else{
|
||
viewMsgRecv(datas);
|
||
} */
|
||
};
|
||
function viewMsg(id,content){
|
||
swal({
|
||
title:'消息',
|
||
text: content,
|
||
dangerMode: true,
|
||
buttons: {
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-info",
|
||
closeModal: true
|
||
}
|
||
}
|
||
});
|
||
viewMsgRecv(id);
|
||
}
|
||
/* function viewMsgRecv(id){
|
||
$.post(ext.contextPath + '/msg/updateMsgRecvStatus.do', {ids:id} , function(data) {
|
||
if(data.res){
|
||
$("#table").bootstrapTable('refresh');
|
||
}
|
||
},'json');
|
||
} */
|
||
function viewMsgRecv(id){
|
||
$.post(ext.contextPath + '/msg/updateMsgRecvStatus.do', {ids:id} , function(data) {
|
||
if(data.res){
|
||
$("#table").bootstrapTable('refresh');
|
||
}
|
||
},'json');
|
||
}
|
||
function viewAllMsgRecv(){
|
||
$.post(ext.contextPath + '/msg/updateMsgRecvStatus.do', {} , function(data) {
|
||
if(data.res){
|
||
$.post(ext.contextPath + '/msg/getMsgrecv.do', {} , function(data) {
|
||
//alert(data);
|
||
if(data){
|
||
document.getElementById("listdiv").innerHTML = data;
|
||
}
|
||
});
|
||
}
|
||
},'json');
|
||
}
|
||
/* var dosearch = function() {
|
||
$("#table").bootstrapTable('refresh');
|
||
}; */
|
||
|
||
var dosearch = function dosearch() {
|
||
var st = document.getElementById("status").value;
|
||
var sc = document.getElementById("search_content").value;
|
||
//var pg = document.getElementById("page").value;
|
||
var pg=1;
|
||
$.post(ext.contextPath + '/msg/getMsgrecv.do', {status:st,search_content:sc,page:pg} , function(data) {
|
||
//alert(data);
|
||
if(data){
|
||
document.getElementById("listdiv").innerHTML = data;
|
||
}
|
||
});
|
||
};
|
||
|
||
var next = function() {
|
||
var st = document.getElementById("status").value;
|
||
var sc = document.getElementById("search_content").value;
|
||
if(document.getElementById("pageNum") ==null){
|
||
var pgn=1;
|
||
|
||
}else{
|
||
var pgn = parseInt(document.getElementById("pageNum").value);
|
||
}
|
||
|
||
var pg = parseInt(document.getElementById("pages").value);
|
||
if(pgn<pg){
|
||
pgn=pgn+1;
|
||
$.post(ext.contextPath + '/msg/getMsgrecv.do', {status:st,search_content:sc,page:pgn} , function(data) {
|
||
//alert(data);
|
||
if(data){
|
||
document.getElementById("listdiv").innerHTML = data;
|
||
}
|
||
});
|
||
}
|
||
};
|
||
var last = function() {
|
||
var st = document.getElementById("status").value;
|
||
var sc = document.getElementById("search_content").value;
|
||
if(document.getElementById("pageNum") !=null){
|
||
var pgn = parseInt(document.getElementById("pageNum").value);
|
||
pgn=pgn-1;
|
||
if(pgn<=1){
|
||
pgn=1;
|
||
}
|
||
}else{
|
||
var pgn = 1;
|
||
}
|
||
$.post(ext.contextPath + '/msg/getMsgrecv.do', {status:st,search_content:sc,page:pgn} , function(data) {
|
||
//alert(data);
|
||
if(data){
|
||
document.getElementById("listdiv").innerHTML = data;
|
||
}
|
||
});
|
||
};
|
||
|
||
</script>
|
||
</head>
|
||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini" id="body">
|
||
<div class="wrapper">
|
||
<!-- 引用top -->
|
||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||
<!-- 菜单栏 -->
|
||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||
<div class="content-wrapper">
|
||
<!-- Content Header (Page header) -->
|
||
<section class="content-header">
|
||
<h1 id ="head_title"></h1>
|
||
<ol class="breadcrumb">
|
||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||
<!-- <li class="active">Here</li> -->
|
||
</ol>
|
||
</section>
|
||
<!-- Main content -->
|
||
<section class="content container-fluid">
|
||
<div id="mainAlertdiv"></div>
|
||
<div id="subDiv"></div>
|
||
<div id="menu4SelectDiv"></div>
|
||
<div >
|
||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||
<button type="button" class="btn btn-default" onclick="updateStatusFun();"><i class="fa fa-tags"></i> 全部标记为已读</button>
|
||
<!-- <button type="button" class="btn btn-default " onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button> -->
|
||
|
||
</div>
|
||
<br>
|
||
<div class="form-group pull-right form-inline" >
|
||
<div class="input-group input-group-sm pull-left">
|
||
<select class="form-control select2 pull-left" id="status" name ="status" style="width: 120px;" onchange="dosearch()">
|
||
|
||
</select>
|
||
</div>
|
||
|
||
<div class="input-group input-group-sm pull-left" style="width: 250px;">
|
||
<input type="text" id="search_content" name="search_content" class="form-control " placeholder="内容">
|
||
<div class="input-group-btn">
|
||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-lg-12 col-xs-12 " style="padding:0px;margin-left:0px;margin-right:0px" id="listdiv">
|
||
|
||
</div>
|
||
|
||
</section>
|
||
<%-- <section class="list1" >
|
||
|
||
<ul class="list-ul products-list product-list-in-box">
|
||
<c:forEach var="current" items="${list }">
|
||
|
||
<li id="li" class="list-li">
|
||
<div class="product-img">
|
||
<img
|
||
src="<%=request.getContextPath()%>/plugins/AdminLTE/img/avatar2.png"
|
||
alt="Product Image">
|
||
</div>
|
||
<div class="con product-info">
|
||
<a href="javascript:void(0)" class="product-title"> <c:if
|
||
test="${!empty current.typename}">${current.typename.name }
|
||
</c:if> <c:if test="${empty current.typename}">--
|
||
</c:if> <span class="label label-success pull-right">${fn:substring(current.sdt,0,10) }</span></a>
|
||
<span class="product-description"> ${current.content } </span>
|
||
</div>
|
||
|
||
<div class="btn1">删除</div>
|
||
</li>
|
||
</c:forEach>
|
||
</ul>
|
||
<!-- /.box-body -->
|
||
<div class="box-footer text-center">
|
||
<a href="javascript:void(0)" class="uppercase">View All Products</a>
|
||
</div>
|
||
<!-- /.box-footer -->
|
||
</section> --%>
|
||
</div>
|
||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||
</div>
|
||
</body>
|
||
</html> |