Menu management
1. Menu management page
Click [Menu Management] under [System Management] to enter the menu management page. This page displays a tree structure list containing fields such as menu name, icon, sorting, permission identification, component path, status, and creation time.

2. Add new menu information
Click the [Add] button on the page, fill in the menu information in the pop-up box that appears, and click the [OK] button to complete the addition of the menu information.

3. Modify menu information
Select the menu information to be modified, click the [Modify] button in the operation column, modify the existing menu information in the pop-up box that appears, and click the [OK] button to complete the modification of the menu information.

4. Delete menu information
Select the menu information to be deleted, click the [Delete] button in the operation column, and click the [OK] button. The system will delete the menu information.

5. Added submenu to automatically fill in the previous level
Select the target parent menu and click the [Add] button in its operation column. In the pop-up new window, the "Parent Menu" field automatically displays the current menu. After filling in other information and clicking [OK], you can add a submenu to it.

6. Expand/collapse
Click the [Expand/Collapse] button to switch the expanded and collapsed state of the tree list.

7. Extended information
7.1 Scenario introduction
During the project iteration process, if new functions are added, corresponding entries need to be added to the system menu.
The code part can be pulled directly from the repository, but the menu requires manual execution of SQL scripts. The following is a menu SQL example and description.
7.2 Script execution method
Database type description
- MySQL: The following script can be executed directly.
- Dameng: You need to first execute "Menu SQL" to generate the main menu, manually query the generated ID, and then replace
@parentIdin the subsequent script with this ID.
Execution order
- Step 1: Execute "Menu SQL" to insert into the main menu.
- Step 2: Query
@parentIdor manually obtain the ID of the newly inserted menu. - Step 3: Execute the "Button SQL" script and insert the corresponding button permissions.
Notes
- Please execute under administrator account.
- If there is a cache, please clear the cache or restart the service after execution.
7.3 Sample script
-- Notice! The following is how to write MySql
-- Menu SQL
insert into system_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('数据元', '2306', '1', 'dpDataElem', 'dp/dataElem/index', 1, 0, 'C', '0', '0', 'dp:dataElem:dataelem:list', '#', 'admin', sysdate(), '', null, '数据元菜单');
-- Button parent menu ID (DM currently does not support it and will not be implemented)
SELECT @parentId := LAST_INSERT_ID();
-- Button SQL (execute sequentially)
insert into system_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('数据元查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'dp:dataElem:dataelem:query', '#', 'admin', sysdate(), '', null, '');
insert into system_menu values('数据元新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'dp:dataElem:dataelem:add', '#', 'admin', sysdate(), '', null, '');
insert into system_menu values('数据元修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'dp:dataElem:dataelem:edit', '#', 'admin', sysdate(), '', null, '');
insert into system_menu values('数据元删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'dp:dataElem:dataelem:remove','#', 'admin', sysdate(), '', null, '');
insert into system_menu values('数据元导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'dp:dataElem:dataelem:export','#', 'admin', sysdate(), '', null, '');
insert into system_menu values('数据元导入', @parentId, '6', '#', '', 1, 0, 'F', '0', '0', 'dp:dataElem:dataelem:import','#', 'admin', sysdate(), '', null, '');7.4 Field meaning description
| Field name | meaning | Example value |
|---|---|---|
| menu_name | Menu name/button name | Data element / new data element |
| parent_id | Parent menu ID | 2306 (Business module parent menu) |
| order_num | Menu sort number | 1 |
| path | routing address | dpDataElem |
| component | Front-end component path | dp/dataElem/index |
| menu_type | Type: M=menu, C=menu, F=button | C |
| perms | Permission identification, the front and back ends must be consistent | dp:dataElem:dataelem:add |
| icon | menu icon | # |
| create_by | Creator | admin |
| create_time | creation time | sysdate() |
| remark | Remarks | Data element menu |
7.5 Configuration effects
After executing the script, the "Data Element" module will appear in the system menu,
Contains the following action buttons:
- Data element query
- New data element
- Data element modification
- Data element deletion
- Data element export
- Data element import
Administrators can view and adjust menu hierarchy, sorting, and permission assignments on the Menu Management page.
