diff --git a/src/Drama/index.tsx b/src/Drama/index.tsx index 1357bbd..def565b 100644 --- a/src/Drama/index.tsx +++ b/src/Drama/index.tsx @@ -1,10 +1,35 @@ import { useState } from 'react'; -import { Button, Card, Form, Input, Message, Modal, Table, Tag } from '@arco-design/web-react'; +import { + Button, + Card, + Form, + Grid, + Input, + InputNumber, + InputTag, + Message, + Modal, + Select, + Switch, + Table, + Tag, +} from '@arco-design/web-react'; import { IconPlus } from '@arco-design/web-react/icon'; import type { Drama } from '../api/types'; import { api } from '../api/client'; import { usePageData } from '../hooks/usePageData'; +const { Row, Col } = Grid; + +const TYPE_OPTIONS = ['revenge', 'romance', 'action']; + +const STATUS_OPTIONS: { value: string; label: string }[] = [ + { value: 'draft', label: '草稿' }, + { value: 'scheduled', label: '定时发布' }, + { value: 'published', label: '已发布' }, + { value: 'offline', label: '已下线' }, +]; + function DramasPage() { const { data, loading, reload } = usePageData('/api/admin/v1/dramas'); const [visible, setVisible] = useState(false); @@ -13,7 +38,7 @@ function DramasPage() { const createDrama = async (values: Partial) => { setCreating(true); try { - await api.post('/api/admin/v1/dramas', { ...values, status: values.status || 'draft' }); + await api.post('/api/admin/v1/dramas', values); Message.success('短剧创建成功'); setVisible(false); await reload(); @@ -31,13 +56,73 @@ function DramasPage() { { title: '状态', dataIndex: 'status', width: 120, render: (status) => {status} }, { title: '推荐', dataIndex: 'isRecommended', width: 140, render: (value) => value ? : }, ]} /> - setVisible(false)} footer={null}> -
- - - - - + setVisible(false)} footer={null} style={{ width: 640 }}> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
diff --git a/src/api/types.ts b/src/api/types.ts index ce0621d..865878e 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -35,6 +35,12 @@ export type Drama = { status: string; coverUrl: string; isRecommended: boolean; + description?: string; + tags?: string[]; + region?: string; + language?: string; + year?: number; + sortOrder?: number; createdAt: string; };