diff --git a/projects/Infrastructure/Application/PagedListModel.cs b/projects/Infrastructure/Application/PagedListModel.cs index 4b570d77..dbeae828 100644 --- a/projects/Infrastructure/Application/PagedListModel.cs +++ b/projects/Infrastructure/Application/PagedListModel.cs @@ -4,7 +4,7 @@ namespace Infrastructure.Application { public class PagedListModel : PagedList { - [Display(Name = "已删除")] - public bool IsDeleted { get; set; } + //[Display(Name = "已删除")] + //public bool IsDeleted { get; set; } } } \ No newline at end of file diff --git a/projects/Infrastructure/Views/Shared/DisplayTemplates/ImageUrl.cshtml b/projects/Infrastructure/Views/Shared/DisplayTemplates/ImageUrl.cshtml index 8a39c6a7..89a405e0 100644 --- a/projects/Infrastructure/Views/Shared/DisplayTemplates/ImageUrl.cshtml +++ b/projects/Infrastructure/Views/Shared/DisplayTemplates/ImageUrl.cshtml @@ -1,2 +1,5 @@ @model string - \ No newline at end of file +@{ + var src = Model as string ?? "/images/empty.png"; +} + \ No newline at end of file diff --git a/projects/Infrastructure/Web/Mvc/CrudController.cs b/projects/Infrastructure/Web/Mvc/CrudController.cs index 6273e486..8b6d2a8f 100644 --- a/projects/Infrastructure/Web/Mvc/CrudController.cs +++ b/projects/Infrastructure/Web/Mvc/CrudController.cs @@ -34,10 +34,10 @@ namespace Infrastructure.Web.Mvc throw new ArgumentNullException(nameof(model)); } var query = this.Repo.ReadOnlyTable(); - if (model is ISoftDeleteEntity && !model.IsDeleted) - { - query = query.Where(o => o.IsDeleted == null); - } + //if (model is ISoftDeleteEntity && !model.IsDeleted) + //{ + // query = query.Where(o => o.IsDeleted == null); + //} query = this.Include(query); query = this.Query(model, query); model.TotalCount = query.Count(); diff --git a/projects/Infrastructure/Web/Mvc/DynamicController/GenericController.cs b/projects/Infrastructure/Web/Mvc/DynamicController/GenericController.cs index f981e853..afea83ff 100644 --- a/projects/Infrastructure/Web/Mvc/DynamicController/GenericController.cs +++ b/projects/Infrastructure/Web/Mvc/DynamicController/GenericController.cs @@ -35,10 +35,10 @@ namespace Infrastructure.Web.Mvc throw new ArgumentNullException(nameof(model)); } var query = this.Repo.ReadOnlyTable(); - if (model is ISoftDeleteEntity && !model.IsDeleted) - { - query = query.Where(o => o.IsDeleted == null); - } + //if (model is ISoftDeleteEntity && !model.IsDeleted) + //{ + // query = query.Where(o => o.IsDeleted == null); + //} query = this.Include(query); query = this.Query(model, query); model.TotalCount = query.Count(); diff --git a/projects/IoT.Shared/Areas/Admin/Controlls/AjaxController.cs b/projects/IoT.Shared/Areas/Admin/Controlls/AjaxController.cs index ae8f6baf..6636fe34 100644 --- a/projects/IoT.Shared/Areas/Admin/Controlls/AjaxController.cs +++ b/projects/IoT.Shared/Areas/Admin/Controlls/AjaxController.cs @@ -186,6 +186,20 @@ namespace IoT.Shared.Areas.Admin.Controlls return new JsonResult(this.GetDeviceSelectList(parentId, selected)); } + public SelectList GetDeviceSelectList2(Guid parentId, Guid? selected = null) + { + var list = this._deviceRepo.ReadOnlyTable() + .Where(o => o.NodeId == parentId && o.Product.Apis.Count() > 0) + .Select(o => new { o.Id, Name = $"{o.DisplayName}({o.Number})" }) + .ToList(); + return new SelectList(list, "Id", "Name", selected); + } + + public JsonResult GetDeviceJson2(Guid parentId, Guid? selected) + { + return new JsonResult(this.GetDeviceSelectList2(parentId, selected)); + } + #endregion Device #region Data diff --git a/projects/IoT.Shared/Areas/Admin/Controlls/CommandController.cs b/projects/IoT.Shared/Areas/Admin/Controlls/CommandController.cs index dba0e020..fa11768c 100644 --- a/projects/IoT.Shared/Areas/Admin/Controlls/CommandController.cs +++ b/projects/IoT.Shared/Areas/Admin/Controlls/CommandController.cs @@ -71,7 +71,7 @@ namespace IoT.Shared.Areas.Admin.Controlls { this.ToDisplayModel(entity, model); ViewData.SelectList(o => model.NodeId, () => this._ajax.GetNodeSelectList(model.NodeId)); - ViewData.SelectList(o => model.DeviceId, () => this._ajax.GetDeviceSelectList(model.NodeId.Value, model.DeviceId), model.NodeId.HasValue); + ViewData.SelectList(o => model.DeviceId, () => this._ajax.GetDeviceSelectList2(model.NodeId.Value, model.DeviceId), model.NodeId.HasValue); ViewData.SelectList(o => model.ApiId, () => this._ajax.GetApiSelectList(model.DeviceId.Value, model.ApiId), model.DeviceId.HasValue); if (model.ApiId.HasValue) { diff --git a/projects/IoT.Shared/Areas/Admin/Views/Command/_Script.cshtml b/projects/IoT.Shared/Areas/Admin/Views/Command/_Script.cshtml index 9d91eb1d..e60456b5 100644 --- a/projects/IoT.Shared/Areas/Admin/Views/Command/_Script.cshtml +++ b/projects/IoT.Shared/Areas/Admin/Views/Command/_Script.cshtml @@ -3,7 +3,7 @@ $('#NodeId').change(function () { var id = $(this).find(':selected').val(); update('@Url.Action("GetSceneJson", "Ajax")', id, "#SceneId"); - update('@Url.Action("GetDeviceJson", "Ajax")', id, "#DeviceId"); + update('@Url.Action("GetDeviceJson2", "Ajax")', id, "#DeviceId"); update(null, null, "#ApiId"); $('#ajax').html(''); diff --git a/projects/IoTCenter/Areas/Admin/Views/Shared/_Menu.cshtml b/projects/IoTCenter/Areas/Admin/Views/Shared/_Menu.cshtml index e5ae748c..9d2d314d 100644 --- a/projects/IoTCenter/Areas/Admin/Views/Shared/_Menu.cshtml +++ b/projects/IoTCenter/Areas/Admin/Views/Shared/_Menu.cshtml @@ -1,28 +1,93 @@ @functions{ diff --git a/projects/IoTCenter/db.sql b/projects/IoTCenter/db.sql index 81170e6e..6c1d65f8 100644 --- a/projects/IoTCenter/db.sql +++ b/projects/IoTCenter/db.sql @@ -22,9 +22,7 @@ CREATE TABLE "iot_Node" ( "Number" TEXT NOT NULL, "IsOnline" INTEGER NOT NULL, "Image" TEXT NULL, - "Longitude" TEXT NOT NULL, - "Latitude" TEXT NOT NULL, - "Altitude" TEXT NOT NULL, + "Version" TEXT NULL, "DisplayOrder" INTEGER NOT NULL, "Disabled" INTEGER NOT NULL ); diff --git a/projects/IoTNode/Areas/Admin/Views/Shared/_Menu.cshtml b/projects/IoTNode/Areas/Admin/Views/Shared/_Menu.cshtml index b078ace4..9980dc89 100644 --- a/projects/IoTNode/Areas/Admin/Views/Shared/_Menu.cshtml +++ b/projects/IoTNode/Areas/Admin/Views/Shared/_Menu.cshtml @@ -1,21 +1,73 @@ @functions{ public string GetClass(params string[] controllers) diff --git a/projects/IoTNode/db.sql b/projects/IoTNode/db.sql index 6f9904b6..d661a67a 100644 --- a/projects/IoTNode/db.sql +++ b/projects/IoTNode/db.sql @@ -13,9 +13,7 @@ CREATE TABLE "iot_Node" ( "Number" TEXT NOT NULL, "IsOnline" INTEGER NOT NULL, "Image" TEXT NULL, - "Longitude" TEXT NOT NULL, - "Latitude" TEXT NOT NULL, - "Altitude" TEXT NOT NULL, + "Version" TEXT NULL, "DisplayOrder" INTEGER NOT NULL, "Disabled" INTEGER NOT NULL ); diff --git a/projects/UserCenter/Application/Models/EditUserModel.cs b/projects/UserCenter/Application/Models/EditUserModel.cs index 2aef0b29..b3c142d2 100644 --- a/projects/UserCenter/Application/Models/EditUserModel.cs +++ b/projects/UserCenter/Application/Models/EditUserModel.cs @@ -2,6 +2,7 @@ using Application.Domain.Entities; using Infrastructure.Application; using System; using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace Application.Models @@ -15,6 +16,7 @@ namespace Application.Models [Display(Name = "用户名")] public string UserName { get; set; } + [Description("编辑时不修改密码请保持为空")] [StringLength(100, MinimumLength = 6, ErrorMessage = "密码长度范围为{2}-{1}")] [DataType(DataType.Password)] [Display(Name = "登录密码")] @@ -23,6 +25,7 @@ namespace Application.Models [DataType(DataType.EmailAddress)] [RegularExpression(@"^\w+@\w+\.\w+$", ErrorMessage = "邮箱格式错误")] [Display(Name = "邮箱")] + [Required(ErrorMessage = nameof(RequiredAttribute))] public string Email { get; set; } [RegularExpression(@"^\d{11}$", ErrorMessage = "手机号格式错误")] @@ -38,10 +41,6 @@ namespace Application.Models [DataType(DataType.ImageUrl)] public string Avatar { get; set; } - [Display(Name = "面部图像")] - [DataType(DataType.ImageUrl)] - public string FaceImage { get; set; } - [Display(Name = "性别")] [UIHint("RadioButtonList")] [Required(ErrorMessage = nameof(RequiredAttribute))] @@ -54,13 +53,6 @@ namespace Application.Models [Display(Name = "登录锁定")] public bool LockoutEnabled { get; set; } - [Display(Name = "解锁时间")] - [DataType(DataType.DateTime)] - public DateTimeOffset? LockoutEnd { get; set; } - - [Display(Name = "登录失败")] - public int AccessFailedCount { get; set; } - [DataType("MultiSelectList")] [Display(Name = "角色")] public List Roles { get; set; } = new List(); diff --git a/projects/UserCenter/Areas/Admin/Views/Shared/_Menu.cshtml b/projects/UserCenter/Areas/Admin/Views/Shared/_Menu.cshtml index f36e08ac..148b0c49 100644 --- a/projects/UserCenter/Areas/Admin/Views/Shared/_Menu.cshtml +++ b/projects/UserCenter/Areas/Admin/Views/Shared/_Menu.cshtml @@ -1,10 +1,25 @@ @functions{ public string GetClass(params string[] controllers)