feat(web): 健康模块 13 页面按钮级权限控制 — AuthButton 包装
使用 AuthButton 声明式组件包装健康模块全部操作按钮: - health.patient.manage: PatientList/PatientDetail/PatientTagManage - health.appointment.manage: AppointmentList - health.doctor.manage: DoctorList/DoctorSchedule - health.follow-up.manage: FollowUpTaskList - health.consultation.manage: ConsultationList/ConsultationDetail - health.points.manage: OfflineEventList/PointsProductList/PointsOrderList/PointsRuleList
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
type PointsRule,
|
||||
type CreatePointsRuleReq,
|
||||
} from '../../api/health/points';
|
||||
import { AuthButton } from '../../components/AuthButton';
|
||||
|
||||
/** 事件类型映射 */
|
||||
const EVENT_TYPES: Record<string, string> = {
|
||||
@@ -216,23 +217,25 @@ export default function PointsRuleList() {
|
||||
key: 'action',
|
||||
width: 200,
|
||||
render: (_: unknown, record: PointsRule) => (
|
||||
<Space size="small">
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
icon={<EditOutlined />}
|
||||
onClick={() => openEdit(record)}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Switch
|
||||
size="small"
|
||||
checked={record.is_active}
|
||||
checkedChildren="启用"
|
||||
unCheckedChildren="停用"
|
||||
onChange={() => handleToggleActive(record)}
|
||||
/>
|
||||
</Space>
|
||||
<AuthButton code="health.points.manage">
|
||||
<Space size="small">
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
icon={<EditOutlined />}
|
||||
onClick={() => openEdit(record)}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Switch
|
||||
size="small"
|
||||
checked={record.is_active}
|
||||
checkedChildren="启用"
|
||||
unCheckedChildren="停用"
|
||||
onChange={() => handleToggleActive(record)}
|
||||
/>
|
||||
</Space>
|
||||
</AuthButton>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -247,9 +250,11 @@ export default function PointsRuleList() {
|
||||
</span>
|
||||
</Col>
|
||||
<Col>
|
||||
<Button type="primary" icon={<PlusOutlined />} onClick={openCreate}>
|
||||
新建规则
|
||||
</Button>
|
||||
<AuthButton code="health.points.manage">
|
||||
<Button type="primary" icon={<PlusOutlined />} onClick={openCreate}>
|
||||
新建规则
|
||||
</Button>
|
||||
</AuthButton>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user