zioinfo-mail/_archive/backend/src/main/resources/static/assets/AdminRecruit-CfX4mhQb.js
DESKTOP-TKLFCPR\ython 28d3ba4836 refactor(cleanup): commit folder reorganization - scripts/, _archive/, docs/ restructure
- Move backend/frontend/messenger/ old paths to _archive/
- Reorganize scripts into scripts/deploy, check, push, setup, misc
- Move docs (pptx, docx) to docs/
- Add .claude agents and skills for fullstack/folder-cleanup harness
- workspace/ projects remain intact

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 19:43:09 +09:00

2 lines
6.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{r,j as e}from"./index-ChpGil2q.js";const P=()=>localStorage.getItem("admin_token"),u=(l,c={})=>fetch(l,{...c,headers:{"Content-Type":"application/json",Authorization:`Bearer ${P()}`,...c.headers}}),f={title:"",department:"",jobType:"정규직",description:"",requirements:"",preferred:"",deadline:"",headcount:1,active:!0},w=["정규직","계약직","인턴","프리랜서"];function z(){const[l,c]=r.useState(0),[i,N]=r.useState({content:[],totalPages:0,totalElements:0}),[y,d]=r.useState(!1),[t,m]=r.useState(f),[o,p]=r.useState(null),[b,g]=r.useState(!1),[j,v]=r.useState(null),x=(s,a="success")=>{v({msg:s,type:a}),setTimeout(()=>v(null),2500)},h=r.useCallback(()=>{u(`/api/admin/recruits?page=${l}&size=10`).then(s=>s.json()).then(N)},[l]);r.useEffect(()=>{h()},[h]);const C=()=>{m(f),p(null),d(!0)},S=s=>{m({...s,deadline:s.deadline||""}),p(s.id),d(!0)},k=async()=>{g(!0);const s=o?`/api/admin/recruits/${o}`:"/api/admin/recruits",a=await u(s,{method:o?"PUT":"POST",body:JSON.stringify(t)});g(!1),a.ok?(d(!1),h(),x(o?"수정되었습니다.":"등록되었습니다.")):x("저장 실패","error")},T=async s=>{if(!confirm("삭제하시겠습니까?"))return;(await u(`/api/admin/recruits/${s}`,{method:"DELETE"})).ok&&(h(),x("삭제되었습니다."))},n=(s,a)=>m(E=>({...E,[s]:a}));return e.jsxs(e.Fragment,{children:[j&&e.jsx("div",{className:"admin-toast",children:e.jsx("div",{className:`toast-item ${j.type}`,children:j.msg})}),e.jsxs("div",{className:"admin-card",children:[e.jsxs("div",{className:"admin-toolbar",children:[e.jsxs("span",{style:{fontSize:13,color:"#64748b"},children:["전체 ",i.totalElements,"건"]}),e.jsx("div",{className:"admin-toolbar-right",children:e.jsx("button",{className:"btn btn-primary",onClick:C,children:" 채용공고 등록"})})]}),e.jsx("div",{className:"admin-table-wrap",children:e.jsxs("table",{className:"admin-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"No"}),e.jsx("th",{children:"공고명"}),e.jsx("th",{children:"부서"}),e.jsx("th",{children:"유형"}),e.jsx("th",{children:"모집인원"}),e.jsx("th",{children:"마감일"}),e.jsx("th",{children:"상태"}),e.jsx("th",{children:"관리"})]})}),e.jsxs("tbody",{children:[i.content.map((s,a)=>e.jsxs("tr",{children:[e.jsx("td",{style:{color:"#94a3b8",fontSize:12},children:i.totalElements-l*10-a}),e.jsx("td",{children:e.jsx("span",{className:"truncate",style:{display:"block"},children:s.title})}),e.jsx("td",{children:s.department||"-"}),e.jsx("td",{children:e.jsx("span",{className:`badge ${s.jobType==="정규직"?"badge-blue":s.jobType==="인턴"?"badge-orange":"badge-gray"}`,children:s.jobType})}),e.jsxs("td",{children:[s.headcount,"명"]}),e.jsx("td",{style:{fontSize:12},children:s.deadline||"상시"}),e.jsx("td",{children:e.jsx("span",{className:`badge ${s.active?"badge-green":"badge-red"}`,children:s.active?"진행중":"마감"})}),e.jsx("td",{children:e.jsxs("div",{className:"action-btns",children:[e.jsx("button",{className:"btn btn-outline btn-sm",onClick:()=>S(s),children:"수정"}),e.jsx("button",{className:"btn btn-danger btn-sm",onClick:()=>T(s.id),children:"삭제"})]})})]},s.id)),!i.content.length&&e.jsx("tr",{children:e.jsx("td",{colSpan:8,children:e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-icon",children:"👥"}),e.jsx("p",{children:"등록된 채용공고가 없습니다."})]})})})]})]})}),i.totalPages>1&&e.jsxs("div",{className:"admin-pagination",children:[e.jsxs("span",{className:"admin-pagination-info",children:["페이지 ",l+1," / ",i.totalPages]}),e.jsxs("div",{className:"pagination-btns",children:[e.jsx("button",{disabled:l===0,onClick:()=>c(s=>s-1),children:""}),Array.from({length:i.totalPages},(s,a)=>e.jsx("button",{className:l===a?"active":"",onClick:()=>c(a),children:a+1},a)),e.jsx("button",{disabled:l>=i.totalPages-1,onClick:()=>c(s=>s+1),children:""})]})]})]}),y&&e.jsx("div",{className:"modal-backdrop",onClick:s=>s.target===s.currentTarget&&d(!1),children:e.jsxs("div",{className:"modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:o?"채용공고 수정":"채용공고 등록"}),e.jsx("button",{onClick:()=>d(!1),children:"✕"})]}),e.jsxs("div",{className:"modal-body",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"공고 제목 *"}),e.jsx("input",{className:"form-control",value:t.title,onChange:s=>n("title",s.target.value),placeholder:"예: 백엔드 개발자 (Java/Spring)"})]}),e.jsxs("div",{className:"form-row",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"부서"}),e.jsx("input",{className:"form-control",value:t.department,onChange:s=>n("department",s.target.value),placeholder:"개발팀, 영업팀 등"})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"고용형태"}),e.jsx("select",{className:"form-control",value:t.jobType,onChange:s=>n("jobType",s.target.value),children:w.map(s=>e.jsx("option",{children:s},s))})]})]}),e.jsxs("div",{className:"form-row",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"모집 인원"}),e.jsx("input",{type:"number",min:1,className:"form-control",value:t.headcount,onChange:s=>n("headcount",parseInt(s.target.value))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"마감일"}),e.jsx("input",{type:"date",className:"form-control",value:t.deadline,onChange:s=>n("deadline",s.target.value)})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"공고 상태"}),e.jsxs("select",{className:"form-control",value:t.active,onChange:s=>n("active",s.target.value==="true"),children:[e.jsx("option",{value:"true",children:"진행중"}),e.jsx("option",{value:"false",children:"마감"})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"담당 업무"}),e.jsx("textarea",{className:"form-control",rows:4,value:t.description,onChange:s=>n("description",s.target.value),placeholder:"- 주요 담당 업무를 입력하세요"})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"지원 자격"}),e.jsx("textarea",{className:"form-control",rows:4,value:t.requirements,onChange:s=>n("requirements",s.target.value),placeholder:"- 필수 자격요건을 입력하세요"})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"우대 사항"}),e.jsx("textarea",{className:"form-control",rows:3,value:t.preferred,onChange:s=>n("preferred",s.target.value),placeholder:"- 우대 사항을 입력하세요"})]})]}),e.jsxs("div",{className:"modal-footer",children:[e.jsx("button",{className:"btn btn-outline",onClick:()=>d(!1),children:"취소"}),e.jsx("button",{className:"btn btn-primary",onClick:k,disabled:b||!t.title,children:b?"저장 중...":o?"수정 완료":"등록"})]})]})})]})}export{z as default};