From 56f8c477c2380ae528a569343ecaea4cb2b52c76 Mon Sep 17 00:00:00 2001 From: zhxiao1124 Date: Wed, 1 Jul 2026 16:04:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E7=9F=AD=E5=89=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E7=9A=84=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E4=B8=8E=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 扩展了Drama类型定义,新增简介、标签、地区等字段,重构创建短剧弹窗表单,使用更友好的选择器与布局优化用户填写体验,移除冗余的默认status参数拼接 --- src/Drama/index.tsx | 103 ++++++++++++++++++++++++++++++++++++++++---- src/api/types.ts | 6 +++ 2 files changed, 100 insertions(+), 9 deletions(-) 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; };