7.5 KiB
Requirements Document
Introduction
本文档定义了"内容与辅助"模块从老项目(PHP ThinkPHP + Layui)迁移到新项目(ASP.NET Core + Vue 3 + Element Plus)的需求。该模块包含单页管理、悬浮球配置和福利屋入口三个子模块。
Glossary
- Admin_System: 后台管理系统
- Danye_Module: 单页管理模块,用于管理静态页面内容(如关于我们、用户协议等)
- FloatBall_Module: 悬浮球配置模块,用于配置首页悬浮球
- WelfareHouse_Module: 福利屋入口模块,用于配置福利屋入口
- Rich_Text_Editor: 富文本编辑器,用于编辑HTML内容
- Image_Optimizer: 图片优化开关,开启后只显示图片,支持长按识别二维码
Requirements
Requirement 1: 单页管理列表
User Story: As an administrator, I want to view and manage static pages, so that I can maintain content like "About Us" and "User Agreement".
Acceptance Criteria
- WHEN an administrator accesses the Danye list page, THE Admin_System SHALL display a list of all static pages with ID, title, and image optimizer status
- WHEN an administrator clicks the edit button, THE Admin_System SHALL open an edit dialog with the page content
- WHEN an administrator toggles the image optimizer switch, THE Admin_System SHALL update the page's image optimizer status immediately
- THE Admin_System SHALL display the image optimizer status as a toggle switch for each page
Requirement 2: 单页编辑
User Story: As an administrator, I want to edit static page content, so that I can update the information displayed to users.
Acceptance Criteria
- WHEN an administrator opens the edit dialog, THE Admin_System SHALL display the page title and content in a rich text editor
- WHEN an administrator modifies the content and clicks save, THE Admin_System SHALL update the page content
- IF the page ID is between 2 and 20, THEN THE Admin_System SHALL prevent editing the title field
- THE Rich_Text_Editor SHALL support image upload and basic formatting
Requirement 3: 悬浮球列表
User Story: As an administrator, I want to view and manage float ball configurations, so that I can control the floating buttons on the homepage.
Acceptance Criteria
- WHEN an administrator accesses the FloatBall list page, THE Admin_System SHALL display a list of all float ball configurations
- THE Admin_System SHALL display title, image, background image, detail image, type, link URL, position (X/Y), size (width/height), detail image position and size, effect, status, and create time
- THE Admin_System SHALL display images as thumbnails with preview capability
- THE Admin_System SHALL support pagination for the float ball list
Requirement 4: 悬浮球新增
User Story: As an administrator, I want to create new float ball configurations, so that I can add floating buttons to the homepage.
Acceptance Criteria
- WHEN an administrator clicks the add button, THE Admin_System SHALL open a form dialog for creating a new float ball
- THE Admin_System SHALL require type, image, position X, position Y, width, height, and effect fields
- THE Admin_System SHALL provide type selection (show image/jump to page)
- THE Admin_System SHALL provide image upload for image, background image, and detail image
- THE Admin_System SHALL provide link URL input when type is "jump to page"
- THE Admin_System SHALL provide position and size inputs
- THE Admin_System SHALL provide effect selection (none/scale animation)
- THE Admin_System SHALL provide status toggle
Requirement 5: 悬浮球编辑
User Story: As an administrator, I want to edit existing float ball configurations, so that I can update floating button settings.
Acceptance Criteria
- WHEN an administrator clicks the edit button, THE Admin_System SHALL open a form dialog with the configuration data pre-filled
- THE Admin_System SHALL allow editing all fields
- WHEN an administrator saves changes, THE Admin_System SHALL update the configuration
Requirement 6: 悬浮球状态管理
User Story: As an administrator, I want to manage float ball status, so that I can enable or disable floating buttons.
Acceptance Criteria
- WHEN an administrator toggles the status switch, THE Admin_System SHALL update the float ball status immediately
- WHEN an administrator clicks delete, THE Admin_System SHALL show a confirmation dialog and delete the configuration upon confirmation
Requirement 7: 福利屋入口列表
User Story: As an administrator, I want to view and manage welfare house entries, so that I can control the welfare house navigation.
Acceptance Criteria
- WHEN an administrator accesses the WelfareHouse list page, THE Admin_System SHALL display a list of all welfare house entries
- THE Admin_System SHALL display ID, name, image, URL, sort order, status, and create time
- THE Admin_System SHALL display images as thumbnails with preview capability
- THE Admin_System SHALL support pagination for the welfare house list
Requirement 8: 福利屋入口新增
User Story: As an administrator, I want to create new welfare house entries, so that I can add navigation items.
Acceptance Criteria
- WHEN an administrator clicks the add button, THE Admin_System SHALL open a form dialog for creating a new entry
- THE Admin_System SHALL require name, image, URL, and sort order fields
- THE Admin_System SHALL provide image upload for the entry image
- THE Admin_System SHALL provide status toggle
Requirement 9: 福利屋入口编辑
User Story: As an administrator, I want to edit existing welfare house entries, so that I can update navigation items.
Acceptance Criteria
- WHEN an administrator clicks the edit button, THE Admin_System SHALL open a form dialog with the entry data pre-filled
- THE Admin_System SHALL allow editing all fields
- WHEN an administrator saves changes, THE Admin_System SHALL update the entry
Requirement 10: 福利屋入口状态管理
User Story: As an administrator, I want to manage welfare house entry status, so that I can enable or disable navigation items.
Acceptance Criteria
- WHEN an administrator toggles the status switch, THE Admin_System SHALL update the entry status immediately
- WHEN an administrator clicks delete, THE Admin_System SHALL show a confirmation dialog and delete the entry upon confirmation
Requirement 11: 后端API
User Story: As a developer, I want backend APIs for all content and auxiliary modules, so that the frontend can interact with the data.
Acceptance Criteria
- THE Admin_System SHALL provide Danye API endpoints: GET list, GET by ID, PUT update, PUT toggle image optimizer
- THE Admin_System SHALL provide FloatBall API endpoints: GET list, GET by ID, POST create, PUT update, DELETE, PUT status
- THE Admin_System SHALL provide WelfareHouse API endpoints: GET list, GET by ID, POST create, PUT update, DELETE, PUT status
- THE Admin_System SHALL return consistent response format for all APIs
- THE Admin_System SHALL validate required fields before saving
Requirement 12: 路由和菜单配置
User Story: As an administrator, I want to access content and auxiliary management pages from the menu, so that I can navigate to these features.
Acceptance Criteria
- THE Admin_System SHALL add "内容管理" menu group with sub-menus for Danye, FloatBall, and WelfareHouse
- THE Admin_System SHALL configure routes for all content and auxiliary pages
- THE Admin_System SHALL configure appropriate permissions for each page