This commit is contained in:
ditiqi 2025-03-02 21:04:25 +08:00
commit 49e34eeeaa
3 changed files with 57 additions and 47 deletions

View File

@ -82,54 +82,57 @@ export default function ResourcesShower({
</Image.PreviewGroup>
</Row>
)}
<div className=" text-sm px-2">:</div>
{fileResources.length > 0 && (
<div className="rounded-xl p-1 border border-gray-100 bg-white">
<div className="flex flex-nowrap overflow-x-auto scrollbar-hide gap-1.5">
{fileResources.map((resource) => {
return (
<a
key={resource.url}
className="flex-shrink-0 relative active:scale-95 transition-transform select-none "
href={resource.originalUrl}
target="_blank"
download={true}
title="点击下载文件">
{/* 超紧凑卡片容器 */}
<div className="w-[120px] h-[80px] p-2 flex flex-col items-center justify-between rounded-xl hover:bg-primary-50/40 cursor-pointer">
{/* 微型文件图标 */}
<div className="text-primary-600 text-base">
{getFileIcon(resource.url)}
</div>
{/* 压缩信息展示 */}
<div className="w-full text-center space-y-0.5">
<p className="text-xs font-medium text-gray-800 truncate">
{resource.title?.slice(0, 12) ||
"未命名"}
</p>
<div className="flex items-center justify-between text-xs text-gray-500 ">
<span className="bg-gray-100 px-0.5 rounded-sm mr-2 whitespace-pre-wrap">
{resource.url
.split(".")
.pop()
?.slice(0, 4)
.toUpperCase()}
</span>
<span className="flex bg-gray-100 px-0.5 rounded-sm justify-items-center whitespace-pre-wrap">
{resource.meta.size &&
formatFileSize(
resource.meta.size
)}
</span>
{fileResources.length > 0 && (
<>
<div className=" text-sm px-2">:</div>
<div className="rounded-xl p-1 border border-gray-100 bg-white">
<div className="flex flex-nowrap overflow-x-auto scrollbar-hide gap-1.5">
{fileResources.map((resource) => {
return (
<a
key={resource.url}
className="flex-shrink-0 relative active:scale-95 transition-transform select-none "
href={resource.originalUrl}
target="_blank"
download={true}
title="点击下载文件">
{/* 超紧凑卡片容器 */}
<div className="w-[120px] h-[80px] p-2 flex flex-col items-center justify-between rounded-xl hover:bg-primary-50/40 cursor-pointer">
{/* 微型文件图标 */}
<div className="text-primary-600 text-base">
{getFileIcon(resource.url)}
</div>
{/* 压缩信息展示 */}
<div className="w-full text-center space-y-0.5">
<p className="text-xs font-medium text-gray-800 truncate">
{resource.title?.slice(0, 12) ||
"未命名"}
</p>
<div className="flex items-center justify-between text-xs text-gray-500 ">
<span className="bg-gray-100 px-0.5 rounded-sm mr-2 whitespace-pre-wrap">
{resource.url
.split(".")
.pop()
?.slice(0, 4)
.toUpperCase()}
</span>
<span className="flex bg-gray-100 px-0.5 rounded-sm justify-items-center whitespace-pre-wrap">
{resource.meta.size &&
formatFileSize(
resource.meta.size
)}
</span>
</div>
</div>
</div>
</div>
</a>
);
})}
</a>
);
})}
</div>
</div>
</div>
</>
)}
</div>
);

View File

@ -69,12 +69,15 @@ export const CourseDetailDescription: React.FC = () => {
<div className="text-lg font-bold">{"课程简介:"}</div>
<div className="flex flex-col gap-2">
<div className="flex gap-2 flex-wrap items-center float-start">
{post?.subTitle && <div>{post?.subTitle}</div>}
<TermInfo terms={post.terms}></TermInfo>
</div>
<div className="flex gap-2 flex-wrap items-center float-start pl-2">
{post?.subTitle && <div>{post?.subTitle}</div>}
{/* <TermInfo terms={post.terms}></TermInfo> */}
</div>
</div>
<Paragraph
className="text-gray-600"
className="text-gray-600 pl-2"
ellipsis={{
rows: 3,
expandable: true,

View File

@ -202,7 +202,11 @@ export const SortableLecture: React.FC<SortableLectureProps> = ({
message: "请输入内容",
},
]}>
<QuillEditor />
<QuillEditor
style={{
width:"700px",
}}
></QuillEditor>
</Form.Item>
<Form.Item
name={["meta", "fileIds"]}