add
This commit is contained in:
parent
b50e1521f6
commit
dc24523bf8
|
@ -1,5 +1,6 @@
|
||||||
import { Card, Rate, Tag, Typography, Button } from "antd";
|
import { Card, Rate, Tag, Typography, Button } from "antd";
|
||||||
import {
|
import {
|
||||||
|
EyeOutlined,
|
||||||
PlayCircleOutlined,
|
PlayCircleOutlined,
|
||||||
TeamOutlined,
|
TeamOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
|
@ -13,7 +14,7 @@ export default function PathCard({ path }: pathCardProps) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const handleClick = (path: PostDto) => {
|
const handleClick = (path: PostDto) => {
|
||||||
navigate(`/path/editor/${path.id}`);
|
navigate(`/path/editor/${path.id}`);
|
||||||
window.scrollTo({ top: 0, behavior: "smooth", })
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
|
@ -34,6 +35,7 @@ export default function PathCard({ path }: pathCardProps) {
|
||||||
</div>
|
</div>
|
||||||
}>
|
}>
|
||||||
<div className="px-4">
|
<div className="px-4">
|
||||||
|
{path?.terms && path?.terms?.length > 0 ? (
|
||||||
<div className="flex gap-2 mb-4">
|
<div className="flex gap-2 mb-4">
|
||||||
{path?.terms?.map((term) => {
|
{path?.terms?.map((term) => {
|
||||||
return (
|
return (
|
||||||
|
@ -55,6 +57,15 @@ export default function PathCard({ path }: pathCardProps) {
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="flex gap-2 mb-4">
|
||||||
|
<Tag
|
||||||
|
color={"orange"}
|
||||||
|
className="px-3 py-1 rounded-full bg-blue-100 text-blue-600 border-0">
|
||||||
|
{"未设置分类"}
|
||||||
|
</Tag>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<Title
|
<Title
|
||||||
level={4}
|
level={4}
|
||||||
|
@ -63,8 +74,10 @@ export default function PathCard({ path }: pathCardProps) {
|
||||||
</Title>
|
</Title>
|
||||||
|
|
||||||
<div className="flex items-center mb-4 p-2 rounded-lg transition-all duration-300 hover:bg-blue-50 group">
|
<div className="flex items-center mb-4 p-2 rounded-lg transition-all duration-300 hover:bg-blue-50 group">
|
||||||
|
{
|
||||||
|
<div className=" gap-1 flex items-center flex-grow">
|
||||||
<TeamOutlined className="text-blue-500 text-lg transform group-hover:scale-110 transition-transform duration-300" />
|
<TeamOutlined className="text-blue-500 text-lg transform group-hover:scale-110 transition-transform duration-300" />
|
||||||
<div className="ml-2 flex items-center flex-grow">
|
{path?.depts && path?.depts?.length > 0 ? (
|
||||||
<Text className="font-medium text-blue-500 hover:text-blue-600 transition-colors duration-300 truncate max-w-[120px]">
|
<Text className="font-medium text-blue-500 hover:text-blue-600 transition-colors duration-300 truncate max-w-[120px]">
|
||||||
{path?.depts?.length > 1
|
{path?.depts?.length > 1
|
||||||
? `${path.depts[0].name}等`
|
? `${path.depts[0].name}等`
|
||||||
|
@ -72,11 +85,18 @@ export default function PathCard({ path }: pathCardProps) {
|
||||||
{/* {path?.depts?.map((dept) => {return dept.name.length > 1 ?`${dept.name.slice}等`: dept.name})} */}
|
{/* {path?.depts?.map((dept) => {return dept.name.length > 1 ?`${dept.name.slice}等`: dept.name})} */}
|
||||||
{/* {path?.depts?.map((dept)=>{return dept.name})} */}
|
{/* {path?.depts?.map((dept)=>{return dept.name})} */}
|
||||||
</Text>
|
</Text>
|
||||||
|
) : (
|
||||||
|
<Text className="font-medium text-blue-500 hover:text-blue-600 transition-colors duration-300 truncate max-w-[120px]">
|
||||||
|
未设置单位
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<span className="text-xs font-medium text-gray-500">
|
}
|
||||||
|
<span className="flex text-xs font-medium text-gray-500">
|
||||||
|
<EyeOutlined className="mr-2"></EyeOutlined>
|
||||||
{path?.meta?.views
|
{path?.meta?.views
|
||||||
? `观看次数 ${path?.meta?.views}`
|
? `观看次数 ${path?.meta?.views}`
|
||||||
: null}
|
: 0}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="pt-4 border-t border-gray-100 text-center">
|
<div className="pt-4 border-t border-gray-100 text-center">
|
||||||
|
|
Loading…
Reference in New Issue