Files
Road_roller/README.md
2026-09-17 09:19:24 +08:00

124 lines
5.9 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.
<h2 align="center">
Road Roller - 压路机智能监控管理系统
</h2>
<p align="center">
基于 uni-app 的压路机作业监控与管理应用,支持实时 RTK 轨迹追踪、热力图可视化、蓝牙设备通信及本地数据持久化。
</p>
## 项目简介
Road Roller 是一款面向道路施工场景的压路机智能监控应用,帮助施工团队实时掌握碾压作业状态、设备运行数据和施工质量。
### 核心功能
| 模块 | 说明 |
|------|------|
| **项目管理** | 创建/切换施工项目,跟踪项目进度、压实面积、合格率等核心指标 |
| **作业监控** | 实时记录碾压遍数、行驶速度、作业时长,支持多工作记录管理 |
| **RTK 轨迹** | 基于 RTK 定位的高精度轨迹追踪,支持轨迹回放与分析 |
| **热力图** | 将压实数据可视化为热力图,直观展示碾压覆盖情况 |
| **告警系统** | 数据中断、高温异常、定位异常等多类型告警,支持处置记录 |
| **历史报告** | 自动生成碾压报告,包含合格率、平均速度、平均压实度等统计 |
| **蓝牙通信** | 通过蓝牙连接压路机设备,实时采集传感器数据 |
| **本地存储** | SQLite 本地数据库,离线可用,数据自动同步 |
### 技术栈
- **框架**: uni-app (Vue 3 + TypeScript)
- **构建**: Vite + pnpm
- **UI**: Wot Design UI + UnoCSS
- **状态管理**: Pinia
- **数据库**: SQLite (plus.sqlite)
- **通信**: 蓝牙 (plus.Bluetooth)
- **定位**: GPS/RTK (plus.Geolocation)
## 特性
- ⚡️ [Vue 3](https://github.com/vuejs/core), [Vite](https://github.com/vitejs/vite), [pnpm](https://pnpm.io/), [esbuild](https://github.com/evanw/esbuild) - 就是快!
- 🔧 [ESM 优先](https://github.com/uni-helper/plugin-uni)
- 🗂 [基于文件的路由](./src/pages)
- 📦 [组件自动化加载](./src/components)
- 📑 [布局系统](./src/layouts)
- 🎨 [UnoCSS](https://github.com/unocss/unocss) - 高性能且极具灵活性的即时原子化 CSS 引擎
- 😃 [各种图标集为你所用](https://github.com/antfu/unocss/tree/main/packages/preset-icons)
- 🔥 使用 [新的 `<script setup>` 语法](https://github.com/vuejs/rfcs/pull/227)
- 📥 [API 自动加载](https://github.com/antfu/unplugin-auto-import) - 直接使用 Composition API 无需引入
- 🦾 [TypeScript](https://www.typescriptlang.org/) & [ESLint](https://eslint.org/) - 保证代码质量
## 项目结构
```
Road_roller/
├── .github/ # GitHub Actions CI/CD 配置
├── .hbuilderx/ # HBuilderX 编辑器配置
├── .opencode/ # OpenCode AI 工具配置(skills、插件等)
├── .vscode/ # VS Code 编辑器配置
├── dist/ # 构建输出目录
├── node_modules/ # 依赖包
├── src/ # 源代码目录
│ ├── api/ # 接口请求
│ │ ├── request.ts # Axios 请求封装(拦截器、基础配置)
│ │ └── home/ # 首页相关接口
│ ├── components/ # 公共组件(自动加载)
│ │ ├── home/ # 首页组件(进度、概览、项目列表等)
│ │ ├── settings/ # 设置组件(项目表单等)
│ │ └── ...
│ ├── composables/ # 组合式函数(自动加载)
│ ├── layouts/ # 页面布局组件
│ ├── pages/ # 页面文件(文件路由)
│ │ ├── Ahome/ # 首页(项目概览、进度、告警)
│ │ ├── work/ # 工作页(作业记录、实时监控)
│ │ ├── report/ # 报告页(历史报告、统计分析)
│ │ ├── project/ # 项目管理
│ │ ├── warning/ # 告警记录与详情
│ │ ├── heatmap/ # 热力图可视化
│ │ ├── rtk/ # RTK 轨迹追踪
│ │ ├── bluetooth/ # 蓝牙设备连接
│ │ ├── settings/ # 系统设置
│ │ └── message/ # 消息通知
│ ├── service/ # 数据库服务层(SQLite 表定义与 CRUD)
│ ├── store/ # Pinia 状态管理
│ ├── utils/ # 工具函数(sqlite、bluetooth、storage 等)
│ ├── App.vue # 根组件
│ ├── main.ts # 应用入口
│ └── manifest.json # uni-app 应用配置
├── eslint.config.js # ESLint 配置
├── manifest.config.ts # uni-app manifest 配置(源文件)
├── pages.config.ts # 页面路由配置(源文件)
├── uno.config.ts # UnoCSS 原子化 CSS 配置
└── vite.config.ts # Vite 构建配置
```
### 目录说明
| 目录 | 作用 |
|------|------|
| `src/api` | 接口请求封装,基于 Axios + uni-app 适配器 |
| `src/components` | 公共 Vue 组件,通过 vite-plugin-uni-components 自动加载 |
| `src/composables` | Vue 3 组合式函数,通过 unplugin-auto-import 自动导入 |
| `src/layouts` | 页面布局模板,通过 vite-plugin-uni-layouts 管理 |
| `src/pages` | 页面组件,文件即路由(vite-plugin-uni-pages) |
| `src/service` | 数据库服务层,包含 SQLite 表定义、CRUD 操作和种子数据 |
| `src/store` | Pinia 状态管理,统一数据源 |
| `src/utils` | 工具函数,包含 SQLite 封装、蓝牙通信、本地存储等 |
### 数据库表结构
| 表名 | 说明 |
|------|------|
| `project` | 项目信息(名称、范围、面积、进度、状态) |
| `work_record` | 作业记录(时间、时长、压实面积、碾压遍数) |
| `rtk_track` | RTK 轨迹点(经纬度、速度、航向、压实度) |
| `warning_record` | 告警记录(异常类型、级别、处置记录) |
| `history_report` | 历史报告(统计数据、合格率、平均指标) |