Files
leaudit-platform-frontend/database/add_documents_index_route.sql
2025-12-05 00:09:32 +08:00

55 lines
1.6 KiB
SQL
Raw Permalink 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.
-- ============================================================
-- 添加文档列表子菜单路由
-- 说明:为 /documents 父级菜单添加"文档列表"子菜单
-- 生成时间: 2025-11-17
-- ============================================================
-- 添加 /documents 索引路由作为子菜单
INSERT INTO sys_routes (
route_path,
route_name,
route_title,
parent_id,
icon,
sort_order,
is_hidden,
is_cache,
component,
meta
) VALUES (
'/documents',
'DocumentsList',
'文档列表',
2, -- parent_id = 2 (Documents 父级菜单)
NULL,
1,
false,
true,
'views/documents/Index.vue',
'{}'
);
-- 调整文档上传的排序,让文档列表排在第一位
UPDATE sys_routes
SET sort_order = 2
WHERE id = 32; -- /documents/upload
-- 验证结果
SELECT id, route_path, route_name, route_title, parent_id, sort_order, is_hidden
FROM sys_routes
WHERE parent_id = 2 OR id = 2
ORDER BY parent_id NULLS FIRST, sort_order;
-- ============================================================
-- 说明
-- ============================================================
-- 现在的菜单结构:
-- 文档管理 (/documents) [id=2]
-- ├─ 文档列表 (/documents) [新增,sort_order=1]
-- └─ 文档上传 (/documents/upload) [id=32sort_order=2]
--
-- 注意:虽然父级和子菜单路径相同,但 Remix 会根据路由文件正确处理
-- - documents.tsx: 父级布局
-- - documents._index.tsx: 索引路由(文档列表)
-- ============================================================