diff --git a/frontend/css/style.css b/frontend/css/style.css index df4f743..6041d85 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -432,6 +432,8 @@ body { .modal-body { padding: 30px; + max-height: calc(100vh - 300px); /* 留出顶部和底部空间 */ + overflow-y: auto; /* 内容过多时显示滚动条 */ } .modal-footer { @@ -476,6 +478,7 @@ body { .form-group textarea { resize: vertical; min-height: 100px; + max-height: 300px; /* 限制最大高度,避免占用过多空间 */ } .form-actions { @@ -504,6 +507,10 @@ body { background: white; border-radius: 6px; border: 1px solid #e2e8f0; + max-height: 200px; /* 限制润色文本的最大高度 */ + overflow-y: auto; /* 内容过多时显示滚动条 */ + white-space: pre-wrap; /* 保留换行和空格 */ + word-wrap: break-word; /* 长单词自动换行 */ } .polished-actions { diff --git a/frontend/js/app.js b/frontend/js/app.js index 0719754..27bdcab 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -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'); }