From 6af1a84b8146e0d194d62f79be37d569063dd008 Mon Sep 17 00:00:00 2001 From: bot5 Date: Thu, 19 Mar 2026 09:05:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(health):=20H5=E7=AB=AF=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=94=A8=E8=8D=AF=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 medicationAdherence.js:统计API接口 - 新增 statistic/medication/index.vue:用药统计页面 - 概览卡片:总任务、已服药、漏服、服药率、准时率 - 趋势图:服药率和准时率折线图 - 时段分布:四时段统计卡片 - 日历视图:月度服药日历 - 修改 pages.json:添加页面路由 - 修改 statistic/index.vue:添加健康统计分析入口 --- src/api/health/medicationAdherence.js | 46 ++ src/pages.json | 8 + src/pages/statistic/index.vue | 23 + src/pages/statistic/medication/index.vue | 591 +++++++++++++++++++++++ 4 files changed, 668 insertions(+) create mode 100644 src/api/health/medicationAdherence.js create mode 100644 src/pages/statistic/medication/index.vue diff --git a/src/api/health/medicationAdherence.js b/src/api/health/medicationAdherence.js new file mode 100644 index 0000000..f4d75e2 --- /dev/null +++ b/src/api/health/medicationAdherence.js @@ -0,0 +1,46 @@ +import request from '@/utils/request' + +// 获取总体依从性统计 +export function getOverallAdherence(query) { + return request({ + url: '/health/adherence/overall', + method: 'get', + params: query + }) +} + +// 获取每日依从性统计列表 +export function getDailyAdherence(query) { + return request({ + url: '/health/adherence/daily', + method: 'get', + params: query + }) +} + +// 获取日历视图数据 +export function getCalendarData(personId, yearMonth) { + return request({ + url: '/health/adherence/calendar', + method: 'get', + params: { personId, yearMonth } + }) +} + +// 获取各时段服药统计 +export function getTimeSlotAdherence(query) { + return request({ + url: '/health/adherence/timeSlot', + method: 'get', + params: query + }) +} + +// 获取仪表盘概览数据 +export function getDashboard(personId) { + return request({ + url: '/health/adherence/dashboard', + method: 'get', + params: { personId } + }) +} \ No newline at end of file diff --git a/src/pages.json b/src/pages.json index 65a2421..fa6dbda 100644 --- a/src/pages.json +++ b/src/pages.json @@ -238,6 +238,14 @@ } } , + { + "path": "pages/statistic/medication/index", + "style": { + "navigationBarTitleText": "用药统计", + "navigationStyle": "custom" + } + } + , { "path": "pages/work/accounts/accountDealRecord/list", "style": { diff --git a/src/pages/statistic/index.vue b/src/pages/statistic/index.vue index 500dcc1..3012752 100644 --- a/src/pages/statistic/index.vue +++ b/src/pages/statistic/index.vue @@ -74,6 +74,26 @@ + + + + 健康统计分析 + + + + + + + + {{ item.text }} + + + @@ -109,6 +129,9 @@ { path: '/pages/statistic/bill/investAnalysis/index', text: '收益统计分析', icon: 'settings', color: 'linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%)', permission: 'invest:investAnalysis:list'}, { path: '/pages/statistic/bill/futuresAnalysis/index', text: '期货统计分析', icon: 'fire', color: 'linear-gradient(135deg, #fc5c65 0%, #fd79a8 100%)', permission: 'invest:futuresAnalysis:list'}, { path: '/pages/statistic/bill/stocksAnalysis/index', text: '股票统计分析', icon: 'flag-filled', color: 'linear-gradient(135deg, #5f72bd 0%, #9b23ea 100%)', permission: 'invest:stocksAnalysis:list' } + ]) + const healthGridList=ref([ + { path: '/pages/statistic/medication/index', text: '用药统计', icon: 'heart-filled', color: 'linear-gradient(135deg, #409EFF 0%, #67C23A 100%)', permission: 'health:medicationStatistic:query' } ]) function navigateTo(path) { uni.navigateTo({ diff --git a/src/pages/statistic/medication/index.vue b/src/pages/statistic/medication/index.vue new file mode 100644 index 0000000..5aa9bba --- /dev/null +++ b/src/pages/statistic/medication/index.vue @@ -0,0 +1,591 @@ + + + + + \ No newline at end of file