添加项目文件。
This commit is contained in:
1 parent
05e131ca4e
commit
514d6f5255
1162 files changed
+81255
No files matched your search
@@ -0,0 +1,24 @@
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class SysJobBatchVM : BaseBatchVM<SysJob, SysJob_BatchEdit>
|
||||
{
|
||||
public SysJobBatchVM()
|
||||
{
|
||||
ListVM = new SysJobListVM();
|
||||
LinkedVM = new SysJob_BatchEdit();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class to define batch edit fields
|
||||
/// </summary>
|
||||
public class SysJob_BatchEdit : BaseVM
|
||||
{
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class SysJobTemplateVM : BaseTemplateVM
|
||||
{
|
||||
[Display(Name = "SysJob.JobName")]
|
||||
public ExcelPropety JobName_Excel = ExcelPropety.CreateProperty<SysJob>(x => x.JobName);
|
||||
|
||||
[Display(Name = "SysJob.JobGroup")]
|
||||
public ExcelPropety JobGroup_Excel = ExcelPropety.CreateProperty<SysJob>(x => x.JobGroup);
|
||||
|
||||
[Display(Name = "SysJob.MethodName")]
|
||||
public ExcelPropety MethodName_Excel = ExcelPropety.CreateProperty<SysJob>(x => x.MethodName);
|
||||
|
||||
[Display(Name = "SysJob.MethodParams")]
|
||||
public ExcelPropety MethodParams_Excel = ExcelPropety.CreateProperty<SysJob>(x => x.MethodParams);
|
||||
|
||||
[Display(Name = "SysJob.CronExpression")]
|
||||
public ExcelPropety CronExpression_Excel = ExcelPropety.CreateProperty<SysJob>(x => x.CronExpression);
|
||||
|
||||
[Display(Name = "SysJob.LastFireTime")]
|
||||
public ExcelPropety LastFireTime_Excel = ExcelPropety.CreateProperty<SysJob>(x => x.LastFireTime);
|
||||
|
||||
[Display(Name = "SysJob.NextFireTime")]
|
||||
public ExcelPropety NextFireTime_Excel = ExcelPropety.CreateProperty<SysJob>(x => x.NextFireTime);
|
||||
|
||||
[Display(Name = "SysJob.MisfirePolicy")]
|
||||
public ExcelPropety MisfirePolicy_Excel = ExcelPropety.CreateProperty<SysJob>(x => x.MisfirePolicy);
|
||||
|
||||
[Display(Name = "SysJob.Status")]
|
||||
public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<SysJob>(x => x.Status);
|
||||
|
||||
[Display(Name = "System.Remark")]
|
||||
public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty<SysJob>(x => x.Remark);
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class SysJobImportVM : BaseImportVM<SysJobTemplateVM, SysJob>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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).SetHide(),
|
||||
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
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class SysJobSearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "SysJob.JobName")]
|
||||
public String JobName { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Support.Quartz;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class SysJobVM : BaseCRUDVM<SysJob>
|
||||
{
|
||||
public List<ComboSelectListItem> AllJob { get; set; }
|
||||
|
||||
public SysJobVM()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
List<ComboSelectListItem> rv = new List<ComboSelectListItem>();
|
||||
|
||||
var test = Assembly.Load("HHWMS.Web").GetExportedTypes().Where(x => x.FullName.Contains("HHWMS.Web"));
|
||||
var t = test.Where(x => typeof(WtmJob).IsAssignableFrom(x) && x.Name != "WtmJob");
|
||||
foreach (var st in t)
|
||||
{
|
||||
var ci = st.GetConstructor(Type.EmptyTypes);
|
||||
var job = ci?.Invoke(null) as WtmJob;
|
||||
if (job != null)
|
||||
{
|
||||
string jobName = st.Name;
|
||||
rv.Add(new ComboSelectListItem { Text = jobName, Value = jobName });
|
||||
}
|
||||
}
|
||||
AllJob = rv;
|
||||
}
|
||||
|
||||
public override void DoAdd()
|
||||
{
|
||||
base.DoAdd();
|
||||
}
|
||||
|
||||
public override void DoEdit(bool updateAllFields = false)
|
||||
{
|
||||
base.DoEdit(updateAllFields);
|
||||
}
|
||||
|
||||
public override void DoDelete()
|
||||
{
|
||||
base.DoDelete();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user