Skip to content

Commit

Permalink
Merge branch 'develop' into feature/45-notice_api
Browse files Browse the repository at this point in the history
  • Loading branch information
eejx0 authored May 27, 2024
2 parents fc95634 + b0eb29b commit 11b4983
Show file tree
Hide file tree
Showing 27 changed files with 1,273 additions and 157 deletions.
262 changes: 262 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"@team-return/design-system": "^1.1.13",
"axios": "^1.3.4",
"file-saver": "^2.0.5",
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
"react": "^18.2.0",
"react-beautiful-dnd": "^13.1.1",
"react-cookie": "^4.1.1",
Expand Down
1 change: 1 addition & 0 deletions src/Apis/Companies/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export const useGetCompanyDetail = (companyId: string) => {
},
{
refetchOnWindowFocus: true,
enabled: !!+companyId,
}
);
};
Expand Down
1 change: 1 addition & 0 deletions src/Apis/Companies/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ export interface CompanyInfoEditType {
take: number;
service_name: string;
company_profile_url: string;
representative_phone_no: string;
}
3 changes: 3 additions & 0 deletions src/Apis/Companies/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ export interface CompanyDetailResponse {
fax: string | null;
email: string;
representative_name: string;
representative_phone_no: string;
founded_at: string;
worker_number: number;
take: number;
recruitment_id: number | null;
attachments: string[];
service_name: string;
business_area: string;
business_area_code: number;
biz_registration_url: string;
}
2 changes: 1 addition & 1 deletion src/Apis/Recruitments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const useAddArea = (
/** 모집 의뢰 수정 */
export const useEditRecruitment = (
recruitmentId: string,
recruitmentData: EditRecruitmentRequest,
recruitmentData: Omit<EditRecruitmentRequest, 'start_time' | 'end_time'>,
options: MutationOptions
) => {
return useMutation(
Expand Down
6 changes: 4 additions & 2 deletions src/Apis/Recruitments/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ export interface EditRecruitmentRequest {
required_grade?: number | null;
start_time: string;
end_time: string;
working_hours: string;
train_pay: number;
pay: string | null;
benefits: string | null;
military: boolean;
hiring_progress: string[];
submit_document: string;
start_date: string;
end_date: string;
start_date: string | null;
end_date: string | null;
etc: string | null;
flexible_working: boolean;
}

export interface EditAreasType {
Expand Down
14 changes: 10 additions & 4 deletions src/Apis/Recruitments/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ export interface RecruitmentFormDetailResponse {
company_name: string;
areas: AreasType[];
required_grade: number | null;
start_time: string;
end_time: string;
working_hours: string;
flexible_working: boolean;
required_licenses: string[];
recruitment_id: number;
hiring_progress: string[];
train_pay: number;
pay: string | null;
Expand All @@ -36,10 +37,15 @@ export interface RecruitmentFormDetailResponse {
etc: string | null;
}

interface nameAndId {
name: string;
id: number;
}

export interface AreasType {
id: number;
job: string[];
tech: string[];
job: nameAndId[];
tech: nameAndId[];
hiring: number;
major_task: string;
preferential_treatment: string | null;
Expand Down
22 changes: 18 additions & 4 deletions src/Components/CompanyRecruitment/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Button, DropDown, Input } from '@team-return/design-system';
import * as _ from './style';
import { useGetCode } from '../../../Apis/Codes';
import { useCompanyRecruitmentQueryString } from '../../../Store/State';
import { companyType } from '../../../Utils/Translation';
import { getValueByKey } from '../../../Utils/useGetPropertyKey';

interface PropsType {
refetchCompanyRecruitment: () => void;
Expand Down Expand Up @@ -38,12 +40,16 @@ export function CompanyRecruitmentSearch({
onChange={(type) =>
companyRecruitmentQueryStringDropDown(
'company_type',
type
getValueByKey(companyType, type)
)
}
width={28}
option={['전체', '선도기업', '참여기업']}
value={companyRecruitmentQueryString.company_type}
value={
companyType[
companyRecruitmentQueryString.company_type
]
}
/>
</_.ContentWrapper>
<_.TitleText>지역</_.TitleText>
Expand Down Expand Up @@ -89,12 +95,20 @@ export function CompanyRecruitmentSearch({
onChange={(industry) =>
companyRecruitmentQueryStringDropDown(
'industry',
industry
businessCode?.codes.find(
(item) => item.keyword === industry
)?.code
)
}
width={90}
option={allKeywords}
value={companyRecruitmentQueryString.industry}
value={
businessCode?.codes.find(
(item) =>
item.code.toString() ===
companyRecruitmentQueryString.industry
)?.keyword
}
/>
</_.ContentWrapper>
<_.Btn>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/CompanyRecruitment/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export function CompanyRecruitmentTable({
<_.ContentText
status={companie.company_type === 'PARTICIPATING'}
>
{companyType[companie.company_type]}기업
{companyType[companie.company_type]}
</_.ContentText>, // 기업구분
<_.ContentText>{companie.convention && 'Y'}</_.ContentText>, // 협약여부
<_.ContentText>
Expand Down
50 changes: 39 additions & 11 deletions src/Components/Detail/CompanyDetail/Basic/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Button, Stack, Text } from '@team-return/design-system';
import { Button, Stack, Text, Icon } from '@team-return/design-system';
import { Dispatch, SetStateAction } from 'react';
import { useNavigate } from 'react-router-dom';
import { CompanyDetailResponse } from '../../../../Apis/Companies/response';
import * as _ from '../../style';
import { useDownloadData } from '../../../../Apis/File';

interface PropsType {
companyDetailInfo: CompanyDetailResponse;
Expand All @@ -14,42 +15,69 @@ export function CompanyDetailBasic({
setCanEdit,
}: PropsType) {
const navigate = useNavigate();

const nameArray = decodeURI(companyDetailInfo?.biz_registration_url).split(
'/'
);
const { mutate: downloadFile } = useDownloadData({
fileName: nameArray[nameArray.length - 1].substring(37),
fileUrl: companyDetailInfo?.biz_registration_url,
});

return (
<_.Container>
<_.Wrapper>
<Stack direction="column">
<_.BackWrapper onClick={() => navigate(-1)}>
<_.BackIcon
icon="Chevron"
/>
<Text margin={[0, 0, -4, 0]} size='Body2'>뒤로가기</Text>
<_.BackIcon icon="Chevron" />
<Text margin={[0, 0, -4, 0]} size="Body2">
뒤로가기
</Text>
</_.BackWrapper>
<_.LogoWrapper>
<_.CompanyLogo
src={`${process.env.REACT_APP_FILE_URL}${companyDetailInfo?.company_profile_url}`}
/>
</_.LogoWrapper>
</Stack>
<Button size="M" onClick={() => setCanEdit(true)}>
수정
</Button>
<Stack gap={10}>
<Button
size="M"
onClick={() => {
downloadFile();
}}
>
사업자등록증
<Icon icon="Download" color="gray10" size={20}></Icon>
</Button>
<Button size="M" onClick={() => setCanEdit(true)}>
수정
</Button>
</Stack>
</_.Wrapper>
<_.Stack>
<_.TitleBox>기업명</_.TitleBox>
<_.ContentBox width={25}>
<_.ContentBox width={15}>
{companyDetailInfo?.company_name}
</_.ContentBox>
<_.TitleBox>사업자 번호</_.TitleBox>
<_.ContentBox width={25}>
<_.ContentBox width={15}>
{companyDetailInfo?.business_number.replace(
/(\d{3})(\d{2})(\d{5})/,
'$1-$2-$3'
)}
</_.ContentBox>
<_.TitleBox>대표자</_.TitleBox>
<_.ContentBox width={20}>
<_.ContentBox width={15}>
{companyDetailInfo?.representative_name}
</_.ContentBox>
<_.TitleBox>대표 전화번호</_.TitleBox>
<_.ContentBox width={15}>
{companyDetailInfo?.representative_phone_no.replace(
/(\d{3})(\d{4})(\d{4})/,
'$1-$2-$3'
)}
</_.ContentBox>
</_.Stack>
<_.Stack>
<_.TitleBox>설립일</_.TitleBox>
Expand Down
26 changes: 22 additions & 4 deletions src/Components/Detail/CompanyDetail/Edit/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { Button, Icon, Stack, useToastStore, Text } from '@team-return/design-system';
import {
Button,
Icon,
Stack,
useToastStore,
Text,
} from '@team-return/design-system';
import { Dispatch, SetStateAction, useRef, useState } from 'react';
import { CompanyDetailResponse } from '../../../../Apis/Companies/response';
import { useForm } from '../../../../Hooks/useForm';
Expand Down Expand Up @@ -46,6 +52,7 @@ export function CompanyDetailEdit({
take: companyDetailInfo?.take,
service_name: companyDetailInfo?.service_name,
company_profile_url: companyDetailInfo?.company_profile_url,
representative_phone_no: companyDetailInfo?.representative_phone_no,
});

const {
Expand All @@ -66,6 +73,7 @@ export function CompanyDetailEdit({
worker_number,
take,
service_name,
representative_phone_no,
} = companyDetailEditInfo;

const { mutate: editCompanyInfo } = useChangeCompanyInfo(
Expand Down Expand Up @@ -166,7 +174,7 @@ export function CompanyDetailEdit({
</_.Wrapper>
<_.Stack>
<_.TitleBox>기업명</_.TitleBox>
<_.ContentBox width={25}>
<_.ContentBox width={15}>
<_.CustomInput
width={100}
type="text"
Expand All @@ -176,7 +184,7 @@ export function CompanyDetailEdit({
/>
</_.ContentBox>
<_.TitleBox>사업자 번호</_.TitleBox>
<_.ContentBox width={25}>
<_.ContentBox width={15}>
<_.CustomInput
width={100}
type="text"
Expand All @@ -188,7 +196,7 @@ export function CompanyDetailEdit({
/>
</_.ContentBox>
<_.TitleBox>대표자</_.TitleBox>
<_.ContentBox width={20}>
<_.ContentBox width={15}>
<_.CustomInput
width={100}
type="text"
Expand All @@ -197,6 +205,16 @@ export function CompanyDetailEdit({
onChange={companyDetailEditInfohandler}
/>
</_.ContentBox>
<_.TitleBox>대표 전화번호</_.TitleBox>
<_.ContentBox width={15}>
<_.CustomInput
width={100}
type="text"
value={representative_phone_no}
name="representative_phone_no"
onChange={companyDetailEditInfohandler}
/>
</_.ContentBox>
</_.Stack>
<_.Stack>
<_.TitleBox>설립일</_.TitleBox>
Expand Down
44 changes: 31 additions & 13 deletions src/Components/Detail/RecruitmentFormDetail/Basic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,21 @@ export function RecruitmentFormDetailBasic({
/>
</_.LogoWrapper>
</Stack>
<Button size="M" onClick={() => setCanEdit(true)}>
수정
</Button>
<Stack gap={10}>
<Button
size="M"
onClick={() =>
navigate(
`/pdf/${recruitmentFormDetail.recruitment_id}`
)
}
>
모집의뢰서 미리보기
</Button>
<Button size="M" onClick={() => setCanEdit(true)}>
수정
</Button>
</Stack>
</_.Wrapper>
<_.Stack>
<_.TitleBox>기업명</_.TitleBox>
Expand All @@ -41,8 +53,15 @@ export function RecruitmentFormDetailBasic({
</_.ContentBox>
<_.TitleBox>모집기간</_.TitleBox>
<_.ContentBox width={40}>
{recruitmentFormDetail?.start_date.replace(/-/g, '.')} ~{' '}
{recruitmentFormDetail?.end_date.replace(/-/g, '.')}
{recruitmentFormDetail?.start_date
? `${recruitmentFormDetail?.start_date.replace(
/-/g,
'.'
)} ~ ${recruitmentFormDetail?.end_date.replace(
/-/g,
'.'
)}`
: '상시모집'}
</_.ContentBox>
</_.Stack>
<_.Stack>
Expand Down Expand Up @@ -73,7 +92,9 @@ export function RecruitmentFormDetailBasic({
overflow="scroll"
longText={true}
>
{area.job.join(' / ')}
{area.job
.map((item) => item.name)
.join(' / ')}
</_.ContentBox>
<_.TitleBox height={125}>
사용기술
Expand All @@ -84,7 +105,9 @@ export function RecruitmentFormDetailBasic({
overflow="scroll"
longText={true}
>
{area.tech.join(' / ')}
{area.tech
.map((item) => item.name)
.join(' / ')}
</_.ContentBox>
</_.Stack>
<_.Stack>
Expand Down Expand Up @@ -150,12 +173,7 @@ export function RecruitmentFormDetailBasic({
<_.Stack>
<_.TitleBox>근무시간</_.TitleBox>
<_.ContentBox width={23}>
{recruitmentFormDetail?.start_time.replace(
/^(\d{2}:\d{2}):\d{2}$/,
'$1'
)}
{' ~ '}
{recruitmentFormDetail?.end_time.replace(
{recruitmentFormDetail?.working_hours.replace(
/^(\d{2}:\d{2}):\d{2}$/,
'$1'
)}
Expand Down
Loading

0 comments on commit 11b4983

Please sign in to comment.