Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/info-dsm/INFO_v1_FrontEnd i…
Browse files Browse the repository at this point in the history
…nto #29-CreateNotice
  • Loading branch information
drainxc committed Nov 12, 2022
2 parents b91cc35 + dec1747 commit 279b52a
Show file tree
Hide file tree
Showing 14 changed files with 677 additions and 391 deletions.
79 changes: 71 additions & 8 deletions src/components/api/company/requesrResistration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useQuery } from "@tanstack/react-query";
import axios from "axios";
import { BaseUrl } from "../../../../export/base";
const token =
"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNiIsInR5cGUiOiJhY2Nlc3MiLCJpYXQiOjE2NjgwMDU3OTEsImV4cCI6MTY2ODA5MjE5MX0.QTZ34-wPuT39t-B_28_zfNi9PMEZSel4s632aw1AgF0";
"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNiIsInR5cGUiOiJhY2Nlc3MiLCJpYXQiOjE2NjgyMTYzODMsImV4cCI6MTY2ODMwMjc4M30.VaaCr7wVhxcbG0Mkq9m671P2JuCqpR1GcrFYT9kXrek";
export const getListProps = () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
return useQuery(["datas"], async () => {
Expand Down Expand Up @@ -76,12 +76,75 @@ export const postNotice = (arr, ad) => {
export const getMyList = () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
return useQuery(["MyCompanyList"], async () => {
const { data } = await axios.get(BaseUrl + "/notice/me", {
headers: {
Authorization: `Bearer ${token}`,
},
});
console.log(data);
return data;
let res;
await axios
.get(BaseUrl + "/notice/me", {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then((response) => {
const data = response.data;
let arr = new Array(data.length)
.fill(0)
.map((e, i) =>
new Array(
data[i].data.notice.recruitmentBusinessResponse.length
).fill("")
);
let arr2 = new Array(data.length)
.fill(0)
.map((e, i) =>
new Array(
data[i].data.notice.recruitmentBusinessResponse.length
).fill("")
);
let count = [];
for (let i = 0; i < data.length; i++) {
let temp = 0;
for (
let j = 0;
j < data[i].data.notice.recruitmentBusinessResponse.length;
j++
) {
arr[i][j] =
data[i].data.notice.recruitmentBusinessResponse[
j
].classificationResponse.bigClassification.bigClassificationName;
arr2[i][j] =
data[i].data.notice.recruitmentBusinessResponse[
j
].classificationResponse.name;
temp =
temp +
data[i].data.notice.recruitmentBusinessResponse[j]
.numberOfEmployee;
}
count.push({
total: temp,
approve: data[i].approveStatus,
day: data[i].data.notice.company.lastNoticeDate,
id: data[i].data.notice.recruitmentBusinessResponse[0]
.recruitmentBusinessId,
});
}
const ad = arr.map((item) =>
item.filter((e, i, ar) => {
return ar.findIndex((el) => e === el) === i;
})
);
console.log(ad);
const as = arr2.map((item) =>
item.filter((e, i, ar) => {
return ar.findIndex((el) => e === el) === i;
})
);
for (let i = 0; i < data.length; i++) {
as[i] = as[i].join();
ad[i] = ad[i].join();
}
res = { count, as, ad };
});
return res;
});
};
31 changes: 31 additions & 0 deletions src/components/api/teacher/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { useQuery } from "@tanstack/react-query";
import axios from "axios";
import { BaseUrl } from "../../../export/base";
const token =
"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyNSIsInR5cGUiOiJhY2Nlc3MiLCJpYXQiOjE2NjgyMTc4OTAsImV4cCI6MTY2ODMwNDI5MH0.MKJc3OQID5--XKcbxn045jrArILC5Sop_e5UQXV7Fcc";
export const getBoardList = () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
return useQuery(["getBoardList"], async () => {
const { data } = await axios({
method: "get",
url: BaseUrl + "/notice",
params: { id: 656574354 },
headers: {
Authorization: `Bearer ${token}`,
},
});
console.log(data);
return data;
});
};
export const noticeRequest = async (method, path, query) => {
const { data } = await axios({
method: method,
url: BaseUrl + path,
params: { noticeId: query },
headers: {
Authorization: `Bearer ${token}`,
},
});
console.log(data);
};
39 changes: 26 additions & 13 deletions src/components/pages/companyPage/recruitmentList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,33 @@ import React from "react";
import Header from "../../../common/header";
import styled from "styled-components";
import ResistrationList from "./list";
import LoadingPage from "../../../common/loading";
import ErrorPage from "../../../common/error";
import { getMyList } from "../../../api/company/requesrResistration";
const RecruitmentList = () => {
const { status, data } = getMyList();
return (
<>
<Header
title={"모집의뢰 목록"}
description={"모집의뢰서등을 관리해보세요"}
/>
<MainDiv>
<List>
<AddBtn>
<button>+</button>
</AddBtn>
<ResistrationList />
</List>
</MainDiv>
{status === "loading" ? (
<LoadingPage />
) : status === "error" ? (
<ErrorPage />
) : (
<>
<Header
title={"모집의뢰 목록"}
description={"모집의뢰서등을 관리해보세요"}
/>
<MainDiv>
<List>
<AddBtn>
<button>+</button>
</AddBtn>
<ResistrationList data={data} />
</List>
</MainDiv>
</>
)}
</>
);
};
Expand All @@ -42,8 +54,9 @@ const AddBtn = styled.div`
}
`;
const List = styled.div`
width: 1136px;
width: 1176px;
margin-bottom: 300px;
padding: 0;
`;

export default RecruitmentList;
101 changes: 49 additions & 52 deletions src/components/pages/companyPage/recruitmentList/list/index.jsx
Original file line number Diff line number Diff line change
@@ -1,56 +1,40 @@
import styled from "styled-components";
import LoadingPage from "../../../../common/loading";
import ErrorPage from "../../../../common/error";
import { getMyList } from "../../../../api/company/requesrResistration";

import ImageProps from "./Status";
const ResistrationList = () => {
const { status, data } = getMyList();
const ResistrationList = ({ data }) => {
console.log(data);
return (
<>
{status === "loading" ? (
<LoadingPage />
) : status === "error" ? (
<ErrorPage />
) : (
<Ul>
{data.map((user) => (
<>
{user.data.notice.recruitmentBusinessResponse.map((item) => (
<Li>
<Recruitment>
<div>
<ImageProps status={user.approveStatus} />
<Number>{item.recruitmentBusinessId}</Number>
<Category>
<div>대분류</div>
<div>
{
item.classificationResponse.bigClassification
.bigClassificationName
}
</div>
</Category>
<Category>
<div>소분류</div>
<div>{item.classificationResponse.name}</div>
</Category>
<Category>
<div>채용인원</div>
<div>{item.numberOfEmployee}</div>
</Category>
</div>
<ApplicantList>
<div>{user.data.notice.company.lastNoticeDate}</div>
<button>신청자 리스트</button>
</ApplicantList>
</Recruitment>
</Li>
))}
</>
))}
</Ul>
)}
<Ul>
{data.as.map((user, i) => (
<>
<Li>
<Recruitment>
<div>
<ImageProps status={data.count[i].approve} />
<Number>{data.count[i].id}</Number>
<Category>
<div>대분류</div>
<Main>{user}</Main>
</Category>
<Category>
<div>소분류</div>
<Sub>{data.ad[i]}</Sub>
</Category>
<Category>
<div>채용인원</div>
<div>{data.count[i].total}</div>
</Category>
</div>
<ApplicantList>
<div>{data.count[i].day}</div>
<button>신청자 리스트</button>
</ApplicantList>
</Recruitment>
</Li>
</>
))}
</Ul>
</>
);
};
Expand Down Expand Up @@ -91,13 +75,25 @@ const ApplicantList = styled.div`
`;

const Number = styled.div`
width: 10px;
font-size: 24px;
font-weight: 700;
color: #4000ff;
margin-left: 20px;
margin-right: 31px;
`;

const Main = styled.div`
width: 130px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;
const Sub = styled.div`
width: 120px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;
const Category = styled.div`
display: inline-flex;
align-items: center;
Expand All @@ -109,13 +105,14 @@ const Category = styled.div`
color: #4000ff;
+ div {
color: #000;
font-weight: 400;
font-size: 20px;
font: 400 normal 18px "NanumGothic", sans-serif;
}
}
`;
const Ul = styled.ul`
position: relative;
list-style-type: none;
`;
const Li = styled.li``;
const Li = styled.li`
width: 1136px;
`;
39 changes: 39 additions & 0 deletions src/components/pages/teacherPage/manage/Bokli/bok/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import * as s from "../../style";
const BokliAfter = ({ wel }) => {
let ad = [];
if (wel.dormitorySupport) {
ad.push("기숙사 지원");
}
if (wel.selfDevelopmentPay) {
ad.push("자기개발비");
}
if (wel.equipmentSupport) {
ad.push("장비지원");
}
if (wel.youthTomorrowChaeumDeduction) {
ad.push("청년내일채움");
}
if (wel.alternativeMilitaryPlan) {
ad.push("병특신청");
}
if (wel.elseSupport !== null) {
wel.elseSupport.map((item) => ad.push(item));
}
return (
<>
<s.Subdd>복리후생</s.Subdd>
<s.UlLineBreak>
{ad.map((user) => (
<>
<s.EssentialLi>
<s.ButtonProps width={101} left={20}>
{user}
</s.ButtonProps>
</s.EssentialLi>
</>
))}
</s.UlLineBreak>
</>
);
};
export default BokliAfter;
Loading

0 comments on commit 279b52a

Please sign in to comment.