From 5742b16a3e4e54621de2a61073ff7ab844ac9ed8 Mon Sep 17 00:00:00 2001 From: bot5 Date: Thu, 19 Mar 2026 21:38:32 +0800 Subject: [PATCH] =?UTF-8?q?refactor(health):=20=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=AB=AF=E9=80=82=E9=85=8D=E5=90=8E=E7=AB=AFAPI=E9=87=8D?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 medicationTask.js 替代 medicationRecord.js - 新增 medicationAdherence.js 依从性统计API --- src/api/health/medicationAdherence.js | 46 ++++++++++++++++ src/api/health/medicationRecord.js | 79 --------------------------- src/api/health/medicationTask.js | 28 ++++++++++ 3 files changed, 74 insertions(+), 79 deletions(-) create mode 100644 src/api/health/medicationAdherence.js delete mode 100644 src/api/health/medicationRecord.js create mode 100644 src/api/health/medicationTask.js diff --git a/src/api/health/medicationAdherence.js b/src/api/health/medicationAdherence.js new file mode 100644 index 0000000..e0ae9c0 --- /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(memberId, yearMonth) { + return request({ + url: '/health/adherence/calendar', + method: 'get', + params: { memberId, yearMonth } + }) +} + +// 获取各时段服药统计 +export function getTimeSlotAdherence(query) { + return request({ + url: '/health/adherence/timeSlot', + method: 'get', + params: query + }) +} + +// 获取仪表盘概览数据 +export function getDashboard(memberId) { + return request({ + url: '/health/adherence/dashboard', + method: 'get', + params: { memberId } + }) +} \ No newline at end of file diff --git a/src/api/health/medicationRecord.js b/src/api/health/medicationRecord.js deleted file mode 100644 index 42cd863..0000000 --- a/src/api/health/medicationRecord.js +++ /dev/null @@ -1,79 +0,0 @@ -import request from '@/utils/request' - -// 查询用药记录列表 -export function listMedicationRecord(query) { - return request({ - url: '/health/medicationRecord/list', - method: 'get', - params: query - }) -} - -// 查询今日用药记录 -export function getTodayRecords(personId) { - return request({ - url: '/health/medicationRecord/today', - method: 'get', - params: { personId } - }) -} - -// 查询某计划某天的用药记录 -export function getRecordsByPlanAndDate(planId, date) { - return request({ - url: '/health/medicationRecord/plan/' + planId + '/date/' + date, - method: 'get' - }) -} - -// 查询用药记录详细 -export function getMedicationRecord(id) { - return request({ - url: '/health/medicationRecord/' + id, - method: 'get' - }) -} - -// 新增用药记录 -export function addMedicationRecord(data) { - return request({ - url: '/health/medicationRecord', - method: 'post', - data - }) -} - -// 修改用药记录 -export function updateMedicationRecord(data) { - return request({ - url: '/health/medicationRecord', - method: 'put', - data - }) -} - -// 删除用药记录 -export function delMedicationRecord(id) { - return request({ - url: '/health/medicationRecord/' + id, - method: 'delete' - }) -} - -// 服药(标记为已服用) -export function takeMedication(id, dosage, remark) { - return request({ - url: '/health/medicationRecord/take/' + id, - method: 'put', - params: { dosage, remark } - }) -} - -// 跳过服药 -export function skipMedication(id, remark) { - return request({ - url: '/health/medicationRecord/skip/' + id, - method: 'put', - params: { remark } - }) -} \ No newline at end of file diff --git a/src/api/health/medicationTask.js b/src/api/health/medicationTask.js new file mode 100644 index 0000000..1e9ad3e --- /dev/null +++ b/src/api/health/medicationTask.js @@ -0,0 +1,28 @@ +import request from '@/utils/request' + +// 查询服药任务列表 +export function listMedicationTask(query) { + return request({ + url: '/health/medicationTask/list', + method: 'get', + params: query + }) +} + +// 确认服药 +export function confirmMedication(id, confirmType) { + return request({ + url: '/health/medicationTask/confirm/' + id, + method: 'put', + params: { confirmType } + }) +} + +// 跳过服药 +export function skipMedication(id, notes) { + return request({ + url: '/health/medicationTask/skip/' + id, + method: 'put', + params: { notes } + }) +} \ No newline at end of file