yunzer_go/server/database/add_knowledge_menus.sql

66 lines
1.4 KiB
SQL
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.

-- 添加知识库管理相关的菜单项
-- 注意需要先查询知识库菜单的IDparent_id假设为 11
-- 如果知识库菜单ID为11添加分类管理和标签管理菜单
-- 请根据实际数据库中的知识库菜单ID修改下面的 parent_id 值
-- 查询知识库菜单ID如果需要
-- SELECT id FROM yz_menus WHERE path = '/apps/knowledge';
-- 添加分类管理菜单(如果不存在)
INSERT INTO yz_menus (
name,
path,
parent_id,
icon,
`order`,
status,
component_path,
menu_type,
description
)
SELECT
'分类管理',
'/apps/knowledge/category',
id,
'fa-solid fa-folder',
2,
1,
'@/views/apps/knowledge/category/index.vue',
1,
'知识库分类管理'
FROM yz_menus
WHERE path = '/apps/knowledge'
AND NOT EXISTS (
SELECT 1 FROM yz_menus WHERE path = '/apps/knowledge/category'
);
-- 添加标签管理菜单(如果不存在)
INSERT INTO yz_menus (
name,
path,
parent_id,
icon,
`order`,
status,
component_path,
menu_type,
description
)
SELECT
'标签管理',
'/apps/knowledge/tag',
id,
'fa-solid fa-tags',
3,
1,
'@/views/apps/knowledge/tag/index.vue',
1,
'知识库标签管理'
FROM yz_menus
WHERE path = '/apps/knowledge'
AND NOT EXISTS (
SELECT 1 FROM yz_menus WHERE path = '/apps/knowledge/tag'
);