21
This commit is contained in:
parent
54605a0736
commit
4bbe43bf3e
|
|
@ -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
|
|
||||||
|
|
@ -23,18 +23,6 @@ public class BusinessPage
|
||||||
[MaxLength(100)]
|
[MaxLength(100)]
|
||||||
public string Title { get; set; } = null!;
|
public string Title { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图标URL(未选中状态)
|
|
||||||
/// </summary>
|
|
||||||
[MaxLength(500)]
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图标URL(选中状态)
|
|
||||||
/// </summary>
|
|
||||||
[MaxLength(500)]
|
|
||||||
public string? ActiveIconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 详情图片URL
|
/// 详情图片URL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,18 @@ public class Promotion
|
||||||
[MaxLength(500)]
|
[MaxLength(500)]
|
||||||
public string ImageUrl { get; set; } = null!;
|
public string ImageUrl { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图标URL(未选中状态)
|
||||||
|
/// </summary>
|
||||||
|
[MaxLength(500)]
|
||||||
|
public string? IconUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图标URL(选中状态)
|
||||||
|
/// </summary>
|
||||||
|
[MaxLength(500)]
|
||||||
|
public string? ActiveIconUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 位置:1首页底部 2团队页
|
/// 位置:1首页底部 2团队页
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -15,16 +15,6 @@ public class BusinessPageDto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Title { get; set; } = null!;
|
public string Title { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图标URL(未选中状态)
|
|
||||||
/// </summary>
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图标URL(选中状态)
|
|
||||||
/// </summary>
|
|
||||||
public string? ActiveIconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 详情图片URL(长图)
|
/// 详情图片URL(长图)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -14,18 +14,6 @@ public class CreateBusinessPageRequest
|
||||||
[MaxLength(100, ErrorMessage = "标题长度不能超过100个字符")]
|
[MaxLength(100, ErrorMessage = "标题长度不能超过100个字符")]
|
||||||
public string Title { get; set; } = null!;
|
public string Title { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图标URL(未选中状态)
|
|
||||||
/// </summary>
|
|
||||||
[MaxLength(500, ErrorMessage = "图标URL长度不能超过500个字符")]
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图标URL(选中状态)
|
|
||||||
/// </summary>
|
|
||||||
[MaxLength(500, ErrorMessage = "选中图标URL长度不能超过500个字符")]
|
|
||||||
public string? ActiveIconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 详情图片URL(必填,长图)
|
/// 详情图片URL(必填,长图)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -20,18 +20,6 @@ public class UpdateBusinessPageRequest
|
||||||
[MaxLength(100, ErrorMessage = "标题长度不能超过100个字符")]
|
[MaxLength(100, ErrorMessage = "标题长度不能超过100个字符")]
|
||||||
public string Title { get; set; } = null!;
|
public string Title { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图标URL(未选中状态)
|
|
||||||
/// </summary>
|
|
||||||
[MaxLength(500, ErrorMessage = "图标URL长度不能超过500个字符")]
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图标URL(选中状态)
|
|
||||||
/// </summary>
|
|
||||||
[MaxLength(500, ErrorMessage = "选中图标URL长度不能超过500个字符")]
|
|
||||||
public string? ActiveIconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 详情图片URL(必填,长图)
|
/// 详情图片URL(必填,长图)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,16 @@ public class CreatePromotionRequest
|
||||||
[Required(ErrorMessage = "图片URL不能为空")]
|
[Required(ErrorMessage = "图片URL不能为空")]
|
||||||
public string ImageUrl { get; set; } = null!;
|
public string ImageUrl { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图标URL(未选中状态)
|
||||||
|
/// </summary>
|
||||||
|
public string? IconUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图标URL(选中状态)
|
||||||
|
/// </summary>
|
||||||
|
public string? ActiveIconUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 位置:1首页底部 2团队页(必填)
|
/// 位置:1首页底部 2团队页(必填)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,16 @@ public class PromotionDto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ImageUrl { get; set; } = null!;
|
public string ImageUrl { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图标URL(未选中状态)
|
||||||
|
/// </summary>
|
||||||
|
public string? IconUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图标URL(选中状态)
|
||||||
|
/// </summary>
|
||||||
|
public string? ActiveIconUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 位置:1首页底部 2团队页
|
/// 位置:1首页底部 2团队页
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,16 @@ public class UpdatePromotionRequest
|
||||||
[Required(ErrorMessage = "图片URL不能为空")]
|
[Required(ErrorMessage = "图片URL不能为空")]
|
||||||
public string ImageUrl { get; set; } = null!;
|
public string ImageUrl { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图标URL(未选中状态)
|
||||||
|
/// </summary>
|
||||||
|
public string? IconUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图标URL(选中状态)
|
||||||
|
/// </summary>
|
||||||
|
public string? ActiveIconUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 位置:1首页底部 2团队页(必填)
|
/// 位置:1首页底部 2团队页(必填)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,6 @@ public class BusinessPageService : IBusinessPageService
|
||||||
{
|
{
|
||||||
Id = p.Id,
|
Id = p.Id,
|
||||||
Title = p.Title,
|
Title = p.Title,
|
||||||
IconUrl = p.IconUrl,
|
|
||||||
ActiveIconUrl = p.ActiveIconUrl,
|
|
||||||
ImageUrl = p.ImageUrl,
|
ImageUrl = p.ImageUrl,
|
||||||
HasActionButton = p.HasActionButton,
|
HasActionButton = p.HasActionButton,
|
||||||
ActionButtonText = p.ActionButtonText,
|
ActionButtonText = p.ActionButtonText,
|
||||||
|
|
@ -92,8 +90,6 @@ public class BusinessPageService : IBusinessPageService
|
||||||
{
|
{
|
||||||
Id = p.Id,
|
Id = p.Id,
|
||||||
Title = p.Title,
|
Title = p.Title,
|
||||||
IconUrl = p.IconUrl,
|
|
||||||
ActiveIconUrl = p.ActiveIconUrl,
|
|
||||||
ImageUrl = p.ImageUrl,
|
ImageUrl = p.ImageUrl,
|
||||||
HasActionButton = p.HasActionButton,
|
HasActionButton = p.HasActionButton,
|
||||||
ActionButtonText = p.ActionButtonText,
|
ActionButtonText = p.ActionButtonText,
|
||||||
|
|
@ -130,8 +126,6 @@ public class BusinessPageService : IBusinessPageService
|
||||||
var entity = new BusinessPage
|
var entity = new BusinessPage
|
||||||
{
|
{
|
||||||
Title = request.Title,
|
Title = request.Title,
|
||||||
IconUrl = request.IconUrl,
|
|
||||||
ActiveIconUrl = request.ActiveIconUrl,
|
|
||||||
ImageUrl = request.ImageUrl,
|
ImageUrl = request.ImageUrl,
|
||||||
HasActionButton = request.HasActionButton,
|
HasActionButton = request.HasActionButton,
|
||||||
ActionButtonText = request.ActionButtonText,
|
ActionButtonText = request.ActionButtonText,
|
||||||
|
|
@ -172,8 +166,6 @@ public class BusinessPageService : IBusinessPageService
|
||||||
|
|
||||||
// 更新字段
|
// 更新字段
|
||||||
entity.Title = request.Title;
|
entity.Title = request.Title;
|
||||||
entity.IconUrl = request.IconUrl;
|
|
||||||
entity.ActiveIconUrl = request.ActiveIconUrl;
|
|
||||||
entity.ImageUrl = request.ImageUrl;
|
entity.ImageUrl = request.ImageUrl;
|
||||||
entity.HasActionButton = request.HasActionButton;
|
entity.HasActionButton = request.HasActionButton;
|
||||||
entity.ActionButtonText = request.ActionButtonText;
|
entity.ActionButtonText = request.ActionButtonText;
|
||||||
|
|
|
||||||
|
|
@ -327,6 +327,8 @@ public class ContentService : IContentService
|
||||||
Id = p.Id,
|
Id = p.Id,
|
||||||
Title = p.Title,
|
Title = p.Title,
|
||||||
ImageUrl = p.ImageUrl,
|
ImageUrl = p.ImageUrl,
|
||||||
|
IconUrl = p.IconUrl,
|
||||||
|
ActiveIconUrl = p.ActiveIconUrl,
|
||||||
Position = p.Position,
|
Position = p.Position,
|
||||||
PositionName = GetPositionName(p.Position),
|
PositionName = GetPositionName(p.Position),
|
||||||
Sort = p.Sort,
|
Sort = p.Sort,
|
||||||
|
|
@ -350,6 +352,8 @@ public class ContentService : IContentService
|
||||||
Id = p.Id,
|
Id = p.Id,
|
||||||
Title = p.Title,
|
Title = p.Title,
|
||||||
ImageUrl = p.ImageUrl,
|
ImageUrl = p.ImageUrl,
|
||||||
|
IconUrl = p.IconUrl,
|
||||||
|
ActiveIconUrl = p.ActiveIconUrl,
|
||||||
Position = p.Position,
|
Position = p.Position,
|
||||||
PositionName = GetPositionName(p.Position),
|
PositionName = GetPositionName(p.Position),
|
||||||
Sort = p.Sort,
|
Sort = p.Sort,
|
||||||
|
|
@ -384,6 +388,8 @@ public class ContentService : IContentService
|
||||||
{
|
{
|
||||||
Title = request.Title,
|
Title = request.Title,
|
||||||
ImageUrl = request.ImageUrl,
|
ImageUrl = request.ImageUrl,
|
||||||
|
IconUrl = request.IconUrl,
|
||||||
|
ActiveIconUrl = request.ActiveIconUrl,
|
||||||
Position = request.Position,
|
Position = request.Position,
|
||||||
Sort = request.Sort,
|
Sort = request.Sort,
|
||||||
Status = request.Status,
|
Status = request.Status,
|
||||||
|
|
@ -426,6 +432,8 @@ public class ContentService : IContentService
|
||||||
// 更新字段
|
// 更新字段
|
||||||
promotion.Title = request.Title;
|
promotion.Title = request.Title;
|
||||||
promotion.ImageUrl = request.ImageUrl;
|
promotion.ImageUrl = request.ImageUrl;
|
||||||
|
promotion.IconUrl = request.IconUrl;
|
||||||
|
promotion.ActiveIconUrl = request.ActiveIconUrl;
|
||||||
promotion.Position = request.Position;
|
promotion.Position = request.Position;
|
||||||
promotion.Sort = request.Sort;
|
promotion.Sort = request.Sort;
|
||||||
promotion.Status = request.Status;
|
promotion.Status = request.Status;
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ import type { PagedRequest, PagedResult, UpdateStatusRequest } from '@/types/com
|
||||||
export interface BusinessPageItem {
|
export interface BusinessPageItem {
|
||||||
id: number
|
id: number
|
||||||
title: string
|
title: string
|
||||||
iconUrl?: string
|
|
||||||
activeIconUrl?: string
|
|
||||||
imageUrl: string
|
imageUrl: string
|
||||||
hasActionButton: boolean
|
hasActionButton: boolean
|
||||||
actionButtonText?: string
|
actionButtonText?: string
|
||||||
|
|
@ -33,8 +31,6 @@ export interface BusinessPageQuery extends PagedRequest {
|
||||||
/** 创建请求 */
|
/** 创建请求 */
|
||||||
export interface CreateBusinessPageRequest {
|
export interface CreateBusinessPageRequest {
|
||||||
title: string
|
title: string
|
||||||
iconUrl?: string
|
|
||||||
activeIconUrl?: string
|
|
||||||
imageUrl: string
|
imageUrl: string
|
||||||
hasActionButton: boolean
|
hasActionButton: boolean
|
||||||
actionButtonText?: string
|
actionButtonText?: string
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,10 @@ export interface PromotionItem {
|
||||||
title: string
|
title: string
|
||||||
/** 图片URL */
|
/** 图片URL */
|
||||||
imageUrl: string
|
imageUrl: string
|
||||||
|
/** 图标URL(未选中状态) */
|
||||||
|
iconUrl: string
|
||||||
|
/** 图标URL(选中状态) */
|
||||||
|
activeIconUrl: string
|
||||||
/** 位置 */
|
/** 位置 */
|
||||||
position: number
|
position: number
|
||||||
/** 位置名称 */
|
/** 位置名称 */
|
||||||
|
|
@ -121,6 +125,10 @@ export interface CreatePromotionRequest {
|
||||||
title?: string
|
title?: string
|
||||||
/** 图片URL */
|
/** 图片URL */
|
||||||
imageUrl: string
|
imageUrl: string
|
||||||
|
/** 图标URL(未选中状态) */
|
||||||
|
iconUrl?: string
|
||||||
|
/** 图标URL(选中状态) */
|
||||||
|
activeIconUrl?: string
|
||||||
/** 位置 */
|
/** 位置 */
|
||||||
position: number
|
position: number
|
||||||
/** 排序值 */
|
/** 排序值 */
|
||||||
|
|
|
||||||
|
|
@ -150,24 +150,6 @@
|
||||||
<el-input v-model="state.formData.title" placeholder="请输入标题" maxlength="100" show-word-limit />
|
<el-input v-model="state.formData.title" placeholder="请输入标题" maxlength="100" show-word-limit />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="图标(未选中)">
|
|
||||||
<ImageUpload
|
|
||||||
v-model="state.formData.iconUrl"
|
|
||||||
placeholder="点击上传未选中图标"
|
|
||||||
tip="建议尺寸64x64px,png格式"
|
|
||||||
:max-size="2"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="图标(选中)">
|
|
||||||
<ImageUpload
|
|
||||||
v-model="state.formData.activeIconUrl"
|
|
||||||
placeholder="点击上传选中图标"
|
|
||||||
tip="建议尺寸64x64px,png格式"
|
|
||||||
:max-size="2"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="介绍图片" prop="imageUrl" required>
|
<el-form-item label="介绍图片" prop="imageUrl" required>
|
||||||
<ImageUpload
|
<ImageUpload
|
||||||
v-model="state.formData.imageUrl"
|
v-model="state.formData.imageUrl"
|
||||||
|
|
@ -233,8 +215,6 @@ import { DictSelect, ImageUpload } from '@/components'
|
||||||
interface FormData {
|
interface FormData {
|
||||||
id?: number
|
id?: number
|
||||||
title: string
|
title: string
|
||||||
iconUrl: string
|
|
||||||
activeIconUrl: string
|
|
||||||
imageUrl: string
|
imageUrl: string
|
||||||
hasActionButton: boolean
|
hasActionButton: boolean
|
||||||
actionButtonText: string
|
actionButtonText: string
|
||||||
|
|
@ -289,8 +269,6 @@ const formRules: FormRules = {
|
||||||
function getDefaultFormData(): FormData {
|
function getDefaultFormData(): FormData {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
iconUrl: '',
|
|
||||||
activeIconUrl: '',
|
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
hasActionButton: false,
|
hasActionButton: false,
|
||||||
actionButtonText: '',
|
actionButtonText: '',
|
||||||
|
|
@ -347,8 +325,6 @@ function handleEdit(row: BusinessPageItem) {
|
||||||
state.formData = {
|
state.formData = {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
title: row.title || '',
|
title: row.title || '',
|
||||||
iconUrl: row.iconUrl || '',
|
|
||||||
activeIconUrl: row.activeIconUrl || '',
|
|
||||||
imageUrl: row.imageUrl,
|
imageUrl: row.imageUrl,
|
||||||
hasActionButton: row.hasActionButton,
|
hasActionButton: row.hasActionButton,
|
||||||
actionButtonText: row.actionButtonText || '',
|
actionButtonText: row.actionButtonText || '',
|
||||||
|
|
@ -400,8 +376,6 @@ async function handleSubmit() {
|
||||||
const fd = state.formData
|
const fd = state.formData
|
||||||
const data: CreateBusinessPageRequest | UpdateBusinessPageRequest = {
|
const data: CreateBusinessPageRequest | UpdateBusinessPageRequest = {
|
||||||
title: fd.title,
|
title: fd.title,
|
||||||
iconUrl: fd.iconUrl || undefined,
|
|
||||||
activeIconUrl: fd.activeIconUrl || undefined,
|
|
||||||
imageUrl: fd.imageUrl,
|
imageUrl: fd.imageUrl,
|
||||||
hasActionButton: fd.hasActionButton,
|
hasActionButton: fd.hasActionButton,
|
||||||
actionButtonText: fd.hasActionButton ? fd.actionButtonText : undefined,
|
actionButtonText: fd.hasActionButton ? fd.actionButtonText : undefined,
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,27 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 团队页位置时显示图标上传 -->
|
||||||
|
<template v-if="state.formData.position === '2'">
|
||||||
|
<el-form-item label="未选中图标" prop="iconUrl">
|
||||||
|
<ImageUpload
|
||||||
|
v-model="state.formData.iconUrl"
|
||||||
|
placeholder="点击上传未选中图标"
|
||||||
|
tip="建议尺寸:64x64,支持 jpg、png 格式"
|
||||||
|
:max-size="2"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="选中图标" prop="activeIconUrl">
|
||||||
|
<ImageUpload
|
||||||
|
v-model="state.formData.activeIconUrl"
|
||||||
|
placeholder="点击上传选中图标"
|
||||||
|
tip="建议尺寸:64x64,支持 jpg、png 格式"
|
||||||
|
:max-size="2"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
<el-form-item label="位置" prop="position" required>
|
<el-form-item label="位置" prop="position" required>
|
||||||
<DictSelect
|
<DictSelect
|
||||||
v-model="state.formData.position"
|
v-model="state.formData.position"
|
||||||
|
|
@ -254,6 +275,8 @@ interface PromotionFormData {
|
||||||
id?: number
|
id?: number
|
||||||
title: string
|
title: string
|
||||||
imageUrl: string
|
imageUrl: string
|
||||||
|
iconUrl: string
|
||||||
|
activeIconUrl: string
|
||||||
position: string
|
position: string
|
||||||
sort: number
|
sort: number
|
||||||
status: string
|
status: string
|
||||||
|
|
@ -327,6 +350,8 @@ function getDefaultFormData(): PromotionFormData {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
|
iconUrl: '',
|
||||||
|
activeIconUrl: '',
|
||||||
position: '',
|
position: '',
|
||||||
sort: 0,
|
sort: 0,
|
||||||
status: '1'
|
status: '1'
|
||||||
|
|
@ -430,6 +455,8 @@ function handleEdit(row: PromotionItem) {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
title: row.title || '',
|
title: row.title || '',
|
||||||
imageUrl: row.imageUrl,
|
imageUrl: row.imageUrl,
|
||||||
|
iconUrl: row.iconUrl || '',
|
||||||
|
activeIconUrl: row.activeIconUrl || '',
|
||||||
position: String(row.position),
|
position: String(row.position),
|
||||||
sort: row.sort,
|
sort: row.sort,
|
||||||
status: String(row.status)
|
status: String(row.status)
|
||||||
|
|
@ -490,6 +517,8 @@ async function handleSubmit() {
|
||||||
const requestData: CreatePromotionRequest | UpdatePromotionRequest = {
|
const requestData: CreatePromotionRequest | UpdatePromotionRequest = {
|
||||||
title: formData.title || undefined,
|
title: formData.title || undefined,
|
||||||
imageUrl: formData.imageUrl,
|
imageUrl: formData.imageUrl,
|
||||||
|
iconUrl: formData.iconUrl || undefined,
|
||||||
|
activeIconUrl: formData.activeIconUrl || undefined,
|
||||||
position: Number(formData.position),
|
position: Number(formData.position),
|
||||||
sort: formData.sort,
|
sort: formData.sort,
|
||||||
status: Number(formData.status)
|
status: Number(formData.status)
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,10 @@ public class TeamService : ITeamService
|
||||||
{
|
{
|
||||||
_logger.LogDebug("获取团队介绍信息");
|
_logger.LogDebug("获取团队介绍信息");
|
||||||
|
|
||||||
// 从 business_pages 表查询启用状态的业务页,按排序降序
|
// 从 promotions 表查询团队页(Position=2)启用状态的宣传图,按排序降序
|
||||||
var pages = await _dbContext.BusinessPages
|
var promotions = await _dbContext.Promotions
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Where(p => p.Status == 1 && !p.IsDeleted)
|
.Where(p => p.Position == 2 && p.Status == 1 && !p.IsDeleted)
|
||||||
.OrderByDescending(p => p.Sort)
|
.OrderByDescending(p => p.Sort)
|
||||||
.Select(p => new TeamPageItemDto
|
.Select(p => new TeamPageItemDto
|
||||||
{
|
{
|
||||||
|
|
@ -47,13 +47,13 @@ public class TeamService : ITeamService
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
_logger.LogDebug("获取到 {Count} 个团队业务页", pages.Count);
|
_logger.LogDebug("获取到 {Count} 个团队宣传图", promotions.Count);
|
||||||
|
|
||||||
return new TeamInfoDto
|
return new TeamInfoDto
|
||||||
{
|
{
|
||||||
// 兼容旧版:保留 images 字段
|
// 兼容旧版:保留 images 字段
|
||||||
Images = pages.Select(p => p.ImageUrl).ToList(),
|
Images = promotions.Select(p => p.ImageUrl).ToList(),
|
||||||
Items = pages
|
Items = promotions
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -390,6 +390,12 @@ public partial class MiAssessmentDbContext : DbContext
|
||||||
entity.Property(e => e.ImageUrl)
|
entity.Property(e => e.ImageUrl)
|
||||||
.HasMaxLength(500)
|
.HasMaxLength(500)
|
||||||
.HasComment("图片URL");
|
.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)
|
entity.Property(e => e.Position)
|
||||||
.HasDefaultValue(1)
|
.HasDefaultValue(1)
|
||||||
.HasComment("位置:1首页底部 2团队页");
|
.HasComment("位置:1首页底部 2团队页");
|
||||||
|
|
@ -422,12 +428,6 @@ public partial class MiAssessmentDbContext : DbContext
|
||||||
entity.Property(e => e.Title)
|
entity.Property(e => e.Title)
|
||||||
.HasMaxLength(100)
|
.HasMaxLength(100)
|
||||||
.HasComment("标题");
|
.HasComment("标题");
|
||||||
entity.Property(e => e.IconUrl)
|
|
||||||
.HasMaxLength(500)
|
|
||||||
.HasComment("图标URL(未选中状态)");
|
|
||||||
entity.Property(e => e.ActiveIconUrl)
|
|
||||||
.HasMaxLength(500)
|
|
||||||
.HasComment("图标URL(选中状态)");
|
|
||||||
entity.Property(e => e.ImageUrl)
|
entity.Property(e => e.ImageUrl)
|
||||||
.HasMaxLength(500)
|
.HasMaxLength(500)
|
||||||
.HasComment("详情图片URL");
|
.HasComment("详情图片URL");
|
||||||
|
|
|
||||||
|
|
@ -22,18 +22,6 @@ public class BusinessPage
|
||||||
[MaxLength(100)]
|
[MaxLength(100)]
|
||||||
public string? Title { get; set; }
|
public string? Title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图标URL(未选中状态)
|
|
||||||
/// </summary>
|
|
||||||
[MaxLength(500)]
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图标URL(选中状态)
|
|
||||||
/// </summary>
|
|
||||||
[MaxLength(500)]
|
|
||||||
public string? ActiveIconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 详情图片URL
|
/// 详情图片URL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,18 @@ public class Promotion
|
||||||
[MaxLength(500)]
|
[MaxLength(500)]
|
||||||
public string ImageUrl { get; set; } = null!;
|
public string ImageUrl { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图标URL(未选中状态)
|
||||||
|
/// </summary>
|
||||||
|
[MaxLength(500)]
|
||||||
|
public string? IconUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图标URL(选中状态)
|
||||||
|
/// </summary>
|
||||||
|
[MaxLength(500)]
|
||||||
|
public string? ActiveIconUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 位置:1首页底部 2团队页
|
/// 位置:1首页底部 2团队页
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user