|
@@ -73,22 +73,41 @@
|
|
|
$(this).remove();
|
|
|
});
|
|
|
//循环遍历后台所有通知信息
|
|
|
- <c:forEach items="${oaNotifyList}" var="item" varStatus="status" >
|
|
|
- var info = '${item}';
|
|
|
+ <c:forEach items="${page}" var="item" varStatus="status" >
|
|
|
+ /*var info = '${item}';
|
|
|
//字符串转map参数
|
|
|
- var map = eval("("+info+")");
|
|
|
- if(map.type == this.value){
|
|
|
+ var map = eval("("+info+")");*/
|
|
|
+ $("#notifyClickValue").val(this.value)
|
|
|
+ if(0 === this.value){
|
|
|
var elem = $("#msg-bord .bord-right ul");
|
|
|
var xml = "";
|
|
|
if(count<8){
|
|
|
- xml ="<a href=\"javascript:void(0)\" onclick=\"homeOpenDialogView('查看公告', '${ctx}/oa/oaNotify/homeView?id="+map.id+"&readAttr=disabled','95%','95%')\" >";
|
|
|
- elem.append('<li>' + xml + "<span class=\"bord-record\" title=\""+map.title+"\">"+map.title+"</span>"+
|
|
|
- '<span class="bord-record-flag">'+ map.readFlagStr +'</span>' +
|
|
|
- '<span class="bord-record-time">' + map.updateDate + '</span></a></li>');
|
|
|
+ xml ="<a href=\"javascript:void(0)\" onclick=\"homeOpenDialogView('查看公告', '${ctx}/oa/oaNotify/homeView?id=${item.id}&readAttr=disabled','95%','95%')\" >";
|
|
|
+
|
|
|
+ elem.append('<li>' + xml + "<span class=\"bord-record-type\" title=\"${item.typeStr}\">${item.typeStr}</span><span class=\"bord-record\" title=\"${item.title}\">${item.title}</span>"+
|
|
|
+ '<span class="bord-record-flag">'+'${item.readFlagStr}'+'</span>' +
|
|
|
+ '<span class="bord-record-time">' + '<fmt:formatDate value="${item.updateDate}" pattern="yyyy-MM-dd"/>' + '</span></a></li>');
|
|
|
}
|
|
|
count ++ ;
|
|
|
+ }else{
|
|
|
+ if(${item.parentType} === this.value) {
|
|
|
+ var elem = $("#msg-bord .bord-right ul");
|
|
|
+ var xml = "";
|
|
|
+ if(count<8){
|
|
|
+ xml ="<a href=\"javascript:void(0)\" onclick=\"homeOpenDialogView('查看公告', '${ctx}/oa/oaNotify/homeView?id=${item.id}&readAttr=disabled','95%','95%')\" >";
|
|
|
+ elem.append('<li>' + xml + "<span class=\"bord-record-type\" title=\"${item.typeStr}\">${item.typeStr}</span><span class=\"bord-record\" title=\"${item.title}\">${item.title}</span>"+
|
|
|
+ '<span class="bord-record-flag">'+'${item.readFlagStr}'+'</span>' +
|
|
|
+ '<span class="bord-record-time">' + '<fmt:formatDate value="${item.updateDate}" pattern="yyyy-MM-dd"/>' + '</span></a></li>');
|
|
|
+ }
|
|
|
+ count ++ ;
|
|
|
+ }
|
|
|
}
|
|
|
+ $(".bord-record").attr("style", "width:" + ($(".border-ul").width() - 80 - 115) + "px;");
|
|
|
</c:forEach>
|
|
|
+
|
|
|
+ <c:if test="${count1 eq 0}">
|
|
|
+ hasMsg = false
|
|
|
+ </c:if>
|
|
|
})
|
|
|
|
|
|
});
|
|
@@ -632,228 +651,71 @@
|
|
|
});
|
|
|
|
|
|
}
|
|
|
- </script>
|
|
|
- <script type="text/javascript">
|
|
|
- /* $(function () {
|
|
|
- var userId = '${fns:getUser().id}';
|
|
|
- var roleId = '${fns:getUser().roleIds}';
|
|
|
- var companyId = '${fns:getUser().company.id}';
|
|
|
- var officeId ='${fns:getUser().office.id}';
|
|
|
- var type ='2';
|
|
|
-
|
|
|
- var socket;
|
|
|
- if(typeof(WebSocket) == "undefined") {
|
|
|
- //top.layer.alert("您的浏览器不支持WebSocket");
|
|
|
- return;
|
|
|
- }
|
|
|
- socket = new WebSocket("ws://"+window.document.domain+":8670");
|
|
|
-
|
|
|
- //监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
|
|
|
- window.onbeforeunload = function(){
|
|
|
- socket.close();
|
|
|
- };
|
|
|
- //发生了错误事件
|
|
|
- socket.onerror = function(event) {
|
|
|
-
|
|
|
- };
|
|
|
- //关闭事件
|
|
|
- socket.onclose = function(event) {
|
|
|
-
|
|
|
- };
|
|
|
- //打开连接事件
|
|
|
- socket.onopen = function() {
|
|
|
- //登录成功首次刷新和点击"首页" --- 用的是{ctx}/home 方法
|
|
|
- //socket.send("_user_notify{\"userId\":\""+userId+"\",\"companyId\":\""+companyId+"\",\"officeId\":\""+officeId+"\",\"roleId\":\""+roleId+"\",\"type\":\""+type+"\","messageType":"_user_notify_"}");
|
|
|
- //以后每隔30秒 服务端向浏览器 推送消息
|
|
|
- //setInterval(exeMessage,30000);
|
|
|
- };
|
|
|
- function exeMessage()
|
|
|
- {
|
|
|
- socket.send("{\"userId\":\""+userId+"\",\"companyId\":\""+companyId+"\",\"officeId\":\""+officeId+"\",\"roleId\":\""+roleId+"\",\"type\":\""+type+"\",\"messageType\":\"_user_notify_\"}");
|
|
|
- }
|
|
|
- //发送消息事件
|
|
|
- socket.onmessage = function(event) {
|
|
|
- //top.layer.alert("onMessage:服务器返回的数据!");
|
|
|
- var resultData = event.data;
|
|
|
- var message = $.parseJSON(resultData);
|
|
|
- var resultState = message['resultState'];
|
|
|
- //console.log(resultState);
|
|
|
- if (resultState != "success") {
|
|
|
- console.info("false");
|
|
|
- return;
|
|
|
- }
|
|
|
- var noReadCount=message['noReadCount'],
|
|
|
- mailPage=message['mailPage'],
|
|
|
- count=message['count'],
|
|
|
- page=message['page'],
|
|
|
- notifyCount=message['notifyCount'],
|
|
|
- notifyPage=message['notifyPage'],
|
|
|
- notifyShowCount=message['notifyShowCount'],
|
|
|
- notifyShowPage=message['notifyShowPage'];
|
|
|
-
|
|
|
-// console.log("noReadCount==="+noReadCount);
|
|
|
-// console.log("mailPage==="+mailPage);
|
|
|
-// console.log("count==="+count);
|
|
|
-// console.log("page==="+page);
|
|
|
-// console.log("notifyCount==="+notifyCount);
|
|
|
-// console.log("notifyPage==="+notifyPage);
|
|
|
-// console.log("notifyShowCount==="+notifyShowCount);
|
|
|
-// console.log("notifyShowPage==="+notifyShowPage);
|
|
|
-
|
|
|
- var regExp = /'/g;
|
|
|
- if(noReadCount.length<1){
|
|
|
- noReadCount="0";
|
|
|
- }
|
|
|
- if(mailPage.length>1){
|
|
|
- mailPage = mailPage.replace(regExp,"\"");
|
|
|
- mailPage = $.parseJSON(mailPage);
|
|
|
- }else{mailPage=""}
|
|
|
- if(count.length<1){
|
|
|
- count="0";
|
|
|
- }
|
|
|
- if(page.length>1){
|
|
|
- page = page.replace(regExp,"\"");
|
|
|
- page = $.parseJSON(page);
|
|
|
- }else{page=""}
|
|
|
- if(notifyCount.length<1){
|
|
|
- notifyCount="0";
|
|
|
- }
|
|
|
- if(notifyPage.length>1){
|
|
|
- notifyPage = notifyPage.replace(regExp,"\"");
|
|
|
- notifyPage = $.parseJSON(notifyPage);
|
|
|
- }else{notifyPage=""}
|
|
|
- if(notifyShowCount.length<1){
|
|
|
- notifyShowCount="0";
|
|
|
- }
|
|
|
- if(notifyShowPage.length>1){
|
|
|
- notifyShowPage = notifyShowPage.replace(regExp,"\"");
|
|
|
- notifyShowPage = $.parseJSON(notifyShowPage);
|
|
|
- }else{notifyShowPage=""}
|
|
|
-
|
|
|
- $("#countSpan_notifyCount").text(parseInt(notifyCount)>9?"10+":parseInt(notifyCount));
|
|
|
- $("#countSpan_notifyShowCount").text(parseInt(notifyShowCount)>9?"10+":parseInt(notifyShowCount));
|
|
|
- $("#countSpan_count").text(parseInt(count)>9?"10+":parseInt(count));
|
|
|
- $("#countSpan_noReadCount").text(parseInt(noReadCount)>9?"10+":parseInt(noReadCount));
|
|
|
-
|
|
|
- //待办
|
|
|
- if(parseInt(notifyCount)==0){
|
|
|
- $("#contentDiv_notifyPage").html("当前暂无我的待办任务");
|
|
|
- }else{
|
|
|
- if(notifyPage!=null&¬ifyPage!=undefined&¬ifyPage!="") {
|
|
|
|
|
|
- var idArray = new Array();
|
|
|
- for (var i in notifyPage) {
|
|
|
- var id = notifyPage[i].id;
|
|
|
- idArray[i] = id;
|
|
|
- }
|
|
|
|
|
|
- $("table#contentTable_notifyPage").find("tbody").find("tr").each(function (i,n) {
|
|
|
- var trId = $(n).attr("id");
|
|
|
- if($.inArray(trId,idArray)==-1){
|
|
|
- $(n).nextAll().each(function (j,m) {
|
|
|
- var num = $(m).find("td:first").text().trim();
|
|
|
- $(m).find("td:first").text(parseInt(num)-1);
|
|
|
- });
|
|
|
- $(n).remove();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ //打开选项卡菜单
|
|
|
+ function openNotifyTab(url, title, isNew) {//isNew 为true时,打开一个新的选项卡;为false时,如果选项卡不存在,打开一个新的选项卡,如果已经存在,使已经存在的选项卡变为活跃状态。
|
|
|
+ var notifyClickValue = $("#notifyClickValue").val();
|
|
|
+ if(null != notifyClickValue && notifyClickValue != undefined && notifyClickValue != '' && notifyClickValue != 0){
|
|
|
+ if(notifyClickValue == 1){
|
|
|
+ url = '${ctx }/oa/oaNotify/self'
|
|
|
+ }else if (notifyClickValue == 2) {
|
|
|
+ url = '${ctx }/knowledgeSharingDetails/knowledgeSharingDetails'
|
|
|
}
|
|
|
- //通知
|
|
|
- if(parseInt(notifyShowCount)==0){
|
|
|
- $("#contentDiv_notifyShowPage").html("当前暂无我的通知信息");
|
|
|
- }else{
|
|
|
- if(notifyShowPage!=null&¬ifyShowPage!=undefined&¬ifyShowPage!="") {
|
|
|
-
|
|
|
- var idArray = new Array();
|
|
|
- for (var i in notifyShowPage) {
|
|
|
- var id = notifyShowPage[i].id;
|
|
|
- idArray[i] = id;
|
|
|
- }
|
|
|
-
|
|
|
- var trArray = new Array();
|
|
|
- $("table#contentTable_notifyShowPage").find("tbody").find("tr").each(function (i,n) {
|
|
|
- var trId = $(n).attr("id");
|
|
|
- trArray[i] = trId;
|
|
|
- if($.inArray(trId,idArray)==-1){
|
|
|
- $(n).nextAll().each(function (j,m) {
|
|
|
- var num = $(m).find("td:first").text().trim();
|
|
|
- $(m).find("td:first").text(parseInt(num)-1);
|
|
|
+ // 获取标识数据
|
|
|
+ var dataUrl = url,
|
|
|
+ dataIndex,
|
|
|
+ menuName = title,
|
|
|
+ flag = true;
|
|
|
+ if (dataUrl == undefined || top.$.trim(dataUrl).length == 0) return false;
|
|
|
+
|
|
|
+ if (!isNew) {
|
|
|
+ top.$('.J_menuTab').each(function () {
|
|
|
+ if (top.$(this).data('id') == dataUrl) {// 选项卡已存在,激活。
|
|
|
+ if (!top.$(this).hasClass('active')) {
|
|
|
+ top.$(this).addClass('active').siblings('.J_menuTab').removeClass('active');
|
|
|
+ top.scrollToTab(top.$(this));
|
|
|
+ // 显示tab对应的内容区
|
|
|
+ top.$('.J_mainContent .J_iframe').each(function () {
|
|
|
+ if (top.$(this).data('id') == dataUrl) {
|
|
|
+ top.$(this).show().siblings('.J_iframe').hide();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
});
|
|
|
- $(n).remove();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- /!* for(var i in notifyShowPage){
|
|
|
- var id = notifyShowPage[i].id;
|
|
|
- if($.inArray(id,trArray)==-1){
|
|
|
- var title = notifyShowPage[i].title;
|
|
|
- var status = notifyShowPage[i].status;
|
|
|
- var updateDate = notifyShowPage[i].updateDate;
|
|
|
- //暂时
|
|
|
- window.location.reload();
|
|
|
-
|
|
|
-
|
|
|
- var aTab = '<a><span>'+
|
|
|
- '${fns:abbr(''+title+'',30)}'+
|
|
|
- '</span></a>';
|
|
|
-
|
|
|
}
|
|
|
- }*!/
|
|
|
-
|
|
|
- }
|
|
|
+ flag = false;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- //公告
|
|
|
- if(parseInt(count)==0){
|
|
|
- $("#contentDiv_oaNotify").html("当前暂无我的公告信息");
|
|
|
- }else{
|
|
|
- if(page!=null&&page!=undefined&&page!="") {
|
|
|
|
|
|
- var idArray = new Array();
|
|
|
- for (var i in page) {
|
|
|
- var id = page[i].id;
|
|
|
- idArray[i] = id;
|
|
|
- }
|
|
|
+ if (isNew || flag) {//isNew为true,打开一个新的选项卡; flag为true,选项卡不存在,打开一个新的选项卡。
|
|
|
+ var str = '<a href="javascript:;" class="active J_menuTab" data-id="' + dataUrl + '">' + menuName + ' <i class="fa fa-times-circle"></i></a>';
|
|
|
+ top.$('.J_menuTab').removeClass('active');
|
|
|
|
|
|
- $("table#contentTable_oaNotify").find("tbody").find("tr").each(function (i,n) {
|
|
|
- var trId = $(n).attr("id");
|
|
|
- if($.inArray(trId,idArray)==-1){
|
|
|
- $(n).nextAll().each(function (j,m) {
|
|
|
- var num = $(m).find("td:first").text().trim();
|
|
|
- $(m).find("td:first").text(parseInt(num)-1);
|
|
|
- });
|
|
|
- $(n).remove();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- //邮件
|
|
|
- if(parseInt(noReadCount)==0){
|
|
|
- $("#contentDiv_email").html("当前暂无我的邮件信息");
|
|
|
- }else{
|
|
|
- if(mailPage!=null&&mailPage!=undefined&&mailPage!="") {
|
|
|
+ // 添加选项卡对应的iframe
|
|
|
+ var str1 = '<iframe class="J_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>';
|
|
|
+ top.$('.J_mainContent').find('iframe.J_iframe').hide().parents('.J_mainContent').append(str1);
|
|
|
|
|
|
- var idArray = new Array();
|
|
|
- for (var i in mailPage) {
|
|
|
- var id = mailPage[i].id;
|
|
|
- idArray[i] = id;
|
|
|
- }
|
|
|
+ //显示loading提示
|
|
|
+ var loading = layer.load();
|
|
|
+
|
|
|
+ top.$('.J_mainContent iframe:visible').load(function () {
|
|
|
+ //iframe加载完成后隐藏loading提示
|
|
|
+ layer.close(loading);
|
|
|
+ });
|
|
|
+ // 添加选项卡
|
|
|
+ top.$('.J_menuTabs .page-tabs-content').append(str);
|
|
|
+ top.scrollToTab(top.$('.J_menuTab.active'));
|
|
|
|
|
|
- $("table#contentTable_email").find("tbody").find("tr").each(function (i,n) {
|
|
|
- var trId = $(n).attr("id");
|
|
|
- if($.inArray(trId,idArray)==-1){
|
|
|
- $(n).nextAll().each(function (j,m) {
|
|
|
- var num = $(m).find("td:first").text().trim();
|
|
|
- $(m).find("td:first").text(parseInt(num)-1);
|
|
|
- });
|
|
|
- $(n).remove();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
}
|
|
|
+ return false;
|
|
|
|
|
|
}
|
|
|
- })*/
|
|
|
+
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+ <script type="text/javascript">
|
|
|
|
|
|
//打开对话框(查看)
|
|
|
function homeOpenDialogView(title,url,width,height){
|
|
@@ -895,6 +757,7 @@
|
|
|
<div class="wrapper wrapper-content">
|
|
|
<sys:message content="${message}"/>
|
|
|
<div class="homeDiv">
|
|
|
+ <input type="hidden" id="notifyClickValue" value="">
|
|
|
<div class="layui-col-sm6 layui-col-md6 call-board">
|
|
|
<div id="schedule-bord" class="call-bord-content contentShadow">
|
|
|
<div class="bord-left">
|
|
@@ -941,25 +804,33 @@
|
|
|
<div id="msg-bord" class="call-bord-content contentShadow">
|
|
|
<div class="bord-left">
|
|
|
<div class="bord-left-content">
|
|
|
+ <%--<div class="bord-title" >公告信息(${count1})</div>--%>
|
|
|
<div class="bord-title">
|
|
|
<div class="layui-tab ggTab" id="nt4">
|
|
|
<ul class="layui-tab-title" id="nt4_1" style="margin-top: -10px;margin-left: 0px" >
|
|
|
+
|
|
|
+ <%--<c:forEach items="${notifyTypeList}" var="notifyInfo">
|
|
|
+ <li value="${notifyInfo.value}"><a style="color: #ffffee">${notifyInfo.label}</a></li>
|
|
|
+ </c:forEach>--%>
|
|
|
<%--<li value="1"><a>通知</a><span class="hide" id="inform"></span></li>
|
|
|
<li value="2"><a>会议通知</a><span class="hide" id="HYinform"></span></li>
|
|
|
<li value="3"><a>公司标准或规范</a><span class="hide" id="standard"></span></li>
|
|
|
<li value="4"><a>行业标准或规范</a><span class="hide" id="standard2"></span></li>
|
|
|
<li value="5"><a>其他</a><span class="hide" id="other"></span></li>--%>
|
|
|
- <li value="1"><a style="color: #ffffee">通知</a></li>
|
|
|
+ <%--<li value="1"><a style="color: #ffffee">通知</a></li>
|
|
|
<li value="2"><a style="color: #ffffee">会议通知</a></li>
|
|
|
<li value="3"><a style="color: #ffffee">公司标准或规范</a></li>
|
|
|
<li value="4"><a style="color: #ffffee">行业标准或规范</a></li>
|
|
|
- <li value="5"><a style="color: #ffffee">其他</a></li>
|
|
|
+ <li value="5"><a style="color: #ffffee">其他</a></li>--%>
|
|
|
+ <li value="0"><a style="color: #ffffee">最新消息</a></li>
|
|
|
+ <li value="1"><a style="color: #ffffee">通告</a></li>
|
|
|
+ <li value="2"><a style="color: #ffffee">知识分享</a></li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="bord-more">
|
|
|
- <a href="javascript:void(0)" onclick='top.openTab("${ctx }/oa/oaNotify/self","公告信息", false)'><span>更多 </span><i class="fa fa-angle-right"></i></a>
|
|
|
+ <a href="javascript:void(0)" onclick='openNotifyTab("${ctx }/oa/oaNotify/self","公告信息", false)'><span>更多 </span><i class="fa fa-angle-right"></i></a>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="bord-right">
|
|
@@ -1257,7 +1128,7 @@
|
|
|
<c:forEach items="${page}" var="oaNotify" varStatus="index">
|
|
|
<c:if test="${index.index < 8}">
|
|
|
xml ="<a href=\"javascript:void(0)\" onclick=\"homeOpenDialogView('查看公告', '${ctx}/oa/oaNotify/homeView?id=${oaNotify.id}&readAttr=disabled','95%','95%')\" >";
|
|
|
- elem.append('<li>' + xml + "<span class=\"bord-record\" title=\"${oaNotify.title}\">${oaNotify.title}</span>"+
|
|
|
+ elem.append('<li>' + xml + "<span class=\"bord-record-type\" title=\"${oaNotify.typeStr}\">${oaNotify.typeStr}</span><span class=\"bord-record\" title=\"${oaNotify.title}\">${oaNotify.title}</span>"+
|
|
|
'<span class="bord-record-flag">'+'${oaNotify.readFlagStr}'+'</span>' +
|
|
|
'<span class="bord-record-time">' + '<fmt:formatDate value="${oaNotify.updateDate}" pattern="yyyy-MM-dd"/>' + '</span></a></li>');
|
|
|
</c:if>
|