HaniBlindBox/.kiro/specs/content-auxiliary-frontend/requirements.md
2026-01-18 11:18:09 +08:00

147 lines
7.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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
1. 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
2. WHEN an administrator clicks the edit button, THE Admin_System SHALL open an edit dialog with the page content
3. WHEN an administrator toggles the image optimizer switch, THE Admin_System SHALL update the page's image optimizer status immediately
4. 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
1. WHEN an administrator opens the edit dialog, THE Admin_System SHALL display the page title and content in a rich text editor
2. WHEN an administrator modifies the content and clicks save, THE Admin_System SHALL update the page content
3. IF the page ID is between 2 and 20, THEN THE Admin_System SHALL prevent editing the title field
4. 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
1. WHEN an administrator accesses the FloatBall list page, THE Admin_System SHALL display a list of all float ball configurations
2. 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
3. THE Admin_System SHALL display images as thumbnails with preview capability
4. 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
1. WHEN an administrator clicks the add button, THE Admin_System SHALL open a form dialog for creating a new float ball
2. THE Admin_System SHALL require type, image, position X, position Y, width, height, and effect fields
3. THE Admin_System SHALL provide type selection (show image/jump to page)
4. THE Admin_System SHALL provide image upload for image, background image, and detail image
5. THE Admin_System SHALL provide link URL input when type is "jump to page"
6. THE Admin_System SHALL provide position and size inputs
7. THE Admin_System SHALL provide effect selection (none/scale animation)
8. 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
1. WHEN an administrator clicks the edit button, THE Admin_System SHALL open a form dialog with the configuration data pre-filled
2. THE Admin_System SHALL allow editing all fields
3. 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
1. WHEN an administrator toggles the status switch, THE Admin_System SHALL update the float ball status immediately
2. 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
1. WHEN an administrator accesses the WelfareHouse list page, THE Admin_System SHALL display a list of all welfare house entries
2. THE Admin_System SHALL display ID, name, image, URL, sort order, status, and create time
3. THE Admin_System SHALL display images as thumbnails with preview capability
4. 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
1. WHEN an administrator clicks the add button, THE Admin_System SHALL open a form dialog for creating a new entry
2. THE Admin_System SHALL require name, image, URL, and sort order fields
3. THE Admin_System SHALL provide image upload for the entry image
4. 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
1. WHEN an administrator clicks the edit button, THE Admin_System SHALL open a form dialog with the entry data pre-filled
2. THE Admin_System SHALL allow editing all fields
3. 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
1. WHEN an administrator toggles the status switch, THE Admin_System SHALL update the entry status immediately
2. 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
1. THE Admin_System SHALL provide Danye API endpoints: GET list, GET by ID, PUT update, PUT toggle image optimizer
2. THE Admin_System SHALL provide FloatBall API endpoints: GET list, GET by ID, POST create, PUT update, DELETE, PUT status
3. THE Admin_System SHALL provide WelfareHouse API endpoints: GET list, GET by ID, POST create, PUT update, DELETE, PUT status
4. THE Admin_System SHALL return consistent response format for all APIs
5. 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
1. THE Admin_System SHALL add "内容管理" menu group with sub-menus for Danye, FloatBall, and WelfareHouse
2. THE Admin_System SHALL configure routes for all content and auxiliary pages
3. THE Admin_System SHALL configure appropriate permissions for each page