Compare commits
2
Commits
a1e4246bf4
...
b779099bcf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b779099bcf | ||
|
|
1bb3978c9a |
+13
-2
@@ -214,7 +214,7 @@
|
|||||||
const checked = selectedTags[tag.id] !== undefined;
|
const checked = selectedTags[tag.id] !== undefined;
|
||||||
const optionsHtml = tag.options.map(o => `
|
const optionsHtml = tag.options.map(o => `
|
||||||
<label class="radio-label">
|
<label class="radio-label">
|
||||||
<input type="radio" name="tag_${tag.id}" value="${o.id}" ${selectedTags[tag.id] === o.id ? 'checked' : ''} onchange="selectTagOption(${tag.id}, ${o.id})">
|
<input type="radio" name="tag_${tag.id}" value="${o.id}" ${selectedTags[tag.id] === o.id ? 'checked' : ''} onclick="selectTagOption(${tag.id}, ${o.id})">
|
||||||
<span class="text-sm">${escapeHtml(o.label)}</span>
|
<span class="text-sm">${escapeHtml(o.label)}</span>
|
||||||
</label>
|
</label>
|
||||||
`).join('');
|
`).join('');
|
||||||
@@ -255,7 +255,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function selectTagOption(tagId, optionId) {
|
function selectTagOption(tagId, optionId) {
|
||||||
|
if (selectedTags[tagId] === optionId) {
|
||||||
|
// 再次点击已选中的选项 → 取消选择(需要 renderTags 重建 DOM 以取消 radio 的 checked 状态)
|
||||||
|
delete selectedTags[tagId];
|
||||||
|
renderTags();
|
||||||
|
} else {
|
||||||
selectedTags[tagId] = optionId;
|
selectedTags[tagId] = optionId;
|
||||||
|
// 同步勾选父标签复选框
|
||||||
|
const checkbox = document.querySelector(`#tag-options-${tagId}`)
|
||||||
|
?.closest('.mb-2')
|
||||||
|
?.querySelector('input[type="checkbox"]');
|
||||||
|
if (checkbox) checkbox.checked = true;
|
||||||
|
}
|
||||||
updatePreview();
|
updatePreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,7 +350,7 @@
|
|||||||
// Custom content
|
// Custom content
|
||||||
const customContent = document.getElementById('custom-content').value.trim();
|
const customContent = document.getElementById('custom-content').value.trim();
|
||||||
if (customContent) {
|
if (customContent) {
|
||||||
parts.push(`## 自定义内容\n\n${customContent}`);
|
parts.push(`## 用户输入\n\n${customContent}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tag constraints
|
// Tag constraints
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ func AssemblePrompt(projectName string, customContent string, tagOptions []model
|
|||||||
|
|
||||||
// Custom content
|
// Custom content
|
||||||
if customContent != "" {
|
if customContent != "" {
|
||||||
parts = append(parts, fmt.Sprintf("## 自定义内容\n\n%s", customContent))
|
parts = append(parts, fmt.Sprintf("## 用户输入\n\n%s", customContent))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tag constraints
|
// Tag constraints
|
||||||
|
|||||||
Reference in New Issue
Block a user