master
xiaochanghai 1 year ago
parent 44c1e4ac1f
commit 26c5f3dbb0
  1. 11
      Tiobon.Core.Services/CommonServices.cs
  2. 8
      Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs

@ -937,6 +937,17 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "CopyYN").FirstOrDefault(); toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "CopyYN").FirstOrDefault();
if (toolbar != null) { toolbar.fnKey = "TBD4YN"; } if (toolbar != null) { toolbar.fnKey = "TBD4YN"; }
index = result.JM_PageControlT1.Toolbar.FindIndex(x => x.fnKey == "TBD2YN");
result.JM_PageControlT1.Toolbar.Insert(index + 1, new Toolbar()
{
display = true,
fnKey = "TBD5YN",
fnTitle = "下载",
fnType = "row",
icon = "ghr-icon-download",
position = "left"
});
break; break;
case "F_Training_Course_Draft": case "F_Training_Course_Draft":

@ -86,15 +86,19 @@ namespace Tiobon.Core.Services
public override async Task<ServicePageResult<Ghre_CourseWareDto>> QueryFilterPage(QueryBody body) public override async Task<ServicePageResult<Ghre_CourseWareDto>> QueryFilterPage(QueryBody body)
{ {
var result = await base.QueryFilterPage(body); var result = await base.QueryFilterPage(body);
result.result.DT_TableDataT1.ForEach(async x => var data = result.result.DT_TableDataT1;
var attachmentIds = data.Select(x => x.Id).ToList();
var attachments = await _ghre_CourseWareAttachmentServices.Query(x => x.CourseWareId != null && attachmentIds.Contains(x.CourseWareId.Value));
data.ForEach(async x =>
{ {
if (!string.IsNullOrWhiteSpace(x.CourseIds)) if (!string.IsNullOrWhiteSpace(x.CourseIds))
x.CourseIds2 = JsonConvert.DeserializeObject<List<long>>(x.CourseIds); x.CourseIds2 = JsonConvert.DeserializeObject<List<long>>(x.CourseIds);
x.StudyDuration = $"{x.Hours}小时{x.Minutes}分钟"; x.StudyDuration = $"{x.Hours}小时{x.Minutes}分钟";
x.SourceLabel = await GetParaLabel("CourseWareSource", x.Source); x.SourceLabel = await GetParaLabel("CourseWareSource", x.Source);
x.Attachments = attachments.Where(a=> a.CourseWareId == x.Id).ToList();
}); });
result.result.DT_TableDataT1 = data;
return result; return result;
} }

Loading…
Cancel
Save