react-phone-apps/.blueprint/modules/local-data-layer.md
lanrtop cea2a5d208 feat: 表单保存优化、照片保存相册及布局性能改进
- 物品表单底部新增冻结保存按钮,保存成功显示 Toast 提示
- 照片全屏预览时支持一键保存到本地相册(expo-media-library ~16.0.0)
- 左侧标记点列表侧栏宽度从 120 调整为 160
- FoldableLayout 改用 LayoutAnimation 替代 JS 线程宽度动画,修复 Android 地图渲染空白及卡顿问题
- 修复 ImagePicker 废弃 API MediaTypeOptions.Images → MediaType.Images

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 00:12:42 +09:00

40 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: local-data-layer
name: 本地数据持久化层
area: data
status: done
---
## 概述
基于 Expo SQLite 的本地数据库层,管理标记点、物品记录和照片路径三张核心表。所有写操作使用事务保证原子性,供上层功能模块调用。
## 任务卡
### 🔵 SQLite 初始化与 Schema 建表
- status: done
- complexity: M
- files: apps/property-survey/src/db/database.ts, apps/property-survey/src/db/schema.ts
- acceptance: App 启动时自动执行 CREATE TABLE IF NOT EXISTS建立 markers / items / photos 三张表,重复启动不报错,字段与设计文档一致
### 🔵 标记点 CRUD 操作
- status: done
- complexity: M
- files: apps/property-survey/src/db/markers.ts
- depends: local-data-layer
- acceptance: 提供 insertMarker / getMarkersByFloor / updateMarker / deleteMarker 四个函数deleteMarker 级联删除关联 items 和 photos所有函数返回类型安全的 Promise
### 🔵 物品记录 CRUD 操作
- status: done
- complexity: M
- files: apps/property-survey/src/db/items.ts
- depends: local-data-layer
- acceptance: 提供 insertItem / getItemsByMarker / updateItem / deleteItem 四个函数,支持批量查询(传入 marker_id 数组),返回带关联照片数量的扩展类型
### 🔵 照片路径 CRUD 操作
- status: done
- complexity: S
- files: apps/property-survey/src/db/photos.ts
- depends: local-data-layer
- acceptance: 提供 insertPhoto / getPhotosByItem / deletePhoto / reorderPhotos 四个函数deletePhoto 同步删除设备文件系统中的对应图片文件