fix: 修复部门树和菜单树时间展示问题,fixes #132

This commit is contained in:
Mr. Lan 2021-02-24 21:41:14 +08:00
parent 5e56e3be09
commit 206eb8ddd9
3 changed files with 9 additions and 5 deletions

View File

@ -92,11 +92,11 @@ INSERT INTO `casbin_rule`(`p_type`, `v0`, `v1`, `v2`, `v3`, `v4`, `v5`) VALUES (
COMMIT;
BEGIN;
INSERT INTO `sys_dept`(`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`) VALUES (1, 0, '/0/1', '磊哥科技', 0, null, '', 'lanyulei@fdevops.com', 0, '1', '1');
INSERT INTO `sys_dept`(`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`) VALUES (7, 1, '/0/1/7', '研发部', 1, null, '', '', 0, '1', '1');
INSERT INTO `sys_dept`(`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`) VALUES (8, 1, '/0/1/8', '运维部', 0, null, '', '', 0, '1', NULL);
INSERT INTO `sys_dept`(`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`) VALUES (9, 1, '/0/1/9', '客服部', 0, null, '', '', 0, '1', NULL);
INSERT INTO `sys_dept`(`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`) VALUES (10, 1, '/0/1/10', '人力资源', 3, null, '', '', 1, '1', '1');
INSERT INTO `sys_dept`(`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (1, 0, '/0/1', '磊哥科技', 0, null, '', 'lanyulei@fdevops.com', 0, '1', '1', '2021-02-24 21:30:59', '2021-02-24 21:30:59');
INSERT INTO `sys_dept`(`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (7, 1, '/0/1/7', '研发部', 1, null, '', '', 0, '1', '1', '2021-02-24 21:30:59', '2021-02-24 21:30:59');
INSERT INTO `sys_dept`(`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (8, 1, '/0/1/8', '运维部', 0, null, '', '', 0, '1', NULL, '2021-02-24 21:30:59', '2021-02-24 21:30:59');
INSERT INTO `sys_dept`(`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (9, 1, '/0/1/9', '客服部', 0, null, '', '', 0, '1', NULL, '2021-02-24 21:30:59', '2021-02-24 21:30:59');
INSERT INTO `sys_dept`(`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (10, 1, '/0/1/10', '人力资源', 3, null, '', '', 1, '1', '1', '2021-02-24 21:30:59', '2021-02-24 21:30:59');
COMMIT;
BEGIN;

View File

@ -158,6 +158,8 @@ func Digui(deptlist *[]Dept, menu Dept) Dept {
mi.Phone = list[j].Phone
mi.Email = list[j].Email
mi.Status = list[j].Status
mi.CreatedAt = list[j].CreatedAt
mi.UpdatedAt = list[j].UpdatedAt
mi.Children = []Dept{}
ms := Digui(deptlist, mi)
min = append(min, ms)

View File

@ -130,6 +130,8 @@ func DiguiMenu(menulist *[]Menu, menu Menu) Menu {
mi.Component = list[j].Component
mi.Sort = list[j].Sort
mi.Visible = list[j].Visible
mi.CreatedAt = list[j].CreatedAt
mi.UpdatedAt = list[j].UpdatedAt
mi.Children = []Menu{}
if mi.MenuType != "F" {