From 3cca6b0e4823b92eeefc865018d7058cd2962cd7 Mon Sep 17 00:00:00 2001 From: ky_yusj <2655568377@qq.com> Date: Thu, 6 May 2021 19:21:14 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Api/Ewide.Application/Ewide.Application.xml | 2 +- .../Dto/HouseProjectInfoInput.cs | 26 +-- .../Dto/HouseProjectOutput.cs | 10 +- .../HouseProjectInfoService.cs | 20 +- .../IHouseProjectInfoService.cs | 2 +- .../api/requests/business/houseProjectInfo.js | 6 +- Web/src/components/yoTreeLayout/index.js | 4 +- .../pages/business/houseprojectinfo/form.vue | 127 ++++++++++ .../pages/business/houseprojectinfo/index.vue | 216 +++++++++++++++--- 9 files changed, 341 insertions(+), 72 deletions(-) create mode 100644 Web/src/pages/business/houseprojectinfo/form.vue diff --git a/Api/Ewide.Application/Ewide.Application.xml b/Api/Ewide.Application/Ewide.Application.xml index 55480a5..d00d013 100644 --- a/Api/Ewide.Application/Ewide.Application.xml +++ b/Api/Ewide.Application/Ewide.Application.xml @@ -23,7 +23,7 @@ - + 编辑项目 diff --git a/Api/Ewide.Application/Service/HouseProjectInfo/Dto/HouseProjectInfoInput.cs b/Api/Ewide.Application/Service/HouseProjectInfo/Dto/HouseProjectInfoInput.cs index 1d4365a..0bbb214 100644 --- a/Api/Ewide.Application/Service/HouseProjectInfo/Dto/HouseProjectInfoInput.cs +++ b/Api/Ewide.Application/Service/HouseProjectInfo/Dto/HouseProjectInfoInput.cs @@ -13,39 +13,27 @@ namespace Ewide.Application.Service.HouseProjectInfo.Dto public string Name { get; set; } public string Note { get; set; } public int Sort { get; set; } - public string AreaID { get; set; } + public string AreaId { get; set; } public string AreaName { get; set; } public int Type { get; set; } - public DateTime? CreatedTime { get; set; } - public DateTime? UpdatedTime { get; set; } - public string CreatedUserId { get; set; } - public string CreatedUserName { get; set; } - public string UpdatedUserId { get; set; } - public string UpdatedUserName { get; set; } } public class AddProjectInput : HouseProjectInfoInput { - [Required(ErrorMessage = "项目ID不可为空")] - public string ID { get; set; } + } - public class UpdateProjectInput + public class UpdateProjectInput : HouseProjectInfoInput { - public string ID { get; set; } - public string Note { get; set; } - - public int Type { get; set; } - public DateTime? UpdatedTime { get; set; } - public string UpdatedUserId { get; set; } - public string UpdatedUserName { get; set; } + [Required(ErrorMessage = "项目ID不可为空")] + public string Id { get; set; } } public class DeleteProjectInput { [Required(ErrorMessage = "项目ID不可为空")] - public string ID { get; set; } + public string Id { get; set; } } - public class QueryProjectInput : AddProjectInput + public class QueryProjectInput : UpdateProjectInput { } diff --git a/Api/Ewide.Application/Service/HouseProjectInfo/Dto/HouseProjectOutput.cs b/Api/Ewide.Application/Service/HouseProjectInfo/Dto/HouseProjectOutput.cs index dfe6d45..9558ace 100644 --- a/Api/Ewide.Application/Service/HouseProjectInfo/Dto/HouseProjectOutput.cs +++ b/Api/Ewide.Application/Service/HouseProjectInfo/Dto/HouseProjectOutput.cs @@ -8,18 +8,12 @@ namespace Ewide.Application.Service.HouseProjectInfo.Dto { public class HouseProjectOutput { - public string ID { get; set; } + public string Id { get; set; } public string Name { get; set; } public string Note { get; set; } public int Sort { get; set; } - public string AreaID { get; set; } + public string AreaId { get; set; } public string AreaName { get; set; } public int Type { get; set; } - public DateTime CreatedTime { get; set; } - public DateTime UpdatedTime { get; set; } - public string CreatedUserId { get; set; } - public string CreatedUserName { get; set; } - public string UpdatedUserId { get; set; } - public string UpdatedUserName { get; set; } } } diff --git a/Api/Ewide.Application/Service/HouseProjectInfo/HouseProjectInfoService.cs b/Api/Ewide.Application/Service/HouseProjectInfo/HouseProjectInfoService.cs index 67f84c2..42b951c 100644 --- a/Api/Ewide.Application/Service/HouseProjectInfo/HouseProjectInfoService.cs +++ b/Api/Ewide.Application/Service/HouseProjectInfo/HouseProjectInfoService.cs @@ -50,7 +50,7 @@ namespace Ewide.Application.Service.HouseProjectInfo [HttpPost("/houseProjectInfo/delete")] public async Task DeleteProject(DeleteProjectInput input) { - var project = _houseProjectInfoRep.FirstOrDefault(p => p.Id == input.ID) ; + var project = _houseProjectInfoRep.FirstOrDefault(p => p.Id == input.Id) ; await project.DeleteNowAsync(); } @@ -60,10 +60,10 @@ namespace Ewide.Application.Service.HouseProjectInfo /// /// [HttpPost("/houseProjectInfo/edit")] - public async Task UpdateProject(AddProjectInput input) + public async Task UpdateProject(UpdateProjectInput input) { var project = input.Adapt(); - await project.UpdateNowAsync(); + await project.UpdateExcludeAsync(new[] { nameof(BsHouseProjectInfo.AreaId), nameof(BsHouseProjectInfo.AreaName)}, true); } /// @@ -82,14 +82,14 @@ namespace Ewide.Application.Service.HouseProjectInfo /// /// /// - [HttpGet("/houseProjectInfo/page")] - public async Task QueryProjectPageList([FromQuery] HouseProjectInfoInput input) + [HttpPost("/houseProjectInfo/page")] + public async Task QueryProjectPageList([FromBody] HouseProjectInfoInput input) { - var areaID = !string.IsNullOrEmpty(input.AreaID); + var areaID = !string.IsNullOrEmpty(input.AreaId); var projects = await _houseProjectInfoRep.DetachedEntities - .Where(areaID, p => p.AreaId == input.AreaID) - .Select(p => p.Adapt()).ToPagedListAsync(input.PageNo, input.PageSize); - return XnPageResult.PageResult(projects); + .Where(areaID, p => p.AreaId == input.AreaId) + .Select(p => p.Adapt()).ToPagedListAsync(input.PageNo, input.PageSize); + return XnPageResult.PageResult(projects); } /// @@ -100,7 +100,7 @@ namespace Ewide.Application.Service.HouseProjectInfo [HttpGet("/houseProjectInfo/detail")] public async Task GetProject([FromQuery] QueryProjectInput input) { - var user = await _houseProjectInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == input.ID); + var user = await _houseProjectInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == input.Id); var userDto = user.Adapt(); return userDto; diff --git a/Api/Ewide.Application/Service/HouseProjectInfo/IHouseProjectInfoService.cs b/Api/Ewide.Application/Service/HouseProjectInfo/IHouseProjectInfoService.cs index 6c50503..a004011 100644 --- a/Api/Ewide.Application/Service/HouseProjectInfo/IHouseProjectInfoService.cs +++ b/Api/Ewide.Application/Service/HouseProjectInfo/IHouseProjectInfoService.cs @@ -13,7 +13,7 @@ namespace Ewide.Application.Service.HouseProjectInfo { Task AddProject(AddProjectInput input); Task DeleteProject(DeleteProjectInput input); - Task UpdateProject(AddProjectInput input); + Task UpdateProject(UpdateProjectInput input); Task GetProjectById([FromRoute] string id); Task GetProject([FromQuery] QueryProjectInput input); Task QueryProjectPageList([FromQuery] HouseProjectInfoInput input); diff --git a/Web/src/common/api/requests/business/houseProjectInfo.js b/Web/src/common/api/requests/business/houseProjectInfo.js index 4d9490b..bad72bd 100644 --- a/Web/src/common/api/requests/business/houseProjectInfo.js +++ b/Web/src/common/api/requests/business/houseProjectInfo.js @@ -1,3 +1,7 @@ export default { - getHouseProjectPage :['/houseProjectInfo/page','get'], + getHouseProjectPage: ['/houseProjectInfo/page', 'post'], + houseProejctAdd: ['/houseProjectInfo/add', 'post'], + houseProejctEdit: ['/houseProjectInfo/edit', 'post'], + houseProejctDelete: ['/houseProjectInfo/delete', 'post'], + houseProejctDetail:['/houseProjectInfo/detail','get'] } \ No newline at end of file diff --git a/Web/src/components/yoTreeLayout/index.js b/Web/src/components/yoTreeLayout/index.js index 7a05d81..9373170 100644 --- a/Web/src/components/yoTreeLayout/index.js +++ b/Web/src/components/yoTreeLayout/index.js @@ -195,8 +195,8 @@ export default { const { key } = data[i] this.list.push({ key, - id: data[i][this.replaceFields.value], - title: data[i][this.replaceFields.title] + [this.replaceFields.value]: data[i][this.replaceFields.value], + [this.replaceFields.title]: data[i][this.replaceFields.title] }) if (data[i][this.replaceFields.children]) { this.generateList(data[i][this.replaceFields.children]) diff --git a/Web/src/pages/business/houseprojectinfo/form.vue b/Web/src/pages/business/houseprojectinfo/form.vue new file mode 100644 index 0000000..33c582c --- /dev/null +++ b/Web/src/pages/business/houseprojectinfo/form.vue @@ -0,0 +1,127 @@ + + \ No newline at end of file diff --git a/Web/src/pages/business/houseprojectinfo/index.vue b/Web/src/pages/business/houseprojectinfo/index.vue index 28cf4f5..1347bb3 100644 --- a/Web/src/pages/business/houseprojectinfo/index.vue +++ b/Web/src/pages/business/houseprojectinfo/index.vue @@ -1,41 +1,146 @@ + \ No newline at end of file