namespace Tiobon.Core.Services { /// /// 模板区域 (服务) /// public class Ghrp_TemplateAreaServices : BaseServices, IGhrp_TemplateAreaServices { private readonly IBaseRepository _dal; public Ghrp_TemplateAreaServices(ICaching caching, IBaseRepository dal) { this._dal = dal; base.BaseDal = dal; base._caching = caching; } #region 初始化模板参数 /// /// 初始化加载 区域元素 /// /// public async Task> InitAreaInfo() { string sql = @"select (select 'Label' type,ColumnName field,StaffInfoColumnName [text] from Ghra_StaffTemplateInfoGroupColumn a inner join Ghra_StaffInfoColumn b on a.StaffInfoColumnID = b.StaffInfoColumnId where StaffTemplateId =1 and a.IsEnable=1 and b.IsEnable=1 and b.IsRelease = 1 and GroupType='base' and IsDisplay=1 order by RowNum,ColNum for json path) StaffInfo, (select 'Label' [type],field field,[label] [text] from Ghrs_PageSettingEdit where IsEnable=1 and pageNo = 'F_PerformancePeriod' and defaultHidden != 'true' and elementType != 'FnKey' order by RowNum,ColNum for json path) PerformancePeriodInfo"; DataTable dt = await Db.Ado.GetDataTableAsync(sql); string StaffInfo = dt.Rows[0]["StaffInfo"].ToString(); if (string.IsNullOrEmpty(StaffInfo)) StaffInfo = "[]"; string PerformancePeriodInfo = dt.Rows[0]["PerformancePeriodInfo"].ToString(); if (string.IsNullOrEmpty(PerformancePeriodInfo)) PerformancePeriodInfo = "[]"; string JsonStr = @"[ { ""title"": ""摘要区"", ""name"": ""AbstractArea"", ""children"": [ { ""groupName"": ""基本信息"", ""groupList"": "+ StaffInfo + @" }, { ""groupName"": ""考核期间信息"", ""groupList"": " + PerformancePeriodInfo + @" } ] }, { ""title"": ""考核单说明区"", ""name"": ""DescriptionArea"", ""children"": [ { ""groupName"": ""控件选择"", ""groupList"": [ { ""type"": ""RichText"", ""field"": null, ""text"": ""富文本框"" } ] } ] }, { ""title"": ""指标区"", ""name"": ""TargetArea"", ""children"": [ { ""groupName"": ""控件选择"", ""groupList"": [ { ""type"": ""Table"", ""field"": null, ""text"": ""表格"" } ] } ] }, { ""title"": ""调整显示区"", ""name"": ""AdjustArea"", ""children"": [ { ""groupName"": ""控件选择"", ""groupList"": [ { ""type"": ""Input"", ""field"": null, ""text"": ""单行文本框"" } ] } ] }, { ""title"": ""评语区"", ""name"": ""CommentArea"", ""children"": [ { ""groupName"": ""控件选择"", ""groupList"": [ { ""type"": ""Input"", ""field"": null, ""text"": ""单行文本框"" }, { ""type"": ""InputTextArea"", ""field"": null, ""text"": ""多行文本框"" } ] } ] }, { ""title"": ""页面按钮区"", ""name"": ""ButtonArea"", ""children"": [ { ""groupName"": ""控件选择"", ""groupList"": [ { ""type"": ""Button"", ""field"": ""Save"", ""text"": ""暂存"" }, { ""type"": ""Button"", ""field"": ""Reject"", ""text"": ""驳回"" }, { ""type"": ""Button"", ""field"": ""Submit"", ""text"": ""提交"" }, { ""type"": ""Button"", ""field"": ""Export"", ""text"": ""导出"" }, { ""type"": ""Button"", ""field"": ""Close"", ""text"": ""关闭"" } ] } ] }, { ""title"": ""最终显示区"", ""name"": ""FinalArea"", ""children"": [] }, { ""title"": ""操作历史区"", ""name"": ""HistoryArea"", ""children"": [] }, { ""title"": ""考勤信息区"", ""name"": ""AttendanceArea"", ""children"": [] }, { ""title"": ""奖惩信息区"", ""name"": ""RewardsArea"", ""children"": [] }, { ""title"": ""自定义区域"", ""name"": ""CustomizeArea"", ""children"": [ { ""groupName"": ""控件选择"", ""groupList"": [ { ""type"": ""Input"", ""field"": null, ""text"": ""单行文本框"" }, { ""type"": ""InputTextArea"", ""field"": null, ""text"": ""多行文本框"" }, { ""type"": ""ApiSelect"", ""field"": null, ""text"": ""下拉框"" } ] } ] }, { ""title"": ""引用区域"", ""name"": ""QuoteArea"", ""children"": [] }, { ""title"": ""流程区域"", ""name"": ""FlowArea"", ""children"": [] }, { ""title"": ""附件区域"", ""name"": ""FileUploadArea"", ""children"": [] } ]"; var Result = JArray.Parse(JsonStr); return ServiceResult.OprateSuccess("查询成功!", Result); } /// /// 获取 指标匹配字段 /// /// public async Task> ItemMatchField() { string sql = @"select field,label,dbo.FS_GetdataSourceBySet(dataSource,APIDataSourceType,Ghrs_PageSettingEdit.APIDataSourceID) dataSource ,elementType,dataType from Ghrs_PageSettingEdit where IsEnable=1 and pageNo = 'F_PerformanceItem' and (field like 'Tag%')"; DataTable dt = await Db.Ado.GetDataTableAsync(sql); return ServiceResult.OprateSuccess("查询成功!", dt); } #endregion } }