feat0806: 把健康科普改成健康知识移植到宣传知识里面
| | |
| | | |
| | | -- 将「项目介绍密码」(6014) 迁移到「宣传知识」(6100) 下,并将路由前缀改为 /live/promotion |
| | | UPDATE sys_menu SET parent_id = 6100, path = '/live/promotion/project-introduction-password' WHERE id = 6014; |
| | | |
| | | -- ---------------------------- |
| | | -- 「健康科普」改名为「健康知识」,并从课程管理(3050)迁移到宣传知识(6100)下 |
| | | -- 主菜单 id: 3120,子按钮 3121/3122/3123 随父级一起迁移(parent_id 不变,无需单独处理) |
| | | -- 添加时间:2026-08-22 |
| | | -- ---------------------------- |
| | | UPDATE sys_menu |
| | | SET parent_id = 6100, |
| | | name = '健康知识', |
| | | path = '/live/promotion/health-popularization', |
| | | remark = '健康知识菜单' |
| | | WHERE id = 3120; |
| | | |
| | | -- 子按钮随主菜单改名(parent_id 仍为 3120,不变) |
| | | UPDATE sys_menu SET name = '新增健康知识', remark = '健康知识新增按钮' WHERE id = 3121; |
| | | UPDATE sys_menu SET name = '编辑健康知识', remark = '健康知识编辑按钮' WHERE id = 3122; |
| | | UPDATE sys_menu SET name = '删除健康知识', remark = '健康知识删除按钮' WHERE id = 3123; |
| | |
| | | null, null, null, 8, "live:health-course:video:edit", "养生课程视频编辑按钮")); |
| | | menuIds.add(saveMenu(3119L, 3110L, "删除视频课程", "live_health_course_video_delete", "B", |
| | | null, null, null, 9, "live:health-course:video:delete", "养生课程视频删除按钮")); |
| | | menuIds.add(saveMenu(3120L, 3050L, "健康科普", "live_health_popularization_manage", "C", |
| | | "/live/course/health-popularization", "Live/HealthPopularizationList", null, 50, "live:health-popularization:view", "健康科普菜单")); |
| | | menuIds.add(saveMenu(3121L, 3120L, "新增健康科普", "live_health_popularization_add", "B", |
| | | null, null, null, 1, "live:health-popularization:add", "健康科普新增按钮")); |
| | | menuIds.add(saveMenu(3122L, 3120L, "编辑健康科普", "live_health_popularization_edit", "B", |
| | | 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(3120L, 6100L, "健康知识", "live_health_popularization_manage", "C", |
| | | "/live/promotion/health-popularization", "Live/HealthPopularizationList", null, 50, "live:health-popularization:view", "健康知识菜单")); |
| | | menuIds.add(saveMenu(3121L, 3120L, "新增健康知识", "live_health_popularization_add", "B", |
| | | null, null, null, 1, "live:health-popularization:add", "健康知识新增按钮")); |
| | | menuIds.add(saveMenu(3122L, 3120L, "编辑健康知识", "live_health_popularization_edit", "B", |
| | | 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(6100L, 3000L, "宣传知识", "live_promotion_root", "M", |
| | | "/live/promotion", null, null, 20, null, "宣传知识目录")); |
| | | menuIds.add(saveMenu(6010L, 6100L, "项目介绍", "live_project_introduction_manage", "C", |
| | |
| | | component: './live/health', |
| | | }, |
| | | { |
| | | name: '健康科普', |
| | | path: '/live/course/health-popularization', |
| | | access: 'live:health-popularization:view', |
| | | component: './live/health-popularization', |
| | | }, |
| | | { |
| | | name: '新增健康科普', |
| | | path: '/live/course/health-popularization/create', |
| | | hideInMenu: true, |
| | | access: 'live:health-popularization:add', |
| | | component: './live/health-popularization/manage', |
| | | }, |
| | | { |
| | | name: '编辑健康科普', |
| | | path: '/live/course/health-popularization/:id/edit', |
| | | hideInMenu: true, |
| | | access: 'live:health-popularization:edit', |
| | | component: './live/health-popularization/manage', |
| | | }, |
| | | { |
| | | name: '视频与课程资源管理', |
| | | path: '/live/course/video-resources', |
| | | access: 'live:health-course:view', |
| | |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/project-introduction-password', |
| | | }, |
| | | { |
| | | path: '/live/course/health-popularization/create', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/health-popularization/create', |
| | | }, |
| | | { |
| | | path: '/live/course/health-popularization', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/health-popularization', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | |
| | | redirect: '/live/promotion/project-introduction', |
| | | }, |
| | | { |
| | | name: '健康知识', |
| | | path: '/live/promotion/health-popularization', |
| | | access: 'live:health-popularization:view', |
| | | component: './live/health-popularization', |
| | | }, |
| | | { |
| | | name: '新增健康知识', |
| | | path: '/live/promotion/health-popularization/create', |
| | | hideInMenu: true, |
| | | access: 'live:health-popularization:add', |
| | | component: './live/health-popularization/manage', |
| | | }, |
| | | { |
| | | name: '编辑健康知识', |
| | | path: '/live/promotion/health-popularization/:id/edit', |
| | | hideInMenu: true, |
| | | access: 'live:health-popularization:edit', |
| | | component: './live/health-popularization/manage', |
| | | }, |
| | | { |
| | | name: '项目介绍', |
| | | path: '/live/promotion/project-introduction', |
| | | access: 'live:project-introduction:view', |
| | |
| | | |
| | | const handleDelete = (record: PopularizationItem) => { |
| | | Modal.confirm({ |
| | | title: '确定要删除该健康科普吗?', |
| | | title: '确定要删除该健康知识吗?', |
| | | okText: '删除', |
| | | cancelText: '取消', |
| | | onOk: async () => { |
| | |
| | | {canEdit ? ( |
| | | <button |
| | | type="button" |
| | | onClick={() => history.push(`/live/course/health-popularization/${record.id}/edit`)} |
| | | onClick={() => history.push(`/live/promotion/health-popularization/${record.id}/edit`)} |
| | | > |
| | | 编辑 |
| | | </button> |
| | |
| | | return ( |
| | | <div className="health-popularization-page"> |
| | | <div className="health-popularization-page__panel"> |
| | | <div className="health-popularization-page__title">健康科普</div> |
| | | <div className="health-popularization-page__title">健康知识</div> |
| | | <div className="health-popularization-search-card"> |
| | | <Form form={searchForm} layout="horizontal" className="health-popularization-search-form"> |
| | | <Form.Item label="标题" name="keyword"> |
| | |
| | | |
| | | <div className="health-popularization-toolbar"> |
| | | {canAdd ? ( |
| | | <Button type="primary" onClick={() => history.push('/live/course/health-popularization/create')}> |
| | | <Button type="primary" onClick={() => history.push('/live/promotion/health-popularization/create')}> |
| | | 添加 |
| | | </Button> |
| | | ) : null} |
| | |
| | | const [coverImg, setCoverImg] = useState(''); |
| | | const pathname = history.location.pathname; |
| | | const isCreate = pathname.endsWith('/create'); |
| | | const listPagePath = '/live/course/health-popularization'; |
| | | const listPagePath = '/live/promotion/health-popularization'; |
| | | const recordId = useMemo(() => { |
| | | if (isCreate) { |
| | | return ''; |
| | |
| | | return ( |
| | | <div className="health-popularization-page"> |
| | | <div className="health-popularization-page__panel"> |
| | | <div className="health-popularization-page__title">{isCreate ? '添加健康科普' : '编辑健康科普'}</div> |
| | | <div className="health-popularization-page__title">{isCreate ? '添加健康知识' : '编辑健康知识'}</div> |
| | | <Form form={form} layout="vertical" className="health-popularization-edit-form"> |
| | | <div className="health-popularization-edit-form__section-title">信息</div> |
| | | <div className="health-popularization-edit-form__grid"> |