employees table
This commit is contained in:
parent
4697383bf3
commit
db5896d29b
3
src/assets/icons/report.svg
Normal file
3
src/assets/icons/report.svg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M6.62109 12.928H2.62109C2.44428 12.928 2.27471 12.8577 2.14969 12.7327C2.02467 12.6077 1.95443 12.4381 1.95443 12.2613V2.92798C1.95443 2.75117 2.02467 2.5816 2.14969 2.45657C2.27471 2.33155 2.44428 2.26131 2.62109 2.26131H5.95443V4.26131C5.95443 4.79174 6.16514 5.30045 6.54021 5.67553C6.91529 6.0506 7.42399 6.26131 7.95443 6.26131H9.95443V9.59465C9.95443 9.77146 10.0247 9.94103 10.1497 10.066C10.2747 10.1911 10.4443 10.2613 10.6211 10.2613C10.7979 10.2613 10.9675 10.1911 11.0925 10.066C11.2175 9.94103 11.2878 9.77146 11.2878 9.59465V5.59465C11.2878 5.59465 11.2878 5.59465 11.2878 5.55465C11.2808 5.4934 11.2674 5.43307 11.2478 5.37465V5.31465C11.2157 5.2461 11.1729 5.18309 11.1211 5.12798L7.12109 1.12798C7.06598 1.07612 7.00297 1.03337 6.93443 1.00131C6.91237 0.997451 6.88982 0.997451 6.86776 1.00131C6.80294 0.966647 6.73327 0.941927 6.66109 0.927979H2.62109C2.09066 0.927979 1.58195 1.13869 1.20688 1.51377C0.831807 1.88884 0.621094 2.39755 0.621094 2.92798V12.2613C0.621094 12.7917 0.831807 13.3005 1.20688 13.6755C1.58195 14.0506 2.09066 14.2613 2.62109 14.2613H6.62109C6.7979 14.2613 6.96747 14.1911 7.0925 14.0661C7.21752 13.941 7.28776 13.7715 7.28776 13.5946C7.28776 13.4178 7.21752 13.2483 7.0925 13.1232C6.96747 12.9982 6.7979 12.928 6.62109 12.928ZM7.28776 3.20131L9.01443 4.92798H7.95443C7.77762 4.92798 7.60805 4.85774 7.48302 4.73272C7.358 4.60769 7.28776 4.43812 7.28776 4.26131V3.20131ZM3.95443 8.92798H7.95443C8.13124 8.92798 8.30081 8.85774 8.42583 8.73272C8.55086 8.60769 8.62109 8.43812 8.62109 8.26131C8.62109 8.0845 8.55086 7.91493 8.42583 7.78991C8.30081 7.66488 8.13124 7.59465 7.95443 7.59465H3.95443C3.77762 7.59465 3.60805 7.66488 3.48302 7.78991C3.358 7.91493 3.28776 8.0845 3.28776 8.26131C3.28776 8.43812 3.358 8.60769 3.48302 8.73272C3.60805 8.85774 3.77762 8.92798 3.95443 8.92798ZM6.62109 10.2613H3.95443C3.77762 10.2613 3.60805 10.3315 3.48302 10.4566C3.358 10.5816 3.28776 10.7512 3.28776 10.928C3.28776 11.1048 3.358 11.2744 3.48302 11.3994C3.60805 11.5244 3.77762 11.5946 3.95443 11.5946H6.62109C6.7979 11.5946 6.96747 11.5244 7.0925 11.3994C7.21752 11.2744 7.28776 11.1048 7.28776 10.928C7.28776 10.7512 7.21752 10.5816 7.0925 10.4566C6.96747 10.3315 6.7979 10.2613 6.62109 10.2613ZM3.95443 6.26131H4.62109C4.7979 6.26131 4.96747 6.19107 5.0925 6.06605C5.21752 5.94103 5.28776 5.77146 5.28776 5.59465C5.28776 5.41783 5.21752 5.24827 5.0925 5.12324C4.96747 4.99822 4.7979 4.92798 4.62109 4.92798H3.95443C3.77762 4.92798 3.60805 4.99822 3.48302 5.12324C3.358 5.24827 3.28776 5.41783 3.28776 5.59465C3.28776 5.77146 3.358 5.94103 3.48302 6.06605C3.60805 6.19107 3.77762 6.26131 3.95443 6.26131ZM13.0944 10.4546C13.0325 10.3922 12.9587 10.3426 12.8775 10.3087C12.7962 10.2749 12.7091 10.2574 12.6211 10.2574C12.5331 10.2574 12.4459 10.2749 12.3647 10.3087C12.2835 10.3426 12.2097 10.3922 12.1478 10.4546L9.95443 12.6546L9.09443 11.788C9.03227 11.7258 8.95848 11.6765 8.87726 11.6429C8.79605 11.6092 8.709 11.5919 8.62109 11.5919C8.53319 11.5919 8.44614 11.6092 8.36493 11.6429C8.28371 11.6765 8.20992 11.7258 8.14776 11.788C8.0856 11.8501 8.03629 11.9239 8.00265 12.0051C7.96901 12.0864 7.9517 12.1734 7.9517 12.2613C7.9517 12.3492 7.96901 12.4363 8.00265 12.5175C8.03629 12.5987 8.0856 12.6725 8.14776 12.7346L9.48109 14.068C9.54307 14.1305 9.6168 14.1801 9.69804 14.2139C9.77928 14.2478 9.86642 14.2652 9.95443 14.2652C10.0424 14.2652 10.1296 14.2478 10.2108 14.2139C10.2921 14.1801 10.3658 14.1305 10.4278 14.068L13.0944 11.4013C13.1569 11.3393 13.2065 11.2656 13.2404 11.1844C13.2742 11.1031 13.2916 11.016 13.2916 10.928C13.2916 10.84 13.2742 10.7528 13.2404 10.6716C13.2065 10.5904 13.1569 10.5166 13.0944 10.4546Z" fill="#52B709"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.7 KiB |
@ -17,6 +17,7 @@ import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadc
|
|||||||
import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
|
import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
|
||||||
|
|
||||||
import rightArrow from "assets/icons/arrows/arrowRight.svg";
|
import rightArrow from "assets/icons/arrows/arrowRight.svg";
|
||||||
|
import report from "assets/icons/report.svg";
|
||||||
|
|
||||||
// import PartnerPersonCard from "@components/PartnerPersonCard/PartnerPersonCard";
|
// import PartnerPersonCard from "@components/PartnerPersonCard/PartnerPersonCard";
|
||||||
// import { useDispatch } from "react-redux";
|
// import { useDispatch } from "react-redux";
|
||||||
@ -33,6 +34,7 @@ import rightArrow from "assets/icons/arrows/arrowRight.svg";
|
|||||||
// import TestImg from "assets/images/partnerProfile/PersonalTesters.svg";
|
// import TestImg from "assets/images/partnerProfile/PersonalTesters.svg";
|
||||||
// import BackEndImg from "assets/images/partnerProfile/personalBackEnd.svg";
|
// import BackEndImg from "assets/images/partnerProfile/personalBackEnd.svg";
|
||||||
import "./partnerСategories.scss";
|
import "./partnerСategories.scss";
|
||||||
|
import { LEVELS, SKILLS } from "@utils/constants";
|
||||||
export const PartnerCategories = () => {
|
export const PartnerCategories = () => {
|
||||||
// const dispatch = useDispatch();
|
// const dispatch = useDispatch();
|
||||||
if (localStorage.getItem("role_status") !== "18") {
|
if (localStorage.getItem("role_status") !== "18") {
|
||||||
@ -46,6 +48,17 @@ export const PartnerCategories = () => {
|
|||||||
|
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
|
|
||||||
|
const tabs = [
|
||||||
|
{
|
||||||
|
name: 'Фронтенд',
|
||||||
|
value: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Бэкенд',
|
||||||
|
value: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
const COLUMNS = [
|
const COLUMNS = [
|
||||||
{
|
{
|
||||||
label: "",
|
label: "",
|
||||||
@ -59,18 +72,15 @@ export const PartnerCategories = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Данные",
|
label: "Данные",
|
||||||
renderCell: (item) => <p>{item?.employee.fio}</p>,
|
renderCell: (item) => <div className="table__info"><p>{item?.employee.fio}</p><span>{LEVELS[item?.resume.userCard.level]} / {SKILLS[item?.resume.userCard.position_id]}</span></div>,
|
||||||
// sort: { sortKey: "NAME" }
|
// sort: { sortKey: "NAME" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Резюме",
|
label: "Участвует в проекте",
|
||||||
renderCell: (item) => (
|
renderCell: (item) => (
|
||||||
<Link className="table__link" to={`/candidate/${item.user_id}`}>
|
<div className="table__project">
|
||||||
Резюме
|
{item.resume.userCard.at_project ? <div>item.resume.userCard.at_project</div> : <span>Нет проектов</span>}
|
||||||
<div className="img__wrapper">
|
|
||||||
<img src={rightArrow} alt="arrow" />
|
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -80,6 +90,7 @@ export const PartnerCategories = () => {
|
|||||||
className="table__link"
|
className="table__link"
|
||||||
to={`/profile/employees/report/${item.user_id}`}
|
to={`/profile/employees/report/${item.user_id}`}
|
||||||
>
|
>
|
||||||
|
<img src={report} alt="report" />
|
||||||
Подробный отчет
|
Подробный отчет
|
||||||
<div className="img__wrapper">
|
<div className="img__wrapper">
|
||||||
<img src={rightArrow} alt="arrow" />
|
<img src={rightArrow} alt="arrow" />
|
||||||
@ -88,14 +99,12 @@ export const PartnerCategories = () => {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Действие",
|
label: <span className="table__action">Действие</span>,
|
||||||
renderCell: (item) => (
|
renderCell: () => (
|
||||||
<Link
|
<div
|
||||||
className="table__link"
|
className="table__more"
|
||||||
to={`/profile/employees/report/${item.user_id}`}
|
|
||||||
>
|
>
|
||||||
123
|
</div>
|
||||||
</Link>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@ -125,9 +134,23 @@ export const PartnerCategories = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLoader(true);
|
setLoader(true);
|
||||||
apiRequest("/project/my-employee").then((el) => {
|
apiRequest("/project/my-employee").then((el) => {
|
||||||
|
const fetchResumes = async () => {
|
||||||
|
const promises = el.managerEmployees.map(async (manager) => {
|
||||||
|
const resume = await apiRequest(`/resume?userId=${manager.user_id}`);
|
||||||
|
return { ...manager, resume }; // Возвращаем объект с добавленным ключом resume
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const updatedManagers = await Promise.all(promises);
|
||||||
|
setInitialNodes(updatedManagers);
|
||||||
|
setNodes(updatedManagers);
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setNodes(el?.managerEmployees);
|
} catch (error) {
|
||||||
setInitialNodes(el.managerEmployees);
|
console.error("Ошибка при получении резюме:", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
fetchResumes();
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -276,6 +299,12 @@ export const PartnerCategories = () => {
|
|||||||
onChange={handleSearch}
|
onChange={handleSearch}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
<div className="table__tabs">
|
||||||
|
<div className="table__tab">Все</div>
|
||||||
|
{tabs.map((tab) => {
|
||||||
|
return <div className="table__tab" key={tab.value}>{tab.name}</div>
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
<CompactTable
|
<CompactTable
|
||||||
columns={COLUMNS}
|
columns={COLUMNS}
|
||||||
data={data}
|
data={data}
|
||||||
|
@ -178,8 +178,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__tabs {
|
||||||
|
display: flex;
|
||||||
|
margin: 0 auto 30px 18px;
|
||||||
|
padding: 4px 8px;
|
||||||
|
gap: 10px;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 16px;
|
||||||
|
background: rgba(240, 242, 245, 1);
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
&__avatar {
|
&__avatar {
|
||||||
max-width: 45px;
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
margin-left: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__info {
|
||||||
|
p {
|
||||||
|
color: rgba(46, 58, 89, 1);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 17.5px;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
color: rgba(155, 171, 197, 1);
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 17.5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__link {
|
&__link {
|
||||||
@ -199,11 +226,56 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 14px;
|
width: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__project {
|
||||||
|
color: rgba(46, 58, 89, 1);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 17.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__action {
|
||||||
|
color: rgba(155, 171, 197, 1);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__more {
|
||||||
|
position: relative;
|
||||||
|
height: 30px;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
flex-direction: column;
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
display: flex;
|
||||||
|
top: 2px;
|
||||||
|
width: 4px;
|
||||||
|
height: 4px;
|
||||||
|
background: rgba(155, 171, 197, 1);
|
||||||
|
border-radius: 50px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
display: flex;
|
||||||
|
bottom: 2px;
|
||||||
|
width: 4px;
|
||||||
|
height: 4px;
|
||||||
|
background: rgba(155, 171, 197, 1);
|
||||||
|
border-radius: 50px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&__pagination {
|
&__pagination {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -251,6 +323,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
|
--data-table-library_grid-template-columns: minmax(0px, 0.5fr) minmax(0px, 1.5fr) minmax(0px, 1fr) minmax(0px, 1fr) minmax(0px, 1fr) !important;
|
||||||
th {
|
th {
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
border-bottom: 1px solid #EDEDED;
|
border-bottom: 1px solid #EDEDED;
|
||||||
|
Loading…
Reference in New Issue
Block a user