This commit is contained in:
quantulr
2023-10-30 17:29:35 +08:00
parent 1090ca0dd0
commit 7e465da9d2
49 changed files with 1090 additions and 56 deletions

1
.idea/misc.xml generated
View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />

View File

@ -1,16 +1,9 @@
import { ReactNode } from "react";
import ArticleLayout from "@/app/components/ArticleLayout";
const navLinks = [
{ title: "人才概况", href: "/" },
{ title: "人才概况", href: "/3" },
{ title: "人才概况", href: "/4" },
{ title: "人才概况", href: "/5" },
];
import Breadcrumb from "@/app/components/Breadcrumb";
const Layout = ({
children,
params,
}: {
children: ReactNode;
params: {
@ -19,7 +12,10 @@ const Layout = ({
}) => {
return (
<ArticleLayout leftNavTitle={"新闻详情"} navigations={[]}>
{children}
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={[]} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
</ArticleLayout>
);
};

View File

@ -0,0 +1,21 @@
import { ReactNode } from "react";
import ArticleLayout from "@/app/components/ArticleLayout";
import Breadcrumb from "@/app/components/Breadcrumb";
const Layout = ({ children }: { children: ReactNode }) => {
return (
<ArticleLayout navigations={[]} leftNavTitle={"公告通知"}>
<div className={"flex flex-col h-full"}>
<Breadcrumb
navigations={[
{ title: "首页", href: "/" },
{ title: "公告通知", href: "/announcements/pages/1" },
]}
/>
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
</ArticleLayout>
);
};
export default Layout;

View File

@ -0,0 +1,43 @@
import { listArticles } from "@/app/api/articles";
import { Fragment } from "react";
import styles from "./styles.module.scss";
import Link from "next/link";
import Pagination from "@/app/components/Pagination";
const Page = async ({
params,
}: {
params: {
pageIndex: string;
};
}) => {
const data = await listArticles({
cid: "3",
pageNo: params.pageIndex,
pageSize: 20,
});
return (
<div>
<h2 className={"text-[#0f6fca] text-sm"}></h2>
<ul className={`${styles.articles} mt-5`}>
{data.lists.map((article, index) => (
<li className={`${styles.article}`} key={article.id}>
<Link
className={"flex h-8 text-sm text-[#666666] items-center"}
href={`/announcements/${article.id}`}
>
{article.title}
</Link>
</li>
))}
</ul>
<Pagination
page={parseInt(params.pageIndex)}
total={data.count}
perPage={20}
/>
</div>
);
};
export default Page;

View File

@ -0,0 +1,7 @@
.articles {
.article {
&:not(:last-child) {
border-bottom: 1px dashed #000;
}
}
}

View File

@ -0,0 +1,20 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/func-dep/general-office", title: "职能部门" },
{ href: "/organization/func-dep/asset-finance", title: "资产财务处" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,32 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
</h2>
<p className={"text-base indent-8 mt-8"}>
<ol className={"list-decimal list-inside"}>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li></li>
<li></li>
<li></li>
<li></li>
</ol>
</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,20 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/func-dep/general-office", title: "职能部门" },
{ href: "/organization/func-dep/general-office", title: "综合办公室" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,44 @@
import React from "react";
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
</h2>
<p className={"text-base indent-8 mt-8"}>
<ol className={"list-decimal list-inside"}>
<li>
</li>
<li>
</li>
<li></li>
<li>
</li>
<li>
,
ARP系统
</li>
<li>
</li>
<li></li>
<li></li>
<li></li>
<li>访</li>
<li></li>
<li></li>
</ol>
</p>
<p className={"text-base indent-8 mt-8"}>
</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,20 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/func-dep/general-office", title: "职能部门" },
{ href: "/organization/func-dep/industry", title: "产业处" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,28 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}></h2>
<p className={"text-base indent-8 mt-8"}>
<ol className={"list-decimal list-inside"}>
<li></li>
<li></li>
<li></li>
<li>
</li>
<li></li>
<li>
</li>
<li></li>
<li></li>
<li></li>
<li></li>
</ol>
</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,20 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/func-dep/general-office", title: "职能部门" },
{ href: "/organization/func-dep/personnel", title: "人事处" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,32 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}></h2>
<p className={"text-base indent-8 mt-8"}>
<ol className={"list-decimal list-inside"}>
<li></li>
<li></li>
<li>
()
</li>
<li>
</li>
<li></li>
<li>
访
</li>
<li>
</li>
<li></li>
<li></li>
<li></li>
</ol>
</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,20 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/func-dep/general-office", title: "职能部门" },
{ href: "/organization/func-dep/technology", title: "科技处" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,35 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}></h2>
<p className={"text-base indent-8 mt-8"}>
</p>
<ol className={"list-decimal list-inside indent-8"}>
<li>
,
</li>
<li></li>
<li>
</li>
<li>
</li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ol>
</>
);
};
export default Page;

View File

@ -0,0 +1,20 @@
import ArticleLayout from "@/app/components/ArticleLayout";
import { ReactNode } from "react";
const navigations = [
{ title: "综合办公室", href: "/organization/func-dep/general-office" },
{ title: "人事处", href: "/organization/func-dep/personnel" },
{ title: "科技处", href: "/organization/func-dep/technology" },
{ title: "产业处", href: "/organization/func-dep/industry" },
{ title: "资产财务处", href: "/organization/func-dep/asset-finance" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<ArticleLayout leftNavTitle={"职能部门"} navigations={navigations}>
{children}
</ArticleLayout>
);
};
export default Layout;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/architecture", title: "组织架构" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,15 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
</h2>
<img
className={"w-full mt-8"}
src={`${process.env.NEXT_ADMIN_BASE_URL}/uploads/image/20231030/5c0b98dc-cf76-49c3-a510-f2f197f7dd09.jpeg`}
/>
</>
);
};
export default Page;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/dean-speech", title: "院长致辞" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,24 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
</h2>
<p className={"text-base indent-8 mt-8"}>
</p>
<p className={"text-base indent-8 mt-8"}>
绿绿
</p>
<p className={"text-base indent-8 mt-8"}>
5G物联网等领域进行科技布局绿沿
</p>
<p className={"text-base indent-8 mt-8"}>
</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/joint-laboratory", title: "研究中心联合实验室" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,12 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
</h2>
<p className={"text-base indent-8 mt-8"}>...</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/joint-venture", title: "合作企业" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,12 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
</h2>
<p className={"text-base indent-8 mt-8"}>...</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,23 @@
import ArticleLayout from "@/app/components/ArticleLayout";
import { ReactNode } from "react";
const navigations = [
{ title: "机构简介", href: "/organization/overview" },
{ title: "院长致辞", href: "/organization/dean-speech" },
{ title: "科技产业发展委员会", href: "/organization/stidc" },
{ title: "组织架构", href: "/organization/architecture" },
{ title: "职能部门", href: "/organization/func-dep/general-office" },
{ title: "研究中心联合实验室", href: "/organization/joint-laboratory" },
{ title: "合作企业", href: "/organization/joint-venture" },
{ title: "科研平台", href: "/organization/research-platform" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<ArticleLayout leftNavTitle={"机构设置"} navigations={navigations}>
{children}
</ArticleLayout>
);
};
export default Layout;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/overview", title: "机构简介" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,20 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
绿
</h2>
<p className={"text-base indent-8 mt-8"}>
绿绿201822020181220
</p>
<p className={"text-base indent-8 mt-8"}>
5G物联绿绿
</p>
<p className={"text-base indent-8 mt-8"}>
</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/research-platform", title: "科研平台" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,12 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
</h2>
<p className={"text-base indent-8 mt-8"}>...</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/func-dep/stidc", title: "科技产业发展委员会" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,12 @@
const Page = () => {
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
</h2>
<p className={"text-base indent-8 mt-8"}>...</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/research-platform", title: "科研平台" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -1,5 +1,22 @@
import Image from "next/image";
const Page = () => {
return <div></div>;
return (
<>
{" "}
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
</h2>
<p className={"text-base mt-8 text-center"}></p>
<p className={"flex justify-center mt-2"}>
<img
src={`${process.env.NEXT_ADMIN_BASE_URL}/uploads/image/20231030/8d05e613-e2c6-47d1-81a9-08bd70b8ba73.jpeg`}
alt={"张景中"}
/>
</p>
<p className={"text-center"}></p>
</>
);
};
export default Page;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/research-platform", title: "科研平台" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -1,5 +1,15 @@
const Page = () => {
return <div>overview</div>;
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}>
</h2>
<p className={"text-base indent-8 mt-8"}>
20171033340611362120171025381173973
5
</p>
</>
);
};
export default Page;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/research-platform", title: "科研平台" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -0,0 +1,7 @@
.academicians {
.academician {
&:not(:nth-child(4n)) {
margin-right: 12px;
}
}
}

View File

@ -1,5 +1,71 @@
import styles from "./page.module.scss";
import Link from "next/link";
const academicians = [
{
picture:
"/uploads/image/20231030/8dbabce9-3454-4dab-b66f-34b30849db90.jpeg",
name: "任以伟",
link: "",
},
{
picture:
"/uploads/image/20231030/5d3c322f-8163-4034-b01e-8897f3ba9a7a.jpeg",
name: "张炜",
link: "",
},
{
picture:
"/uploads/image/20231030/63c2d39e-21c1-466f-b5fd-6f27e4ff1d43.jpeg",
name: "石宇",
link: "",
},
{
picture:
"/uploads/image/20231030/4f0f8923-a72f-4ea7-8333-fc98878a4fb3.jpeg",
name: "裴得胜",
link: "",
},
{
picture:
"/uploads/image/20231030/5e6dd527-5311-4444-b8ad-be597b57a724.jpeg",
name: "宋立岩",
link: "",
},
{
picture:
"/uploads/image/20231030/b3ab92e4-391e-49f3-956e-97bd2f8ebf94.jpeg",
name: "陆文强",
link: "",
},
{
picture:
"/uploads/image/20231030/d55d1de5-6c14-489d-b2ee-d62dd78d3478.jpeg",
name: "王德强",
link: "",
},
];
const Page = () => {
return <div></div>;
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}></h2>
<div className={`${styles.academicians} flex flex-wrap mt-8`}>
{academicians.map((academician) => (
<div
key={academician.name}
className={`${styles.academician} flex flex-col items-center w-1/5 mt-4`}
>
<img
className={"h-[138px]"}
src={`${process.env.NEXT_ADMIN_BASE_URL}${academician.picture}`}
/>
<Link href={academician.link}>{academician.name}</Link>
</div>
))}
</div>
</>
);
};
export default Page;

View File

@ -0,0 +1,19 @@
import React, { ReactNode } from "react";
import Breadcrumb from "@/app/components/Breadcrumb";
const breadcrumb = [
{ href: "/", title: "首页" },
{ href: "/organization/overview", title: "机构设置" },
{ href: "/organization/research-platform", title: "科研平台" },
];
const Layout = ({ children }: { children: ReactNode }) => {
return (
<div className={"flex flex-col h-full"}>
<Breadcrumb navigations={breadcrumb} />
<div className={"bg-white px-5 py-4 flex-1 mt-2"}>{children}</div>
</div>
);
};
export default Layout;

View File

@ -1,5 +1,40 @@
import Link from "next/link";
const academicians = [
{
picture:
"/uploads/image/20231030/2a2f235b-711a-47fb-9d20-c5a1c332ff78.jpeg",
name: "周祥东",
link: "",
},
{
picture:
"/uploads/image/20231030/390a39d3-0729-446f-b361-c34f4f6cb0ff.jpeg",
name: "王兴祖",
link: "",
},
];
const Page = () => {
return <div></div>;
return (
<>
<h2 className={"text-center text-lg font-bold text-[#054786]"}></h2>
<div className={`flex mt-8 justify-around`}>
{academicians.map((academician) => (
<div
key={academician.name}
className={`flex flex-col items-center w-1/5`}
>
<img
className={"h-[138px]"}
src={`${process.env.NEXT_ADMIN_BASE_URL}${academician.picture}`}
/>
<Link href={academician.link}>{academician.name}</Link>
</div>
))}
</div>
</>
);
};
export default Page;

View File

@ -1,13 +1,34 @@
import React from "react";
import { ArticleDetail } from "@/app/types/article";
import Link from "next/link";
const ArticleContent = ({ article }: { article: ArticleDetail }) => {
return (
<div className={"px-5 py-4 h-full"}>
<div className={"h-full"}>
<h1 className={"text-[18px] text-[#054786] text-center font-bold"}>
{article.title}
</h1>
<div dangerouslySetInnerHTML={{ __html: article.content }}></div>
<div className={"bottom-nav mt-[27px] mb-[50px]"}>
<div className={"prev"}>
<span className={"text-base"}></span>
<Link
className={"text-sm text-[#666] ml-8"}
href={`./${article.prev?.id}`}
>
{article.prev?.title ?? "没有了"}
</Link>
</div>
<div className={"next mt-8"}>
<span className={"text-base"}></span>
<Link
className={"text-sm text-[#666] ml-8"}
href={`./${article.next?.id}`}
>
{article.next?.title ?? "没有了"}
</Link>
</div>
</div>
</div>
);
};

View File

@ -15,7 +15,7 @@ const ArticleLayout = ({
<div className={"left-side w-[325px]"}>
<LeftNav navigations={navigations} title={leftNavTitle} />
</div>
<div className={"flex-1 ml-3 bg-white"}>{children}</div>
<div className={"flex-1 ml-3"}>{children}</div>
</div>
);
};

View File

@ -0,0 +1,29 @@
import { Fragment } from "react";
import Link from "next/link";
interface BreadcrumbItem {
href: string;
title: string;
}
const Breadcrumb = ({ navigations }: { navigations: BreadcrumbItem[] }) => {
return (
<div className={"flex text-xs text-[#13426e]"}>
<span className={"mr-2"}>:</span>
{navigations.map((navigation, index) => {
if (index === navigations.length - 1) {
return <div key={navigation.href}>{navigation.title}</div>;
} else {
return (
<Fragment key={navigation.href}>
<Link href={navigation.href}>{navigation.title}</Link>
<div className={"mx-2"}>/</div>
</Fragment>
);
}
})}
</div>
);
};
export default Breadcrumb;

View File

@ -15,7 +15,11 @@ const LeftNav = ({
}) => {
const pathname = usePathname();
return (
<div className={"left-nav min-h-[600px] bg-[#d7ecfd] rounded shadow pt-2"}>
<div
className={
"left-nav min-h-[600px] h-full bg-[#d7ecfd] rounded shadow pt-2"
}
>
<div className={"flex items-center pl-2 h-7"}>
<Image src={circle} alt={"circle icon"} height={16} width={16} />
<span className={"pl-2"}>{title}</span>

View File

@ -0,0 +1,50 @@
"use client";
import React from "react";
import Link from "next/link";
import { usePathname } from "next/navigation";
const navigations = [
{ title: "首页", href: "/" },
{ title: "机构设置", href: "/organization/overview" },
{ title: "人才队伍", href: "/talents/overview" },
{ title: "科研进展", href: "#" },
{ title: "科技成果", href: "#" },
{ title: "学术交流", href: "#" },
{ title: "成果转化服务", href: "#" },
{ title: "中科院科技资源共享平台", href: "#" },
{ title: "联系我们", href: "#" },
];
const isActive = (link: string, current: string): boolean => {
if (link === current) return true;
if (link === "/") return false;
const link_0 = link.split(/\/+/).filter(Boolean)[0];
const current_0 = current.split(/\/+/).filter(Boolean)[0];
return link_0 === current_0;
};
const MainNav = () => {
const pathname = usePathname();
return (
<nav className={"main-nav bg-[#1958a7] h-[38px]"}>
<ul className={"w-full h-full flex"}>
{navigations.map((navigation, index) => (
<li key={navigation.title + index}>
<Link
href={navigation.href}
className={`${
isActive(navigation.href, pathname)
? "text-[#dedede]"
: "text-white"
} hover:text-[#dedede] text-sm h-[38px] flex justify-center items-center min-w-[60px] mx-2.5`}
>
{navigation.title}
</Link>
</li>
))}
</ul>
</nav>
);
};
export default MainNav;

View File

@ -0,0 +1,45 @@
import Link from "next/link";
const Pagination = ({
page,
total,
perPage,
}: {
page: number;
total: number;
perPage: number;
}) => {
const pageCount = Math.ceil(total / perPage);
return (
<div
className={"w-full flex justify-center mt-2.5 h-10 items-center text-sm"}
>
{page <= 1 ? (
<div className={"prev mx-3"}></div>
) : (
<Link className={"next block mx-3"} href={`./${page - 1}`}>
</Link>
)}
{[...Array(pageCount)].map((el, index) => (
<div
key={index}
className={`page-item mx-3 ${
page === index + 1 ? "text-[#009fe9]" : "text-[#666666]"
}`}
>
{index + 1}
</div>
))}
{page >= pageCount ? (
<div className={"next mx-3"}></div>
) : (
<Link className={"next block mx-3"} href={`./${page + 1}`}>
</Link>
)}
</div>
);
};
export default Pagination;

View File

@ -6,6 +6,7 @@ import footer from "@/app/assets/footer.jpg";
import Image from "next/image";
import banner from "@/app/assets/banner.jpg";
import { ReactNode } from "react";
import MainNav from "@/app/components/MainNav";
const inter = Inter({ subsets: ["latin"] });
@ -14,40 +15,13 @@ export const metadata: Metadata = {
description: "Generated by create next app",
};
const navLinks = [
{ title: "首页", href: "/" },
{ title: "机构设置", href: "#" },
{ title: "人才队伍", href: "/talents/overview" },
{ title: "科研进展", href: "#" },
{ title: "科技成果", href: "#" },
{ title: "学术交流", href: "#" },
{ title: "成果转化服务", href: "#" },
{ title: "中科院科技资源共享平台", href: "#" },
{ title: "联系我们", href: "#" },
];
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body className={inter.className}>
<main className={"w-[1000px] m-auto"}>
<Image className={"w-full"} src={banner} alt={"banner"} />
<nav className={"main-nav bg-[#1958a7] h-[38px]"}>
<ul className={"w-full h-full flex"}>
{navLinks.map((link, index) => (
<li key={link.title + index}>
<Link
href={link.href}
className={
"text-white text-sm h-[38px] flex justify-center items-center min-w-[60px] mx-2.5"
}
>
{link.title}
</Link>
</li>
))}
</ul>
</nav>
<MainNav />
{children}
<Image src={footer} alt={"footer"} className={"mt-4"} />
</main>

View File

@ -4,17 +4,89 @@ import ArticleBlock from "@/app/components/ArticleBlock";
export default async function Home() {
return (
<main className={"flex justify-between"}>
<main className={"flex justify-between bg-[#f5fafe]"}>
<div className={"left-side w-[222px]"}>
<Image src={leftBanner} alt={"left banner"} />
<Image
src={leftBanner}
alt={"left banner"}
useMap={"#hotAreaMap1539"}
/>
<map name={"hotAreaMap1539"} id={"hotAreaMap1539"}>
<area
title=""
shape="rect"
coords="0,0,220,80"
href="http://124.16.212.11/"
target="_blank"
/>
<area
title=""
shape="rect"
coords="34,135,105,162"
href="http://172.16.51.4:61080/"
target="_blank"
/>
<area
title=""
shape="rect"
coords="119,135,187,160"
href="http://www.clas.ac.cn/"
target="_blank"
/>
<area
title=""
shape="rect"
coords="0,168,221,247"
href="http://119.78.100.138/"
target="_blank"
/>
<area
title=""
shape="rect"
coords="0,253,221,332"
href="http://159.226.28.30/cigit/"
target="_blank"
/>
<area
title=""
shape="rect"
coords="0,334,221,421"
href="http://www.cigit.cas.cn/"
target="_blank"
/>
<area
title=""
shape="rect"
coords="0,425,221,512"
href="http://tmcloud.casip.ac.cn/f"
target="_blank"
/>
<area
title="热区8"
shape="rect"
coords="0,516,221,612"
href="http://www.cnipa.gov.cn/"
target="_blank"
/>
<area
title="热区9"
shape="rect"
coords="0,620,221,703"
href="http://www.sciencenet.cn/"
target="_blank"
/>
</map>
</div>
<div className={"main-content w-[513px]"}>
<div className={"main-content w-[540px]"}>
<div className={"h-[180px] bg-white"}></div>
<div className={"mt-1"}>
<ArticleBlock
height={218}
title={"综合新闻"}
category={"4"}
linkPrefix={"/general-news"}
></ArticleBlock>
</div>
<div className={"flex justify-between mt-1"}>
<ArticleBlock
width={250}

View File

@ -10,6 +10,9 @@ export interface Article {
export interface ArticleListParams {
cid?: string;
pageSize?: number;
pageNo?: number;
sort?: string;
}
export interface ArticleDetail {
@ -27,11 +30,16 @@ export interface ArticleDetail {
isCollect: number;
createTime: string;
updateTime: string;
// prev: Prev
// next: Next
prev?: Prev;
next?: Prev;
// news: News[]
}
export interface Prev {
id: string;
title: string;
}
export interface ArticleDetailParams {
id: string;
}