From ebee35ce26b1c468c545aacb035c26da9e5e3e91 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Fri, 24 May 2024 10:43:10 +0800 Subject: [PATCH] =?UTF-8?q?2.=E4=BF=AE=E6=94=B9=E8=AF=95=E5=8D=B7=E9=A1=B5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=20=E6=8C=89=E9=92=AEicon=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Services/CommonServices.cs | 146 ++++++++++++------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index f663308a..8e69b28c 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -274,79 +274,6 @@ public partial class CommonServices : BaseServices>, ICommon sql = string.Format(sql, param.menuName, App.User.ID, param.langId); result.JM_PageControlT1.Toolbar = DbAccess.QueryList(sql); - #region 特殊处理 - var toolbar = new Toolbar(); - var index = -1; - switch (param.menuName) - { - case "F_QuestionBank": - toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault(); - if (toolbar != null) { toolbar.fnKey = "TBD1YN"; } - toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "UpdateYN").FirstOrDefault(); - if (toolbar != null) { toolbar.fnKey = "TBD2YN"; } - break; - case "F_ExamPaperDraft": - toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault(); - if (toolbar != null) { toolbar.fnKey = "TBD1YN"; } - toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "UpdateYN").FirstOrDefault(); - if (toolbar != null) { toolbar.fnKey = "TBD2YN"; } - toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault(); - if (toolbar != null) { toolbar.fnKey = "TBD3YN"; } - - index = result.JM_PageControlT1.Toolbar.FindIndex(x => x.fnKey == "TBD1YN"); - result.JM_PageControlT1.Toolbar.Insert(index + 1, new Toolbar() - { - display = true, - fnKey = "TBD4YN", - fnTitle = "发布", - fnType = "table", - icon = "ghr-publish", - position = "left" - }); - - break; - case "F_ExamPaperReleased": - toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault(); - if (toolbar != null) { toolbar.fnKey = "TBD3YN"; } - - result.JM_PageControlT1.Toolbar.Insert(0, new Toolbar() - { - display = true, - fnKey = "TBD4YN", - fnTitle = "取消发布", - fnType = "table", - icon = "ghr-publish", - position = "left" - }); - result.JM_PageControlT1.Toolbar.Insert(1, new Toolbar() - { - display = true, - fnKey = "TBD5YN", - fnTitle = "停用", - fnType = "table", - icon = "ghr-publish", - position = "left" - }); - - break; - case "F_ExamPaperDisabled": - toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault(); - if (toolbar != null) { toolbar.fnKey = "TBD3YN"; } - - result.JM_PageControlT1.Toolbar.Insert(0, new Toolbar() - { - display = true, - fnKey = "TBD4YN", - fnTitle = "启用", - fnType = "table", - icon = "ghr-publish", - position = "left" - }); - break; - } - - #endregion - #endregion #region 定义表格页面的栏位, 含 表格栏位, 常用查询栏位, 高级查询栏位,可编辑栏位 @@ -919,6 +846,79 @@ public partial class CommonServices : BaseServices>, ICommon #endregion + + #region 特殊处理 + var toolbar = new Toolbar(); + var index = -1; + switch (param.menuName) + { + case "F_QuestionBank": + toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault(); + if (toolbar != null) { toolbar.fnKey = "TBD1YN"; } + toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "UpdateYN").FirstOrDefault(); + if (toolbar != null) { toolbar.fnKey = "TBD2YN"; } + break; + case "F_ExamPaperDraft": + toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault(); + if (toolbar != null) { toolbar.fnKey = "TBD1YN"; } + toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "UpdateYN").FirstOrDefault(); + if (toolbar != null) { toolbar.fnKey = "TBD2YN"; } + toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault(); + if (toolbar != null) { toolbar.fnKey = "TBD3YN"; } + + index = result.JM_PageControlT1.Toolbar.FindIndex(x => x.fnKey == "TBD1YN"); + result.JM_PageControlT1.Toolbar.Insert(index + 1, new Toolbar() + { + display = true, + fnKey = "TBD4YN", + fnTitle = "发布", + fnType = "table", + icon = "ghr-publish", + position = "left" + }); + + break; + case "F_ExamPaperReleased": + toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault(); + if (toolbar != null) { toolbar.fnKey = "TBD3YN"; } + + result.JM_PageControlT1.Toolbar.Insert(0, new Toolbar() + { + display = true, + fnKey = "TBD4YN", + fnTitle = "取消发布", + fnType = "table", + icon = "ghr-publish", + position = "left" + }); + result.JM_PageControlT1.Toolbar.Insert(1, new Toolbar() + { + display = true, + fnKey = "TBD5YN", + fnTitle = "停用", + fnType = "table", + icon = "ghr-icon-stop", + position = "left" + }); + + break; + case "F_ExamPaperDisabled": + toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault(); + if (toolbar != null) { toolbar.fnKey = "TBD3YN"; } + + result.JM_PageControlT1.Toolbar.Insert(0, new Toolbar() + { + display = true, + fnKey = "TBD4YN", + fnTitle = "启用", + fnType = "table", + icon = "ghr-icon-start", + position = "left" + }); + break; + } + + #endregion return new ServiceResult() { Success = true, Message = "查询成功", Data = result, }; } #endregion