From 69313a177e0e96ff6bed337e5c0fc078d82fc54f Mon Sep 17 00:00:00 2001 From: iven Date: Sat, 25 Apr 2026 23:33:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E5=81=A5=E5=BA=B7=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=2013=20=E9=A1=B5=E9=9D=A2=E6=8C=89=E9=92=AE=E7=BA=A7?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6=20=E2=80=94=20AuthButton?= =?UTF-8?q?=20=E5=8C=85=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用 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 --- apps/web/src/pages/health/AppointmentList.tsx | 37 +++++---- .../src/pages/health/ConsultationDetail.tsx | 31 ++++---- .../web/src/pages/health/ConsultationList.tsx | 63 ++++++++------- apps/web/src/pages/health/DoctorList.tsx | 49 ++++++------ apps/web/src/pages/health/DoctorSchedule.tsx | 31 +++++--- .../web/src/pages/health/FollowUpTaskList.tsx | 79 ++++++++++--------- .../web/src/pages/health/OfflineEventList.tsx | 67 ++++++++-------- apps/web/src/pages/health/PatientDetail.tsx | 9 ++- apps/web/src/pages/health/PatientList.tsx | 57 +++++++------ .../web/src/pages/health/PatientTagManage.tsx | 19 +++-- apps/web/src/pages/health/PointsOrderList.tsx | 17 ++-- .../src/pages/health/PointsProductList.tsx | 45 ++++++----- apps/web/src/pages/health/PointsRuleList.tsx | 45 ++++++----- 13 files changed, 303 insertions(+), 246 deletions(-) diff --git a/apps/web/src/pages/health/AppointmentList.tsx b/apps/web/src/pages/health/AppointmentList.tsx index b8bd509..be81e3d 100644 --- a/apps/web/src/pages/health/AppointmentList.tsx +++ b/apps/web/src/pages/health/AppointmentList.tsx @@ -26,6 +26,7 @@ import { doctorApi } from '../../api/health/doctors'; import { StatusTag } from './components/StatusTag'; import { PatientSelect } from './components/PatientSelect'; import { DoctorSelect } from './components/DoctorSelect'; +import { AuthButton } from '../../components/AuthButton'; /** 预约类型选项 */ const APPOINTMENT_TYPE_OPTIONS = [ @@ -305,19 +306,21 @@ export default function AppointmentList() { return 无可用操作; } return ( - ({ - key: t.value, - label: t.label, - onClick: () => handleStatusChange(record, t.value), - })), - }} - > - - + + ({ + key: t.value, + label: t.label, + onClick: () => handleStatusChange(record, t.value), + })), + }} + > + + + ); }, }, @@ -352,9 +355,11 @@ export default function AppointmentList() { - + + + diff --git a/apps/web/src/pages/health/ConsultationDetail.tsx b/apps/web/src/pages/health/ConsultationDetail.tsx index ac7bd32..f99423d 100644 --- a/apps/web/src/pages/health/ConsultationDetail.tsx +++ b/apps/web/src/pages/health/ConsultationDetail.tsx @@ -6,6 +6,7 @@ import { consultationApi, type Session, type Message } from '../../api/health/co import { StatusTag } from './components/StatusTag'; import { ImagePreview } from './components/ImagePreview'; import { useThemeMode } from '../../hooks/useThemeMode'; +import { AuthButton } from '../../components/AuthButton'; const PAGE_SIZE = 30; @@ -276,21 +277,23 @@ export default function ConsultationDetail() { )} {session && !isClosed && ( - - - + + + )} diff --git a/apps/web/src/pages/health/ConsultationList.tsx b/apps/web/src/pages/health/ConsultationList.tsx index b90511f..29e3833 100644 --- a/apps/web/src/pages/health/ConsultationList.tsx +++ b/apps/web/src/pages/health/ConsultationList.tsx @@ -20,6 +20,7 @@ import { PatientSelect } from './components/PatientSelect'; import { DoctorSelect } from './components/DoctorSelect'; import { ExportButton } from './components/ExportButton'; import { useThemeMode } from '../../hooks/useThemeMode'; +import { AuthButton } from '../../components/AuthButton'; const STATUS_OPTIONS = [ { value: 'waiting', label: '等待中' }, @@ -258,26 +259,28 @@ export default function ConsultationList() { key: 'actions', width: 120, render: (_: unknown, record: Session) => ( - - {record.status !== 'closed' && ( - handleClose(record)} - okText="确认" - cancelText="取消" - > - - - )} - + + + )} + + ), }, ]; @@ -305,16 +308,18 @@ export default function ConsultationList() { value={query.status} onChange={handleFilterChange} /> - + + + ( - - - handleDelete(record.id)} - okText="确定" - cancelText="取消" - > - - - + handleDelete(record.id)} + okText="确定" + cancelText="取消" + > + + + + ), }, ]; @@ -284,9 +287,11 @@ export default function DoctorList() { - + + + diff --git a/apps/web/src/pages/health/DoctorSchedule.tsx b/apps/web/src/pages/health/DoctorSchedule.tsx index 8d3b111..6d2ffdc 100644 --- a/apps/web/src/pages/health/DoctorSchedule.tsx +++ b/apps/web/src/pages/health/DoctorSchedule.tsx @@ -30,6 +30,7 @@ import { import { DoctorSelect } from './components/DoctorSelect'; import { CalendarView, type ScheduleItem } from './components/CalendarView'; import { StatusTag } from './components/StatusTag'; +import { AuthButton } from '../../components/AuthButton'; /** 时段选项 */ const PERIOD_OPTIONS = [ @@ -258,16 +259,18 @@ export default function DoctorSchedule() { key: 'action', width: 120, render: (_: unknown, record: Schedule) => ( - - - + + + + + ), }, ]; @@ -309,9 +312,11 @@ export default function DoctorSchedule() { {selectedDoctorId && ( - + + + )} diff --git a/apps/web/src/pages/health/FollowUpTaskList.tsx b/apps/web/src/pages/health/FollowUpTaskList.tsx index 0f946b1..f135db5 100644 --- a/apps/web/src/pages/health/FollowUpTaskList.tsx +++ b/apps/web/src/pages/health/FollowUpTaskList.tsx @@ -19,6 +19,7 @@ import { StatusTag } from './components/StatusTag'; import { PatientSelect } from './components/PatientSelect'; import { DoctorSelect } from './components/DoctorSelect'; import { useThemeMode } from '../../hooks/useThemeMode'; +import { AuthButton } from '../../components/AuthButton'; const STATUS_OPTIONS = [ { value: 'pending', label: '待处理' }, @@ -289,34 +290,36 @@ export default function FollowUpTaskList() { key: 'actions', width: 220, render: (_: unknown, record: FollowUpTask) => ( - - - - handleDelete(record)} - okText="确认" - cancelText="取消" - > - - - + + handleDelete(record)} + okText="确认" + cancelText="取消" + > + + + + ), }, ]; @@ -344,16 +347,18 @@ export default function FollowUpTaskList() { value={query.status} onChange={(value) => handleFilterChange('status', value)} /> - + + + = { @@ -245,35 +246,37 @@ export default function OfflineEventList() { key: 'action', width: 200, render: (_: unknown, record: OfflineEvent) => ( - - - - handleDelete(record)} - okText="确定" - cancelText="取消" - > - - - + + handleDelete(record)} + okText="确定" + cancelText="取消" + > + + + + ), }, ]; @@ -298,9 +301,11 @@ export default function OfflineEventList() { - + + + diff --git a/apps/web/src/pages/health/PatientDetail.tsx b/apps/web/src/pages/health/PatientDetail.tsx index d8c004d..473b0df 100644 --- a/apps/web/src/pages/health/PatientDetail.tsx +++ b/apps/web/src/pages/health/PatientDetail.tsx @@ -16,6 +16,7 @@ import { } from 'antd'; import { ArrowLeftOutlined, EditOutlined } from '@ant-design/icons'; import { patientApi } from '../../api/health/patients'; +import { AuthButton } from '../../components/AuthButton'; import type { PatientDetail as PatientDetailType, UpdatePatientReq, @@ -187,9 +188,11 @@ export default function PatientDetail() { - + + + diff --git a/apps/web/src/pages/health/PatientList.tsx b/apps/web/src/pages/health/PatientList.tsx index af742a5..8bf3165 100644 --- a/apps/web/src/pages/health/PatientList.tsx +++ b/apps/web/src/pages/health/PatientList.tsx @@ -27,6 +27,7 @@ import type { import { StatusTag } from './components/StatusTag'; import { GENDER_OPTIONS, BLOOD_TYPE_OPTIONS, STATUS_OPTIONS } from '../../constants/health'; import { useThemeMode } from '../../hooks/useThemeMode'; +import { AuthButton } from '../../components/AuthButton'; export default function PatientList() { const [patients, setPatients] = useState([]); @@ -239,33 +240,35 @@ export default function PatientList() { key: 'actions', width: 140, render: (_: unknown, record: PatientListItem) => ( - - + + + diff --git a/apps/web/src/pages/health/PatientTagManage.tsx b/apps/web/src/pages/health/PatientTagManage.tsx index e990514..3fa76d9 100644 --- a/apps/web/src/pages/health/PatientTagManage.tsx +++ b/apps/web/src/pages/health/PatientTagManage.tsx @@ -14,6 +14,7 @@ import { TagsOutlined, AppstoreOutlined } from '@ant-design/icons'; import { patientApi, type TagItem } from '../../api/health/patients'; import type { PatientListItem } from '../../api/health/patients'; import { useThemeMode } from '../../hooks/useThemeMode'; +import { AuthButton } from '../../components/AuthButton'; export default function PatientTagManage() { const [patients, setPatients] = useState([]); @@ -178,14 +179,16 @@ export default function PatientTagManage() { key: 'actions', width: 120, render: (_: unknown, record: PatientListItem) => ( - + + + ), }, ]; diff --git a/apps/web/src/pages/health/PointsOrderList.tsx b/apps/web/src/pages/health/PointsOrderList.tsx index 3d3ab9a..6c26485 100644 --- a/apps/web/src/pages/health/PointsOrderList.tsx +++ b/apps/web/src/pages/health/PointsOrderList.tsx @@ -23,6 +23,7 @@ import { type PointsOrder, } from '../../api/health/points'; import { patientApi } from '../../api/health/patients'; +import { AuthButton } from '../../components/AuthButton'; /** 订单状态映射 */ const STATUS_MAP: Record = { @@ -228,13 +229,15 @@ export default function PointsOrderList() { - + + + diff --git a/apps/web/src/pages/health/PointsProductList.tsx b/apps/web/src/pages/health/PointsProductList.tsx index e8cbe1c..b2a9bb3 100644 --- a/apps/web/src/pages/health/PointsProductList.tsx +++ b/apps/web/src/pages/health/PointsProductList.tsx @@ -26,6 +26,7 @@ import { type PointsProduct, type CreatePointsProductReq, } from '../../api/health/points'; +import { AuthButton } from '../../components/AuthButton'; /** 商品类型映射 */ const PRODUCT_TYPES: Record = { @@ -212,23 +213,25 @@ export default function PointsProductList() { key: 'action', width: 140, render: (_: unknown, record: PointsProduct) => ( - - - handleToggleActive(record)} - /> - + + + + handleToggleActive(record)} + /> + + ), }, ]; @@ -253,9 +256,11 @@ export default function PointsProductList() { - + + + diff --git a/apps/web/src/pages/health/PointsRuleList.tsx b/apps/web/src/pages/health/PointsRuleList.tsx index 6d84d84..7d01a5e 100644 --- a/apps/web/src/pages/health/PointsRuleList.tsx +++ b/apps/web/src/pages/health/PointsRuleList.tsx @@ -26,6 +26,7 @@ import { type PointsRule, type CreatePointsRuleReq, } from '../../api/health/points'; +import { AuthButton } from '../../components/AuthButton'; /** 事件类型映射 */ const EVENT_TYPES: Record = { @@ -216,23 +217,25 @@ export default function PointsRuleList() { key: 'action', width: 200, render: (_: unknown, record: PointsRule) => ( - - - handleToggleActive(record)} - /> - + + + + handleToggleActive(record)} + /> + + ), }, ]; @@ -247,9 +250,11 @@ export default function PointsRuleList() { - + + +