refactor: 系统权限模块重构,迁移至PostgreSQL并对齐新设计
- 切换数据库为PostgreSQL,更新依赖与配置 - 重构权限体系,使用sys_user/sys_role/sys_menu等新实体替代旧模型 - 移除旧的用户角色/权限/系统设置相关代码与实体 - 新增字典、菜单管理模块与基础CRUD接口 - 优化鉴权逻辑,基于菜单权限标识进行接口校验 - 前端同步更新API、路由与权限控制逻辑 - 删除冗余的v-permission指令与相关代码
This commit is contained in:
1 parent
98c22f6afb
commit
0a8103f33d
67 files changed
+3263
-1924
No files matched your search
+3
-40
@@ -1307,51 +1307,14 @@ CREATE INDEX idx_file_business ON file_record (business_type, business_id);
|
||||
|
||||
-- ============================================================
|
||||
-- 十三、初始数据
|
||||
-- 已迁移至独立脚本 db_seed.sql(幂等执行,便于单独重置种子数据)
|
||||
-- 执行顺序:先 db_init.sql 建表结构 → 再 db_seed.sql 写入种子数据
|
||||
-- ============================================================
|
||||
|
||||
-- 初始角色
|
||||
INSERT INTO sys_role (role_code, role_name, description, sort_order) VALUES
|
||||
('ADMIN', '运营管理员', '全部菜单权限,管理所有客户', 1),
|
||||
('SALESMAN', '业务员', '客户/项目/方案/合同/回访', 2),
|
||||
('WORKER', '共享电工', 'APP 接单处理,无后台菜单', 3),
|
||||
('CUSTOMER', '客户', '小程序查看用电/报警/报修', 4);
|
||||
|
||||
-- 初始菜单
|
||||
INSERT INTO sys_menu (menu_name, menu_path, menu_type, sort_order, permission) VALUES
|
||||
('客户管理', '/customer', 2, 1, 'customer:list'),
|
||||
('项目管理', '/project', 2, 2, 'project:list'),
|
||||
('运营派单', '/dispatch', 2, 3, 'dispatch:list'),
|
||||
('设备监控', '/device', 2, 4, 'device:list'),
|
||||
('统计报表', '/report', 2, 5, 'report:list'),
|
||||
('系统管理', '/system', 2, 6, 'system:list');
|
||||
|
||||
-- 初始字典
|
||||
INSERT INTO sys_dict (dict_type, dict_label, dict_value, sort_order) VALUES
|
||||
('customer_status', '意向', '1', 1),
|
||||
('customer_status', '签约', '2', 2),
|
||||
('customer_status', '运维中', '3', 3),
|
||||
('customer_status', '终止', '4', 4),
|
||||
('equip_type', '配电间', '配电间', 1),
|
||||
('equip_type', '配电井', '配电井', 2),
|
||||
('equip_type', '配电箱', '配电箱', 3),
|
||||
('device_type', '网关', '网关', 1),
|
||||
('device_type', '探测器', '探测器', 2),
|
||||
('device_type', '采集器', '采集器', 3),
|
||||
('dispatch_status', '已派发', '0', 1),
|
||||
('dispatch_status', '已接单', '1', 2),
|
||||
('dispatch_status', '已完成', '2', 3),
|
||||
('pay_cycle', '按月支付', '按月', 1),
|
||||
('pay_cycle', '按年支付', '按年', 2),
|
||||
('dispatch_type', '勘察派单', 'survey', 1),
|
||||
('dispatch_type', '安装派单', 'install', 2),
|
||||
('dispatch_type', '报警派单', 'alarm', 3),
|
||||
('dispatch_type', '维修派单', 'repair', 4),
|
||||
('dispatch_type', '维保派单', 'maintenance', 5);
|
||||
|
||||
COMMIT;
|
||||
|
||||
-- ============================================================
|
||||
-- 完 · 37 张表 · 50+ 索引 · 3 个触发器 · 3 个分区管理函数 · 1 个物化视图 · 2 个 pg_cron 定时任务 · 初始数据
|
||||
-- 完 · 37 张表 · 50+ 索引 · 3 个触发器 · 3 个分区管理函数 · 1 个物化视图 · 2 个 pg_cron 定时任务(种子数据见 db_seed.sql)
|
||||
-- ============================================================
|
||||
|
||||
-- ============================================================
|
||||
|
||||
Reference in new issue
Block a user