瀏覽代碼

修复同步视图,插入判断逻辑错误
新增视图信息编辑
数据字典查询数据精简
更新数据包

zhontai 3 年之前
父節點
當前提交
c6d250aa69

+ 5 - 0
Admin.Core.Model/Admin/ViewEntity.cs

@@ -49,6 +49,11 @@ namespace Admin.Core.Model.Admin
         /// </summary>
         public bool Enabled { get; set; } = true;
 
+        /// <summary>
+        /// 缓存
+        /// </summary>
+        public bool Cache { get; set; } = true;
+
         /// <summary>
         /// 排序
         /// </summary>

+ 2 - 2
Admin.Core.Service/Admin/Dictionary/Input/DictionaryAddInput.cs

@@ -6,9 +6,9 @@
     public class DictionaryAddInput
     {
         /// <summary>
-        /// 字典父级
+        /// 字典类型Id
         /// </summary>
-		public long ParentId { get; set; }
+        public long DictionaryTypeId { get; set; }
 
         /// <summary>
         /// 字典名称

+ 0 - 15
Admin.Core.Service/Admin/Dictionary/Output/DictionaryListOutput.cs

@@ -9,11 +9,6 @@ namespace Admin.Core.Service.Admin.Dictionary.Output
         /// </summary>
         public long Id { get; set; }
 
-        /// <summary>
-        /// 字典父级
-        /// </summary>
-		public long ParentId { get; set; }
-
         /// <summary>
         /// 字典名称
         /// </summary>
@@ -29,19 +24,9 @@ namespace Admin.Core.Service.Admin.Dictionary.Output
         /// </summary>
         public string Value { get; set; }
 
-        /// <summary>
-        /// 描述
-        /// </summary>
-        public string Description { get; set; }
-
         /// <summary>
         /// 启用
         /// </summary>
 		public bool Enabled { get; set; }
-
-        /// <summary>
-        /// 创建时间
-        /// </summary>
-        public DateTime? CreatedTime { get; set; }
     }
 }

+ 0 - 10
Admin.Core.Service/Admin/DictionaryType/Output/DictionaryTypeListOutput.cs

@@ -19,19 +19,9 @@ namespace Admin.Core.Service.Admin.DictionaryType.Output
         /// </summary>
         public string Code { get; set; }
 
-        /// <summary>
-        /// 描述
-        /// </summary>
-        public string Description { get; set; }
-
         /// <summary>
         /// 启用
         /// </summary>
 		public bool Enabled { get; set; }
-
-        /// <summary>
-        /// 创建时间
-        /// </summary>
-        public DateTime? CreatedTime { get; set; }
     }
 }

+ 15 - 0
Admin.Core.Service/Admin/View/Input/ViewSyncDto.cs

@@ -11,5 +11,20 @@
         /// 地址
         /// </summary>
         public string Path { get; set; }
+
+        /// <summary>
+        /// 视图名称
+        /// </summary>
+        public string Label { get; set; }
+
+        /// <summary>
+        /// 说明
+        /// </summary>
+        public string Description { get; set; }
+
+        /// <summary>
+        /// 缓存
+        /// </summary>
+        public bool Cache { get; set; } = true;
     }
 }

+ 11 - 4
Admin.Core.Service/Admin/View/ViewService.cs

@@ -125,13 +125,16 @@ namespace Admin.Core.Service.Admin.View
 
             //ÅúÁ¿²åÈë
             {
-                var inputViews = (from a in input.Views where !paths.Contains(a.Path) || !names.Contains(a.Name) select a).ToList();
+                var inputViews = (from a in input.Views where !(paths.Contains(a.Path) || names.Contains(a.Name)) select a).ToList();
                 if (inputViews.Count > 0)
                 {
                     var insertViews = Mapper.Map<List<ViewEntity>>(inputViews);
                     foreach (var insertView in insertViews)
                     {
-                        insertView.Label = insertView.Name;
+                        if (insertView.Label.IsNull())
+                        {
+                            insertView.Label = insertView.Name;
+                        }
                     }
                     insertViews = await _viewRepository.InsertAsync(insertViews);
                     views.AddRange(insertViews);
@@ -152,7 +155,11 @@ namespace Admin.Core.Service.Admin.View
                         var inputView = input.Views.Where(a => a.Name == view.Name || a.Path == view.Path).FirstOrDefault();
                         if (view.Label.IsNull())
                         {
-                            view.Label = inputView.Name;
+                            view.Label = inputView.Label ?? inputView.Name;
+                        }
+                        if (view.Description.IsNull())
+                        {
+                            view.Description = inputView.Description;
                         }
                         view.Name = inputView.Name;
                         view.Path = inputView.Path;
@@ -172,7 +179,7 @@ namespace Admin.Core.Service.Admin.View
 
                 updateViews.AddRange(disabledViews);
                 await _viewRepository.UpdateDiy.SetSource(updateViews)
-                .UpdateColumns(a => new { a.Label, a.Name, a.Path, a.Enabled })
+                .UpdateColumns(a => new { a.Label, a.Name, a.Path, a.Enabled, a.Description })
                 .ExecuteAffrowsAsync();
             }
             

+ 5 - 0
Admin.Core/Admin.Core.Model.xml

@@ -699,6 +699,11 @@
             启用
             </summary>
         </member>
+        <member name="P:Admin.Core.Model.Admin.ViewEntity.Cache">
+            <summary>
+            缓存
+            </summary>
+        </member>
         <member name="P:Admin.Core.Model.Admin.ViewEntity.Sort">
             <summary>
             排序

+ 17 - 27
Admin.Core/Admin.Core.Service.xml

@@ -435,21 +435,11 @@
             字典编码
             </summary>
         </member>
-        <member name="P:Admin.Core.Service.Admin.DictionaryType.Output.DictionaryTypeListOutput.Description">
-            <summary>
-            描述
-            </summary>
-        </member>
         <member name="P:Admin.Core.Service.Admin.DictionaryType.Output.DictionaryTypeListOutput.Enabled">
             <summary>
             启用
             </summary>
         </member>
-        <member name="P:Admin.Core.Service.Admin.DictionaryType.Output.DictionaryTypeListOutput.CreatedTime">
-            <summary>
-            创建时间
-            </summary>
-        </member>
         <member name="T:Admin.Core.Service.Admin.DictionaryType.MapConfig">
             <summary>
             映射配置
@@ -460,9 +450,9 @@
             添加
             </summary>
         </member>
-        <member name="P:Admin.Core.Service.Admin.Dictionary.Input.DictionaryAddInput.ParentId">
+        <member name="P:Admin.Core.Service.Admin.Dictionary.Input.DictionaryAddInput.DictionaryTypeId">
             <summary>
-            字典父级
+            字典类型Id
             </summary>
         </member>
         <member name="P:Admin.Core.Service.Admin.Dictionary.Input.DictionaryAddInput.Name">
@@ -510,11 +500,6 @@
             主键Id
             </summary>
         </member>
-        <member name="P:Admin.Core.Service.Admin.Dictionary.Output.DictionaryListOutput.ParentId">
-            <summary>
-            字典父级
-            </summary>
-        </member>
         <member name="P:Admin.Core.Service.Admin.Dictionary.Output.DictionaryListOutput.Name">
             <summary>
             字典名称
@@ -530,21 +515,11 @@
             字典值
             </summary>
         </member>
-        <member name="P:Admin.Core.Service.Admin.Dictionary.Output.DictionaryListOutput.Description">
-            <summary>
-            描述
-            </summary>
-        </member>
         <member name="P:Admin.Core.Service.Admin.Dictionary.Output.DictionaryListOutput.Enabled">
             <summary>
             启用
             </summary>
         </member>
-        <member name="P:Admin.Core.Service.Admin.Dictionary.Output.DictionaryListOutput.CreatedTime">
-            <summary>
-            创建时间
-            </summary>
-        </member>
         <member name="T:Admin.Core.Service.Admin.Dictionary.MapConfig">
             <summary>
             映射配置
@@ -1736,6 +1711,21 @@
             地址
             </summary>
         </member>
+        <member name="P:Admin.Core.Service.Admin.View.Input.ViewSyncDto.Label">
+            <summary>
+            视图名称
+            </summary>
+        </member>
+        <member name="P:Admin.Core.Service.Admin.View.Input.ViewSyncDto.Description">
+            <summary>
+            说明
+            </summary>
+        </member>
+        <member name="P:Admin.Core.Service.Admin.View.Input.ViewSyncDto.Cache">
+            <summary>
+            缓存
+            </summary>
+        </member>
         <member name="T:Admin.Core.Service.Admin.View.Input.ViewUpdateInput">
             <summary>
             修改

File diff suppressed because it is too large
+ 0 - 0
Admin.Core/Db/Data/data-share.json


File diff suppressed because it is too large
+ 0 - 0
Admin.Core/Db/Data/data.json


Some files were not shown because too many files changed in this diff