@@ -73,6 +73,20 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取未读的消息的数量 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetCountForUnread() | |||
{ | |||
var count = messageRindIBLL.GetCountForUnread(); | |||
return Success(count); | |||
} | |||
/// <summary> | |||
/// 获取未读的消息 | |||
/// </summary> | |||
@@ -129,26 +129,5 @@ var bootstrap = function ($, learun) { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
funopen(); | |||
function funopen() { | |||
learun.layeropen({ | |||
//id: 'form', | |||
type: 2, | |||
title: "消息提示", | |||
closeBtn: 0, //不显示关闭按钮 | |||
shade: [0], | |||
area: ['340px', '215px'], | |||
offset: 'rb', //右下角弹出 | |||
anim: 2, | |||
content: top.$.rootUrl + '/LR_Desktop/MessageRind/UnreadIndex', | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}; | |||
function onload() { | |||
$('#gridtable').jfGridSet('reload'); | |||
} | |||
} |
@@ -85,58 +85,74 @@ | |||
//更改状态为已读 | |||
var MessageId = params[2]; | |||
if (top.learun.checkrow(MessageId)) { | |||
$.ajax({ | |||
url: top.$.rootUrl + '/LR_Desktop/MessageRind/SaveReadSigns', | |||
type: "post", | |||
data: { keyValue: MessageId }, | |||
dataType: "json", | |||
async: false, | |||
success: function (data) { | |||
//console.log(data); | |||
//弹窗查看详情 | |||
var keyValue = params[1]; | |||
var ConnectionUrl = params[3]; | |||
var title = params[0]; | |||
if (top.learun.checkrow(keyValue)) { | |||
top.learun.layerForm({ | |||
id: 'formview', | |||
title: title, | |||
url: top.$.rootUrl + ConnectionUrl + keyValue, | |||
width: 1000, | |||
height: 650, | |||
maxmin: true, | |||
btn: null, | |||
callBack: function (id) { | |||
return top[id].acceptClick(onload()); | |||
} | |||
}); | |||
} | |||
top.learun.deleteForm(top.$.rootUrl + '/LR_Desktop/MessageRind/SaveReadSigns', { keyValue: MessageId }, function () { | |||
//弹窗查看详情 | |||
var keyValue = params[1]; | |||
var ConnectionUrl = params[3]; | |||
var title = params[0]; | |||
if (top.learun.checkrow(keyValue)) { | |||
top.learun.layerForm({ | |||
id: 'formview', | |||
title: title, | |||
url: top.$.rootUrl + ConnectionUrl + keyValue, | |||
width: 1000, | |||
height: 650, | |||
maxmin: true, | |||
btn: null, | |||
}); | |||
} | |||
}) | |||
}); | |||
//$.ajax({ | |||
// url: top.$.rootUrl + '/LR_Desktop/MessageRind/SaveReadSigns', | |||
// type: "post", | |||
// data: { keyValue: MessageId }, | |||
// dataType: "json", | |||
// async: false, | |||
// success: function (data) { | |||
// //弹窗查看详情 | |||
// var keyValue = params[1]; | |||
// var ConnectionUrl = params[3]; | |||
// var title = params[0]; | |||
// if (top.learun.checkrow(keyValue)) { | |||
// top.learun.layerForm({ | |||
// id: 'formview', | |||
// title: title, | |||
// url: top.$.rootUrl + ConnectionUrl + keyValue, | |||
// width: 1000, | |||
// height: 650, | |||
// maxmin: true, | |||
// btn: null, | |||
// }); | |||
// } | |||
// } | |||
//}) | |||
} | |||
}); | |||
}); | |||
//function funLook(param) { | |||
// var id = "433d5658-40b0-4e2d-b736-c4e8561d017e";//$obj.attr('id'); | |||
// var _module = top.learun.clientdata.get(['modulesMap', id]); | |||
// switch (_module.F_Target) { | |||
// case 'iframe':// 窗口 | |||
// if (top.learun.validator.isNotNull(_module.F_UrlAddress).code) { | |||
// top.learun.frameTab.open(_module); | |||
// } | |||
// break; | |||
// case 'open':// 窗口 | |||
// var newWin = window.open(_module.F_UrlAddress); | |||
// newWin.location.replace(_module.F_UrlAddress); | |||
// break; | |||
// } | |||
//} | |||
//function funLook(param) { | |||
// var id = "433d5658-40b0-4e2d-b736-c4e8561d017e";//$obj.attr('id'); | |||
// var _module = top.learun.clientdata.get(['modulesMap', id]); | |||
// switch (_module.F_Target) { | |||
// case 'iframe':// 窗口 | |||
// if (top.learun.validator.isNotNull(_module.F_UrlAddress).code) { | |||
// top.learun.frameTab.open(_module); | |||
// } | |||
// break; | |||
// case 'open':// 窗口 | |||
// var newWin = window.open(_module.F_UrlAddress); | |||
// newWin.location.replace(_module.F_UrlAddress); | |||
// break; | |||
// } | |||
//} | |||
</script> | |||
</body> | |||
@@ -31,11 +31,13 @@ | |||
<div id="TitleColor" class="portal-panel-title"> | |||
<i class="fa fa-balance-scale"></i> 统计指标 | |||
</div> | |||
<div class="portal-panel-content" id="lr_target" > | |||
<div class="portal-panel-content" id="lr_target"> | |||
</div> | |||
</div> | |||
</div> | |||
@*<div id="sound"></div>*@ | |||
<audio id="sound" autoplay="autoplay"></audio> | |||
</div> | |||
@Html.AppendJsFile("/Views/Home/AdminDesktop/Index.js") |
@@ -87,7 +87,7 @@ $(function () { | |||
var l = g.find('[data-value="' + m.Id + '"]'); | |||
$.each(m.value, | |||
function (p, q) { | |||
console.log(q.rnewsid); | |||
//console.log(q.rnewsid); | |||
if (q.rnewsid) { | |||
if (q.rnewsid === '0') { | |||
var o = ' <div class="lr-msg-line"> <a href="#" style="text-decoration: none;" >' + q.f_title + "</a> <label>" + q.f_time + "</label> </div>"; | |||
@@ -304,6 +304,36 @@ $(function () { | |||
} | |||
}) | |||
funopen(); | |||
window.setInterval(funopen, 60000); | |||
//window.clearInterval(t1); | |||
//消息提醒 | |||
function funopen() { | |||
$.ajax({ | |||
url: top.$.rootUrl + '/LR_Desktop/MessageRind/GetCountForUnread', | |||
type: "get", | |||
dataType: "json", | |||
async: false, | |||
success: function (data) { | |||
if (data.data != 0) { | |||
document.getElementById("sound").src = '/Resource/wav/收到新消息.wav'; | |||
top.learun.layeropen({ | |||
//id: 'form', | |||
type: 2, | |||
title: "消息提示", | |||
closeBtn: 0, //不显示关闭按钮 | |||
shade: [0], | |||
area: ['340px', '215px'], | |||
offset: 'rb', //右下角弹出 | |||
anim: 2, | |||
content: top.$.rootUrl + '/LR_Desktop/MessageRind/UnreadIndex', | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
} | |||
}); | |||
}; | |||
}); |
@@ -241,8 +241,9 @@ | |||
btn: dfop.btn, | |||
offset: 'rb', //右下角弹出 | |||
closeBtn: 1, //显示关闭按钮 | |||
shade: [0], | |||
content: [op.content, 'yes'],//op.url, | |||
shade: false,//[0], | |||
time: 60000, //60秒后自动关闭 | |||
content: op.content,//op.url, | |||
//skin: dfop.btn == null ? 'lr-layer-nobtn' : 'lr-layer', | |||
success: function (layero, index) { | |||
top['layer_' + dfop.id] = learun.iframe($(layero).find('iframe').attr('id'), top.frames); | |||
@@ -66,6 +66,30 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
} | |||
} | |||
/// <summary> | |||
/// 未读消息的数量 | |||
/// </summary> | |||
/// <returns></returns> | |||
public int GetCountForUnread() | |||
{ | |||
try | |||
{ | |||
return messageRindService.GetCountForUnread(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取MessageRemind表实体数据 | |||
/// </summary> | |||
@@ -27,6 +27,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
/// <returns></returns> | |||
IEnumerable<MessageRemindEntity> GetListForUnread(); | |||
/// <summary> | |||
/// 获取未读的消息的数量 | |||
/// </summary> | |||
/// <returns></returns> | |||
int GetCountForUnread(); | |||
/// <summary> | |||
/// 获取MessageRemind表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
@@ -91,6 +91,34 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
} | |||
} | |||
/// <summary> | |||
/// 获取MessageRemind表未读消息的数量 | |||
/// </summary> | |||
/// <returns></returns> | |||
public int GetCountForUnread() | |||
{ | |||
try | |||
{ | |||
string sql = "select count(1) from MessageRemind where ReadSigns=0"; | |||
var obj = this.BaseRepository().FindObject(sql); | |||
if (obj == null) | |||
return 0; | |||
else | |||
return Convert.ToInt32(obj); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取MessageRemind表实体数据 | |||
/// </summary> | |||