From 77ebdd2ccbc40215cfb07bdb6f44e9327979284b Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 25 Jan 2026 12:32:38 +0000 Subject: [PATCH] =?UTF-8?q?fix(ai):=20=E5=89=8D=E7=AB=AF=E4=BB=85=E5=9C=A8?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1/=E9=A1=B9=E7=9B=AE=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E4=B8=AD=E6=98=BE=E7=A4=BA=20/analyze=20=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /analyze 命令仅在 group_type 为 task 或 project 时显示 - /summarize 命令保持在所有对话类型中可用 - 统一变量名 notifyMsgId -> pendingMsgId Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- app/Tasks/AiDialogCommandTask.php | 10 +++++----- .../js/pages/manage/components/ChatInput/index.vue | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Tasks/AiDialogCommandTask.php b/app/Tasks/AiDialogCommandTask.php index c69597d64..4cc8cff3d 100644 --- a/app/Tasks/AiDialogCommandTask.php +++ b/app/Tasks/AiDialogCommandTask.php @@ -15,15 +15,15 @@ class AiDialogCommandTask extends AbstractTask protected int $dialogId; protected string $command; protected int $userId; - protected int $notifyMsgId; + protected int $pendingMsgId; - public function __construct(int $dialogId, string $command, int $userId, int $notifyMsgId = 0) + public function __construct(int $dialogId, string $command, int $userId, int $pendingMsgId = 0) { parent::__construct(); $this->dialogId = $dialogId; $this->command = $command; $this->userId = $userId; - $this->notifyMsgId = $notifyMsgId; + $this->pendingMsgId = $pendingMsgId; } public function start() @@ -37,8 +37,8 @@ class AiDialogCommandTask extends AbstractTask try { match ($this->command) { - 'analyze' => AiDialogCommand::analyze($dialog, $this->userId, $this->notifyMsgId), - 'summarize' => AiDialogCommand::summarize($dialog, $this->userId, $this->notifyMsgId), + 'analyze' => AiDialogCommand::analyze($dialog, $this->userId, $this->pendingMsgId), + 'summarize' => AiDialogCommand::summarize($dialog, $this->userId, $this->pendingMsgId), default => null, }; } catch (\Throwable $e) { diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index a719f11f8..111fff883 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -2739,11 +2739,12 @@ export default { value: this.$L('工作报告'), tip: '%', }, - { + // /analyze 仅在任务和项目对话中显示 + ...(['task', 'project'].includes(this.dialogData?.group_type) ? [{ id: 'analyze', value: this.$L('分析'), tip: '/analyze', - }, + }] : []), { id: 'summarize', value: this.$L('总结'),