1 首先在页面引用Echarts 3.0 文件
2 在控制器写返回类型为jsonlist的方法
public List GetChildDataReDesign(Guid? pId, string SysName, string begindate, string enddate)
{
List LevelOne = context.Organizations.Where(a => a.ParentId == pId).ToList();
if (LevelOne.Count == 0) return null;
DateTime begin = new DateTime();
DateTime end = new DateTime();
//默认查询一月之内数据
if (string.IsNullOrEmpty(enddate) && string.IsNullOrEmpty(begindate))
{ end = DateTime.Now.Date; begin = end.Date.AddMonths(-1); }
if (!string.IsNullOrEmpty(enddate) && string.IsNullOrEmpty(begindate))
{ end = DateTime.Parse(enddate); begin = new DateTime(2016, 1, 1); }
if (string.IsNullOrEmpty(enddate) && !string.IsNullOrEmpty(begindate))
{ end = DateTime.Now.Date; begin = DateTime.Parse(begindate); }
if (!string.IsNullOrEmpty(enddate) && !string.IsNullOrEmpty(begindate))
{ end = DateTime.Parse(enddate); begin = DateTime.Parse(begindate); }
end = end.AddDays(1);
var queryP = (from l in context.ResourceAccess
join b in context.Users on l.UserCode equals b.Name
where l.CreateTime >= begin && l.CreateTime < end && l.SystemCode == SysName
select new
{
Id = l.Id,
UserName = b.Id.ToString() != null ? b.Id.ToString() : null,
OrgId = b.OrganizationIds
}).ToList();
List list = new List();
List TempOrg = new List();
foreach (var s in LevelOne)
{
if (children.Count > 0) children.RemoveAll(a => true);
//if (TempOrg.Count>0) TempOrg.RemoveAll(a =>
ASP.Net MVC中 Echarts简单Demo
最新推荐文章于 2024-02-29 10:52:00 发布