mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-26 20:48:12 +00:00
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:
parent
28504e4a4e
commit
77ebdd2ccb
@ -15,15 +15,15 @@ class AiDialogCommandTask extends AbstractTask
|
|||||||
protected int $dialogId;
|
protected int $dialogId;
|
||||||
protected string $command;
|
protected string $command;
|
||||||
protected int $userId;
|
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();
|
parent::__construct();
|
||||||
$this->dialogId = $dialogId;
|
$this->dialogId = $dialogId;
|
||||||
$this->command = $command;
|
$this->command = $command;
|
||||||
$this->userId = $userId;
|
$this->userId = $userId;
|
||||||
$this->notifyMsgId = $notifyMsgId;
|
$this->pendingMsgId = $pendingMsgId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function start()
|
public function start()
|
||||||
@ -37,8 +37,8 @@ class AiDialogCommandTask extends AbstractTask
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
match ($this->command) {
|
match ($this->command) {
|
||||||
'analyze' => AiDialogCommand::analyze($dialog, $this->userId, $this->notifyMsgId),
|
'analyze' => AiDialogCommand::analyze($dialog, $this->userId, $this->pendingMsgId),
|
||||||
'summarize' => AiDialogCommand::summarize($dialog, $this->userId, $this->notifyMsgId),
|
'summarize' => AiDialogCommand::summarize($dialog, $this->userId, $this->pendingMsgId),
|
||||||
default => null,
|
default => null,
|
||||||
};
|
};
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
|||||||
@ -2739,11 +2739,12 @@ export default {
|
|||||||
value: this.$L('工作报告'),
|
value: this.$L('工作报告'),
|
||||||
tip: '%',
|
tip: '%',
|
||||||
},
|
},
|
||||||
{
|
// /analyze 仅在任务和项目对话中显示
|
||||||
|
...(['task', 'project'].includes(this.dialogData?.group_type) ? [{
|
||||||
id: 'analyze',
|
id: 'analyze',
|
||||||
value: this.$L('分析'),
|
value: this.$L('分析'),
|
||||||
tip: '/analyze',
|
tip: '/analyze',
|
||||||
},
|
}] : []),
|
||||||
{
|
{
|
||||||
id: 'summarize',
|
id: 'summarize',
|
||||||
value: this.$L('总结'),
|
value: this.$L('总结'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user