新增web端职代会管理(职代会届次取值teacher_congress_session表数据);
This commit is contained in:
@@ -0,0 +1,228 @@
|
||||
-- 职代会电脑端菜单(MySQL 8)。
|
||||
-- 不包含库名前缀,可重复执行。
|
||||
|
||||
INSERT INTO sys_menu (
|
||||
id, parentId, path, name, aliasName, type, href, target, icon,
|
||||
showit, disabled, permission, note, location, hasChildren,
|
||||
createdBy, createdAt, updatedBy, updatedAt, delFlag, platform,
|
||||
moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService
|
||||
)
|
||||
SELECT
|
||||
'congress_pc_root', '',
|
||||
LPAD(IFNULL(MAX(CAST(`path` AS UNSIGNED)), 0) + 1, 4, '0'),
|
||||
'职代会管理', 'Congress', 'menu', '', '', 'ti-agenda',
|
||||
1, 0, 'congress', NULL, 1, 1,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
0, 'PC', NULL, NULL, 'z', 0, 0
|
||||
FROM sys_menu
|
||||
WHERE (parentId IS NULL OR parentId = '') AND CHAR_LENGTH(path) = 4
|
||||
HAVING NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'congress') t
|
||||
);
|
||||
|
||||
-- 一级分组:会议资料(排序 6)。
|
||||
INSERT INTO sys_menu (
|
||||
id, parentId, path, name, aliasName, type, href, target, icon,
|
||||
showit, disabled, permission, note, location, hasChildren,
|
||||
createdBy, createdAt, updatedBy, updatedAt, delFlag, platform,
|
||||
moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService
|
||||
)
|
||||
SELECT
|
||||
'congress_pc_materials', p.id, CONCAT(p.path, '0006'),
|
||||
'会议资料', 'Congress Materials', 'menu', '', '', 'ti-file',
|
||||
1, 0, 'congress.materials', NULL, 6, 1,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
0, 'PC', NULL, NULL, 'h', 0, 0
|
||||
FROM sys_menu p
|
||||
WHERE p.permission = 'congress'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'congress.materials') t
|
||||
);
|
||||
|
||||
-- 一级分组:会议签到(排序 7)。
|
||||
INSERT INTO sys_menu (
|
||||
id, parentId, path, name, aliasName, type, href, target, icon,
|
||||
showit, disabled, permission, note, location, hasChildren,
|
||||
createdBy, createdAt, updatedBy, updatedAt, delFlag, platform,
|
||||
moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService
|
||||
)
|
||||
SELECT
|
||||
'congress_pc_signin', p.id, CONCAT(p.path, '0007'),
|
||||
'会议签到', 'Congress Sign In', 'menu', '', '', 'ti-calendar',
|
||||
1, 0, 'congress.signIn', NULL, 7, 1,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
0, 'PC', NULL, NULL, 'h', 0, 0
|
||||
FROM sys_menu p
|
||||
WHERE p.permission = 'congress'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'congress.signIn') t
|
||||
);
|
||||
|
||||
-- 一级分组:会议投票(排序 8)。
|
||||
INSERT INTO sys_menu (
|
||||
id, parentId, path, name, aliasName, type, href, target, icon,
|
||||
showit, disabled, permission, note, location, hasChildren,
|
||||
createdBy, createdAt, updatedBy, updatedAt, delFlag, platform,
|
||||
moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService
|
||||
)
|
||||
SELECT
|
||||
'congress_pc_vote', p.id, CONCAT(p.path, '0008'),
|
||||
'会议投票', 'Congress Vote', 'menu', '', '', 'ti-bar-chart',
|
||||
1, 0, 'congress.vote', NULL, 8, 1,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
0, 'PC', NULL, NULL, 'h', 0, 0
|
||||
FROM sys_menu p
|
||||
WHERE p.permission = 'congress'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'congress.vote') t
|
||||
);
|
||||
|
||||
-- 二级页面菜单。
|
||||
INSERT INTO sys_menu (
|
||||
id, parentId, path, name, aliasName, type, href, target, icon,
|
||||
showit, disabled, permission, note, location, hasChildren,
|
||||
createdBy, createdAt, updatedBy, updatedAt, delFlag, platform,
|
||||
moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService
|
||||
)
|
||||
SELECT
|
||||
'congress_pc_signin_manage', p.id, CONCAT(p.path, '0001'),
|
||||
'会议管理', 'Meeting Manage', 'menu', '/platform/congress/signIn/index', 'data-pjax', 'ti-layout-grid2',
|
||||
1, 0, 'congress.signIn.manage', NULL, 1, 0,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
0, 'PC', NULL, NULL, 'h', 0, 0
|
||||
FROM sys_menu p
|
||||
WHERE p.permission = 'congress.signIn'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'congress.signIn.manage') t
|
||||
);
|
||||
|
||||
INSERT INTO sys_menu (
|
||||
id, parentId, path, name, aliasName, type, href, target, icon,
|
||||
showit, disabled, permission, note, location, hasChildren,
|
||||
createdBy, createdAt, updatedBy, updatedAt, delFlag, platform,
|
||||
moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService
|
||||
)
|
||||
SELECT
|
||||
'congress_pc_signin_record', p.id, CONCAT(p.path, '0002'),
|
||||
'签到记录', 'Sign In Record', 'menu', '/platform/congress/record/index', 'data-pjax', 'ti-layout-grid2',
|
||||
1, 0, 'congress.signIn.record', NULL, 2, 0,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
0, 'PC', NULL, NULL, 'q', 0, 0
|
||||
FROM sys_menu p
|
||||
WHERE p.permission = 'congress.signIn'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'congress.signIn.record') t
|
||||
);
|
||||
|
||||
INSERT INTO sys_menu (
|
||||
id, parentId, path, name, aliasName, type, href, target, icon,
|
||||
showit, disabled, permission, note, location, hasChildren,
|
||||
createdBy, createdAt, updatedBy, updatedAt, delFlag, platform,
|
||||
moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService
|
||||
)
|
||||
SELECT
|
||||
'congress_pc_vote_issue', p.id, CONCAT(p.path, '0001'),
|
||||
'投票管理', 'Vote Manage', 'menu', '/platform/congress/materials/issue/index', 'data-pjax', 'ti-menu-alt',
|
||||
1, 0, 'congress.vote.issue', NULL, 1, 0,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
0, 'PC', NULL, NULL, 't', 0, 0
|
||||
FROM sys_menu p
|
||||
WHERE p.permission = 'congress.vote'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'congress.vote.issue') t
|
||||
);
|
||||
|
||||
INSERT INTO sys_menu (
|
||||
id, parentId, path, name, aliasName, type, href, target, icon,
|
||||
showit, disabled, permission, note, location, hasChildren,
|
||||
createdBy, createdAt, updatedBy, updatedAt, delFlag, platform,
|
||||
moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService
|
||||
)
|
||||
SELECT
|
||||
'congress_pc_vote_statistics', p.id, CONCAT(p.path, '0002'),
|
||||
'投票统计', 'Vote Statistics', 'menu', '/platform/congress/materials/statistical/index', 'data-pjax', 'ti-menu-alt',
|
||||
1, 0, 'congress.vote.statistical', NULL, 2, 0,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
0, 'PC', NULL, NULL, 't', 0, 0
|
||||
FROM sys_menu p
|
||||
WHERE p.permission = 'congress.vote'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'congress.vote.statistical') t
|
||||
);
|
||||
|
||||
INSERT INTO sys_menu (
|
||||
id, parentId, path, name, aliasName, type, href, target, icon,
|
||||
showit, disabled, permission, note, location, hasChildren,
|
||||
createdBy, createdAt, updatedBy, updatedAt, delFlag, platform,
|
||||
moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService
|
||||
)
|
||||
SELECT
|
||||
'congress_pc_materials_manage', p.id, CONCAT(p.path, '0002'),
|
||||
'资料管理', 'Materials Manage', 'menu', '/platform/congress/materials/manage/index', 'data-pjax', 'ti-file',
|
||||
1, 0, 'congress.materials.manage', NULL, 2, 0,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
0, 'PC', NULL, NULL, 'z', 0, 0
|
||||
FROM sys_menu p
|
||||
WHERE p.permission = 'congress.materials'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'congress.materials.manage') t
|
||||
);
|
||||
|
||||
INSERT INTO sys_menu (
|
||||
id, parentId, path, name, aliasName, type, href, target, icon,
|
||||
showit, disabled, permission, note, location, hasChildren,
|
||||
createdBy, createdAt, updatedBy, updatedAt, delFlag, platform,
|
||||
moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService
|
||||
)
|
||||
SELECT
|
||||
'congress_pc_materials_type', p.id, CONCAT(p.path, '0001'),
|
||||
'资料类型', 'Materials Type', 'menu', '/platform/congress/materials/type/index', 'data-pjax', 'ti-share-alt',
|
||||
1, 0, 'congress.materials.type', NULL, 1, 0,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
'', UNIX_TIMESTAMP(NOW()) * 1000,
|
||||
0, 'PC', NULL, NULL, 'z', 0, 0
|
||||
FROM sys_menu p
|
||||
WHERE p.permission = 'congress.materials'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'congress.materials.type') t
|
||||
);
|
||||
|
||||
-- 兼容已执行过旧版脚本的数据:根菜单和分组菜单只负责展开,不请求后台地址。
|
||||
UPDATE sys_menu
|
||||
SET href = '',
|
||||
target = '',
|
||||
updatedBy = '',
|
||||
updatedAt = UNIX_TIMESTAMP(NOW()) * 1000
|
||||
WHERE id IN (
|
||||
'congress_pc_root',
|
||||
'congress_pc_materials',
|
||||
'congress_pc_signin',
|
||||
'congress_pc_vote'
|
||||
);
|
||||
-- 系统管理员默认拥有模块菜单,其他角色在角色管理中按需授权。
|
||||
INSERT INTO sys_role_menu (roleId, menuId)
|
||||
SELECT r.id, m.id
|
||||
FROM sys_role r
|
||||
JOIN sys_menu m ON m.permission IN (
|
||||
'congress',
|
||||
'congress.signIn',
|
||||
'congress.signIn.manage',
|
||||
'congress.signIn.record',
|
||||
'congress.vote',
|
||||
'congress.vote.issue',
|
||||
'congress.vote.statistical',
|
||||
'congress.materials',
|
||||
'congress.materials.manage',
|
||||
'congress.materials.type'
|
||||
)
|
||||
LEFT JOIN sys_role_menu rm ON rm.roleId = r.id AND rm.menuId = m.id
|
||||
WHERE r.code = 'SYSADMIN' AND rm.roleId IS NULL;
|
||||
Reference in New Issue
Block a user