From f7f8bad301195af9e732137b8377e5783f105405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= <454313500@qq.com> Date: Tue, 20 Feb 2024 15:34:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=B9=E6=8E=A5=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E6=88=90=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SqlSugarDbContext.cs | 1 + .../TemplateDataSeed.cs | 22 +++- .../Dtos/Notice/NoticeCreateInput.cs | 17 +++ .../Dtos/Notice/NoticeGetListInput.cs | 14 ++ .../Dtos/Notice/NoticeGetListOutputDto.cs | 20 +++ .../Dtos/Notice/NoticeGetOutputDto.cs | 20 +++ .../Dtos/Notice/NoticeUpdateInput.cs | 13 ++ .../IServices/INoticeService.cs | 13 ++ .../Services/NoticeService.cs | 39 ++++++ .../Yi.Abp.Web/Properties/launchSettings.json | 4 +- Yi.RuoYi.Vue3/src/api/system/notice.js | 18 +-- .../src/views/system/notice/index.vue | 120 +++++++++++------- 12 files changed, 235 insertions(+), 66 deletions(-) create mode 100644 Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeCreateInput.cs create mode 100644 Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetListInput.cs create mode 100644 Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetListOutputDto.cs create mode 100644 Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetOutputDto.cs create mode 100644 Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeUpdateInput.cs create mode 100644 Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/IServices/INoticeService.cs create mode 100644 Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/NoticeService.cs diff --git a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarDbContext.cs b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarDbContext.cs index 34f2ec21..edfcf258 100644 --- a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarDbContext.cs +++ b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarDbContext.cs @@ -60,6 +60,7 @@ namespace Yi.Framework.SqlSugarCore { options.ConnectionString = currentConnection; })); + connectionCreator.SetDbAop(SqlSugarClient); } /// diff --git a/Yi.Abp.Net8/module/code-gen/Yi.Framework.CodeGen.SqlSugarCore/TemplateDataSeed.cs b/Yi.Abp.Net8/module/code-gen/Yi.Framework.CodeGen.SqlSugarCore/TemplateDataSeed.cs index 348cdaf9..7787d19c 100644 --- a/Yi.Abp.Net8/module/code-gen/Yi.Framework.CodeGen.SqlSugarCore/TemplateDataSeed.cs +++ b/Yi.Abp.Net8/module/code-gen/Yi.Framework.CodeGen.SqlSugarCore/TemplateDataSeed.cs @@ -28,7 +28,7 @@ namespace Yi.Framework.CodeGen.SqlSugarCore Name= "Entity", BuildPath= "D:\\code\\Entities\\@ModelEntity.cs", Remarks= "实体", - TemplateStr= "using SqlSugar;\r\nusing Volo.Abp;\r\nusing Volo.Abp.Auditing;\r\nusing Volo.Abp.Domain.Entities;\r\nusing Yi.Framework.Core.Data;\r\n\r\nnamespace Yi.Framework.Rbac.Domain.Entities\r\n{\r\n /// \r\n /// 实体\r\n /// \r\n [SugarTable(\"@Model\")]\r\n public class @ModelEntity : Entity\r\n {\r\n@field\r\n }\r\n}\r\n" + TemplateStr= "using SqlSugar;\r\nusing lo.Abp;\r\nusing lo.Abp.Auditing;\r\nusing lo.Abp.Domain.Entities;\r\nusing Yi.Framework.Core.Data;\r\n\r\nnamespace Yi.Framework.Rbac.Domain.Entities\r\n{\r\n /// \r\n /// 实体\r\n /// \r\n [SugarTable(\"@Model\")]\r\n public class @ModelEntity : Entity\r\n {\r\n@field\r\n }\r\n}\r\n" }; entities.Add(entityTemplate); @@ -38,7 +38,7 @@ namespace Yi.Framework.CodeGen.SqlSugarCore Name = "GetListInput", BuildPath = "D:\\code\\Dtos\\@Model\\@ModelGetListInput.cs", Remarks = "列表查询参数", - TemplateStr = "using Yi.Framework.Ddd;\r\nusing Yi.Framework.Ddd.Application.Contracts;\r\n\r\nnamespace Yi.Framework.Rbac.Application.Contracts.Dtos.@Model\r\n{\r\n /// \r\n /// 查询参数\r\n /// \r\n public class @ModelGetListInputVo : PagedAllResultRequestDto\r\n {\r\n@field\r\n }\r\n}\r\n" + TemplateStr = "using Yi.Framework.Ddd;\r\nusing Yi.Framework.Ddd.Application.Contracts;\r\n\r\nnamespace Yi.Framework.Rbac.Application.Contracts.Dtos.@Model\r\n{\r\n /// \r\n /// 查询参数\r\n /// \r\n public class @ModelGetListInput : PagedAllResultRequestDto\r\n {\r\n@field\r\n }\r\n}\r\n" }; entities.Add(getListInputTemplate); @@ -48,7 +48,7 @@ namespace Yi.Framework.CodeGen.SqlSugarCore Name = "GetListOutputDto", BuildPath = "D:\\code\\Dtos\\@Model\\@ModelGetListOutputDto.cs", Remarks = "列表返回dto", - TemplateStr = "using Volo.Abp.Application.Dtos;\r\n\r\nnamespace Yi.Framework.Rbac.Application.Contracts.Dtos.@Model\r\n{\r\n public class @ModelGetListOutputDto : EntityDto\r\n {\r\n@field\r\n }\r\n}\r\n" + TemplateStr = "using lo.Abp.Application.Dtos;\r\n\r\nnamespace Yi.Framework.Rbac.Application.Contracts.Dtos.@Model\r\n{\r\n public class @ModelGetListOutputDto : EntityDto\r\n {\r\n@field\r\n }\r\n}\r\n" }; entities.Add(getListOutputDtoTemplate); @@ -58,7 +58,7 @@ namespace Yi.Framework.CodeGen.SqlSugarCore Name = "GetOutputDto", BuildPath = "D:\\code\\Dtos\\@Model\\@ModelGetOutputDto.cs", Remarks = "单返回dto", - TemplateStr = "using Volo.Abp.Application.Dtos;\r\n\r\nnamespace Yi.Framework.Rbac.Application.Contracts.Dtos.@Model\r\n{\r\n public class @ModelGetOutputDto : EntityDto\r\n {\r\n@field\r\n }\r\n}\r\n" + TemplateStr = "using lo.Abp.Application.Dtos;\r\n\r\nnamespace Yi.Framework.Rbac.Application.Contracts.Dtos.@Model\r\n{\r\n public class @ModelGetOutputDto : EntityDto\r\n {\r\n@field\r\n }\r\n}\r\n" }; entities.Add(getOutputDtoTemplate); @@ -86,7 +86,7 @@ namespace Yi.Framework.CodeGen.SqlSugarCore Name = "IServices", BuildPath = "D:\\code\\IServices\\I@ModelService.cs", Remarks = "应用服务抽象", - TemplateStr = "using Volo.Abp.Application.Services;\r\nusing Yi.Framework.Ddd.Application.Contracts;\r\nusing Yi.Framework.Rbac.Application.Contracts.Dtos.@Model;\r\n\r\nnamespace Yi.Framework.Rbac.Application.Contracts.IServices\r\n{\r\n /// \r\n /// @Model服务抽象\r\n /// \r\n public interface I@ModelService : IYiCrudAppService<@ModelGetOutputDto, @ModelGetListOutputDto, Guid, @ModelGetListInputVo, @ModelCreateInputVo, @ModelUpdateInputVo>\r\n {\r\n\r\n }\r\n}\r\n" + TemplateStr = "using lo.Abp.Application.Services;\r\nusing Yi.Framework.Ddd.Application.Contracts;\r\nusing Yi.Framework.Rbac.Application.Contracts.Dtos.@Model;\r\n\r\nnamespace Yi.Framework.Rbac.Application.Contracts.IServices\r\n{\r\n /// \r\n /// @Model服务抽象\r\n /// \r\n public interface I@ModelService : IYiCrudAppService<@ModelGetOutputDto, @ModelGetListOutputDto, Guid, @ModelGetListInput, @ModelCreateInput, @ModelUpdateInput>\r\n {\r\n\r\n }\r\n}\r\n" }; entities.Add(iServicesTemplate); @@ -97,9 +97,19 @@ namespace Yi.Framework.CodeGen.SqlSugarCore Name = "Service", BuildPath = "D:\\code\\Services\\@ModelService.cs", Remarks = "应用服务", - TemplateStr = "using SqlSugar;\r\nusing Volo.Abp.Application.Dtos;\r\nusing Volo.Abp.Application.Services;\r\nusing Yi.Framework.Ddd.Application;\r\nusing Yi.Framework.Rbac.Application.Contracts.Dtos.@Model;\r\nusing Yi.Framework.Rbac.Application.Contracts.IServices;\r\nusing Yi.Framework.Rbac.Domain.Entities;\r\nusing Yi.Framework.SqlSugarCore.Abstractions;\r\n\r\nnamespace Yi.Framework.Rbac.Application.Services\r\n{\r\n /// \r\n /// @Model服务实现\r\n /// \r\n public class @ModelService : YiCrudAppService<@ModelEntity, @ModelGetOutputDto, @ModelGetListOutputDto, Guid, @ModelGetListInputVo, @ModelCreateInputVo, @ModelUpdateInputVo>,\r\n I@ModelService\r\n {\r\n private ISqlSugarRepository<@ModelEntity, Guid> _repository;\r\n public @ModelService(ISqlSugarRepository<@ModelEntity, Guid> repository) : base(repository)\r\n {\r\n _repository = repository;\r\n }\r\n\r\n /// \r\n /// 多查\r\n /// \r\n /// \r\n /// \r\n public override async Task> GetListAsync(@ModelGetListInputVo input)\r\n {\r\n RefAsync total = 0;\r\n\r\n var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.@ModelKey), x => x.@ModelKey.Contains(input.@ModelKey!))\r\n .WhereIF(!string.IsNullOrEmpty(input.@ModelName), x => x.@ModelName!.Contains(input.@ModelName!))\r\n .WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)\r\n .ToPageListAsync(input.SkipCount, input.MaxResultCount, total);\r\n return new PagedResultDto<@ModelGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));\r\n }\r\n }\r\n}\r\n" + TemplateStr = "using SqlSugar;\r\nusing lo.Abp.Application.Dtos;\r\nusing lo.Abp.Application.Services;\r\nusing Yi.Framework.Ddd.Application;\r\nusing Yi.Framework.Rbac.Application.Contracts.Dtos.@Model;\r\nusing Yi.Framework.Rbac.Application.Contracts.IServices;\r\nusing Yi.Framework.Rbac.Domain.Entities;\r\nusing Yi.Framework.SqlSugarCore.Abstractions;\r\n\r\nnamespace Yi.Framework.Rbac.Application.Services\r\n{\r\n /// \r\n /// @Model服务实现\r\n /// \r\n public class @ModelService : YiCrudAppService<@ModelEntity, @ModelGetOutputDto, @ModelGetListOutputDto, Guid, @ModelGetListInput, @ModelCreateInput, @ModelUpdateInput>,\r\n I@ModelService\r\n {\r\n private ISqlSugarRepository<@ModelEntity, Guid> _repository;\r\n public @ModelService(ISqlSugarRepository<@ModelEntity, Guid> repository) : base(repository)\r\n {\r\n _repository = repository;\r\n }\r\n\r\n /// \r\n /// 多查\r\n /// \r\n /// \r\n /// \r\n public override async Task> GetListAsync(@ModelGetListInput input)\r\n {\r\n RefAsync total = 0;\r\n\r\n var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.@ModelKey), x => x.@ModelKey.Contains(input.@ModelKey!))\r\n .WhereIF(!string.IsNullOrEmpty(input.@ModelName), x => x.@ModelName!.Contains(input.@ModelName!))\r\n .WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)\r\n .ToPageListAsync(input.SkipCount, input.MaxResultCount, total);\r\n return new PagedResultDto<@ModelGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));\r\n }\r\n }\r\n}\r\n" }; entities.Add(servicesTemplate); + + TemplateEntity apiTemplate = new TemplateEntity() + { + TemplateStr = "import request from '@/utils/request'\r\n\r\n// 分页查询\r\nexport function listData(query) {\r\n return request({\r\n url: '/@model',\r\n method: 'get',\r\n params: query\r\n })\r\n}\r\n\r\n// id查询\r\nexport function getData(id) {\r\n return request({\r\n url: `/@model/${id}`,\r\n method: 'get'\r\n })\r\n}\r\n\r\n// 新增\r\nexport function addData(data) {\r\n return request({\r\n url: '/@model',\r\n method: 'post',\r\n data: data\r\n })\r\n}\r\n\r\n// 修改\r\nexport function updateData(id,data) {\r\n return request({\r\n url: `/@model/${id}`,\r\n method: 'put',\r\n data: data\r\n })\r\n}\r\n\r\n// 删除\r\nexport function delData(ids) {\r\n return request({\r\n url: `/@model`,\r\n method: 'delete',\r\n params:{id:ids}\r\n })\r\n}\r\n", + Name = "api", + BuildPath = "D:\\code\\Api\\@ModelApi.vue", + Remarks = "前端api" + }; + entities.Add(apiTemplate); + return entities; } } diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeCreateInput.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeCreateInput.cs new file mode 100644 index 00000000..cb420612 --- /dev/null +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeCreateInput.cs @@ -0,0 +1,17 @@ +using Yi.Framework.Rbac.Domain.Shared.Enums; + +namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Notice +{ + /// + /// Notice输入创建对象 + /// + public class NoticeCreateInput + { + public string Title { get; set; } + public NoticeTypeEnum Type { get; set; } + public string Content { get; set; } + public int OrderNum { get; set; } + public bool State { get; set; } + + } +} diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetListInput.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetListInput.cs new file mode 100644 index 00000000..7884d073 --- /dev/null +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetListInput.cs @@ -0,0 +1,14 @@ +using Yi.Framework.Ddd.Application.Contracts; +using Yi.Framework.Rbac.Domain.Shared.Enums; + +namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Notice +{ + /// + /// 查询参数 + /// + public class NoticeGetListInput : PagedAllResultRequestDto + { + public string? Title { get; set; } + public NoticeTypeEnum? Type { get; set; } + } +} diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetListOutputDto.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetListOutputDto.cs new file mode 100644 index 00000000..20521adf --- /dev/null +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetListOutputDto.cs @@ -0,0 +1,20 @@ +using Volo.Abp.Application.Dtos; +using Yi.Framework.Rbac.Domain.Shared.Enums; + +namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Notice +{ + public class NoticeGetListOutputDto : EntityDto + { + public string Title { get; set; } + public NoticeTypeEnum Type { get; set; } + public string Content { get; set; } + public bool IsDeleted { get; set; } + public DateTime CreationTime { get; set; } + public Guid? CreatorId { get; set; } + public Guid? LastModifierId { get; set; } + public DateTime? LastModificationTime { get; set; } + public int OrderNum { get; set; } + public bool State { get; set; } + + } +} diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetOutputDto.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetOutputDto.cs new file mode 100644 index 00000000..423e07b9 --- /dev/null +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeGetOutputDto.cs @@ -0,0 +1,20 @@ +using Volo.Abp.Application.Dtos; +using Yi.Framework.Rbac.Domain.Shared.Enums; + +namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Notice +{ + public class NoticeGetOutputDto : EntityDto + { + public string Title { get; set; } + public NoticeTypeEnum Type { get; set; } + public string Content { get; set; } + public bool IsDeleted { get; set; } + public DateTime CreationTime { get; set; } + public Guid? CreatorId { get; set; } + public Guid? LastModifierId { get; set; } + public DateTime? LastModificationTime { get; set; } + public int OrderNum { get; set; } + public bool State { get; set; } + + } +} diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeUpdateInput.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeUpdateInput.cs new file mode 100644 index 00000000..8bf8f4db --- /dev/null +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Notice/NoticeUpdateInput.cs @@ -0,0 +1,13 @@ +using Yi.Framework.Rbac.Domain.Shared.Enums; + +namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Notice +{ + public class NoticeUpdateInput + { + public string? Title { get; set; } + public NoticeTypeEnum? Type { get; set; } + public string? Content { get; set; } + public int? OrderNum { get; set; } + public bool? State { get; set; } + } +} diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/IServices/INoticeService.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/IServices/INoticeService.cs new file mode 100644 index 00000000..c42e1b75 --- /dev/null +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/IServices/INoticeService.cs @@ -0,0 +1,13 @@ +using Yi.Framework.Ddd.Application.Contracts; +using Yi.Framework.Rbac.Application.Contracts.Dtos.Notice; + +namespace Yi.Framework.Rbac.Application.Contracts.IServices +{ + /// + /// Notice服务抽象 + /// + public interface INoticeService : IYiCrudAppService + { + + } +} diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/NoticeService.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/NoticeService.cs new file mode 100644 index 00000000..bcc276bc --- /dev/null +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/NoticeService.cs @@ -0,0 +1,39 @@ +using SqlSugar; +using Volo.Abp.Application.Dtos; +using Yi.Framework.Ddd.Application; +using Yi.Framework.Rbac.Application.Contracts.Dtos.Notice; +using Yi.Framework.Rbac.Application.Contracts.IServices; +using Yi.Framework.Rbac.Domain.Entities; +using Yi.Framework.SqlSugarCore.Abstractions; + +namespace Yi.Framework.Rbac.Application.Services +{ + /// + /// Notice服务实现 + /// + public class NoticeService : YiCrudAppService, + INoticeService + { + private ISqlSugarRepository _repository; + public NoticeService(ISqlSugarRepository repository) : base(repository) + { + _repository = repository; + } + + /// + /// 多查 + /// + /// + /// + public override async Task> GetListAsync(NoticeGetListInput input) + { + RefAsync total = 0; + + var entities = await _repository._DbQueryable.WhereIF(input.Type is not null, x => x.Type==input.Type) + .WhereIF(!string.IsNullOrEmpty(input.Title), x => x.Title!.Contains(input.Title!)) + .WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime) + .ToPageListAsync(input.SkipCount, input.MaxResultCount, total); + return new PagedResultDto(total, await MapToGetListOutputDtosAsync(entities)); + } + } +} diff --git a/Yi.Abp.Net8/src/Yi.Abp.Web/Properties/launchSettings.json b/Yi.Abp.Net8/src/Yi.Abp.Web/Properties/launchSettings.json index 8f58fa9b..44097413 100644 --- a/Yi.Abp.Net8/src/Yi.Abp.Web/Properties/launchSettings.json +++ b/Yi.Abp.Net8/src/Yi.Abp.Web/Properties/launchSettings.json @@ -5,8 +5,8 @@ "launchBrowser": true, "launchUrl": "swagger", "environmentVariables": { - //"ASPNETCORE_ENVIRONMENT": "Development", - "ASPNETCORE_ENVIRONMENT": "Staging" + "ASPNETCORE_ENVIRONMENT": "Development", + //"ASPNETCORE_ENVIRONMENT": "Staging" }, "dotnetRunMessages": true, "applicationUrl": "http://localhost:19001" diff --git a/Yi.RuoYi.Vue3/src/api/system/notice.js b/Yi.RuoYi.Vue3/src/api/system/notice.js index cf4335ae..beb5a208 100644 --- a/Yi.RuoYi.Vue3/src/api/system/notice.js +++ b/Yi.RuoYi.Vue3/src/api/system/notice.js @@ -3,16 +3,16 @@ import request from '@/utils/request' // 查询公告列表 export function listNotice(query) { return request({ - url: '/system/notice/list', + url: '/notice', method: 'get', params: query }) } // 查询公告详细 -export function getNotice(noticeId) { +export function getNotice(id) { return request({ - url: '/system/notice/' + noticeId, + url: `/notice/${id}`, method: 'get' }) } @@ -20,26 +20,26 @@ export function getNotice(noticeId) { // 新增公告 export function addNotice(data) { return request({ - url: '/system/notice', + url: '/notice', method: 'post', data: data }) } // 修改公告 -export function updateNotice(data) { +export function updateNotice(id,data) { return request({ - url: '/system/notice', + url: `/notice/${id}`, method: 'put', data: data }) } // 删除公告 -export function delNotice(noticeId) { +export function delNotice(ids) { return request({ - url: '/system/notice', + url: `/notice`, method: 'delete', - params:{id:noticeId} + params:{id:ids} }) } \ No newline at end of file diff --git a/Yi.RuoYi.Vue3/src/views/system/notice/index.vue b/Yi.RuoYi.Vue3/src/views/system/notice/index.vue index 2d6e4c15..13b41687 100644 --- a/Yi.RuoYi.Vue3/src/views/system/notice/index.vue +++ b/Yi.RuoYi.Vue3/src/views/system/notice/index.vue @@ -1,24 +1,16 @@