diff --git a/server/MiAssessment/scripts/alter_business_pages_add_icons.sql b/server/MiAssessment/scripts/alter_business_pages_add_icons.sql
deleted file mode 100644
index 73418e6..0000000
--- a/server/MiAssessment/scripts/alter_business_pages_add_icons.sql
+++ /dev/null
@@ -1,29 +0,0 @@
--- =============================================
--- Business Pages Table - Add Icon Fields
--- 学业邑规划 - MiAssessment
---
--- 新增团队页 icon 配置字段:
--- IconUrl - 未选中状态图标
--- ActiveIconUrl - 选中状态图标
---
--- Database: SQL Server 2022
--- =============================================
-
-USE [MiAssessment_Business];
-GO
-
--- 新增 IconUrl 字段
-IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[business_pages]') AND name = 'IconUrl')
-BEGIN
- ALTER TABLE [dbo].[business_pages] ADD [IconUrl] NVARCHAR(500) NULL;
- PRINT N'Column IconUrl added successfully';
-END
-GO
-
--- 新增 ActiveIconUrl 字段
-IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[business_pages]') AND name = 'ActiveIconUrl')
-BEGIN
- ALTER TABLE [dbo].[business_pages] ADD [ActiveIconUrl] NVARCHAR(500) NULL;
- PRINT N'Column ActiveIconUrl added successfully';
-END
-GO
diff --git a/server/MiAssessment/src/MiAssessment.Admin.Business/Entities/BusinessPage.cs b/server/MiAssessment/src/MiAssessment.Admin.Business/Entities/BusinessPage.cs
index 8b9ca93..189ec94 100644
--- a/server/MiAssessment/src/MiAssessment.Admin.Business/Entities/BusinessPage.cs
+++ b/server/MiAssessment/src/MiAssessment.Admin.Business/Entities/BusinessPage.cs
@@ -23,18 +23,6 @@ public class BusinessPage
[MaxLength(100)]
public string Title { get; set; } = null!;
- ///
- /// 图标URL(未选中状态)
- ///
- [MaxLength(500)]
- public string? IconUrl { get; set; }
-
- ///
- /// 图标URL(选中状态)
- ///
- [MaxLength(500)]
- public string? ActiveIconUrl { get; set; }
-
///
/// 详情图片URL
///
diff --git a/server/MiAssessment/src/MiAssessment.Admin.Business/Entities/Promotion.cs b/server/MiAssessment/src/MiAssessment.Admin.Business/Entities/Promotion.cs
index 98715ab..e7814bb 100644
--- a/server/MiAssessment/src/MiAssessment.Admin.Business/Entities/Promotion.cs
+++ b/server/MiAssessment/src/MiAssessment.Admin.Business/Entities/Promotion.cs
@@ -29,6 +29,18 @@ public class Promotion
[MaxLength(500)]
public string ImageUrl { get; set; } = null!;
+ ///
+ /// 图标URL(未选中状态)
+ ///
+ [MaxLength(500)]
+ public string? IconUrl { get; set; }
+
+ ///
+ /// 图标URL(选中状态)
+ ///
+ [MaxLength(500)]
+ public string? ActiveIconUrl { get; set; }
+
///
/// 位置:1首页底部 2团队页
///
diff --git a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/BusinessPageDto.cs b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/BusinessPageDto.cs
index a8ee599..6f360a8 100644
--- a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/BusinessPageDto.cs
+++ b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/BusinessPageDto.cs
@@ -15,16 +15,6 @@ public class BusinessPageDto
///
public string Title { get; set; } = null!;
- ///
- /// 图标URL(未选中状态)
- ///
- public string? IconUrl { get; set; }
-
- ///
- /// 图标URL(选中状态)
- ///
- public string? ActiveIconUrl { get; set; }
-
///
/// 详情图片URL(长图)
///
diff --git a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/CreateBusinessPageRequest.cs b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/CreateBusinessPageRequest.cs
index df6a4a1..4bde209 100644
--- a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/CreateBusinessPageRequest.cs
+++ b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/CreateBusinessPageRequest.cs
@@ -14,18 +14,6 @@ public class CreateBusinessPageRequest
[MaxLength(100, ErrorMessage = "标题长度不能超过100个字符")]
public string Title { get; set; } = null!;
- ///
- /// 图标URL(未选中状态)
- ///
- [MaxLength(500, ErrorMessage = "图标URL长度不能超过500个字符")]
- public string? IconUrl { get; set; }
-
- ///
- /// 图标URL(选中状态)
- ///
- [MaxLength(500, ErrorMessage = "选中图标URL长度不能超过500个字符")]
- public string? ActiveIconUrl { get; set; }
-
///
/// 详情图片URL(必填,长图)
///
diff --git a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/UpdateBusinessPageRequest.cs b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/UpdateBusinessPageRequest.cs
index 9be84b5..3981a81 100644
--- a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/UpdateBusinessPageRequest.cs
+++ b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/BusinessPage/UpdateBusinessPageRequest.cs
@@ -20,18 +20,6 @@ public class UpdateBusinessPageRequest
[MaxLength(100, ErrorMessage = "标题长度不能超过100个字符")]
public string Title { get; set; } = null!;
- ///
- /// 图标URL(未选中状态)
- ///
- [MaxLength(500, ErrorMessage = "图标URL长度不能超过500个字符")]
- public string? IconUrl { get; set; }
-
- ///
- /// 图标URL(选中状态)
- ///
- [MaxLength(500, ErrorMessage = "选中图标URL长度不能超过500个字符")]
- public string? ActiveIconUrl { get; set; }
-
///
/// 详情图片URL(必填,长图)
///
diff --git a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/CreatePromotionRequest.cs b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/CreatePromotionRequest.cs
index ac24251..b2aa4dc 100644
--- a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/CreatePromotionRequest.cs
+++ b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/CreatePromotionRequest.cs
@@ -18,6 +18,16 @@ public class CreatePromotionRequest
[Required(ErrorMessage = "图片URL不能为空")]
public string ImageUrl { get; set; } = null!;
+ ///
+ /// 图标URL(未选中状态)
+ ///
+ public string? IconUrl { get; set; }
+
+ ///
+ /// 图标URL(选中状态)
+ ///
+ public string? ActiveIconUrl { get; set; }
+
///
/// 位置:1首页底部 2团队页(必填)
///
diff --git a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/PromotionDto.cs b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/PromotionDto.cs
index 0f2a919..5086f10 100644
--- a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/PromotionDto.cs
+++ b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/PromotionDto.cs
@@ -20,6 +20,16 @@ public class PromotionDto
///
public string ImageUrl { get; set; } = null!;
+ ///
+ /// 图标URL(未选中状态)
+ ///
+ public string? IconUrl { get; set; }
+
+ ///
+ /// 图标URL(选中状态)
+ ///
+ public string? ActiveIconUrl { get; set; }
+
///
/// 位置:1首页底部 2团队页
///
diff --git a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/UpdatePromotionRequest.cs b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/UpdatePromotionRequest.cs
index 094a450..864a8ea 100644
--- a/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/UpdatePromotionRequest.cs
+++ b/server/MiAssessment/src/MiAssessment.Admin.Business/Models/Content/UpdatePromotionRequest.cs
@@ -24,6 +24,16 @@ public class UpdatePromotionRequest
[Required(ErrorMessage = "图片URL不能为空")]
public string ImageUrl { get; set; } = null!;
+ ///
+ /// 图标URL(未选中状态)
+ ///
+ public string? IconUrl { get; set; }
+
+ ///
+ /// 图标URL(选中状态)
+ ///
+ public string? ActiveIconUrl { get; set; }
+
///
/// 位置:1首页底部 2团队页(必填)
///
diff --git a/server/MiAssessment/src/MiAssessment.Admin.Business/Services/BusinessPageService.cs b/server/MiAssessment/src/MiAssessment.Admin.Business/Services/BusinessPageService.cs
index d66d509..ad60914 100644
--- a/server/MiAssessment/src/MiAssessment.Admin.Business/Services/BusinessPageService.cs
+++ b/server/MiAssessment/src/MiAssessment.Admin.Business/Services/BusinessPageService.cs
@@ -63,8 +63,6 @@ public class BusinessPageService : IBusinessPageService
{
Id = p.Id,
Title = p.Title,
- IconUrl = p.IconUrl,
- ActiveIconUrl = p.ActiveIconUrl,
ImageUrl = p.ImageUrl,
HasActionButton = p.HasActionButton,
ActionButtonText = p.ActionButtonText,
@@ -92,8 +90,6 @@ public class BusinessPageService : IBusinessPageService
{
Id = p.Id,
Title = p.Title,
- IconUrl = p.IconUrl,
- ActiveIconUrl = p.ActiveIconUrl,
ImageUrl = p.ImageUrl,
HasActionButton = p.HasActionButton,
ActionButtonText = p.ActionButtonText,
@@ -130,8 +126,6 @@ public class BusinessPageService : IBusinessPageService
var entity = new BusinessPage
{
Title = request.Title,
- IconUrl = request.IconUrl,
- ActiveIconUrl = request.ActiveIconUrl,
ImageUrl = request.ImageUrl,
HasActionButton = request.HasActionButton,
ActionButtonText = request.ActionButtonText,
@@ -172,8 +166,6 @@ public class BusinessPageService : IBusinessPageService
// 更新字段
entity.Title = request.Title;
- entity.IconUrl = request.IconUrl;
- entity.ActiveIconUrl = request.ActiveIconUrl;
entity.ImageUrl = request.ImageUrl;
entity.HasActionButton = request.HasActionButton;
entity.ActionButtonText = request.ActionButtonText;
diff --git a/server/MiAssessment/src/MiAssessment.Admin.Business/Services/ContentService.cs b/server/MiAssessment/src/MiAssessment.Admin.Business/Services/ContentService.cs
index 18fcad5..414b2b0 100644
--- a/server/MiAssessment/src/MiAssessment.Admin.Business/Services/ContentService.cs
+++ b/server/MiAssessment/src/MiAssessment.Admin.Business/Services/ContentService.cs
@@ -327,6 +327,8 @@ public class ContentService : IContentService
Id = p.Id,
Title = p.Title,
ImageUrl = p.ImageUrl,
+ IconUrl = p.IconUrl,
+ ActiveIconUrl = p.ActiveIconUrl,
Position = p.Position,
PositionName = GetPositionName(p.Position),
Sort = p.Sort,
@@ -350,6 +352,8 @@ public class ContentService : IContentService
Id = p.Id,
Title = p.Title,
ImageUrl = p.ImageUrl,
+ IconUrl = p.IconUrl,
+ ActiveIconUrl = p.ActiveIconUrl,
Position = p.Position,
PositionName = GetPositionName(p.Position),
Sort = p.Sort,
@@ -384,6 +388,8 @@ public class ContentService : IContentService
{
Title = request.Title,
ImageUrl = request.ImageUrl,
+ IconUrl = request.IconUrl,
+ ActiveIconUrl = request.ActiveIconUrl,
Position = request.Position,
Sort = request.Sort,
Status = request.Status,
@@ -426,6 +432,8 @@ public class ContentService : IContentService
// 更新字段
promotion.Title = request.Title;
promotion.ImageUrl = request.ImageUrl;
+ promotion.IconUrl = request.IconUrl;
+ promotion.ActiveIconUrl = request.ActiveIconUrl;
promotion.Position = request.Position;
promotion.Sort = request.Sort;
promotion.Status = request.Status;
diff --git a/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/api/business/businessPage.ts b/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/api/business/businessPage.ts
index f9c88a5..fde6fd3 100644
--- a/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/api/business/businessPage.ts
+++ b/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/api/business/businessPage.ts
@@ -12,8 +12,6 @@ import type { PagedRequest, PagedResult, UpdateStatusRequest } from '@/types/com
export interface BusinessPageItem {
id: number
title: string
- iconUrl?: string
- activeIconUrl?: string
imageUrl: string
hasActionButton: boolean
actionButtonText?: string
@@ -33,8 +31,6 @@ export interface BusinessPageQuery extends PagedRequest {
/** 创建请求 */
export interface CreateBusinessPageRequest {
title: string
- iconUrl?: string
- activeIconUrl?: string
imageUrl: string
hasActionButton: boolean
actionButtonText?: string
diff --git a/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/api/business/content.ts b/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/api/business/content.ts
index 474fca6..f340094 100644
--- a/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/api/business/content.ts
+++ b/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/api/business/content.ts
@@ -87,6 +87,10 @@ export interface PromotionItem {
title: string
/** 图片URL */
imageUrl: string
+ /** 图标URL(未选中状态) */
+ iconUrl: string
+ /** 图标URL(选中状态) */
+ activeIconUrl: string
/** 位置 */
position: number
/** 位置名称 */
@@ -121,6 +125,10 @@ export interface CreatePromotionRequest {
title?: string
/** 图片URL */
imageUrl: string
+ /** 图标URL(未选中状态) */
+ iconUrl?: string
+ /** 图标URL(选中状态) */
+ activeIconUrl?: string
/** 位置 */
position: number
/** 排序值 */
diff --git a/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/views/business/content/business-page/index.vue b/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/views/business/content/business-page/index.vue
index 0116d53..d927cf8 100644
--- a/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/views/business/content/business-page/index.vue
+++ b/server/MiAssessment/src/MiAssessment.Admin/admin-web/src/views/business/content/business-page/index.vue
@@ -150,24 +150,6 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
p.Status == 1 && !p.IsDeleted)
+ .Where(p => p.Position == 2 && p.Status == 1 && !p.IsDeleted)
.OrderByDescending(p => p.Sort)
.Select(p => new TeamPageItemDto
{
@@ -47,13 +47,13 @@ public class TeamService : ITeamService
})
.ToListAsync();
- _logger.LogDebug("获取到 {Count} 个团队业务页", pages.Count);
+ _logger.LogDebug("获取到 {Count} 个团队宣传图", promotions.Count);
return new TeamInfoDto
{
// 兼容旧版:保留 images 字段
- Images = pages.Select(p => p.ImageUrl).ToList(),
- Items = pages
+ Images = promotions.Select(p => p.ImageUrl).ToList(),
+ Items = promotions
};
}
}
diff --git a/server/MiAssessment/src/MiAssessment.Model/Data/MiAssessmentDbContext.cs b/server/MiAssessment/src/MiAssessment.Model/Data/MiAssessmentDbContext.cs
index ed2c1a5..f90eaff 100644
--- a/server/MiAssessment/src/MiAssessment.Model/Data/MiAssessmentDbContext.cs
+++ b/server/MiAssessment/src/MiAssessment.Model/Data/MiAssessmentDbContext.cs
@@ -390,6 +390,12 @@ public partial class MiAssessmentDbContext : DbContext
entity.Property(e => e.ImageUrl)
.HasMaxLength(500)
.HasComment("图片URL");
+ entity.Property(e => e.IconUrl)
+ .HasMaxLength(500)
+ .HasComment("图标URL(未选中状态)");
+ entity.Property(e => e.ActiveIconUrl)
+ .HasMaxLength(500)
+ .HasComment("图标URL(选中状态)");
entity.Property(e => e.Position)
.HasDefaultValue(1)
.HasComment("位置:1首页底部 2团队页");
@@ -422,12 +428,6 @@ public partial class MiAssessmentDbContext : DbContext
entity.Property(e => e.Title)
.HasMaxLength(100)
.HasComment("标题");
- entity.Property(e => e.IconUrl)
- .HasMaxLength(500)
- .HasComment("图标URL(未选中状态)");
- entity.Property(e => e.ActiveIconUrl)
- .HasMaxLength(500)
- .HasComment("图标URL(选中状态)");
entity.Property(e => e.ImageUrl)
.HasMaxLength(500)
.HasComment("详情图片URL");
diff --git a/server/MiAssessment/src/MiAssessment.Model/Entities/BusinessPage.cs b/server/MiAssessment/src/MiAssessment.Model/Entities/BusinessPage.cs
index 57aac4a..be4e0f1 100644
--- a/server/MiAssessment/src/MiAssessment.Model/Entities/BusinessPage.cs
+++ b/server/MiAssessment/src/MiAssessment.Model/Entities/BusinessPage.cs
@@ -22,18 +22,6 @@ public class BusinessPage
[MaxLength(100)]
public string? Title { get; set; }
- ///
- /// 图标URL(未选中状态)
- ///
- [MaxLength(500)]
- public string? IconUrl { get; set; }
-
- ///
- /// 图标URL(选中状态)
- ///
- [MaxLength(500)]
- public string? ActiveIconUrl { get; set; }
-
///
/// 详情图片URL
///
diff --git a/server/MiAssessment/src/MiAssessment.Model/Entities/Promotion.cs b/server/MiAssessment/src/MiAssessment.Model/Entities/Promotion.cs
index b2aea07..a058b75 100644
--- a/server/MiAssessment/src/MiAssessment.Model/Entities/Promotion.cs
+++ b/server/MiAssessment/src/MiAssessment.Model/Entities/Promotion.cs
@@ -29,6 +29,18 @@ public class Promotion
[MaxLength(500)]
public string ImageUrl { get; set; } = null!;
+ ///
+ /// 图标URL(未选中状态)
+ ///
+ [MaxLength(500)]
+ public string? IconUrl { get; set; }
+
+ ///
+ /// 图标URL(选中状态)
+ ///
+ [MaxLength(500)]
+ public string? ActiveIconUrl { get; set; }
+
///
/// 位置:1首页底部 2团队页
///