FEAT => 本次更新项目为:

素材列表、编辑、新增全部完成
This commit is contained in:
超级老白兔
2025-07-29 16:38:48 +08:00
parent d1d8391e1d
commit 1c1062b235
4 changed files with 49 additions and 28 deletions

View File

@@ -141,6 +141,7 @@ const MaterialForm: React.FC = () => {
sendTime: sendTime || "",
resUrls,
urls: finalUrls,
type: contentType,
};
if (isEdit) {
@@ -184,7 +185,30 @@ const MaterialForm: React.FC = () => {
}
return (
<Layout header={<NavCommon title={isEdit ? "编辑素材" : "新建素材"} />}>
<Layout
header={<NavCommon title={isEdit ? "编辑素材" : "新建素材"} />}
footer={
<div className={style["form-actions"]}>
<Button
fill="outline"
onClick={handleBack}
className={style["back-btn"]}
>
<ArrowLeftOutlined />
</Button>
<Button
color="primary"
onClick={handleSubmit}
loading={saving}
className={style["submit-btn"]}
>
<SaveOutlined />
{isEdit ? " 保存修改" : " 保存素材"}
</Button>
</div>
}
>
<div className={style["form-page"]}>
<div className={style["form"]}>
{/* 基础信息 */}
@@ -370,27 +394,6 @@ const MaterialForm: React.FC = () => {
/>
</div>
</Card>
{/* 操作按钮 */}
<div className={style["form-actions"]}>
<Button
fill="outline"
onClick={handleBack}
className={style["back-btn"]}
>
<ArrowLeftOutlined />
</Button>
<Button
color="primary"
onClick={handleSubmit}
loading={saving}
className={style["submit-btn"]}
>
<SaveOutlined />
{isEdit ? "保存修改" : "保存素材"}
</Button>
</div>
</div>
</div>
</Layout>

View File

@@ -28,7 +28,7 @@ export function updateContentItem(params: UpdateContentItemParams) {
// 删除素材
export function deleteContentItem(id: string) {
return request("/v1/content/item/delete", { id }, "DELETE");
return request("/v1/content/library/delete-item", { id }, "DELETE");
}
// 获取内容库详情

View File

@@ -393,13 +393,25 @@
}
}
// 4张及以上:网格布局
// 4张图片2x2网格布局
&.quad {
grid-template-columns: repeat(2, 1fr);
img {
width: 100%;
height: 140px;
object-fit: cover;
border-radius: 8px;
}
}
// 5张及以上网格布局
&.grid {
grid-template-columns: repeat(3, 1fr);
img {
width: 100%;
height: 80px;
height: 100px;
object-fit: cover;
border-radius: 8px;
}
@@ -413,7 +425,7 @@
color: #666;
font-size: 12px;
font-weight: 500;
height: 80px;
height: 100px;
}
}
}

View File

@@ -157,7 +157,9 @@ const MaterialsList: React.FC = () => {
? style.double
: resUrls.length === 3
? style.triple
: style.grid
: resUrls.length === 4
? style.quad
: style.grid
}`}
>
{resUrls.slice(0, 9).map((url, index) => (
@@ -364,7 +366,11 @@ const MaterialsList: React.FC = () => {
{renderContentTypeTag(material.contentType)}
</div>
{/* 标题 */}
<div className={style["card-title"]}>{material.content}</div>
{material.contentType != 4 && (
<div className={style["card-title"]}>
{material.content}
</div>
)}
{/* 内容预览 */}
{renderContentPreview(material)}