在长者位置按钮左边添加了一个"长者档案"按钮,点击后弹窗展示长者的详细档案信息,包括基本信息、联系方式和预警历史。
ElderProfileDialog.vue路径: src/views/Home/components/ElderProfileDialog.vue
功能:
主要特性:
/api/pc/admin/getElderDetail 接口获取数据ElderlyCard.vue路径: src/views/Home/components/ElderlyCard.vue
修改内容:
viewProfile 事件,点击档案按钮时触发type="info" 样式,与"添加设备"按钮形成对比ElderlyList.vue路径: src/views/Home/components/ElderlyList.vue
修改内容:
viewProfile 事件的 emit 定义@view-profile 事件home-refactored.vue路径: src/views/Home/home-refactored.vue
修改内容:
ElderProfileDialog 组件elderProfileDialogVisible 和 currentProfileElderId 响应式变量@view-profile 事件openElderProfileDialog 方法,打开档案弹窗接口: GET /api/pc/admin/getElderDetail
参数:
elderId: number - 长者ID
返回数据结构:
{
id: number // 长者ID
name: string // 长者名称
avatar?: string // 头像URL(可选)
age: number // 年龄
gender: string // 性别(男/女)
relativePhone?: string // 家属电话
elderPhone?: string // 长者电话
address?: string // 长者地址
warningData?: [ // 预警历史数组
{
eventType: string // 预警类型(汉字)
message: string // 预警信息
happensAt: string // 发生时间(ISO格式)
}
]
}
当接口暂无数据或出错时,组件会自动生成假数据用于测试。假数据包括:
长者信息:
预警记录: