From 332fb53cfa248367626e39cf69bfdc4e07f2582b Mon Sep 17 00:00:00 2001 From: yelan Date: Thu, 27 Aug 2026 16:48:17 +0800 Subject: [PATCH] feat(reports): implement report analysis --- .../DepartmentDistributionChart.vue | 86 +++++ .../reports/components/ReportDetailTable.vue | 175 +++++++++ .../reports/components/ReportFilterBar.vue | 158 +++++++++ .../reports/components/ReportMetricCard.vue | 117 ++++++ .../components/SignatureTrendChart.vue | 114 ++++++ .../src/views/management/reports/index.vue | 335 +++++++++++++++++- .../src/views/management/reports/mock.ts | 175 +++++++++ .../src/views/management/reports/types.ts | 54 ++- 8 files changed, 1198 insertions(+), 16 deletions(-) create mode 100644 clinical-web/src/views/management/reports/components/DepartmentDistributionChart.vue create mode 100644 clinical-web/src/views/management/reports/components/ReportDetailTable.vue create mode 100644 clinical-web/src/views/management/reports/components/ReportFilterBar.vue create mode 100644 clinical-web/src/views/management/reports/components/ReportMetricCard.vue create mode 100644 clinical-web/src/views/management/reports/components/SignatureTrendChart.vue create mode 100644 clinical-web/src/views/management/reports/mock.ts diff --git a/clinical-web/src/views/management/reports/components/DepartmentDistributionChart.vue b/clinical-web/src/views/management/reports/components/DepartmentDistributionChart.vue new file mode 100644 index 0000000..c013ba7 --- /dev/null +++ b/clinical-web/src/views/management/reports/components/DepartmentDistributionChart.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/clinical-web/src/views/management/reports/components/ReportDetailTable.vue b/clinical-web/src/views/management/reports/components/ReportDetailTable.vue new file mode 100644 index 0000000..a7b5f95 --- /dev/null +++ b/clinical-web/src/views/management/reports/components/ReportDetailTable.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/clinical-web/src/views/management/reports/components/ReportFilterBar.vue b/clinical-web/src/views/management/reports/components/ReportFilterBar.vue new file mode 100644 index 0000000..13d74bb --- /dev/null +++ b/clinical-web/src/views/management/reports/components/ReportFilterBar.vue @@ -0,0 +1,158 @@ + + + + + diff --git a/clinical-web/src/views/management/reports/components/ReportMetricCard.vue b/clinical-web/src/views/management/reports/components/ReportMetricCard.vue new file mode 100644 index 0000000..611337d --- /dev/null +++ b/clinical-web/src/views/management/reports/components/ReportMetricCard.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/clinical-web/src/views/management/reports/components/SignatureTrendChart.vue b/clinical-web/src/views/management/reports/components/SignatureTrendChart.vue new file mode 100644 index 0000000..2050e33 --- /dev/null +++ b/clinical-web/src/views/management/reports/components/SignatureTrendChart.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/clinical-web/src/views/management/reports/index.vue b/clinical-web/src/views/management/reports/index.vue index afacc51..724337a 100644 --- a/clinical-web/src/views/management/reports/index.vue +++ b/clinical-web/src/views/management/reports/index.vue @@ -1,12 +1,333 @@ + + diff --git a/clinical-web/src/views/management/reports/mock.ts b/clinical-web/src/views/management/reports/mock.ts new file mode 100644 index 0000000..5f2cdb5 --- /dev/null +++ b/clinical-web/src/views/management/reports/mock.ts @@ -0,0 +1,175 @@ +import type { + ReportCampus, + ReportDepartmentPoint, + ReportDocumentCategory, + ReportPeriodOption, + ReportSelectOption, + ReportTask, +} from './types' + +function daysAgo(days: number, hour: number, minute: number) { + const date = new Date() + date.setDate(date.getDate() - days) + date.setHours(hour, minute, 0, 0) + return date +} + +export const reportCampusOptions: ReportSelectOption[] = [ + { value: 'all', label: '全部院区' }, + { value: '本部院区', label: '本部院区' }, + { value: '东院区', label: '东院区' }, + { value: '西院区', label: '西院区' }, +] + +export const reportDepartmentOptions: ReportSelectOption[] = [ + { value: 'all', label: '全部科室' }, + { value: '放射科', label: '放射科' }, + { value: '心内科', label: '心内科' }, + { value: '骨科', label: '骨科' }, + { value: '健康管理中心', label: '健康管理中心' }, + { value: '全院通用', label: '全院通用' }, +] + +export const reportCategoryOptions: ReportSelectOption[] = [ + { value: 'all', label: '全部类别' }, + { value: 'consent', label: '知情同意书' }, + { value: 'risk', label: '风险告知书' }, + { value: 'admission', label: '入院告知' }, +] + +export const reportPeriodOptions: ReportSelectOption[] = [ + { value: '7d', label: '近7天' }, + { value: '14d', label: '近14天' }, + { value: 'month', label: '本月' }, + { value: 'custom', label: '自定义…' }, +] + +export const reportTasks: ReportTask[] = [ + { + id: 'T0818001', + patientName: '赵美英', + patientId: 'P202610004', + documentName: '体检报告发放及知情同意书', + department: '健康管理中心', + campus: '东院区', + category: 'consent', + method: 'pad', + status: 'signed', + createdAt: daysAgo(0, 9, 12), + durationMinutes: 7, + }, + { + id: 'T0818002', + patientName: '李淑芬', + patientId: 'P202610002', + documentName: 'MRI磁共振检查知情同意书', + department: '放射科', + campus: '东院区', + category: 'consent', + method: 'sms', + status: 'pending', + createdAt: daysAgo(0, 10, 5), + }, + { + id: 'T0818003', + patientName: '周雅琴', + patientId: 'P202610006', + documentName: '住院须知及告知书', + department: '全院通用', + campus: '本部院区', + category: 'admission', + method: 'pad', + status: 'pending', + createdAt: daysAgo(0, 11, 20), + }, + { + id: 'T0818004', + patientName: '孙浩然', + patientId: 'P202610005', + documentName: '心脏介入手术知情同意书', + department: '心内科', + campus: '西院区', + category: 'consent', + method: 'pad', + status: 'signed', + createdAt: daysAgo(1, 15, 40), + durationMinutes: 7, + }, + { + id: 'T0817001', + patientName: '王建国', + patientId: 'P202610001', + documentName: '冠状动脉造影知情同意书', + department: '心内科', + campus: '本部院区', + category: 'consent', + method: 'sms', + status: 'signed', + createdAt: daysAgo(1, 9, 30), + durationMinutes: 7, + }, + { + id: 'T0817002', + patientName: '陈志强', + patientId: 'P202610003', + documentName: '骨科手术知情同意书', + department: '骨科', + campus: '本部院区', + category: 'consent', + method: 'pad', + status: 'signed', + createdAt: daysAgo(2, 10, 15), + durationMinutes: 7, + }, + { + id: 'T0816001', + patientName: '陈志强', + patientId: 'P202610003', + documentName: '麻醉知情同意书', + department: '骨科', + campus: '本部院区', + category: 'consent', + method: 'pad', + status: 'signed', + createdAt: daysAgo(3, 14, 25), + durationMinutes: 7, + }, + { + id: 'T0815001', + patientName: '王建国', + patientId: 'P202610001', + documentName: '心包穿刺知情同意书', + department: '心内科', + campus: '本部院区', + category: 'consent', + method: 'sms', + status: 'expired', + createdAt: daysAgo(4, 16, 0), + }, + { + id: 'T0814001', + patientName: '周雅琴', + patientId: 'P202610006', + documentName: '患者授权委托书', + department: '全院通用', + campus: '本部院区', + category: 'consent', + method: 'pad', + status: 'void', + createdAt: daysAgo(5, 11, 45), + }, +] + +export const reportDepartmentColors: Record = { + 放射科: '#0e6e8c', + 心内科: '#18a0c0', + 骨科: '#0f9d6c', + 健康管理中心: '#d9821f', + 全院通用: '#7a4dbb', +} + +export const fallbackDepartmentPoint: ReportDepartmentPoint = { + department: '暂无数据', + value: 0, + color: '#cbd8de', +} diff --git a/clinical-web/src/views/management/reports/types.ts b/clinical-web/src/views/management/reports/types.ts index 5e1b0a5..0e4c5bc 100644 --- a/clinical-web/src/views/management/reports/types.ts +++ b/clinical-web/src/views/management/reports/types.ts @@ -1,21 +1,57 @@ -export type ReportPeriodOption = 'today' | 'week' | 'month' | 'year' +export type ReportPeriodOption = '7d' | '14d' | 'month' | 'custom' + +export type ReportCampus = 'all' | '本部院区' | '东院区' | '西院区' + +export type ReportDocumentCategory = 'all' | 'consent' | 'risk' | 'admission' export interface ReportFilterForm { period: ReportPeriodOption + campus: ReportCampus department: string + category: ReportDocumentCategory } +export type ReportMetricTone = 'brand' | 'ok' | 'info' | 'warn' + export interface ReportMetricCard { key: string label: string - value: number - unit: string - trend: number + value: string | number + unit?: string + tone: ReportMetricTone } -export interface ReportChartPoint { - date: string - signed: number - rejected: number - pending: number +export type ReportTaskStatus = 'signed' | 'pending' | 'expired' | 'void' + +export type ReportSigningMethod = 'pad' | 'sms' + +export interface ReportTask { + id: string + patientName: string + patientId: string + documentName: string + department: string + campus: Exclude + category: Exclude + method: ReportSigningMethod + status: ReportTaskStatus + createdAt: Date + durationMinutes?: number +} + +export interface ReportTrendPoint { + date: string + label: string + value: number +} + +export interface ReportDepartmentPoint { + department: string + value: number + color: string +} + +export interface ReportSelectOption { + value: T + label: string }