fix(ai): 前端仅在任务/项目对话中显示 /analyze 命令

- /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 <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
kuaifan 2026-01-25 12:32:38 +00:00
parent 28504e4a4e
commit 77ebdd2ccb
2 changed files with 8 additions and 7 deletions

View File

@ -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) {

View File

@ -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('总结'),