Files
HF-MES-manual/en/system_settings/menu_configuration.md
2026-05-12 01:46:34 +08:00

172 lines
6.1 KiB
Markdown

# Menu Management
## 1. Function Overview
The Menu Management module is used to configure the system's menu structure, supporting menu configuration for both the backend management and PDA terminals. It enables menu CRUD operations, sorting, and permission association.
**Core Functions:**
- Menu Tree Structure Management: Supports creation, editing, and deletion of multi-level menus
- Menu Category Management: Distinguishes between admin (backend) and PDA module menus
- Menu Status Control: Supports enabling/disabling menu operations
- Menu Sorting: Supports drag-and-drop sorting to adjust menu display order
- Menu Permission Association: New menus are automatically associated with the super admin role
- Menu Navigation Property: Controls whether menus are displayed in the navigation bar
**Function Screenshot**:
![Menu Management Function Screenshot](/public/image_en/menu_configuration/图片:菜单管理功能截图.png)
## 2. Term Explanation
#### 2.1.1 Menu-related Terms
| Term | Definition | Description |
|------|------------|-------------|
| Top-level Menu | Menu node without parent menu | Serves as root node of menu tree |
| Sub-menu | Menu node with parent menu | Supports multi-level nesting |
| Module | System module to which menu belongs | admin (backend), pda (PDA terminal) |
| Navigation Property | Whether menu is displayed in navigation bar | Visible (1) or Hidden (0) |
| Link Type | Type of menu link | Module (0) or External Link (1) |
| Open Method | Link opening method | Current window (_self) or New window (_blank) |
## 3. Menu Management Operations
### 3.1 Menu Query
**Query Conditions:**
| Query Condition | Description |
|----------------|-------------|
| Module | Select backend (admin) or PDA module |
| Status | Filter enabled or disabled menus |
| Navigation Property | Filter visible or hidden menus |
| Menu Depth | Control expansion level of menu tree |
**Operation Steps:**
1. Go to [System Settings] → [Menu Management] → [Menu Configuration]
2. Select query conditions in the top query area
3. Click [Query] button to get menu list
4. Click [Reset] button to clear query conditions
**Function Screenshot**:
![Menu Management Query Function Screenshot](/public/image_en/menu_configuration/图片:菜单管理查询功能截图.png)
### 3.2 Add Menu
**Operation Steps:**
1. Go to [System Settings] → [Menu Management] → [Menu Configuration]
2. Click [Add Top-level Menu] button, or click [Add] button on existing menu to add sub-menu
3. Fill in menu form information
4. Click [OK] to complete addition
**Field Description:**
| Field | Description | Required |
|-------|-------------|----------|
| Parent Menu | Select parent menu; no selection means top-level menu | No |
| Name | Display name of menu | Yes |
| Alias | Alias identifier for menu; required for API-type menus | No |
| Icon | Menu icon, can be selected or customized | No |
| Sort | Sort order number; smaller value means higher priority | Yes |
| Navigation | Controls whether menu is displayed in navigation bar | Yes |
| Link Type | Module (0) or External Link (1) | Yes |
| Open Method | Current window or New window | Yes |
| URL | Menu link address | No |
| Parameters | Link parameters | No |
| Remarks | Remarks for menu | No |
**[Tip]** When adding a menu, the system automatically associates it with the super admin role.
**Function Screenshot**:
![Menu Management Add Function Screenshot](/public/image_en/menu_configuration/图片:菜单管理新增功能截图.png)
### 3.3 Edit Menu
**Operation Steps:**
1. Click the menu node to edit in the menu tree
2. Modify menu information in the right form
3. Click [Modify] button to save changes
**[Note]** Menu names cannot be duplicated within the same module.
**Function Screenshot**:
![Menu Management Edit Function Screenshot](/public/image_en/menu_configuration/图片:菜单管理编辑功能截图.png)
### 3.4 Delete Menu
**Operation Steps:**
1. Find the menu to delete in the menu tree
2. Click [Delete] button on the right side of the menu
3. Click [OK] in the confirmation dialog
**Function Screenshot**:
![Menu Management Delete Function Screenshot](/public/image_en/menu_configuration/图片:菜单管理删除功能截图.png)
**[Important]** If the menu or its child menus are being used by roles, deletion is not allowed.
### 3.5 Enable/Disable Menu
**Operation Steps:**
1. Find the menu to operate in the menu tree
2. Click [Disable] or [Enable] button on the right side of the menu
3. Click [OK] in the confirmation dialog
**[Note]** Status switching affects the menu and all its child menus.
**Function Screenshot**:
![Menu Management Delete Function Screenshot](/public/image_en/menu_configuration/图片:菜单管理删除功能截图.png)
### 3.6 Menu Sorting
**Operation Steps:**
1. Drag menu node to target position in the menu tree
2. System automatically saves sorting result
**Supported Drag Operations:**
- Drag to front or back of sibling menus
- Drag to other menus as sub-menu
**Function Screenshot**:
![Menu Management Sort Function Screenshot](/public/image_en/menu_configuration/图片:菜单管理排序功能截图.png)
## 7. Data Flow Diagram
```mermaid
flowchart TD
A[User Request] --> B{Is Super Admin?}
B -->|Yes| C[Query All Menus]
B -->|No| D[Query Role-associated Menus]
C --> E[Return Menu List]
D --> E
E --> F[Frontend Renders Tree Structure]
F --> G[User Operation]
G --> H{Operation Type}
H -->|Add| I[Validate Name Uniqueness]
H -->|Edit| J[Validate Name Uniqueness]
H -->|Delete| K[Check Role Usage]
H -->|Status Switch| L[Check Role Usage]
I --> M[Save Menu Data]
J --> M
K --> N{Is Being Used?}
L --> N
N -->|Yes| O[Show Error Message]
N -->|No| P[Execute Operation]
M --> Q[Associate Super Admin]
Q --> R[Return Result]
P --> R
O --> R
```
## 8. Notes
**[Important]** Before deleting or disabling a menu, ensure it is not used by any role; otherwise, the operation will fail.
**[Tip]** It is recommended to regularly organize the menu structure to maintain clarity and logic of the menu tree.
**[Note]** Smaller menu sort values appear first; default value is 50.