优化显示

This commit is contained in:
2026-01-13 10:11:49 +00:00
parent 1a9286c153
commit 5fe8b035f7
3 changed files with 35 additions and 2 deletions

View File

@@ -266,6 +266,8 @@ body {
color: #718096;
line-height: 1.6;
margin-bottom: 15px;
white-space: pre-wrap; /* 保留换行和空格 */
word-wrap: break-word; /* 长单词自动换行 */
}
.task-description.polished {

View File

@@ -384,11 +384,38 @@ class WorkListApp {
}
// 使用润色版本
usePolishedDescription() {
async usePolishedDescription() {
const polishedText = document.querySelector('.polished-text').textContent;
document.getElementById('taskDescription').value = polishedText;
document.getElementById('polishedDescription').style.display = 'none';
this.showNotification('已使用润色版本', 'success');
// 如果是编辑模式,立即保存更新,将润色版本替换原始描述
if (this.currentEditingTask) {
try {
this.showLoading();
// 更新任务description = 润色版本, polished_description = null
await api.updateTask(this.currentEditingTask.id, {
description: polishedText,
polished_description: null // 清空润色字段
});
// 关闭模态框
this.hideModal(document.getElementById('taskModal'));
// 刷新任务列表
await this.loadTasks();
this.showNotification('已应用润色版本', 'success');
} catch (error) {
console.error('应用润色版本失败:', error);
this.showNotification(error.message || '应用润色版本失败', 'error');
} finally {
this.hideLoading();
}
} else {
this.showNotification('已使用润色版本', 'success');
}
}
// 丢弃润色版本