From c06016412d6ab782cdfdf356c90ce104937aa3b3 Mon Sep 17 00:00:00 2001 From: bluish <734499798@qq.com> Date: Tue, 13 Jan 2026 09:48:44 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=95=8C=E9=9D=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/css/style.css | 7 +++++++ frontend/js/app.js | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) 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'); }