feat: 🎸 简历列表弹窗

This commit is contained in:
2025-08-22 14:04:04 +08:00
parent bba32ca5fb
commit e24105b78b
6 changed files with 118 additions and 74 deletions

View File

@@ -24,9 +24,14 @@
background-color: #fff; background-color: #fff;
} }
} }
.empty-data-wrapper {
width: 100%;
min-height: 555px;
display: flex;
}
.job-info-modal-user-resumes-list { .job-info-modal-user-resumes-list {
width: 100%; width: 100%;
min-height: 555px;
margin-top: 16px; margin-top: 16px;
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); /* 每行两列 */ grid-template-columns: repeat(2, 1fr); /* 每行两列 */

View File

@@ -1,24 +1,48 @@
import { useState } from "react"; import { useState } from "react";
import { useSelector } from "react-redux";
import { Input } from "@arco-design/web-react"; import { Input } from "@arco-design/web-react";
import Modal from "@/components/Modal"; import Modal from "@/components/Modal";
import { mockData } from "@/data/mockData"; import InfiniteScroll from "@/components/InfiniteScroll";
import ResumeInfoModal from "@/pages/CompanyJobsPage/components/ResumeInfoModal"; import ResumeInfoModal from "@/pages/CompanyJobsPage/components/ResumeInfoModal";
import FILEICON from "@/assets/images/CompanyJobsPage/file_icon.png"; import FILEICON from "@/assets/images/CompanyJobsPage/file_icon.png";
import { getResumesList } from "@/services";
import "./index.css"; import "./index.css";
const InputSearch = Input.Search; const InputSearch = Input.Search;
const { userResumes } = mockData; const PAGE_SIZE = 10;
export default ({ visible, onClose, data }) => { export default ({ visible, onClose, data }) => {
console.log(data); const studentInfo = useSelector((state) => state.student.studentInfo);
const [resumeModalShow, setResumeModalShow] = useState(false); const [resumeModalShow, setResumeModalShow] = useState(false);
const [resumeInfoModalShow, setResumeInfoModalShow] = useState(false); const [resumeInfoModalShow, setResumeInfoModalShow] = useState(false);
const [resumeList, setResumeList] = useState([]); // 简历列表
const [listPage, setListPage] = useState(1);
const [listHasMore, setListHasMore] = useState(true);
const handleCloseModal = () => { const handleCloseModal = () => {
setResumeModalShow(false); setResumeModalShow(false);
onClose(); onClose();
}; };
const queryResumeList = async () => {
const res = await getResumesList({
page: listPage,
pageSize: PAGE_SIZE,
studentId: studentInfo?.id,
});
if (res.success) {
setResumeList((prevList) => {
const newList = [...prevList, ...res.data];
if (res.total === newList?.length) {
setListHasMore(false);
} else {
setListPage((prevPage) => prevPage + 1);
}
return newList;
});
}
};
// 点击立即投递 // 点击立即投递
const handleClickDeliverBtn = (e) => { const handleClickDeliverBtn = (e) => {
e.stopPropagation(); e.stopPropagation();
@@ -53,9 +77,18 @@ export default ({ visible, onClose, data }) => {
searchButton searchButton
placeholder="搜索简历" placeholder="搜索简历"
/> />
{
<ul className="job-info-modal-user-resumes-list"> <InfiniteScroll
{userResumes.map((item) => ( loadMore={queryResumeList}
hasMore={listHasMore}
empty={resumeList.length === 0}
className={`${
resumeList.length
? "job-info-modal-user-resumes-list"
: "empty-data-wrapper"
}`}
>
{resumeList.map((item) => (
<li <li
key={item.id} key={item.id}
className="list-item" className="list-item"
@@ -65,7 +98,7 @@ export default ({ visible, onClose, data }) => {
<img src={FILEICON} className="file-icon" /> <img src={FILEICON} className="file-icon" />
<div className="file-info"> <div className="file-info">
<p className="file-info-targetPosition"> <p className="file-info-targetPosition">
{item.targetPosition} {item.title}
</p> </p>
{item?.skills?.length > 0 && ( {item?.skills?.length > 0 && (
<p className="file-info-skills"> <p className="file-info-skills">
@@ -82,7 +115,8 @@ export default ({ visible, onClose, data }) => {
</div> </div>
</li> </li>
))} ))}
</ul> </InfiniteScroll>
}
</> </>
) : ( ) : (
<> <>

View File

@@ -2,9 +2,10 @@ import { useState } from "react";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { mapJobList, mapInterviewList } from "@/utils/dataMapper"; import { mapJobList, mapInterviewList } from "@/utils/dataMapper";
import InfiniteScroll from "@/components/InfiniteScroll";
import toast from "@/components/Toast";
import JobList from "./components/JobList"; import JobList from "./components/JobList";
import { getJobsList, getInterviewsList } from "@/services"; import { getJobsList, getInterviewsList } from "@/services";
import InfiniteScroll from "@/components/InfiniteScroll";
import "./index.css"; import "./index.css";
const PAGE_SIZE = 10; const PAGE_SIZE = 10;
@@ -22,7 +23,6 @@ const CompanyJobsPage = () => {
// 获取面试信息 // 获取面试信息
const fetchInterviewsData = async () => { const fetchInterviewsData = async () => {
try {
if (studentInfo?.id) { if (studentInfo?.id) {
const res = await getInterviewsList({ const res = await getInterviewsList({
page: interviewsPage, page: interviewsPage,
@@ -41,11 +41,10 @@ const CompanyJobsPage = () => {
} }
return newList; return newList;
}); });
} } else {
}
} catch (error) {
console.error("Failed to fetch data:", error);
setInterviews([]); setInterviews([]);
toast.error(res.message);
}
} }
}; };

View File

@@ -25,3 +25,19 @@ export async function getInterviewsList(params) {
params, params,
}); });
} }
// 获取简历列表
export async function getResumesList(params) {
return request({
url: `/api/resumes`,
method: "GET",
params: params,
});
}
// 获取简历详情
export async function getResumesDetail(id) {
return request({
url: `/api/resumes/${id}`,
method: "GET",
});
}

View File

@@ -5,7 +5,13 @@ import {
getClassRanking, getClassRanking,
} from "./dashboard"; } from "./dashboard";
import { getProjectsList } from "./projectLibrary"; import { getProjectsList } from "./projectLibrary";
import { getJobsList, getJobsDetail, getInterviewsList } from "./companyJobs"; import {
getJobsList,
getJobsDetail,
getInterviewsList,
getResumesList,
getResumesDetail,
} from "./companyJobs";
import { getLoginStudentInfo } from "./global"; import { getLoginStudentInfo } from "./global";
import { import {
getDashboardStatistics, getDashboardStatistics,
@@ -13,7 +19,7 @@ import {
getClassRank, getClassRank,
getMyRanking, getMyRanking,
} from "./personalProfile"; } from "./personalProfile";
import { getResumesList, getResumesDetail } from "./resumeInterview"; import {} from "./resumeInterview";
export { export {
// 仪表盘相关 // 仪表盘相关

View File

@@ -1,17 +1 @@
import request from "@/utils/request"; import request from "@/utils/request";
// 获取简历列表
export async function getResumesList(params) {
return request({
url: `/api/resumes`,
method: "GET",
params: params,
});
}
// 获取简历详情
export async function getResumesDetail(id) {
return request({
url: `/api/resumes/${id}`,
method: "GET",
});
}