feat: 新增自定义图标库并调整菜单图标与菜单归属

1. 新增 iconfont 自定义图标库及相关依赖文件
2. 调整菜单图标为自定义字体图标,替换原有 Ant Design 图标
3. 将客户拜访菜单从客户管理移动到项目管理作为首个子菜单
4. 优化侧边菜单展开逻辑与图标样式适配
This commit is contained in:
andyesfly committed 2026-09-11 17:01:24 +08:00
1 parent c60caa4770
commit 68af363ca9
12 files changed
+207 -19

No files matched your search

+13 -12
View File
@@ -85,7 +85,7 @@ ON CONFLICT (id) DO UPDATE SET
INSERT INTO sys_menu (id, parent_id, menu_name, menu_path, component, icon, sort_order, menu_type, permission, visible) VALUES
(12, 1, '客户档案管理', '/customer/info', 'customer/info/index', 'UserOutlined', 1, 2, 'customer:list', 1),
(13, 1, '客户部门', '/customer/department', 'customer/department/index', 'TeamOutlined', 2, 2, 'customer:department', 1),
(14, 1, '客户小程序授权管理', '/customer/account', 'customer/account/index', 'SafetyOutlined', 3, 2, 'customer:account', 1),
(14, 1, '客户小程序授权管理', '/customer/account', 'customer/account/index', 'xt-xiaochengxu', 3, 2, 'customer:account', 1),
(15, 1, '新增客户', NULL, NULL, NULL, 1, 3, 'customer:create', 1),
(16, 1, '编辑客户', NULL, NULL, NULL, 2, 3, 'customer:update', 1),
(17, 1, '删除客户', NULL, NULL, NULL, 3, 3, 'customer:delete', 1),
@@ -106,18 +106,19 @@ ON CONFLICT (id) DO UPDATE SET
permission = EXCLUDED.permission,
visible = EXCLUDED.visible;
-- 初始菜单(客户扩展子菜单 + 项目域子菜单,id:24-31 + 空间拓扑 32)
-- 客户域:客户拜访(customer:visit) / 空间拓扑与用电架构(customer:topology)
-- 项目域:项目勘察(project:survey) / 项目方案(project:plan) / 合同管理(project:contract)
-- 项目验收(project:acceptance) / 回访记录(project:visit)
-- 初始菜单(项目域子菜单 + 客户扩展子菜单,id:24-31 + 空间拓扑 32)
-- 项目域:客户拜访(customer:visit) / 项目勘察(project:survey) / 项目方案(project:plan)
-- 合同管理(project:contract) / 项目验收(project:acceptance) / 回访记录(project:visit)
-- 客户域:空间拓扑与用电架构(customer:topology)
-- 注:客户拜访归属“项目管理”,但仍沿用 /customer/visit 路径与 customer:visit 权限码
INSERT INTO sys_menu (id, parent_id, menu_name, menu_path, component, icon, sort_order, menu_type, permission, visible) VALUES
(24, 1, '客户拜访', '/customer/visit', 'customer/visit/index', 'AccountBookOutlined', 4, 2, 'customer:visit', 1),
(27, 2, '项目勘察', '/project/survey', 'project/survey/index', 'CarryOutOutlined', 1, 2, 'project:survey', 1),
(28, 2, '项目方案', '/project/plan', 'project/plan/index', 'FileSearchOutlined', 2, 2, 'project:plan', 1),
(29, 2, '合同管理', '/project/contract', 'project/contract/index', 'FileDoneOutlined', 3, 2, 'project:contract', 1),
(30, 2, '项目验收', '/project/acceptance', 'project/acceptance/index', 'ThunderboltOutlined', 4, 2, 'project:acceptance',1),
(31, 2, '回访记录', '/project/visit', 'project/visit/index', 'AuditOutlined', 5, 2, 'project:visit', 1),
(32, 1, '空间拓扑与用电架构', '/customer/topology', 'customer/topology/index', 'ApartmentOutlined', 5, 2, 'customer:topology',1)
(24, 2, '客户拜访', '/customer/visit', 'customer/visit/index', 'xt-jihuabaifang', 1, 2, 'customer:visit', 1),
(27, 2, '项目勘察', '/project/survey', 'project/survey/index', 'xt-xiangmukancha', 2, 2, 'project:survey', 1),
(28, 2, '项目方案', '/project/plan', 'project/plan/index', 'xt-xiangmufangan', 3, 2, 'project:plan', 1),
(29, 2, '合同管理', '/project/contract', 'project/contract/index', 'FileDoneOutlined', 4, 2, 'project:contract', 1),
(30, 2, '项目验收', '/project/acceptance', 'project/acceptance/index', 'ThunderboltOutlined', 5, 2, 'project:acceptance',1),
(31, 2, '回访记录', '/project/visit', 'project/visit/index', 'AuditOutlined', 6, 2, 'project:visit', 1),
(32, 1, '空间拓扑与用电架构', '/customer/topology', 'customer/topology/index', 'xt-topology', 5, 2, 'customer:topology',1)
ON CONFLICT (id) DO UPDATE SET
parent_id = EXCLUDED.parent_id,
menu_name = EXCLUDED.menu_name,
@@ -0,0 +1,31 @@
-- ============================================================
-- 增量脚本:导航菜单图标切换为 iconfont 自定义图标
-- 日期:2026-09-11
-- 数据库:PostgreSQL 15+ (xintong)
-- 说明:将 5 个业务菜单的 sys_menu.icon 由 ant-design 图标名
-- 改为前端 iconfont 类名(xt- 前缀),前端据此渲染字体图标。
-- 图标源自 client/src/assets/fonts/iconfont(css_prefix_text = xt-)。
-- 幂等脚本,可重复执行。
--
-- 用法:
-- psql -U postgres -d xintong -f 20260911_menu_iconfont.sql
-- ============================================================
BEGIN;
UPDATE sys_menu SET icon = 'xt-xiaochengxu' WHERE menu_path = '/customer/account'; -- 客户小程序授权管理
UPDATE sys_menu SET icon = 'xt-jihuabaifang' WHERE menu_path = '/customer/visit'; -- 客户拜访
UPDATE sys_menu SET icon = 'xt-topology' WHERE menu_path = '/customer/topology'; -- 空间拓扑与用电架构
UPDATE sys_menu SET icon = 'xt-xiangmukancha' WHERE menu_path = '/project/survey'; -- 项目勘察
UPDATE sys_menu SET icon = 'xt-xiangmufangan' WHERE menu_path = '/project/plan'; -- 项目方案
COMMIT;
-- ============================================================
-- 验证查询(可选)
-- ============================================================
SELECT id, menu_name, menu_path, icon
FROM sys_menu
WHERE menu_path IN ('/customer/account', '/customer/visit', '/customer/topology',
'/project/survey', '/project/plan')
ORDER BY id;
@@ -0,0 +1,16 @@
-- 把“客户拜访”从“客户管理”移动到“项目管理”,并调整为项目管理下的第 1 个菜单
-- 说明:仅调整归属(parent_id)与排序(sort_order),
-- menu_path(/customer/visit)、component(customer/visit/index)、permission(customer:visit) 保持不变
BEGIN;
-- 客户拜访改挂到项目管理(parent_id=2),并排在项目勘察之前
UPDATE sys_menu SET parent_id = 2, sort_order = 1 WHERE menu_path = '/customer/visit';
-- 项目管理下原有子菜单顺序后移,保持连续
UPDATE sys_menu SET sort_order = 2 WHERE menu_path = '/project/survey'; -- 项目勘察
UPDATE sys_menu SET sort_order = 3 WHERE menu_path = '/project/plan'; -- 项目方案
UPDATE sys_menu SET sort_order = 4 WHERE menu_path = '/project/contract'; -- 合同管理
UPDATE sys_menu SET sort_order = 5 WHERE menu_path = '/project/acceptance'; -- 项目验收
UPDATE sys_menu SET sort_order = 6 WHERE menu_path = '/project/visit'; -- 回访记录
COMMIT;