style: 移除多余的rounded-xl样式并整理代码格式
1. 移除多个组件冗余的rounded-xl类名,统一圆角样式配置 2. 调整Dashboard页面代码缩进与引号风格为统一的双引号格式 3. 简化DramaDetail页面布局结构,重构详情展示区域 4. 清理index.css中多余的descriptions自定义样式 5. 更新gitignore忽略.trae和.mimocode目录
This commit is contained in:
@@ -38,11 +38,7 @@ export function DramaDetail({ dramaId }: DramaDetailPageProps) {
|
||||
const loadDetail = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const [dramaData, episodeList, channelPage] = await Promise.all([
|
||||
dramaApi.getDrama(dramaId),
|
||||
dramaApi.getDramaEpisodes(dramaId),
|
||||
channelApi.listChannels({ page: 1, pageSize: 100 }).catch(() => ({ list: [] })),
|
||||
]);
|
||||
const [dramaData, episodeList, channelPage] = await Promise.all([dramaApi.getDrama(dramaId), dramaApi.getDramaEpisodes(dramaId), channelApi.listChannels({ page: 1, pageSize: 100 }).catch(() => ({ list: [] }))]);
|
||||
setDrama(dramaData);
|
||||
setEpisodeCount(dramaData.totalEpisodes || 1);
|
||||
setEpisodes(episodeList);
|
||||
@@ -115,70 +111,75 @@ export function DramaDetail({ dramaId }: DramaDetailPageProps) {
|
||||
|
||||
return (
|
||||
<div className="page-stack">
|
||||
<Panel
|
||||
title={
|
||||
<Space>
|
||||
{/* 导航栏 */}
|
||||
<nav className="w-full box-border bg-[#fff] p-4">
|
||||
<div className="w-full flex justify-between items-center font-bold text-[1rem]">
|
||||
<Space size={12}>
|
||||
<Button icon={<IconArrowLeft />} onClick={() => navigate("/dramas")} />
|
||||
短剧详情
|
||||
<span>短剧详情</span>
|
||||
</Space>
|
||||
}
|
||||
extra={
|
||||
<Space>
|
||||
<Button icon={<IconRefresh />} onClick={loadDetail}>
|
||||
刷新
|
||||
</Button>
|
||||
<Button disabled={!drama} onClick={() => setEditVisible(true)}>
|
||||
编辑短剧
|
||||
</Button>
|
||||
<Button onClick={() => updateDramaStatus("draft")}>设为草稿</Button>
|
||||
<Button type="primary" onClick={() => updateDramaStatus("published")}>
|
||||
上架短剧
|
||||
</Button>
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
{loading && !drama ? (
|
||||
<div className="py-12 text-center text-muted">加载中...</div>
|
||||
) : drama ? (
|
||||
<Descriptions
|
||||
column={3}
|
||||
data={[
|
||||
{ label: "短剧ID", value: drama.id },
|
||||
{ label: "名称", value: drama.title },
|
||||
{ label: "频道", value: drama.channelName || "-" },
|
||||
{ label: "地区", value: drama.region || "-" },
|
||||
{ label: "类型", value: drama.type },
|
||||
{ label: "总集数", value: drama.totalEpisodes || 0 },
|
||||
{ label: "已发布集数", value: drama.publishedEpisodes || 0 },
|
||||
{ label: "状态", value: PUBLISH_STATUS_LABEL[drama.status] || drama.status },
|
||||
{ label: "封面", value: drama.coverUrl },
|
||||
{ label: "简介", value: drama.description || "-" },
|
||||
]}
|
||||
/>
|
||||
) : null}
|
||||
</Panel>
|
||||
<Button icon={<IconRefresh />} onClick={loadDetail}>
|
||||
刷新
|
||||
</Button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<Panel
|
||||
title="剧集配置"
|
||||
extra={
|
||||
<Space>
|
||||
<InputNumber min={1} max={500} value={episodeCount} onChange={(value) => setEpisodeCount(Number(value) || 1)} />
|
||||
<Button type="primary" onClick={configureEpisodes}>
|
||||
保存集数
|
||||
</Button>
|
||||
</Space>
|
||||
}
|
||||
noPadding
|
||||
>
|
||||
<EpisodeTable
|
||||
episodes={episodes}
|
||||
loading={loading}
|
||||
uploadingEpisodeId={uploadingEpisodeId}
|
||||
onUploadVideo={uploadEpisodeVideo}
|
||||
onPublishEpisode={publishEpisode}
|
||||
onUpdateEpisode={updateEpisode}
|
||||
/>
|
||||
</Panel>
|
||||
{/* 内容区域 */}
|
||||
<div className="grid grid-cols-1 gap-5 xl:grid-cols-[360px_minmax(0,1fr)]">
|
||||
<Panel>
|
||||
{loading && !drama ? (
|
||||
<div className="py-12 text-center text-muted">加载中...</div>
|
||||
) : drama ? (
|
||||
<div className="flex flex-col gap-4">
|
||||
<Space wrap>
|
||||
<Button disabled={!drama} onClick={() => setEditVisible(true)}>
|
||||
编辑短剧
|
||||
</Button>
|
||||
<Button onClick={() => updateDramaStatus("draft")}>设为草稿</Button>
|
||||
<Button type="primary" onClick={() => updateDramaStatus("published")}>
|
||||
上架短剧
|
||||
</Button>
|
||||
</Space>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<img src={drama.coverUrl} alt={drama.title} className="w-full h-[13rem] object-cover" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Descriptions
|
||||
column={1}
|
||||
data={[
|
||||
{ label: "短剧ID", value: drama.id },
|
||||
{ label: "名称", value: drama.title },
|
||||
{ label: "频道", value: drama.channelName || "-" },
|
||||
{ label: "地区", value: drama.region || "-" },
|
||||
{ label: "类型", value: drama.type || "-" },
|
||||
{ label: "总集数", value: drama.totalEpisodes || 0 },
|
||||
{ label: "已发布集数", value: drama.publishedEpisodes || 0 },
|
||||
{ label: "状态", value: PUBLISH_STATUS_LABEL[drama.status] || drama.status },
|
||||
{ label: "简介", value: drama.description || "-" },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
</Panel>
|
||||
|
||||
<Panel
|
||||
title="剧集配置"
|
||||
extra={
|
||||
<Space>
|
||||
<InputNumber min={1} max={500} value={episodeCount} onChange={(value) => setEpisodeCount(Number(value) || 1)} />
|
||||
<Button type="primary" onClick={configureEpisodes}>
|
||||
保存集数
|
||||
</Button>
|
||||
</Space>
|
||||
}
|
||||
noPadding
|
||||
>
|
||||
<EpisodeTable episodes={episodes} loading={loading} uploadingEpisodeId={uploadingEpisodeId} onUploadVideo={uploadEpisodeVideo} onPublishEpisode={publishEpisode} onUpdateEpisode={updateEpisode} />
|
||||
</Panel>
|
||||
</div>
|
||||
|
||||
{drama && (
|
||||
<Modal title="编辑短剧" visible={editVisible} onCancel={() => setEditVisible(false)} footer={null} style={{ width: "45rem" }}>
|
||||
|
||||
Reference in New Issue
Block a user