修复界面问题

This commit is contained in:
2026-01-13 09:48:44 +00:00
parent 1de554d846
commit c06016412d
2 changed files with 19 additions and 4 deletions

View File

@@ -232,22 +232,30 @@ class WorkListApp {
this.currentEditingTask = task;
const modal = document.getElementById('taskModal');
const form = document.getElementById('taskForm');
const polishedDiv = document.getElementById('polishedDescription');
if (task) {
// 编辑模式
document.getElementById('modalTitle').textContent = '编辑任务';
document.getElementById('taskTitle').value = task.title;
document.getElementById('taskDescription').value = task.description || '';
document.getElementById('taskStatus').value = task.status;
// 如果有润色后的描述,显示它
if (task.polished_description) {
const polishedText = polishedDiv.querySelector('.polished-text');
polishedText.textContent = task.polished_description;
polishedDiv.style.display = 'block';
} else {
polishedDiv.style.display = 'none';
}
} else {
// 新建模式
document.getElementById('modalTitle').textContent = '添加任务';
form.reset();
polishedDiv.style.display = 'none';
}
// 隐藏润色内容
document.getElementById('polishedDescription').style.display = 'none';
this.showModal('taskModal');
}