update:1.修复1-n模式下点击保存章节内容导致章节对应大纲999的问题 2.优化项目主页头部统计数据UI样式

This commit is contained in:
xiamuceer
2025-12-20 15:35:55 +08:00
parent ca6165cb64
commit 6886d903fe
4 changed files with 51 additions and 20 deletions
+4 -2
View File
@@ -80,8 +80,10 @@
### 📝 规划中功能 ### 📝 规划中功能
- [ ] **职业等级体系** - 小说世界观中的职业和等级系统 - [ ] **职业等级体系** - 自定义职业和等级系统,支持修仙境界、魔法等级等多种体系
- [ ] **角色/组织卡片导入导出** - 单独导出角色和组织数据 - [ ] **角色/组织卡片导入导出** - 单独导出角色和组织卡片,支持跨项目数据共享
- [ ] **伏笔管理** - 智能追踪剧情伏笔,提醒未回收线索,可视化伏笔时间线
- [ ] **提示词工坊** - 社区驱动的 Prompt 模板分享平台,一键导入优质提示词
> 💡 欢迎提交 Issue 或 Pull Request > 💡 欢迎提交 Issue 或 Pull Request
+30 -1
View File
@@ -356,7 +356,36 @@ async def update_chapter(
await db.commit() await db.commit()
await db.refresh(chapter) 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="删除章节") @router.delete("/{chapter_id}", summary="删除章节")
+12 -12
View File
@@ -718,15 +718,15 @@ export default function ProjectList() {
border: '1px solid rgba(255, 255, 255, 0.3)', border: '1px solid rgba(255, 255, 255, 0.3)',
backdropFilter: 'blur(10px)', backdropFilter: 'blur(10px)',
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.08)', 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' } }}
> >
<Statistic <Statistic
title={ title={
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: isMobile ? 4 : 8 }}> <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: isMobile ? 4 : 8 }}>
<span style={{ fontSize: isMobile ? 16 : 14, color: 'rgba(255,255,255,0.9)', marginRight: isMobile ? 0 : 8 }}>📚</span> <span style={{ fontSize: isMobile ? 16 : 24, color: 'rgba(255,255,255,0.9)', marginRight: isMobile ? 0 : 8 }}>📚</span>
{!isMobile && <span style={{ color: 'rgba(255,255,255,0.8)' }}></span>} {!isMobile && <span style={{ color: 'rgba(255,255,255,0.8)', fontSize: 16 }}></span>}
{isMobile && <div style={{ fontSize: 11, color: 'rgba(255,255,255,0.8)', marginTop: 2 }}></div>} {isMobile && <div style={{ fontSize: 11, color: 'rgba(255,255,255,0.8)', marginTop: 2 }}></div>}
</div> </div>
} }
@@ -750,15 +750,15 @@ export default function ProjectList() {
border: '1px solid rgba(255, 255, 255, 0.3)', border: '1px solid rgba(255, 255, 255, 0.3)',
backdropFilter: 'blur(10px)', backdropFilter: 'blur(10px)',
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.08)', 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' } }}
> >
<Statistic <Statistic
title={ title={
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: isMobile ? 4 : 8 }}> <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: isMobile ? 4 : 8 }}>
<span style={{ fontSize: isMobile ? 16 : 14, color: 'rgba(255,255,255,0.9)', marginRight: isMobile ? 0 : 8 }}></span> <span style={{ fontSize: isMobile ? 16 : 24, color: 'rgba(255,255,255,0.9)', marginRight: isMobile ? 0 : 8 }}></span>
{!isMobile && <span style={{ color: 'rgba(255,255,255,0.8)' }}></span>} {!isMobile && <span style={{ color: 'rgba(255,255,255,0.8)', fontSize: 16 }}></span>}
{isMobile && <div style={{ fontSize: 11, color: 'rgba(255,255,255,0.8)', marginTop: 2 }}></div>} {isMobile && <div style={{ fontSize: 11, color: 'rgba(255,255,255,0.8)', marginTop: 2 }}></div>}
</div> </div>
} }
@@ -782,15 +782,15 @@ export default function ProjectList() {
border: '1px solid rgba(255, 255, 255, 0.3)', border: '1px solid rgba(255, 255, 255, 0.3)',
backdropFilter: 'blur(10px)', backdropFilter: 'blur(10px)',
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.08)', 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' } }}
> >
<Statistic <Statistic
title={ title={
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: isMobile ? 4 : 8 }}> <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: isMobile ? 4 : 8 }}>
<span style={{ fontSize: isMobile ? 16 : 14, color: 'rgba(255,255,255,0.9)', marginRight: isMobile ? 0 : 8 }}>📝</span> <span style={{ fontSize: isMobile ? 16 : 24, color: 'rgba(255,255,255,0.9)', marginRight: isMobile ? 0 : 8 }}>📝</span>
{!isMobile && <span style={{ color: 'rgba(255,255,255,0.8)' }}></span>} {!isMobile && <span style={{ color: 'rgba(255,255,255,0.8)', fontSize: 16 }}></span>}
{isMobile && <div style={{ fontSize: 11, color: 'rgba(255,255,255,0.8)', marginTop: 2 }}></div>} {isMobile && <div style={{ fontSize: 11, color: 'rgba(255,255,255,0.8)', marginTop: 2 }}></div>}
</div> </div>
} }
+5 -5
View File
@@ -19,11 +19,11 @@ interface SponsorOption {
} }
const sponsorOptions: SponsorOption[] = [ const sponsorOptions: SponsorOption[] = [
{ amount: 5, label: '入门支持', image: '/5.png', description: '¥5' }, { amount: 5, label: '🌶️ 一包辣条', image: '/5.png', description: '¥5' },
{ amount: 10, label: '进阶支持', image: '/10.png', description: '¥10' }, { amount: 10, label: '🍱 一顿拼好饭', image: '/10.png', description: '¥10' },
{ amount: 20, label: '标准支持', image: '/20.png', description: '¥20' }, { amount: 20, label: '🧋 一杯奶茶', image: '/20.png', description: '¥20' },
{ amount: 50, label: '高级支持', image: '/50.png', description: '¥50' }, { amount: 50, label: '🍖 一次烧烤', image: '/50.png', description: '¥50' },
{ amount: 'custom', label: '任意金额', image: '/xx.png', description: '自定义' }, { amount: 'custom', label: '💰 任意金额', image: '/xx.png', description: '自定义' },
]; ];
const benefits = [ const benefits = [