Files
ylt_diy/scripts/start.bat
user9994793890 9383612712 feat: 将项目从Next.js重构为Python Flask版本
完全重构为Python + Flask架构,包含:

1. 核心模块:
   - lib/db.py:数据库连接(PyMySQL)
   - lib/field_mapping.py:字段映射(100+字段英文→中文)
   - lib/report_generator.py:日报生成核心逻辑

2. Flask应用:
   - app.py:主应用,包含所有API路由
   - 配置管理API(CRUD、启用/禁用、排序)
   - 日报生成API(支持预设/自定义时间)
   - 历史记录API(分页查询)
   - 文件下载API
   - 定时任务(APScheduler,每天8:01)

3. 前端页面:
   - templates/index.html:完整的单页面应用
   - 三个标签页:配置管理、日报生成、历史记录
   - 原生HTML+CSS+JavaScript,无需构建

4. 依赖管理:
   - requirements.txt:Python依赖清单
   - Flask 3.0.0 + Flask-CORS 4.0.0
   - PyMySQL 1.1.0(数据库驱动)
   - openpyxl 3.1.2(Excel处理)
   - APScheduler 3.10.4(定时任务)

5. 启动脚本:
   - scripts/dev.bat:Windows开发环境启动
   - scripts/start.bat:Windows生产环境启动

6. 文档:
   - README.md:完整的安装、运行、使用指南
   - 包含API接口说明、数据库表结构、常见问题

Windows运行方式:
1. 安装Python 3.8+
2. pip install -r requirements.txt
3. scripts\dev.bat 或 python app.py
4. 访问 http://localhost:5000
5. 初始化数据库:POST /api/init-tables

所有功能完整保留:
✅ 定时任务(每天8:01)
✅ 配置管理(CRUD+启用/禁用+排序)
✅ 日报生成(按配置+时间范围)
✅ 历史记录(查看+下载)
✅ 自定义字段(中文显示)
✅ 求和功能(多字段求和)
✅ 按企业/用户拆分
✅ Excel导出

Coze-Commit-Type: user
Coze-User-ID: 3722323274763196
Coze-Conversation-ID: 9894087
2026-07-09 11:26:23 +08:00

12 lines
241 B
Batchfile
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.

@echo off
REM Windows生产环境启动脚本
echo Starting Flask production server...
echo Working directory: %cd%
REM 设置环境变量
set FLASK_APP=app.py
set FLASK_ENV=production
REM 启动Flask应用(生产环境)
python app.py