Explorar el Código

桌面消息提示

金隅分支
zhangli hace 3 años
padre
commit
889eb15032
Se han modificado 9 ficheros con 172 adiciones y 73 borrados
  1. +14
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs
  2. +1
    -22
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js
  3. +61
    -45
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml
  4. +4
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop.cshtml
  5. +32
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop/Index.js
  6. +3
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-layer.js
  7. +24
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs
  8. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs
  9. +28
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs

+ 14
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs Ver fichero

@@ -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>


+ 1
- 22
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js Ver fichero

@@ -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');
}
}

+ 61
- 45
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml Ver fichero

@@ -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>


+ 4
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop.cshtml Ver fichero

@@ -31,11 +31,13 @@
<div id="TitleColor" class="portal-panel-title">
<i class="fa fa-balance-scale"></i>&nbsp;&nbsp;统计指标
</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")

+ 32
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop/Index.js Ver fichero

@@ -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);
}
});
}
}
});
};

});

+ 3
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-layer.js Ver fichero

@@ -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);


+ 24
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs Ver fichero

@@ -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>


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs Ver fichero

@@ -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>


+ 28
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs Ver fichero

@@ -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>


Cargando…
Cancelar
Guardar