Go to file
2026-01-09 11:26:22 +08:00
app Implement ZenTao integration for task import and enhance week report generation. Added ZenTao database connection settings, UI for importing tasks, and updated report generation logic for improved clarity and execution time. Adjusted PDF generation styles and added error handling for task loading. 2026-01-09 11:26:22 +08:00
bootstrap Sure! Pl 2026-01-09 11:00:31 +08:00
config Implement ZenTao integration for task import and enhance week report generation. Added ZenTao database connection settings, UI for importing tasks, and updated report generation logic for improved clarity and execution time. Adjusted PDF generation styles and added error handling for task loading. 2026-01-09 11:26:22 +08:00
database Sure! Pl 2026-01-09 11:00:31 +08:00
public Sure! Pl 2026-01-09 11:00:31 +08:00
resources/views/weekreport Implement ZenTao integration for task import and enhance week report generation. Added ZenTao database connection settings, UI for importing tasks, and updated report generation logic for improved clarity and execution time. Adjusted PDF generation styles and added error handling for task loading. 2026-01-09 11:26:22 +08:00
routes Implement ZenTao integration for task import and enhance week report generation. Added ZenTao database connection settings, UI for importing tasks, and updated report generation logic for improved clarity and execution time. Adjusted PDF generation styles and added error handling for task loading. 2026-01-09 11:26:22 +08:00
storage Sure! Pl 2026-01-09 11:00:31 +08:00
.gitignore Sure! Pl 2026-01-09 11:00:31 +08:00
artisan Sure! Pl 2026-01-09 11:00:31 +08:00
composer.json Sure! Pl 2026-01-09 11:00:31 +08:00
composer.lock Sure! Pl 2026-01-09 11:00:31 +08:00
env.txt Sure! Pl 2026-01-09 11:00:31 +08:00
install.bat Sure! Pl 2026-01-09 11:00:31 +08:00
README.md Sure! Pl 2026-01-09 11:00:31 +08:00
start.bat Sure! Pl 2026-01-09 11:00:31 +08:00

智能周报生成器

基于阿里云千问Max大模型的智能周报生成应用使用 Laravel 框架开发。

功能特性

  • 📝 任务管理:动态添加/删除任务列表
  • 🖼️ 图片上传:支持为每个任务上传截图(可选)
  • 🤖 AI生成调用千问Max模型智能生成专业周报
  • 📄 Markdown预览:实时预览生成的周报内容
  • ⬇️ 多格式下载:支持 Markdown 和 PDF 格式下载
  • 🎨 精美界面:现代化深色主题,响应式设计

🛠️ 技术栈

  • 后端PHP 8.0+ / Laravel 8
  • 前端:原生 HTML/CSS/JavaScript
  • AI模型:阿里云通义千问 Max (qwen-max)
  • PDF生成DomPDF

📋 环境要求

  • PHP >= 8.0
  • Composer
  • 以下 PHP 扩展:
    • BCMath
    • Ctype
    • cURL
    • DOM
    • Fileinfo
    • JSON
    • Mbstring
    • OpenSSL
    • PDO
    • Tokenizer
    • XML

🚀 快速开始

Windows 用户

  1. 双击运行安装脚本

    install.bat
    
  2. 启动开发服务器

    start.bat
    
  3. 访问应用

    打开浏览器访问:http://localhost:8000

手动安装

  1. 克隆项目

    cd E:\Workspace\weekreport
    
  2. 安装依赖

    composer install
    
  3. 配置环境

    # 复制环境配置文件
    copy env.txt .env
    
    # 或在 Linux/Mac 上
    cp env.txt .env
    
  4. 生成应用密钥

    php artisan key:generate
    
  5. 创建存储链接

    php artisan storage:link
    
  6. 启动服务器

    php artisan serve
    

⚙️ 配置说明

API 配置

.env 文件中配置千问 API

# 千问Max API配置
QWEN_API_KEY=sk-7ea0fac260574e4ea22c9de728e7bff9
QWEN_API_URL=https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions
QWEN_MODEL=qwen-max

数据库配置(可选)

默认使用 SQLite如需使用 MySQL

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=weekreport
DB_USERNAME=your_username
DB_PASSWORD=your_password

📖 使用指南

  1. 设置周报信息

    • 选择周报的开始和结束日期
    • 填写作者姓名(可选)
  2. 添加任务

    • 点击"添加新任务"按钮
    • 填写任务描述
    • 可选:上传任务相关截图
  3. 生成周报

    • 点击"生成周报"按钮
    • 等待 AI 生成专业周报
  4. 预览与下载

    • 在右侧预览区查看生成结果
    • 点击下载按钮获取 Markdown 或 PDF 格式

📁 项目结构

weekreport/
├── app/
│   ├── Http/
│   │   └── Controllers/
│   │       └── WeekReportController.php  # 主控制器
│   └── Providers/
├── config/
│   ├── app.php
│   ├── services.php        # API配置
│   └── ...
├── public/
│   └── index.php           # 入口文件
├── resources/
│   └── views/
│       └── weekreport/
│           └── index.blade.php  # 前端页面
├── routes/
│   └── web.php             # 路由定义
├── storage/
├── .env                    # 环境配置
├── composer.json
├── install.bat             # Windows安装脚本
├── start.bat               # Windows启动脚本
└── README.md

🔧 API 接口

方法 路径 说明
GET / 显示周报生成页面
POST /upload 上传任务图片
POST /generate 生成周报
POST /download/markdown 下载 Markdown 格式
POST /download/pdf 下载 PDF 格式

🐛 常见问题

Q: 生成周报时报错 "API Key 未配置"

确保 .env 文件中正确配置了 QWEN_API_KEY

Q: 图片上传后不显示

运行以下命令创建存储链接:

php artisan storage:link

Q: PDF 中文乱码

确保系统安装了中文字体DomPDF 会自动使用系统字体。

📄 许可证

MIT License

🙏 致谢