77 lines
3.8 KiB
C#
77 lines
3.8 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using HHWMS.Web.Models;
|
|
using WalkingTec.Mvvm.Core;
|
|
using WalkingTec.Mvvm.Core.Extensions;
|
|
|
|
namespace HHWMS.Web
|
|
{
|
|
public partial class SysJobListVM : BasePagedListVM<SysJob_View, SysJobSearcher>
|
|
{
|
|
protected override List<GridAction> InitGridAction()
|
|
{
|
|
return new List<GridAction>
|
|
{
|
|
this.MakeStandardAction("SysJob", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"system", dialogWidth: 800),
|
|
this.MakeStandardAction("SysJob", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "system", dialogWidth: 800).SetShowInRow(false).SetHideOnToolBar(false),
|
|
this.MakeStandardAction("SysJob", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "system", dialogWidth: 800),
|
|
//this.MakeStandardAction("SysJob", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "system", dialogWidth: 800),
|
|
this.MakeStandardAction("SysJob", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "system", dialogWidth: 800),
|
|
this.MakeStandardAction("SysJob", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "system", dialogWidth: 800),
|
|
this.MakeStandardAction("SysJob", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "system", dialogWidth: 800),
|
|
this.MakeStandardAction("SysJob", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "system"),
|
|
this.MakeAction("SysJob","Execute",Localizer["SysJob.Execute"],null,GridActionParameterTypesEnum.SingleId).SetArea("system").SetShowInRow().SetHideOnToolBar(),
|
|
this.MakeAction("SysJob","PauseOrResume",Localizer["SysJob.PauseOrResume"],null,GridActionParameterTypesEnum.SingleId).SetArea("system").SetShowInRow().SetHideOnToolBar(),
|
|
};
|
|
}
|
|
|
|
protected override IEnumerable<IGridColumn<SysJob_View>> InitGridHeader()
|
|
{
|
|
var AllJob = Wtm.CreateVM<SysJobVM>().AllJob;
|
|
return new List<GridColumn<SysJob_View>>{
|
|
this.MakeGridHeader(x => x.JobName)
|
|
.SetFormat((entity,v) =>
|
|
{
|
|
return AllJob.FirstOrDefault(x => x.Value.ToString() == entity.JobName).Text;
|
|
}),
|
|
this.MakeGridHeader(x => x.JobGroup).SetHide(),
|
|
this.MakeGridHeader(x => x.MethodName),
|
|
this.MakeGridHeader(x => x.MethodParams).SetHide(),
|
|
this.MakeGridHeader(x => x.CronExpression, 120),
|
|
this.MakeGridHeader(x => x.LastFireTime, 150),
|
|
this.MakeGridHeader(x => x.NextFireTime, 150),
|
|
this.MakeGridHeader(x => x.MisfirePolicy).SetHide(),
|
|
this.MakeGridHeader(x => x.Status),
|
|
this.MakeGridHeader(x => x.Remark),
|
|
this.MakeGridHeaderAction(width: 300)
|
|
};
|
|
}
|
|
|
|
public override IOrderedQueryable<SysJob_View> GetSearchQuery()
|
|
{
|
|
var query = DC.Set<SysJob>()
|
|
.CheckContain(Searcher.JobName, x => x.JobName)
|
|
.Select(x => new SysJob_View
|
|
{
|
|
ID = x.ID,
|
|
JobName = x.JobName,
|
|
JobGroup = x.JobGroup,
|
|
MethodName = x.MethodName,
|
|
MethodParams = x.MethodParams,
|
|
CronExpression = x.CronExpression,
|
|
LastFireTime = x.LastFireTime,
|
|
NextFireTime = x.NextFireTime,
|
|
MisfirePolicy = x.MisfirePolicy,
|
|
Status = x.Status,
|
|
Remark = x.Remark,
|
|
})
|
|
.OrderBy(x => x.ID);
|
|
return query;
|
|
}
|
|
}
|
|
|
|
public class SysJob_View : SysJob
|
|
{
|
|
}
|
|
}
|