From 6886d903feaf8d5368121739d25511708914c5f8 Mon Sep 17 00:00:00 2001 From: xiamuceer Date: Sat, 20 Dec 2025 15:35:55 +0800 Subject: [PATCH] =?UTF-8?q?update:1.=E4=BF=AE=E5=A4=8D1-n=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E7=82=B9=E5=87=BB=E4=BF=9D=E5=AD=98=E7=AB=A0?= =?UTF-8?q?=E8=8A=82=E5=86=85=E5=AE=B9=E5=AF=BC=E8=87=B4=E7=AB=A0=E8=8A=82?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=A4=A7=E7=BA=B2999=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=202.=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E5=A4=B4=E9=83=A8=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?UI=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++-- backend/app/api/chapters.py | 31 +++++++++++++++++++++++++++++- frontend/src/pages/ProjectList.tsx | 24 +++++++++++------------ frontend/src/pages/Sponsor.tsx | 10 +++++----- 4 files changed, 51 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 0de1a30..2cf464a 100644 --- a/README.md +++ b/README.md @@ -80,8 +80,10 @@ ### 📝 规划中功能 -- [ ] **职业等级体系** - 小说世界观中的职业和等级系统 -- [ ] **角色/组织卡片导入导出** - 单独导出角色和组织数据 +- [ ] **职业等级体系** - 自定义职业和等级系统,支持修仙境界、魔法等级等多种体系 +- [ ] **角色/组织卡片导入导出** - 单独导出角色和组织卡片,支持跨项目数据共享 +- [ ] **伏笔管理** - 智能追踪剧情伏笔,提醒未回收线索,可视化伏笔时间线 +- [ ] **提示词工坊** - 社区驱动的 Prompt 模板分享平台,一键导入优质提示词 > 💡 欢迎提交 Issue 或 Pull Request! diff --git a/backend/app/api/chapters.py b/backend/app/api/chapters.py index bd9d72e..9b2110e 100644 --- a/backend/app/api/chapters.py +++ b/backend/app/api/chapters.py @@ -356,7 +356,36 @@ async def update_chapter( await db.commit() await db.refresh(chapter) - return chapter + + chapter_dict = { + "id": chapter.id, + "project_id": chapter.project_id, + "chapter_number": chapter.chapter_number, + "title": chapter.title, + "content": chapter.content, + "summary": chapter.summary, + "word_count": chapter.word_count, + "status": chapter.status, + "outline_id": chapter.outline_id, + "sub_index": chapter.sub_index, + "expansion_plan": chapter.expansion_plan, + "created_at": chapter.created_at, + "updated_at": chapter.updated_at, + "outline_title": None, + "outline_order": None + } + + # 如果章节关联了大纲,查询大纲信息 + if chapter.outline_id: + outline_result = await db.execute( + select(Outline).where(Outline.id == chapter.outline_id) + ) + outline = outline_result.scalar_one_or_none() + if outline: + chapter_dict["outline_title"] = outline.title + chapter_dict["outline_order"] = outline.order_index + + return chapter_dict @router.delete("/{chapter_id}", summary="删除章节") diff --git a/frontend/src/pages/ProjectList.tsx b/frontend/src/pages/ProjectList.tsx index 1180510..f46db36 100644 --- a/frontend/src/pages/ProjectList.tsx +++ b/frontend/src/pages/ProjectList.tsx @@ -718,15 +718,15 @@ export default function ProjectList() { border: '1px solid rgba(255, 255, 255, 0.3)', backdropFilter: 'blur(10px)', boxShadow: '0 4px 16px rgba(0, 0, 0, 0.08)', - padding: isMobile ? '8px 4px' : '24px' + padding: isMobile ? '8px 4px' : '12px' }} - styles={{ body: { padding: isMobile ? '4px' : '24px' } }} + styles={{ body: { padding: isMobile ? '4px' : '12px' } }} > - 📚 - {!isMobile && 总项目数} + 📚 + {!isMobile && 总项目数} {isMobile &&
项目
} } @@ -750,15 +750,15 @@ export default function ProjectList() { border: '1px solid rgba(255, 255, 255, 0.3)', backdropFilter: 'blur(10px)', boxShadow: '0 4px 16px rgba(0, 0, 0, 0.08)', - padding: isMobile ? '8px 4px' : '24px' + padding: isMobile ? '8px 4px' : '12px' }} - styles={{ body: { padding: isMobile ? '4px' : '24px' } }} + styles={{ body: { padding: isMobile ? '4px' : '12px' } }} > - ✍️ - {!isMobile && 创作中} + ✍️ + {!isMobile && 创作中} {isMobile &&
创作
} } @@ -782,15 +782,15 @@ export default function ProjectList() { border: '1px solid rgba(255, 255, 255, 0.3)', backdropFilter: 'blur(10px)', boxShadow: '0 4px 16px rgba(0, 0, 0, 0.08)', - padding: isMobile ? '8px 4px' : '24px' + padding: isMobile ? '8px 4px' : '12px' }} - styles={{ body: { padding: isMobile ? '4px' : '24px' } }} + styles={{ body: { padding: isMobile ? '4px' : '12px' } }} > - 📝 - {!isMobile && 总字数} + 📝 + {!isMobile && 总字数} {isMobile &&
字数
} } diff --git a/frontend/src/pages/Sponsor.tsx b/frontend/src/pages/Sponsor.tsx index d3a6cdb..a1025a0 100644 --- a/frontend/src/pages/Sponsor.tsx +++ b/frontend/src/pages/Sponsor.tsx @@ -19,11 +19,11 @@ interface SponsorOption { } const sponsorOptions: SponsorOption[] = [ - { amount: 5, label: '入门支持', image: '/5.png', description: '¥5' }, - { amount: 10, label: '进阶支持', image: '/10.png', description: '¥10' }, - { amount: 20, label: '标准支持', image: '/20.png', description: '¥20' }, - { amount: 50, label: '高级支持', image: '/50.png', description: '¥50' }, - { amount: 'custom', label: '任意金额', image: '/xx.png', description: '自定义' }, + { amount: 5, label: '🌶️ 一包辣条', image: '/5.png', description: '¥5' }, + { amount: 10, label: '🍱 一顿拼好饭', image: '/10.png', description: '¥10' }, + { amount: 20, label: '🧋 一杯奶茶', image: '/20.png', description: '¥20' }, + { amount: 50, label: '🍖 一次烧烤', image: '/50.png', description: '¥50' }, + { amount: 'custom', label: '💰 任意金额', image: '/xx.png', description: '自定义' }, ]; const benefits = [