feat(frontend): 启用工作流快捷提示按钮

This commit is contained in:
2026-06-07 20:14:04 +08:00
parent 228f30a697
commit 82c33e513f
3 changed files with 57 additions and 3 deletions

View File

@@ -965,6 +965,26 @@
});
}
function bindPromptTemplateButtons() {
document.querySelectorAll("[data-prompt-template]").forEach(function (button) {
if (button.dataset.bound === "true") {
return;
}
button.dataset.bound = "true";
button.addEventListener("click", function () {
if (!promptInput) {
return;
}
var template = button.getAttribute("data-prompt-template") || "";
promptInput.value = template;
promptInput.focus();
if (typeof promptInput.setSelectionRange === "function") {
promptInput.setSelectionRange(promptInput.value.length, promptInput.value.length);
}
});
});
}
async function streamChat(event) {
event.preventDefault();
if (!composer || !promptInput || !sendButton || !chatStage) {
@@ -1126,6 +1146,7 @@
bindWorkflowBatchCarouselControls();
bindConditionConfirmForms();
bindRectificationActionButtons();
bindPromptTemplateButtons();
refreshRunningWorkflowCards();
if (chatScroll) {