quling
2026-08-22 9f19520e742ec66226466fd72116a77b81d5eb32
feat0806: 新增宣传知识菜单并移植项目介绍菜单
6个文件已修改
115 ■■■■■ 已修改文件
tcm-training-admin-backend/sql/20260806_admin.sql 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/bootstrap/DataInitializer.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin/config/routes.ts 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin/src/access.js 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin/src/pages/live/project-introduction/index.tsx 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin/src/pages/live/project-introduction/manage.tsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin-backend/sql/20260806_admin.sql
@@ -152,3 +152,21 @@
ALTER TABLE `tcm_health_popularization`
ADD COLUMN `video_description` VARCHAR(255) DEFAULT NULL COMMENT '视频介绍'
AFTER `video_file_name`;
-- ----------------------------
-- 新增二级菜单:宣传知识(与课程管理平级,父级为课程与学习 3000)
-- 并将「项目介绍」「项目介绍密码」菜单从课程管理(3050)迁移到宣传知识下
-- 添加时间:2026-08-22
-- ----------------------------
-- 宣传知识菜单(id: 6100)
INSERT INTO sys_menu (id, parent_id, name, menu_code, type, path, component, icon, sort, status, visible, permission_key, remark, deleted)
VALUES (6100, 3000, '宣传知识', 'live_promotion_root', 'M', '/live/promotion', NULL, NULL, 20, 1, 1, NULL, '宣传知识目录', 0)
ON DUPLICATE KEY UPDATE parent_id = VALUES(parent_id), name = VALUES(name), menu_code = VALUES(menu_code), type = VALUES(type), path = VALUES(path), component = VALUES(component), sort = VALUES(sort), status = VALUES(status), visible = VALUES(visible), permission_key = VALUES(permission_key), remark = VALUES(remark), deleted = 0;
-- 将「项目介绍」(6010) 迁移到「宣传知识」(6100) 下,并将路由前缀改为 /live/promotion
UPDATE sys_menu SET parent_id = 6100, path = '/live/promotion/project-introduction' WHERE id = 6010;
-- 将「项目介绍密码」(6014) 迁移到「宣传知识」(6100) 下,并将路由前缀改为 /live/promotion
UPDATE sys_menu SET parent_id = 6100, path = '/live/promotion/project-introduction-password' WHERE id = 6014;
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/bootstrap/DataInitializer.java
@@ -324,16 +324,18 @@
                null, null, null, 2, "live:health-popularization:edit", "健康科普编辑按钮"));
        menuIds.add(saveMenu(3123L, 3120L, "删除健康科普", "live_health_popularization_delete", "B",
                null, null, null, 3, "live:health-popularization:delete", "健康科普删除按钮"));
        menuIds.add(saveMenu(6010L, 3050L, "项目介绍", "live_project_introduction_manage", "C",
                "/live/course/project-introduction", "Live/ProjectIntroductionList", null, 60, "live:project-introduction:view", "项目介绍菜单"));
        menuIds.add(saveMenu(6100L, 3000L, "宣传知识", "live_promotion_root", "M",
                "/live/promotion", null, null, 20, null, "宣传知识目录"));
        menuIds.add(saveMenu(6010L, 6100L, "项目介绍", "live_project_introduction_manage", "C",
                "/live/promotion/project-introduction", "Live/ProjectIntroductionList", null, 60, "live:project-introduction:view", "项目介绍菜单"));
        menuIds.add(saveMenu(6011L, 6010L, "新增项目介绍", "live_project_introduction_add", "B",
                null, null, null, 1, "live:project-introduction:add", "项目介绍新增按钮"));
        menuIds.add(saveMenu(6012L, 6010L, "编辑项目介绍", "live_project_introduction_edit", "B",
                null, null, null, 2, "live:project-introduction:edit", "项目介绍编辑按钮"));
        menuIds.add(saveMenu(6013L, 6010L, "删除项目介绍", "live_project_introduction_delete", "B",
                null, null, null, 3, "live:project-introduction:delete", "项目介绍删除按钮"));
        menuIds.add(saveMenu(6014L, 3050L, "项目介绍密码", "live_project_introduction_password", "C",
                "/live/course/project-introduction-password", "Live/ProjectIntroductionPassword", null, 61, "live:project-introduction-password:view", "项目介绍密码菜单"));
        menuIds.add(saveMenu(6014L, 6100L, "项目介绍密码", "live_project_introduction_password", "C",
                "/live/promotion/project-introduction-password", "Live/ProjectIntroductionPassword", null, 61, "live:project-introduction-password:view", "项目介绍密码菜单"));
        menuIds.add(saveMenu(6015L, 6014L, "编辑项目介绍密码", "live_project_introduction_password_edit", "B",
                null, null, null, 1, "live:project-introduction-password:edit", "项目介绍密码编辑按钮"));
        menuIds.add(saveMenu(4000L, 0L, "交易与财务", "trade_root", "M",
tcm-training-admin/config/routes.ts
@@ -363,32 +363,6 @@
            component: './live/health-popularization/manage',
          },
          {
            name: '项目介绍',
            path: '/live/course/project-introduction',
            access: 'live:project-introduction:view',
            component: './live/project-introduction',
          },
          {
            name: '新增项目介绍',
            path: '/live/course/project-introduction/create',
            hideInMenu: true,
            access: 'live:project-introduction:add',
            component: './live/project-introduction/manage',
          },
          {
            name: '编辑项目介绍',
            path: '/live/course/project-introduction/:id/edit',
            hideInMenu: true,
            access: 'live:project-introduction:edit',
            component: './live/project-introduction/manage',
          },
          {
            name: '项目介绍密码',
            path: '/live/course/project-introduction-password',
            access: 'live:project-introduction:view',
            component: './live/project-introduction-password',
          },
          {
            name: '视频与课程资源管理',
            path: '/live/course/video-resources',
            access: 'live:health-course:view',
@@ -463,6 +437,57 @@
            access: 'live:expert:view',
            component: './live/expert',
          },
          {
            path: '/live/course/project-introduction/create',
            hideInMenu: true,
            redirect: '/live/promotion/project-introduction/create',
          },
          {
            path: '/live/course/project-introduction',
            hideInMenu: true,
            redirect: '/live/promotion/project-introduction',
          },
          {
            path: '/live/course/project-introduction-password',
            hideInMenu: true,
            redirect: '/live/promotion/project-introduction-password',
          },
        ],
      },
      {
        path: '/live/promotion',
        name: '宣传知识',
        routes: [
          {
            path: '/live/promotion',
            redirect: '/live/promotion/project-introduction',
          },
          {
            name: '项目介绍',
            path: '/live/promotion/project-introduction',
            access: 'live:project-introduction:view',
            component: './live/project-introduction',
          },
          {
            name: '新增项目介绍',
            path: '/live/promotion/project-introduction/create',
            hideInMenu: true,
            access: 'live:project-introduction:add',
            component: './live/project-introduction/manage',
          },
          {
            name: '编辑项目介绍',
            path: '/live/promotion/project-introduction/:id/edit',
            hideInMenu: true,
            access: 'live:project-introduction:edit',
            component: './live/project-introduction/manage',
          },
          {
            name: '项目介绍密码',
            path: '/live/promotion/project-introduction-password',
            access: 'live:project-introduction:view',
            component: './live/project-introduction-password',
          },
        ],
      },
    ],
tcm-training-admin/src/access.js
@@ -39,7 +39,9 @@
      !!permission?.['live:category:view'] ||
      !!permission?.['live:reserve:view'] ||
      !!permission?.['live:watch:view'] ||
      !!permission?.['live:expert:view'],
      !!permission?.['live:expert:view'] ||
      !!permission?.['live:project-introduction:view'] ||
      !!permission?.['live:project-introduction-password:view'],
    canViewTradeFinanceModule:
      !!permission?.['course:purchase-order:view'] ||
      !!permission?.['member:purchase-order:view'] ||
tcm-training-admin/src/pages/live/project-introduction/index.tsx
@@ -177,7 +177,7 @@
          {canEdit ? (
            <button
              type="button"
              onClick={() => history.push(`/live/course/project-introduction/${record.id}/edit`)}
              onClick={() => history.push(`/live/promotion/project-introduction/${record.id}/edit`)}
            >
              编辑
            </button>
@@ -228,7 +228,7 @@
        <div className="project-introduction-toolbar">
          {canAdd ? (
            <Button type="primary" onClick={() => history.push('/live/course/project-introduction/create')}>
            <Button type="primary" onClick={() => history.push('/live/promotion/project-introduction/create')}>
              添加
            </Button>
          ) : null}
tcm-training-admin/src/pages/live/project-introduction/manage.tsx
@@ -33,7 +33,7 @@
  const [coverImg, setCoverImg] = useState('');
  const pathname = history.location.pathname;
  const isCreate = pathname.endsWith('/create');
  const listPagePath = '/live/course/project-introduction';
  const listPagePath = '/live/promotion/project-introduction';
  const recordId = useMemo(() => {
    if (isCreate) {
      return '';