| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <%@ page contentType="text/html;charset=GBK"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html>
- <head>
- <Title>收件箱</Title>
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript">
- <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript" src="/shares/js/yw/master1_oa/mail/mail.js"></script>
- <style type="text/css">
- .loading{ font-size:12px;height:16px;line-height:16px;}
- .loading img{width:16px;height:16px;margin-right:5px;}
- .l-button{margin-left:10px;}
- #layout1{width:99.5%;margin:0; padding:0;}
- img{vertical-align:middle;}
- </style>
- <script type="text/javascript">
- var grid;
- $(function () {
- if(haveDefUser("${mailUser.userName}")){
- $("#layout1").ligerLayout({
- leftWidth : 200,
- height : '99%'
- });
- grid = $("#maingrid4").ligerGrid({
- columns: [
- { display: '', name: 'state',width:"6%",
- render:function(row){
- var html = '';
- /* var t = row.is_read == "0" ? "0" : "-16px";
- html += '<span style="width: 18px;height: 16px;background:url(/shares/images/oa/mail/mail_icon.png) -48px '+t+' no-repeat;"></span>';
- t = row.contain_attach == "1" ? "background:url(/shares/images/oa/mail/paperclip.gif) no-repeat;" : "";
- html += '<span style="width: 18px;height: 16px;'+t+'"></span>'; */
-
- if(row.is_read == "1"){
- html += "<img src='/shares/images/oa/mail/mail_read.png' />";
- }else{
- html += "<img src='/shares/images/oa/mail/mail_unread.png' />";
- }
- if(row.contain_attach == "1"){
- html += " <img src='/shares/images/oa/mail/paperclip.gif' />";
- }
-
- return html;
- }
- },
- { display: '标题', name: 'mail_subject',align:"left", width: "50%",
- render:function(row){
- var mail_subject = row.mail_subject;
- if(mail_subject == null || mail_subject == '' || mail_subject == 'null'){
- mail_subject = '(无标题)';
- }
- var html = '<a href="javascript:void(0);" onclick="show(\''+row.universalid+'\');">'+mail_subject+"</a>";
- return html;
- }},
- { display: '发件人', name: 'mail_sender',align:"left", width: "22%"},
- { display: '日期', name: 'mail_send_date', width: "15%",
- render:function(row){
- // 如果是当天,则只显示时间
- var d = row.mail_send_date.substring(0,10);
- if(d == getCurentDate()){
- return row.mail_send_date.substring(10,16);
- }else{
- return d;
- }
- }}
- ],
- pageSize:20,
- url: 'MTMailAction.do?task=listMail&box=${box}&time=' + new Date().getTime(),
- pageParmName: 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName: 'pSize', //页记录数参数名,(提交给服务器)
- width: '99.9%',
- height: '99%',
- rowAttrRender: function(rowdata,rowid)
- {
- var style= ''; //'style="cursor: pointer;';
- if(rowdata.is_read == '0'){
- style += 'style="font-weight: bold;" ';
- }
- return style; // + '"';
- },
- checkbox: true,
- onAfterShowData:refreshBtn
- });
- $("#pageloading").hide();
-
- showBoxMailCount();
- }
- });
- function refreshBtn(data){
- if(data == undefined || data.Rows.length == 0){
- $("#maingrid4").find("div[class*='l-grid-body']:last").html("<div style='padding-top:50px;width:100%;text-align:center'>没有查询到相关信息……</div>");
- }
- }
- /**
- * 获取选择的行
- */
- function getCheckedData()
- {
- var rows = grid.getCheckedRows();
- var str = "";
- $(rows).each(function ()
- {
- if(str != "") str += ",";
- str += this.universalid;
- });
- // alert(str);
- return str;
- }
- /**
- * 删除
- */
- function delMail(){
- var str = getCheckedData();
- if(str == ""){
- $.ligerDialog.warn("请选择您要删除的邮件!");
- return;
- }
- if("${box}" == "delbox"){
- // 如果是垃圾箱的邮件,则永久删除
- $.ligerDialog.confirm('所选择的邮件将被永久删除,确定要继续吗?', function (yes) {
- if(yes){
- location.href = "${pageContext.request.contextPath }/MTMailAction.do?task=delMail&ids="+str+"&box=${box}";
- }
- });
- }else{
- // 移动到垃圾箱
- $.ligerDialog.confirm('确定要删除所选择的邮件吗?', function (yes) {
- if(yes){
- location.href = "${pageContext.request.contextPath }/MTMailAction.do?task=move&ids="+str+"&newbox=delbox&box=${box}";
- }
- });
- }
- }
- /**
- * 查询
- */
- function searchByKword(){
- grid.set("parms", [{
- name : "mail_subject",
- value : encodeURI(encodeURI($("#mail_subject").val()))
- }
- ]);
- grid.set("newPage", "1");
- grid.loadData(true);
- }
- /**
- * 写邮件
- */
- function sendMail(){
- location.href = '${pageContext.request.contextPath }/MTMailAction.do?task=toSend';
- }
- /**
- * 收件
- */
- function receive(){
- $("#wait").show();
- $("#btnReceive").attr("disabled","disabled");
- $.ajax({
- type:"POST",
- url:"${pageContext.request.contextPath }/MTMailAction.do?task=receive",
- timeout:600000,
- cache:false,
- dataType:"json",
- success:function(data){
- var result = data.result;
- if(result != "1"){
- $.ligerDialog.warn("对不起,无法连接邮件服务器!请检查网络或个人邮件配置!");
- }else{
- toMailList('');
- }
- },
- complete:function(data){
- $("#wait").hide();
- $("#btnReceive").attr("disabled","");
- }
- });
- }
- /**
- * 显示文件夹的邮件数量
- */
- function showBoxMailCount(){
- $("a[box]").each(function(){
- var box = $(this).attr("box");
- $.ajax({
- type:"POST",
- url:"${pageContext.request.contextPath }/MTMailAction.do?task=getMailCount&box="+box,
- cache:false,
- dataType:"json",
- async:false,
- success:function(data){
- var count = data.count;
- if(count > 0){
- var obj = $("#mailcount_"+data.box);
- obj.text("("+count+")");
- obj.show();
-
- if(data.isDelBox == "1"){
- obj.next("a").show(); // 显示清空链接
- }
- }
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- });
- }
- /**
- * 读邮件
- */
- function show(id){
- var parm = '&id='+id+'&box=${box}&userName=${mailUser.userName}&domainName=${mailUser.domainName}';
- var task = "show";
- if("${box}" == "draftbox"){
- task = "toEdit";
- }
- location.href = '${pageContext.request.contextPath }/MTMailAction.do?task='+task+parm;
- }
- /**
- * 清空文件夹
- */
- function clearBox(box, boxName){
- $.ligerDialog.confirm("确定要清空"+boxName+"吗?", function (yes) {
- if(yes){
- location.href = '${pageContext.request.contextPath }/MTMailAction.do?task=clearDir&from=listMail&box=${box}&clearBox='+box;
- }
- });
- }
- function getCurentDate(){
- var now = new Date();
- var year = now.getFullYear(); //年
- var month = now.getMonth() + 1; //月
- var day = now.getDate(); //日
- var clock = year + "-";
- if(month < 10)
- clock += "0";
- clock += month + "-";
- if(day < 10)
- clock += "0";
- clock += day;
- return(clock);
- }
- </SCRIPT>
- </head>
- <Body>
- <div class="container-layout">
- <div id="layout1">
- <div position="left" title="${mailUser.userName}@${mailUser.domainName}" class="user-tree-style" style="height:95%">
- <div id="deptBtn">
- <input type="button" value="收取" id="btnReceive" style="width: 80px;" class="l-button" onclick="receive()"/>
- <input type="button" value="写邮件" style="width: 80px;" class="l-button" onclick="sendMail()"/>
- </div>
- <table style="width:100%;margin-top: 20px;" id="tabMailUser">
- <c:forEach var="item" items="${boxes}">
- <tr style="height: 40px;">
- <td style="padding-left:20px;font-size: 16px;vertical-align: middle;">
- <a href="javascript:void(0);"><img src="/shares/images/oa/mail/${item.code }.gif" border="0" style="vertical-align:middle;" onclick="toMailList('${item.code }')"></a>
- <a href="javascript:void(0);" style="margin-right: 20px" onclick="toMailList('${item.code }')">${item.name }</a>
- <c:if test="${item.hide_count == '0' }">
- <a href="javascript:void(0);" id="mailcount_${item.code }" box="${item.code }" style="font-size: 12px;color: red;display: none;" onclick="toMailList('${item.code }')">(${newMailCount})</a>
- </c:if>
- <a href="javascript:void(0)" style="font-size: 12px;display: none;" onclick="clearBox('${item.code}', '${item.name }')">[清空]</a>
- </td>
- </tr>
- </c:forEach>
- </table>
- <div style="position:absolute;height:30px;bottom:10px;padding-left:20px;">
- <a href="javascript:void(0)" onclick="mailConf()">
- <img src="/shares/images/oa/mail/icon_set.png"/> 邮箱配置
- </a>
- <a href="javascript:void(0)" onclick="showFolder()">
- <img src="/shares/images/oa/mail/folder.gif"/> 文件夹管理
- </a>
- </div>
- </div>
- <div position="center" title="${boxName }" class="user-tree-style">
- <div id="deptBtn" style="text-align: left;">
- <input type="button" value="删除" class="l-button" onclick="delMail();" />
- <c:if test="${box == 'delbox' }">
- <input type="button" value="清空" class="l-button" onclick="clearBox('${box}','${boxName }');" />
- </c:if>
- <span id="wait" class="loading" style="display:none;margin-left: 10px;"><img src="/shares/images/mailloading.gif"/>正在接收邮件, 请稍候...</span>
- </div>
- <div style="overflow: hidden; clear: both;">
- <div id="maingrid4" style="margin: 0; padding: 0"></div>
- </div>
- </div>
- </div>
- </div>
- <%@ include file="/include/message.jsp"%>
- </BODY>
- </HTML>
|