fix:修复提示词工坊相关功能 5
This commit is contained in:
@@ -13,8 +13,6 @@ import {
|
||||
Typography,
|
||||
Row,
|
||||
Col,
|
||||
Tabs,
|
||||
Badge,
|
||||
} from 'antd';
|
||||
import {
|
||||
PlusOutlined,
|
||||
@@ -22,12 +20,10 @@ import {
|
||||
DeleteOutlined,
|
||||
StarOutlined,
|
||||
StarFilled,
|
||||
CloudOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { useStore } from '../store';
|
||||
import { writingStyleApi } from '../services/api';
|
||||
import type { WritingStyle, WritingStyleCreate, WritingStyleUpdate } from '../types';
|
||||
import PromptWorkshop from '../components/PromptWorkshop';
|
||||
|
||||
const { TextArea } = Input;
|
||||
const { Text, Paragraph } = Typography;
|
||||
@@ -168,14 +164,24 @@ export default function WritingStyles() {
|
||||
return styleType === 'preset' ? '预设' : '自定义';
|
||||
};
|
||||
|
||||
// 渲染本地风格列表
|
||||
const renderLocalStyles = () => (
|
||||
<div>
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
|
||||
<div style={{
|
||||
marginBottom: 16,
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
zIndex: 10,
|
||||
backgroundColor: '#fff',
|
||||
padding: isMobile ? '12px 0' : '16px 0',
|
||||
marginBottom: isMobile ? 12 : 16,
|
||||
borderBottom: '1px solid #f0f0f0',
|
||||
display: 'flex',
|
||||
justifyContent: 'flex-end',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
}}>
|
||||
<h2 style={{ margin: 0, fontSize: isMobile ? 18 : 24 }}>
|
||||
<EditOutlined style={{ marginRight: 8 }} />
|
||||
写作风格管理
|
||||
</h2>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
@@ -184,7 +190,7 @@ export default function WritingStyles() {
|
||||
创建自定义风格
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
|
||||
<div style={{ flex: 1, overflowY: 'auto' }}>
|
||||
{styles.length === 0 ? (
|
||||
<Empty description="暂无风格数据" />
|
||||
@@ -303,54 +309,6 @@ export default function WritingStyles() {
|
||||
</Row>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
|
||||
<div style={{
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
zIndex: 10,
|
||||
backgroundColor: '#fff',
|
||||
padding: isMobile ? '12px 0' : '16px 0',
|
||||
marginBottom: isMobile ? 12 : 16,
|
||||
borderBottom: '1px solid #f0f0f0',
|
||||
}}>
|
||||
<h2 style={{ margin: 0, fontSize: isMobile ? 18 : 24 }}>
|
||||
<EditOutlined style={{ marginRight: 8 }} />
|
||||
写作风格管理
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<Tabs
|
||||
defaultActiveKey="local"
|
||||
style={{ flex: 1 }}
|
||||
items={[
|
||||
{
|
||||
key: 'local',
|
||||
label: (
|
||||
<span>
|
||||
<EditOutlined />
|
||||
我的风格
|
||||
</span>
|
||||
),
|
||||
children: renderLocalStyles(),
|
||||
},
|
||||
{
|
||||
key: 'workshop',
|
||||
label: (
|
||||
<Badge dot>
|
||||
<span>
|
||||
<CloudOutlined />
|
||||
提示词工坊
|
||||
</span>
|
||||
</Badge>
|
||||
),
|
||||
children: <PromptWorkshop onImportSuccess={loadStyles} />,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
{/* 创建自定义风格 Modal */}
|
||||
<Modal
|
||||
|
||||
Reference in New Issue
Block a user