feat: v1.4.0 - 典型方案采纳、推荐方案列表、审计字段、导航优化
- 添加典型方案采纳功能 (POST /api/plans/<id>/adopt) - 添加推荐方案列表 (GET /api/students/<id>/recommended-plans) - PracticePlan 新增 created_by/updated_by/updated_at 审计字段 - 方案编辑/详情页导航优化 (bfcache 处理、pageshow 事件) - 方案列表支持删除功能 - 学员列表'暂无方案/问题'样式统一 - 更新文档:问题文件已废弃(迁移到数据库) - 更新部署脚本和验证清单
This commit is contained in:
@@ -65,6 +65,7 @@ async function loadPlanForEdit() {
|
||||
try {
|
||||
const resp = await fetch(`/api/plans/${planId}`);
|
||||
const data = await resp.json();
|
||||
window.currentStudentId = data.student_id;
|
||||
const content = typeof data.content === 'string' ? JSON.parse(data.content) : data.content;
|
||||
|
||||
document.getElementById('editAiReport').value = content.ai_report || '';
|
||||
@@ -147,18 +148,17 @@ async function savePlanContent() {
|
||||
if (!confirm('确定要保存修改吗?')) return;
|
||||
|
||||
try {
|
||||
const resp = await fetch(`/api/plans/${planId}`, {
|
||||
const resp = await fetch(`/api/plans/${planId}/content`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
ai_report: currentAiReport,
|
||||
daily_schedule: tableData
|
||||
content: JSON.stringify({ ai_report: currentAiReport, daily_schedule: tableData })
|
||||
})
|
||||
});
|
||||
|
||||
if (resp.ok) {
|
||||
alert('保存成功');
|
||||
window.location.href = `/plan/${planId}`;
|
||||
// 保存后返回上一页(编辑页的上一页是方案详情,已从bfcache恢复)
|
||||
history.back();
|
||||
} else {
|
||||
alert('保存失败');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user