From 432e16358f34f215b7b79bc50df3136113cf1832 Mon Sep 17 00:00:00 2001 From: Ethanfly Date: Tue, 13 Jan 2026 17:26:25 +0800 Subject: [PATCH] Refine week report guidelines and remove image appendix feature. Updated task description requirements for clarity and consistency, and eliminated the method for building an images section to streamline report generation. --- app/Http/Controllers/WeekReportController.php | 49 ++----------------- 1 file changed, 3 insertions(+), 46 deletions(-) diff --git a/app/Http/Controllers/WeekReportController.php b/app/Http/Controllers/WeekReportController.php index a6e1c30..1c290ef 100644 --- a/app/Http/Controllers/WeekReportController.php +++ b/app/Http/Controllers/WeekReportController.php @@ -165,8 +165,9 @@ class WeekReportController extends Controller 4. 不要使用"高效完成"、"圆满完成"、"取得显著成效"等套话 5. 每个任务用简短的一两句话描述即可,说清楚做了什么 6. 可以按项目或类型简单分组,但不要过度分类 -7. 【重要】只有标注了"(有截图)"的任务才添加"[图片占位符-任务X]",其他任务不要添加{$nextWeekRequirement} -9. 总结部分一两句话概括即可,不要写得太官方 +7. 【重要】只有标注了"(有截图)"的任务才在该任务描述后紧接着添加"[图片占位符-任务X]"(X是原始任务序号),其他任务不要添加{$nextWeekRequirement} +8. 【重要】图片占位符的序号要与原始任务序号的序号一致,不要出现错位 +9. 【重要】不要添加任何总结、小结、回顾等内容 10. 不要出现具体的完成时间、耗时等信息 11. 整体篇幅适中,不要太长 @@ -264,53 +265,9 @@ PROMPT; // 清理可能产生的多余空行 $report = preg_replace('/\n{3,}/', "\n\n", $report); - // 收集所有有图片的任务,并在报告末尾添加截图附录 - $imagesSection = $this->buildImagesSection($tasks); - if (!empty($imagesSection)) { - $report .= $imagesSection; - } - return $report; } - /** - * 构建图片附录部分 - */ - private function buildImagesSection(array $tasks): string - { - $images = []; - - foreach ($tasks as $index => $task) { - if (!empty($task['image'])) { - $num = $index + 1; - $imageUrl = asset('storage/' . $task['image']); - // 提取任务描述的前30个字符作为图片说明 - $desc = mb_substr(trim($task['description']), 0, 50); - if (mb_strlen(trim($task['description'])) > 50) { - $desc .= '...'; - } - $images[] = [ - 'num' => $num, - 'url' => $imageUrl, - 'desc' => $desc, - ]; - } - } - - if (empty($images)) { - return ''; - } - - $section = "\n\n---\n\n## 附:任务截图\n\n"; - - foreach ($images as $img) { - $section .= "**任务{$img['num']}**: {$img['desc']}\n\n"; - $section .= "![任务{$img['num']}截图]({$img['url']})\n\n"; - } - - return $section; - } - /** * 下载Markdown格式 */