田爽 9 mesi fa
parent
commit
befa87d2d7

+ 1 - 1
src/Hotline/Caching/Services/SysDicDataCacheManager.cs

@@ -21,7 +21,7 @@ namespace Hotline.Caching.Services
         {
             var sysDicDataList = _cacheSysDicData.GetOrSet(code, k =>
             {
-                return _sysDicDataRepository.Queryable().Where(x => x.DicTypeCode == code).OrderBy(x=>x.Sort).ToTreeAsync(x => x.Children, it => it.ParentId, "").GetAwaiter().GetResult();
+                return _sysDicDataRepository.Queryable().Where(x => x.DicTypeCode == code && x.IsShow == true).OrderBy(x=>x.Sort).ToTreeAsync(x => x.Children, it => it.ParentId, "").GetAwaiter().GetResult();
             });
             return sysDicDataList;
         }

+ 11 - 4
src/Hotline/Settings/SystemDicData.cs

@@ -5,8 +5,8 @@ using XF.Domain.Repository;
 namespace Hotline.Settings
 {
     [Description("字典表")]
-    public class SystemDicData: CreationEntity
-    {
+    public class SystemDicData : FullStateEntity
+	{
         /// <summary>
         /// 字典类型Id
         /// </summary>
@@ -32,10 +32,17 @@ namespace Hotline.Settings
         /// </summary>
         [SugarColumn(DefaultValue = "0")]
         public int Sort { get; set; }
+
         /// <summary>
-        /// 上级ID
+        /// 是否显示
         /// </summary>
-        [SugarColumn(IsNullable = true)]
+        [SugarColumn(DefaultValue = "true")]
+		public bool IsShow { get; set; }
+
+		/// <summary>
+		/// 上级ID
+		/// </summary>
+		[SugarColumn(IsNullable = true)]
         public string? ParentId { get; set; }
 
         [SugarColumn(IsIgnore = true)]