修改BUG:修复网站头任务通知栏样式与后台代码
This commit is contained in:
parent
82d967f776
commit
d6a95e238d
|
@ -396,9 +396,39 @@ a, a:hover, a:focus {
|
|||
-webkit-border-radius: 4px 4px 0px 0px;
|
||||
}
|
||||
|
||||
.notify-row .dropdown-menu .content {
|
||||
position: absolute;
|
||||
left: 36px;
|
||||
right: 44px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.notify-row .dropdown-menu .label {
|
||||
display: inline-block;
|
||||
height: 18px;
|
||||
width: 20px;
|
||||
padding: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.notify-row .dropdown-menu .small {
|
||||
font-size: 10px;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
float: right;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.notify-row .dropdown-menu.tasks-bar .desc {
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.notify-row .dropdown-menu.tasks-bar .percent {
|
||||
|
@ -406,13 +436,13 @@ a, a:hover, a:focus {
|
|||
float: right;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
padding-left: 10px;
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
.notify-row .dropdown-menu.tasks-bar .progress {
|
||||
margin-bottom: 0 !important;
|
||||
margin-top: 4px;
|
||||
height: 10px;
|
||||
margin-right: 34px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.notify-row .dropdown-menu.inbox .photo img {
|
||||
|
@ -451,33 +481,6 @@ a, a:hover, a:focus {
|
|||
margin-top: 2px;
|
||||
}
|
||||
|
||||
|
||||
.notify-row .dropdown-menu .label {
|
||||
display: inline-block;
|
||||
height: 18px;
|
||||
width: 20px;
|
||||
padding: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.notify-row .dropdown-menu .small {
|
||||
font-size: 10px;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
float: right;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.notify-row .dropdown-menu li a div {
|
||||
position: absolute;
|
||||
left: 36px;
|
||||
right: 44px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdown-menu.menu {
|
||||
top: 50px;
|
||||
left: 6px;
|
||||
|
|
|
@ -54,11 +54,21 @@
|
|||
callback: function (result) {
|
||||
$('#logoutNoti').text(result.NewUsersCount);
|
||||
|
||||
// tasks
|
||||
// new users
|
||||
$('#msgHeaderTask').text(result.NewUsersCount);
|
||||
$('#msgHeaderTaskBadge').text(result.NewUsersCount);
|
||||
var htmlUserTemplate = '<li><a href="../Admin/Tasks?id={3}"><span class="desc">{0}-{2}</span><span class="percent">{1}%</span></span><div class="progress progress-striped"><div class="progress-bar" role="progressbar" aria-valuenow="{1}" aria-valuemin="0" aria-valuemax="100" style="width: {1}%"><span class="sr-only">{1}% 完成</span></div></div></a></li>';
|
||||
var html = result.Tasks.map(function (u) {
|
||||
return $.format(htmlUserTemplate, u.TaskName, u.TaskProgress, u.AssignDisplayName, u.ID);
|
||||
}).join('');
|
||||
$(html).insertAfter($('#msgHeaderTaskContent'));
|
||||
|
||||
// new users
|
||||
$('#msgHeaderUser').text(result.NewUsersCount);
|
||||
$('#msgHeaderUserBadge').text(result.NewUsersCount);
|
||||
var htmlUserTemplate = '<li><a href="../Admin/Notifications"><span class="label label-success"><i class="fa fa-plus"></i></span><div title="{2}">{1}({0})</div><span class="small italic">{3}</span></a></li>';
|
||||
var html = result.Users.map(function (u) {
|
||||
htmlUserTemplate = '<li><a href="../Admin/Notifications"><span class="label label-success"><i class="fa fa-plus"></i></span><div title="{2}" class="content">{1}({0})</div><span class="small italic">{3}</span></a></li>';
|
||||
html = result.Users.map(function (u) {
|
||||
return $.format(htmlUserTemplate, u.UserName, u.DisplayName, u.Description, u.Period);
|
||||
}).join('');
|
||||
$(html).insertAfter($('#msgHeaderUserContent'));
|
||||
|
@ -66,7 +76,7 @@
|
|||
// apps
|
||||
$('#msgHeaderApp').text(result.AppExceptionsCount);
|
||||
$('#msgHeaderAppBadge').text(result.AppExceptionsCount);
|
||||
htmlUserTemplate = '<li><a href="../Admin/Exceptions"><span class="label label-warning"><i class="fa fa-bug"></i></span><div title="{1}">{0}</div><span class="small italic">{2}</span></a></li>';
|
||||
htmlUserTemplate = '<li><a href="../Admin/Exceptions"><span class="label label-warning"><i class="fa fa-bug"></i></span><div title="{1}" class="content">{0}</div><span class="small italic">{2}</span></a></li>';
|
||||
html = result.Apps.map(function (u) {
|
||||
return $.format(htmlUserTemplate, u.ExceptionType, u.Message, u.Period);
|
||||
}).join('');
|
||||
|
@ -75,7 +85,7 @@
|
|||
// dbs
|
||||
$('#msgHeaderDb').text(result.DbExceptionsCount);
|
||||
$('#msgHeaderDbBadge').text(result.DbExceptionsCount);
|
||||
htmlUserTemplate = '<li><a href="../Admin/Exceptions"><span class="label label-danger"><i class="fa fa-bolt"></i></span><div title="{1}">{0}</div><span class="small italic">{2}</span></a></li>';
|
||||
htmlUserTemplate = '<li><a href="../Admin/Exceptions"><span class="label label-danger"><i class="fa fa-bolt"></i></span><div title="{1}" class="content">{0}</div><span class="small italic">{2}</span></a></li>';
|
||||
html = result.Dbs.map(function (u) {
|
||||
return $.format(htmlUserTemplate, u.ErrorPage, u.Message, u.Period);
|
||||
}).join('');
|
||||
|
|
|
@ -66,7 +66,6 @@ namespace Bootstrap.Admin.Controllers
|
|||
else if (ts.Minutes > 0) n.Period = string.Format("{0}分钟", ts.Minutes);
|
||||
});
|
||||
ret.DbExceptionsCount = dbs.Count();
|
||||
|
||||
return ret;
|
||||
}
|
||||
/// <summary>
|
||||
|
|
|
@ -29,12 +29,12 @@
|
|||
<li class="dropdown">
|
||||
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
|
||||
<i class="fa fa-tasks"></i>
|
||||
<span class="badge bg-success"></span>
|
||||
<span id="msgHeaderTaskBadge" class="badge bg-success"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu tasks-bar">
|
||||
<div class="notify-arrow notify-arrow-green"></div>
|
||||
<li>
|
||||
<p>您有 0 个未完成的任务</p>
|
||||
<li id="msgHeaderTaskContent">
|
||||
<p>您有 <span id="msgHeaderTask">0</span> 个未完成的任务</p>
|
||||
</li>
|
||||
<li>
|
||||
<a href="~/Admin/Tasks">查看所有任务</a>
|
||||
|
|
|
@ -17,6 +17,10 @@ namespace Bootstrap.DataAccess
|
|||
/// </summary>
|
||||
public string AssignName { get; set; }
|
||||
/// <summary>
|
||||
/// 获得/设置 分配人昵称
|
||||
/// </summary>
|
||||
public string AssignDisplayName { get; set; }
|
||||
/// <summary>
|
||||
/// 获取/设置 完成任务人
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Longbow;
|
||||
using Longbow.Caching;
|
||||
using Longbow.Caching;
|
||||
using Longbow.Caching.Configuration;
|
||||
using Longbow.ExceptionManagement;
|
||||
using System;
|
||||
|
@ -18,9 +17,9 @@ namespace Bootstrap.DataAccess
|
|||
/// <returns></returns>
|
||||
public static IEnumerable<Task> RetrieveTasks()
|
||||
{
|
||||
var ret = CacheManager.GetOrAdd(RetrieveTasksDataKey, CacheSection.RetrieveIntervalByKey(RetrieveTasksDataKey), key =>
|
||||
return CacheManager.GetOrAdd(RetrieveTasksDataKey, CacheSection.RetrieveIntervalByKey(RetrieveTasksDataKey), key =>
|
||||
{
|
||||
string sql = "select * from Tasks";
|
||||
string sql = "select t.*, u.DisplayName from Tasks t inner join Users u on t.UserName = u.UserName";
|
||||
List<Task> tasks = new List<Task>();
|
||||
DbCommand cmd = DBAccessManager.SqlDBAccess.CreateCommand(CommandType.Text, sql);
|
||||
try
|
||||
|
@ -37,7 +36,8 @@ namespace Bootstrap.DataAccess
|
|||
UserName = (string)reader[3],
|
||||
TaskTime = (int)reader[4],
|
||||
TaskProgress = (double)reader[5],
|
||||
AssignTime = LgbConvert.ReadValue(reader[6], DateTime.MinValue)
|
||||
AssignTime = (DateTime)reader[6],
|
||||
AssignDisplayName = (string)reader[7]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,6 @@ namespace Bootstrap.DataAccess
|
|||
catch (Exception ex) { ExceptionManager.Publish(ex); }
|
||||
return tasks;
|
||||
}, CacheSection.RetrieveDescByKey(RetrieveTasksDataKey));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue