199 lines
7.8 KiB
Plaintext
199 lines
7.8 KiB
Plaintext
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|||
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
|
|||
|
|
<%@page import="java.util.Date" %>
|
|||
|
|
<%@page import="java.text.SimpleDateFormat" %>
|
|||
|
|
<%@ page import="com.sipai.tools.SessionManager"%>
|
|||
|
|
<%
|
|||
|
|
SessionManager sessionManager = new SessionManager();
|
|||
|
|
%>
|
|||
|
|
<%String contextPath = request.getContextPath();%>
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<jsp:include page="inc.jsp"></jsp:include>
|
|||
|
|
<%-- 引入EasyUI Portal插件 --%>
|
|||
|
|
<link rel="stylesheet" href="<%=contextPath%>/JS/jquery-easyui-portal/portal.css" type="text/css"/>
|
|||
|
|
<script type="text/javascript" src="<%=contextPath%>/JS/jquery-easyui-portal/jquery.portal.js" charset="utf-8"></script>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var panels ;
|
|||
|
|
function getCookie(name){
|
|||
|
|
var cookies = document.cookie.split(';');
|
|||
|
|
if (!cookies.length) return '';
|
|||
|
|
for(var i=0; i<cookies.length; i++){
|
|||
|
|
var pair = cookies[i].split('=');
|
|||
|
|
if ($.trim(pair[0]) == name){
|
|||
|
|
return $.trim(pair[1]);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return '';
|
|||
|
|
}
|
|||
|
|
function getPanelOptions(id){
|
|||
|
|
for(var i=0; i<panels.length; i++){
|
|||
|
|
if (panels[i].id == id){
|
|||
|
|
return panels[i];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return undefined;
|
|||
|
|
}
|
|||
|
|
function getPortalState(){
|
|||
|
|
var aa = [];
|
|||
|
|
for(var columnIndex=0; columnIndex<2; columnIndex++){
|
|||
|
|
var cc = [];
|
|||
|
|
var panels = $('#pp').portal('getPanels', columnIndex);
|
|||
|
|
for(var i=0; i<panels.length; i++){
|
|||
|
|
cc.push(panels[i].attr('id'));
|
|||
|
|
}
|
|||
|
|
aa.push(cc.join(','));
|
|||
|
|
}
|
|||
|
|
return aa.join(':');
|
|||
|
|
}
|
|||
|
|
function addPanels(portalState){
|
|||
|
|
var columns = portalState.split(':');
|
|||
|
|
for(var columnIndex=0; columnIndex<columns.length; columnIndex++){
|
|||
|
|
var cc = columns[columnIndex].split(',');
|
|||
|
|
for(var j=0; j<cc.length; j++){
|
|||
|
|
var options = getPanelOptions(cc[j]);
|
|||
|
|
if (options){
|
|||
|
|
var p = $('<div/>').attr('id',options.id).appendTo('body');
|
|||
|
|
p.panel(options);
|
|||
|
|
$('#pp').portal('add',{
|
|||
|
|
panel:p,
|
|||
|
|
columnIndex:columnIndex
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
window.onresize = changesize;
|
|||
|
|
var firstOnResizeFire = true;//谷歌浏览器onresize事件会执行2次,这里加个标志位控制
|
|||
|
|
function changesize(){
|
|||
|
|
if (firstOnResizeFire) {
|
|||
|
|
firstOnResizeFire = false;
|
|||
|
|
$('#pp').portal('resize');
|
|||
|
|
//$('#pp').height=556;
|
|||
|
|
//0.5秒之后将标志位重置(Chrome的window.onresize默认执行两次)
|
|||
|
|
setTimeout(function() {
|
|||
|
|
firstOnResizeFire = true;
|
|||
|
|
}, 500);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
$(document).ready(function(){
|
|||
|
|
var clientHeight=$(window).height()-40;
|
|||
|
|
panels = [
|
|||
|
|
{id:'p1',title:'生产信息',height:clientHeight,collapsible:true,href:ext.contextPath+"/work/scadaPic/showWorkShopInfos.do"},
|
|||
|
|
{id:'p2',title:'待办',height:clientHeight/2-5,collapsible:true,href:ext.contextPath+"/activiti/workflow/taskList4main.do"},
|
|||
|
|
{id:'p3',title:'消息',height:clientHeight/2-5,collapsible:true,href:ext.contextPath+"/msg/showMsgrecv4main.do"}
|
|||
|
|
];
|
|||
|
|
$('#pp').portal({
|
|||
|
|
onStateChange:function(){
|
|||
|
|
var state = getPortalState();
|
|||
|
|
var date = new Date();
|
|||
|
|
date.setTime(date.getTime() + 24*3600*1000);
|
|||
|
|
document.cookie = 'portal-state='+state+';expires='+date.toGMTString();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
var state = getCookie('portal-state');
|
|||
|
|
if (!state){
|
|||
|
|
state = 'p1:p2,p3'; // the default portal state
|
|||
|
|
}
|
|||
|
|
addPanels(state);
|
|||
|
|
|
|||
|
|
$('#pp').portal('resize');
|
|||
|
|
|
|||
|
|
grid = $('#grid').datagrid({
|
|||
|
|
title : '',
|
|||
|
|
url : ext.contextPath + '/msg/getMsgrecv.do',
|
|||
|
|
striped : true,
|
|||
|
|
rownumbers : true,
|
|||
|
|
pagination : true,
|
|||
|
|
ctrlSelect:true,
|
|||
|
|
singleSelect: false,
|
|||
|
|
selectOnCheck: false,
|
|||
|
|
checkOnSelect: false,
|
|||
|
|
idField : 'id',
|
|||
|
|
pageSize : 50,
|
|||
|
|
pageList : [ 20, 50, 100],
|
|||
|
|
rowStyler: function(index,row){
|
|||
|
|
if (row.mrecv!=null){
|
|||
|
|
//必须两个if这样写
|
|||
|
|
if(row.mrecv[0].status=='U'){
|
|||
|
|
return 'font-weight:bold;';
|
|||
|
|
}else{
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
columns : [ [
|
|||
|
|
{checkbox:true , field : 'ck'},
|
|||
|
|
{width : '100', title : '类型', field : 'typename', sortable : true, halign:'center',formatter:function(value){
|
|||
|
|
if(value!=null){
|
|||
|
|
return value.name;
|
|||
|
|
}else{
|
|||
|
|
return value;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{width : '160', title : '内容', field : 'content', sortable : true, halign:'center'},
|
|||
|
|
{width : '80', title : '发送人', field: 'susername', sortable : true, halign:'center',formatter:function(value){
|
|||
|
|
if(value!=null){
|
|||
|
|
return value.caption;
|
|||
|
|
}else{
|
|||
|
|
return value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
{width : '160', title : '发送时间', field : 'sdt', sortable : true, halign:'center',formatter:function(value){
|
|||
|
|
return value.substring(0,19);
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{width : '80', title : '已读状态', field : 'mrecv', sortable : true, halign:'center',formatter:function(value){
|
|||
|
|
if(value[0].status=="U"){
|
|||
|
|
return "未读";
|
|||
|
|
}else{
|
|||
|
|
return "已读";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{title : '操作', field : 'action', width : '90', halign:'center', align:'center', formatter : function(value, row) {
|
|||
|
|
var str = '';
|
|||
|
|
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/> ';
|
|||
|
|
//str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/> ';
|
|||
|
|
<%if (sessionManager.havePermission(session,"msg/deleteMsgRecv.do")) {%>
|
|||
|
|
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
|||
|
|
<%}%>
|
|||
|
|
return str;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
] ],
|
|||
|
|
toolbar : '#toolbar',
|
|||
|
|
onLoadSuccess : function(data) {
|
|||
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
function doviewop(o){
|
|||
|
|
top.addTab("","收消息","msgaction.do?method=doview&id="+o);
|
|||
|
|
}
|
|||
|
|
function dofirstviewop(o){
|
|||
|
|
top.addTab("","收消息","msgaction.do?method=dofirstview&id="+o);
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
</head>
|
|||
|
|
<body style="overflow-x:hidden;">
|
|||
|
|
<div id="showdiv" ></div>
|
|||
|
|
<div id="pp" style="position:relative;border:1px solid #ffffff;">
|
|||
|
|
<div style="width:65%"></div>
|
|||
|
|
<div style="width:35%"></div>
|
|||
|
|
</div>
|
|||
|
|
</body>
|
|||
|
|
</html>
|