feat: 审批流程模块 (T审批A审批)

- 新增 backend/app/api/approval.py 审批API
- 前端H5支持发起审批、审批操作
- 添加审批卡片弹窗组件
- 路由注册审批模块
This commit is contained in:
Simon
2026-06-15 09:32:41 +08:00
parent 64d6812ec3
commit 93ba41ed79
29 changed files with 6584 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
# 🐛 Bug 报告
## 概要 (Summary)
<!-- 简要描述这个 Bug -->
## 复现步骤 (Steps to Reproduce)
1.
2.
3.
## 期望行为 (Expected Behavior)
<!-- 期望的正确行为 -->
## 实际行为 (Actual Behavior)
<!-- 实际发生的错误行为 -->
## 环境信息 (Environment)
- **服务**: [前端 admin/agent/h5/portal / 后端 / 数据库 / Redis]
- **环境**: [本地开发 / NAS 预生产 / 公司生产]
- **浏览器**: [Chrome 120 / Safari 17 / 企业微信 X.X / 微信 X.X]
- **设备**: [Windows 11 / macOS 14 / iOS 17 / Android 14]
- **版本**: [如 backend v0.5.0 / frontend-admin v0.5.0]
## 截图/日志 (Screenshots / Logs)
<!-- 如果有截图或日志,粘贴在这里 -->
## 严重度 (Severity)
- [ ] 🔴 P0 - 生产环境阻塞(立即修)
- [ ] 🟠 P1 - 主要功能不可用(本周修)
- [ ] 🟡 P2 - 一般问题(下周修)
- [ ] 🟢 P3 - 体验改进(下季度)
## 影响范围 (Impact)
- [ ] 全部用户
- [ ] 部分用户(请说明哪些)
- [ ] 特定场景(请说明)
## 紧急程度 (Urgency)
<!-- 是否影响业务运营?是否需要立即响应? -->
## 关联 (Related)
<!-- 相关 Issue / PR / 文档 -->
## 验收标准 (Acceptance Criteria)
- [ ] Bug 复现步骤明确
- [ ] 已尝试排查根因
- [ ] 已提供日志或截图
- [ ] 已与相关方沟通
---
**Reporter**: @your-username
**Date**: YYYY-MM-DD
**Component**: [backend / frontend-X / infra / docs]
+70
View File
@@ -0,0 +1,70 @@
# ✨ 功能请求
## 概要 (Summary)
<!-- 简短描述这个功能 -->
## 业务背景 (Business Context)
### 痛点
<!-- 当前存在什么问题? -->
### 期望价值
<!-- 这个功能能带来什么价值? -->
### 相关方
<!-- 谁会用到?产品经理/坐席/员工/管理员? -->
## 详细方案 (Detailed Proposal)
### 用户故事
```
作为 [角色]
我想要 [功能]
以便于 [价值]
```
### 交互流程
<!-- 描述关键交互步骤 -->
1. 用户操作
2. 系统响应
3. ...
### 数据模型(如有)
<!-- 涉及表 / 字段变更 -->
### API 设计(如有)
<!-- 端点 / 请求 / 响应 -->
### UI 草图(如有)
<!-- 链接 Figma / 截图 / ASCII -->
## 替代方案 (Alternatives)
<!-- 考虑过其他方案吗?优劣? -->
## 验收标准 (Acceptance Criteria)
- [ ] 功能满足用户故事
- [ ] 通过单元测试(覆盖率 > 80%)
- [ ] 通过集成测试
- [ ] 通过 E2E 测试(关键路径)
- [ ] UI 适配桌面 + 移动
- [ ] 错误处理完善
- [ ] 日志/监控接入
- [ ] 文档更新(API + 用户)
## 优先级 (Priority)
- [ ] 🔴 P0 - 阻塞业务
- [ ] 🟠 P1 - 重要功能
- [ ] 🟡 P2 - 增强功能
- [ ] 🟢 P3 - 锦上添花
## 关联 (Related)
- 相关 Issue / PR
- 相关文档
- 依赖项
## 估算 (Estimation)
<!-- 时间 / 工作量 -->
---
**Reporter**: @your-username
**Date**: YYYY-MM-DD
**Component**: [backend / frontend-X / docs / infra]
+121
View File
@@ -0,0 +1,121 @@
# Pull Request 模板
> **提交前必读**:
> - [ ] PR 标题用 [Conventional Commits](https://www.conventionalcommits.org/)(如 `feat:` / `fix:` / `docs:`)
> - [ ] 已关联 Issue(用 `Closes #N` / `Refs #N`)
> - [ ] 已通过 pre-commit-check
> - [ ] 已更新相关文档
> - [ ] 已自测通过
---
## 📋 概要 (Summary)
<!-- 简短描述这个 PR 做了什么 -->
## 🎯 关联 (Related)
<!-- 关联的 Issue / 需求 / 文档 -->
- Closes #
- Refs #
## 🏷️ 类型 (Type of Change)
<!-- 请勾选 -->
- [ ] 🐛 Bug 修复
- [ ] ✨ 新功能
- [ ] 📈 性能优化
- [ ] 🔐 安全修复
- [ ] 🏗️ 基础设施(部署/工具)
- [ ] 📚 文档
- [ ] 🧹 重构
- [ ] 🧪 测试
## 🛠️ 改动 (Changes)
<!-- 详细描述改动内容 -->
### 后端
- [ ] 改 models(alembic 迁移?)
- [ ] 改 API 端点
- [ ] 改 service / utils
- [ ] 改配置
### 前端
- [ ] admin
- [ ] agent
- [ ] h5
- [ ] portal
### 基础设施
- [ ] Dockerfile
- [ ] nginx
- [ ] 脚本
- [ ] CI/CD
### 文档
- [ ] README
- [ ] docs/
- [ ] 注释
## 🧪 测试 (Testing)
<!-- 怎么测试的? -->
### 单元测试
- [ ] 加新测试
- [ ] 现有测试通过
### 集成测试
- [ ] 后端:`pytest backend/tests/`
- [ ] 前端:`npm run test`(如有)
### 手动测试
<!-- 手动测试步骤 -->
1.
2.
3.
### 回归测试
<!-- 是否影响其他模块? -->
## 📸 截图/录屏 (Screenshots / Recordings)
<!-- UI 改动必有 -->
## ⚠️ 风险与回滚 (Risks & Rollback)
<!-- 风险评估,如何回滚 -->
### 风险
<!-- 列出潜在风险 -->
### 回滚方案
<!-- 如何回滚 -->
## ✅ 验收清单 (Acceptance Checklist)
- [ ] 代码风格一致
- [ ] 注释充分
- [ ] 类型注解完整(Python)
- [ ] 无 console.log
- [ ] 无未使用的 import
- [ ] 无硬编码(走 config)
- [ ] 无 token / 凭据
- [ ] 错误处理完善
- [ ] 日志记录
- [ ] 性能考虑
- [ ] 安全考虑
## 📚 文档 (Documentation)
- [ ] API 文档更新
- [ ] 用户文档更新
- [ ] 部署文档更新
- [ ] CHANGELOG.md 更新
## 🔗 关联资源 (References)
- 相关 PR
- 相关 Issue
- 相关文档
- 外部资源
---
**Author**: @your-username
**Reviewer**: @reviewer-username
**Date**: YYYY-MM-DD
+203
View File
@@ -0,0 +1,203 @@
# =============================================================================
# Gitea 内置依赖更新(替代 Dependabot)
# =============================================================================
# 功能: 自动检查依赖更新,提 PR 到仓
# 频率: weekly
# 注: Gitea 1.19+ 支持此功能
# =============================================================================
version: 2
# -----------------------------------------------------------------------------
# 通用配置
# -----------------------------------------------------------------------------
# 限制单批 PR 数(防刷屏)
# 0 = 不限,实际建议 5-10
# 标签:让 reviewer 一眼看出"依赖更新"
labels:
- "dependencies"
- "auto-update"
# 自动合并 patch 级别更新
# minor / patch 都不自动,等 reviewer 评
# 如要开启,加: auto-merge: true
# -----------------------------------------------------------------------------
# Python 后端
# -----------------------------------------------------------------------------
updates:
- package-ecosystem: "pip"
directory: "/backend"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "python"
- "backend"
# 忽略大版本(等人工)
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
# -----------------------------------------------------------------------------
# 前端 admin
# -----------------------------------------------------------------------------
- package-ecosystem: "npm"
directory: "/frontend-admin"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "frontend"
- "admin"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
# -----------------------------------------------------------------------------
# 前端 agent
# -----------------------------------------------------------------------------
- package-ecosystem: "npm"
directory: "/frontend-agent"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "frontend"
- "agent"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
# -----------------------------------------------------------------------------
# 前端 h5
# -----------------------------------------------------------------------------
- package-ecosystem: "npm"
directory: "/frontend-h5"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "frontend"
- "h5"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
# -----------------------------------------------------------------------------
# 前端 portal
# -----------------------------------------------------------------------------
- package-ecosystem: "npm"
directory: "/frontend-portal"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "frontend"
- "portal"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
# -----------------------------------------------------------------------------
# Docker 基础镜像
# -----------------------------------------------------------------------------
- package-ecosystem: "docker"
directory: "/backend"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "docker"
- "backend"
- package-ecosystem: "docker"
directory: "/frontend-admin"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "docker"
- "frontend"
- package-ecosystem: "docker"
directory: "/frontend-agent"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "docker"
- "frontend"
- package-ecosystem: "docker"
directory: "/frontend-h5"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "docker"
- "frontend"
- package-ecosystem: "docker"
directory: "/frontend-portal"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "docker"
- "frontend"
# -----------------------------------------------------------------------------
# GitHub Actions / Gitea Actions(如有)
# -----------------------------------------------------------------------------
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "ci"