update:1.小说项目创建支持双模式生成,大纲-章节(一对一&一对多) 2.新增章节管理-编辑章节规划功能 3.修复灵感模式可重复点击选项问题,刷新对话内容丢失问题

This commit is contained in:
xiamuceer
2025-11-27 17:29:23 +08:00
parent 8121c04af9
commit deb6cc37a4
27 changed files with 1797 additions and 216 deletions
+69 -2
View File
@@ -2,10 +2,10 @@ import { useState, useEffect } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import {
Form, Input, InputNumber, Select, Button, Card,
Row, Col, Typography, Space, message
Row, Col, Typography, Space, message, Radio
} from 'antd';
import {
RocketOutlined, ArrowLeftOutlined
RocketOutlined, ArrowLeftOutlined, CheckCircleOutlined
} from '@ant-design/icons';
import { AIProjectGenerator, type GenerationConfig } from '../components/AIProjectGenerator';
import type { WizardBasicInfo } from '../types';
@@ -83,6 +83,7 @@ export default function ProjectWizardNew() {
target_words: values.target_words || 100000,
chapter_count: 3, // 默认生成3章大纲
character_count: values.character_count || 5,
outline_mode: values.outline_mode || 'one-to-many', // 添加大纲模式
};
setGenerationConfig(config);
@@ -120,6 +121,7 @@ export default function ProjectWizardNew() {
narrative_perspective: '第三人称',
character_count: 5,
target_words: 100000,
outline_mode: 'one-to-many', // 默认为细化模式
}}
>
<Form.Item
@@ -181,6 +183,71 @@ export default function ProjectWizardNew() {
</Select>
</Form.Item>
<Form.Item
label="大纲章节模式"
name="outline_mode"
rules={[{ required: true, message: '请选择大纲章节模式' }]}
tooltip="创建后不可更改,请根据创作习惯选择"
>
<Radio.Group size="large">
<Row gutter={16}>
<Col xs={24} sm={12}>
<Card
hoverable
style={{
borderColor: form.getFieldValue('outline_mode') === 'one-to-one' ? '#1890ff' : '#d9d9d9',
borderWidth: 2,
height: '100%',
}}
onClick={() => form.setFieldValue('outline_mode', 'one-to-one')}
>
<Radio value="one-to-one" style={{ width: '100%' }}>
<Space direction="vertical" size={4} style={{ width: '100%' }}>
<div style={{ fontSize: 16, fontWeight: 'bold' }}>
<CheckCircleOutlined style={{ marginRight: 8, color: '#52c41a' }} />
(11)
</div>
<div style={{ fontSize: 12, color: '#666' }}>
</div>
<div style={{ fontSize: 11, color: '#999' }}>
💡
</div>
</Space>
</Radio>
</Card>
</Col>
<Col xs={24} sm={12}>
<Card
hoverable
style={{
borderColor: form.getFieldValue('outline_mode') === 'one-to-many' ? '#1890ff' : '#d9d9d9',
borderWidth: 2,
height: '100%',
}}
onClick={() => form.setFieldValue('outline_mode', 'one-to-many')}
>
<Radio value="one-to-many" style={{ width: '100%' }}>
<Space direction="vertical" size={4} style={{ width: '100%' }}>
<div style={{ fontSize: 16, fontWeight: 'bold' }}>
<CheckCircleOutlined style={{ marginRight: 8, color: '#52c41a' }} />
(1N)
</div>
<div style={{ fontSize: 12, color: '#666' }}>
</div>
<div style={{ fontSize: 11, color: '#999' }}>
💡
</div>
</Space>
</Radio>
</Card>
</Col>
</Row>
</Radio.Group>
</Form.Item>
<Row gutter={16}>
<Col xs={24} sm={12}>
<Form.Item