PageSourceSearch

https://lms.gie.kr/assets/CourseNoticeDetail-DFZSaiTm.js

js gie.kr collected 2026-10-06 12:43:05 UTC 13,553 bytes, 1 lines download raw bytes

1import{e as B,a as S,b as $,r as n,j as e,f as c}from"./index-DMTSLr9O.js";import{L as h}from"./LMSLayout-DVcuaCDx.js";import{C as u}from"./CourseSidebar-reuob7wx.js";/* empty css                   *//* empty css                   */import{s as W}from"./safeHtml-B9XgEjSj.js";import"./LMSSidebar-DvoCer1q.js";import"./lmsService-SMsr-Q5g.js";import"./LearningActivityIcon-GUcTK9Uz.js";import"./purify.es-CGs5VtEq.js";const q=()=>{const{uuid:t,noticeId:o}=B(),l=S(),{user:x}=$(),[s,b]=n.useState(null),[i,g]=n.useState({prev:null,next:null}),[f,j]=n.useState(!1),[w,m]=n.useState(null),[d,v]=n.useState(""),[y,p]=n.useState(!1),N=async()=>{if(!t||!o){m("잘못된 접근입니다.");return}j(!0),m(null);try{const a=await c.get(`/lms/cws-notices/${t}/${o}`);b(a.data);try{const r=await c.get(`/lms/cws-notices/${t}/prev-next/${o}`);g(r.data)}catch{g({prev:null,next:null})}}catch(a){m(a.message||"공지사항을 불러오는데 실패했습니다."),console.error("공지사항 상세 로드 오류:",a)}finally{j(!1)}};n.useEffect(()=>{(async()=>{if(t)try{const r=await c.get(`/lms/cws/${t}`);v(r.data.title||r.data.cw_kor_title||"");const H=r.data.institution_id;if(x)if(x.role==="admin")p(!0);else if(x.role==="ins_admin"&&x.institution_id===H)p(!0);else try{const M=(await c.get("/lms/instructors/my-courses")).data.courses?.some(P=>P.cw_uuid===t);p(M)}catch{p(!1)}}catch(r){console.error("Failed to load course info:",r)}})()},[t,x]),n.useEffect(()=>{o&&(m(null),N())},[o]);const k=()=>
1{l(`/lms/cws/home/${t}/notice`)},L=()=>{l(`/lms/cws/home/${t}/notice/${o}/edit`)},C=async()=>{if(window.confirm("정말로 이 공지사항을 삭제하시겠습니까?"))try{await c.delete(`/lms/cws-notices/${t}/${o}`),alert("공지사항이 삭제되었습니다."),l(`/lms/cws/home/${t}/notice`)}catch(a){alert(`삭제 실패: ${a.response?.data?.detail||a.message}`)}};return f&&!s?e.jsxs(h,{children:[d&&e.jsx("header",{style:{width:"100%",marginBottom:"24px",paddingBottom:"16px",borderBottom:"2px solid #3a2db3"},children:e.jsx("h1",{style:{fontSize:"28px",fontWeight:"600",color:"#333333",fontFamily:"Pretendard-SemiBold, Helvetica",margin:"0"},children:d})}),e.jsxs("div",{className:"course-home-container",children:[e.jsx(u,{uuid:t}),e.jsx("div",{className:"course-main-content",children:e.jsx("div",{style:{textAlign:"center",padding:"4rem"},children:e.jsx("p",{children:"공지사항을 불러오는 중입니다..."})})})]})]}):w||!f&&!s?e.jsxs(h,{children:[d&&e.jsx("header",{style:{width:"100%",marginBottom:"24px",paddingBottom:"16px",borderBottom:"2px solid #3a2db3"},children:e.jsx("h1",{style:{fontSize:"28px",fontWeight:"600",color:"#333333",fontFamily:"Pretendard-SemiBold, Helvetica",margin:"0"},children:d})}),e.jsxs("div",{className:"course-home-container",children:[e.jsx(u,{uuid:t}),e.jsx("div",{className:"course-main-content",children:e.jsxs("div",{style:{textAlign:"center",padding:"4rem"},children:[e.jsx("p",{style:{color:"red",marginBottom:"1rem"},children:w||"공지사항을 찾을 수 없습니다."}),e.jsx("button",{onClick:k,style:{marginTop:"1rem"},children:"목록으로 돌아가기"})]})})]})]}):e.jsxs(h,{children:[d&&e.jsx("header",{style:{width:"100%",marginBottom:"24px",paddingBottom:"16px",borderBottom:"2px solid #3a2db3"},children:e.jsx("h1",{style:{fontSize:"28px",fontWeight:"600",color:"#333333",fontFamily:"Pretendard-SemiBold, Helvetica",margin:"0"},children:d})}),e.jsxs("div",{className:"course-home-container",children:[e.jsx(u,{uuid:t}),e.jsx("div",{className:"course-main-content",children:e.jsxs("article",{className:"flex flex-col items-start gap-10 px-6 py-6 max-md:px-4 max-md:py-5 max-md:gap-5 relative w-full bg-x-ffffff",children:[f&&s&&e.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10},children:e.jsx("p",{children:"새로운 공지사항을 불러오는 중..."})}),e.jsxs("div",{className:"flex flex-col items-start gap-[7px] w-full border-t-2 border-x-333333",children:[e.jsxs("div",{className:"flex items-end gap-2.5 px-0 py-5 w-full border-b border-line1-e9e9e9 max-md:flex-col max-md:items-start",children:[e.jsxs("div",{className:"flex flex-col items-start gap-2.5 flex-1",children:[e.jsx("h2",{className:"self-stretch mt-[-1.00px] font-['Pretendard-SemiBold',Helvetica] font-semibold text-x-333333 text-2xl max-md:text-lg leading-normal tracking-[0]",children:s.title}),e.jsxs("dl",{className:"flex items-center gap-4 w-full max-md:gap-3 max-md:flex-wrap",children:[e.jsxs("div",{className:"flex items-center max-md:w-auto shrink-0",children:[e.jsx("dt",{className:"font-['Pretendard-Medium',Helvetica] font-medium text-[#333333] text-sm max-md:text-xs",children:"작성자"}),e.jsxs("dd",{className:"font-['Pretendard-Regular',Helvetica] text-[#808080] text-sm max-md:text-xs whitespace-nowrap",children:[" | ",s.author_name||s.author]})]}),e.jsxs("div",{className:"flex items-center max-md:w-auto shrink-0",children:[e.jsx("dt",{className:"font-['Pretendard-Medium',Helvetica] font-medium text-[#333333] text-sm max-md:text-xs",children:"작성일"}),e.jsxs("dd",{className:"font-['Pretendard-Regular',Helvetica] text-[#808080] text-sm max-md:text-xs whitespace-nowrap",children:[" | ",new Date(s.published_at).toLocaleDateString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit"}).replace(/\./g,".").replace(/\s/g," ")]})]}),e.jsxs("div",{className:"flex items-center max-md:w-auto shrink-0",children:[e.jsx("dt",{className:"font-['Pretendard-Medium',Helvetica] font-medium text-[#333333] text-sm max-md:text-xs",children:"조회수"}),e.jsxs("dd",{className:"font-['Pretendard-Regular',Helvetica] text-[#808080] text-sm max-md:text-xs whitespace-nowrap",children:[" | ",s.view_count]})]})]})]}),e.jsxs("div",{className:"inline-flex items-center gap-[7px] max-md:self-start",children:[e.jsx("button",{className:"w-[34px] h-[34px] p-[6.8px] bg-x-ffffff rounded-[17px] border border-solid border-line2-d9d9d9 flex items-center justify-center","aria-label":"Print",onClick:()=>window.print(),children:e.jsxs("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("path",{d:"M6 9V2H18V9",stroke:"#333333",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6 18H4C3.46957 18 2.96086 17.7893 2.58579 17.4142C2.21071 17.0391 2 16.5304 2 16V11C2 10.4696 2.21071 9.96086 2.58579 9.58579C2.96086 9.21071 3.46957 9 4 9H20C20.5304 9 21.0391 9.21071 21.4142 9.58579C21.7893 9.96086 22 10.4696 22 11V16C22 16.5304 21.7893 17.0391 21.4142 17.4142C21.0391 17.7893 20.5304 18 20 18H18",stroke:"#333333",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M18 14H6V22H18V14Z",stroke:"#333333",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("button",{className:"w-[34px] h-[34px] p-[6.8px] bg-x-ffffff rounded-[17px] border border-solid border-line2-d9d9d9 flex items-center justify-center","aria-label":"Share",onClick:()=>{navigator.share?navigator.share({title:s.title,url:window.location.href}):(navigator.clipboard.writeText(window.location.href),alert("링크가 클립보드에 복사되었습니다."))},children:e.jsxs("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("path",{d:"M18 8C19.6569 8 21 6.65685 21 5C21 3.34315 19.6569 2 18 2C16.3431 2 15 3.34315 15 5C15 6.65685 16.3431 8 18 8Z",stroke:"#333333",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6 15C7.65685 15 9 13.6569 9 12C9 10.3431 7.65685 9 6 9C4.34315 9 3 10.3431 3 12C3 13.6569 4.34315 15 6 15Z",stroke:"#333333",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M18 22C19.6569 22 21 20.6569 21 19C21 17.3431 19.6569 16 18 16C16.3431 16 15 17.3431 15 19C15 20.6569 
116.3431 22 18 22Z",stroke:"#333333",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.59 13.51L15.42 17.49",stroke:"#333333",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15.41 6.51L8.59 10.49",stroke:"#333333",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})]}),e.jsxs("div",{className:"flex flex-col min-h-[400px] max-md:min-h-[200px] items-start justify-between pt-[15px] pb-[30px] px-[15px] max-md:px-0 max-md:pt-3 max-md:pb-5 w-full border-b-2 border-x-333333",children:[e.jsx("div",{className:"w-full prose prose-lg max-md:prose-sm max-w-none",dangerouslySetInnerHTML:{__html:W(s.body)}}),s.attached_file&&s.attached_file.length>0&&e.jsx("div",{className:"mt-4 w-full",children:s.attached_file.map((a,r)=>e.jsxs("a",{href:a,download:!0,className:"inline-flex h-10 items-center gap-[7px] px-[15px] py-2.5 bg-x-ffffff rounded-[5px] border border-solid border-line2-d9d9d9 mr-2 mb-2",children:[e.jsxs("svg",{className:"w-[18px] h-[18px]",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("path",{d:"M15.75 11.25V14.25C15.75 14.6478 15.592 15.0294 15.3107 15.3107C15.0294 15.592 14.6478 15.75 14.25 15.75H3.75C3.35218 15.75 2.97064 15.592 2.68934 15.3107C2.40804 15.0294 2.25 14.6478 2.25 14.25V11.25",stroke:"#333333",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M5.25 7.5L9 11.25L12.75 7.5",stroke:"#333333",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M9 11.25V2.25",stroke:"#333333",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsx("span",{className:"w-fit mt-[-2.00px] font-['Pretendard-Medium',Helvetica] font-medium text-x-333333 text-base text-center tracking-[0] leading-[22.4px] whitespace-nowrap",children:a.split("/").pop()||`첨부파일 ${r+1}`})]},r))})]})]}),e.jsxs("nav",{className:"flex flex-col items-start w-full","aria-label":"Post navigation",children:[i.prev&&e.jsxs("button",{onClick:()=>l(`/lms/cws/home/${t}/notice/${i.prev.id}`),className:"flex items-center gap-5 max-md:gap-3 px-[30px] max-md:px-4 py-5 max-md:py-3 w-full border-t border-b border-line1-e9e9e9 hover:bg-gray-50 transition-colors",children:[e.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M5 15L12 8L19 15",stroke:"#333333",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("span",{className:"font-['Pretendard-Medium',Helvetica] font-medium text-base max-md:text-sm leading-[22.4px] text-x-333333 tracking-[0]",style:{width:"60px"},children:"이전글"}),e.jsx("span",{className:"flex-1 text-left font-['Pretendard-Medium',Helvetica] font-medium text-x-333333 text-base max-md:text-sm leading-[22.4px] tracking-[0] overflow-hidden text-ellipsis whitespace-nowrap",children:i.prev.title}),e.jsx("time",{className:"font-['Pretendard-Regular',Helvetica] font-normal text-x-696969 text-base max-md:text-xs tracking-[0] leading-[22.4px] whitespace-nowrap max-md:hidden",children:new Date(i.prev.published_at).toLocaleDateString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit"}).replace(/\s/g,"")})]}),i.next&&e.jsxs("button",{onClick:()=>l(`/lms/cws/home/${t}/notice/${i.next.id}`),className:"flex items-center gap-5 max-md:gap-3 px-[30px] max-md:px-4 py-5 max-md:py-3 w-full border-b border-line1-e9e9e9 hover:bg-gray-50 transition-colors",children:[e.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M19 9L12 16L5 9",stroke:"#333333",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("span",{className:"font-['Pretendard-Medium',Helvetica] font-medium text-base max-md:text-sm leading-[22.4px] text-x-333333 tracking-[0]",style:{width:"60px"},children:"다음글"}),e.jsx("span",{className:"flex-1 text-left font-['Pretendard-Medium',Helvetica] font-medium text-x-333333 text-base max-md:text-sm leading-[22.4px] tracking-[0] overflow-hidden text-ellipsis whitespace-nowrap",children:i.next.title}),e.jsx("time",{className:"font-['Pretendard-Regular',Helvetica] font-normal text-x-696969 text-base max-md:text-xs tracking-[0] leading-[22.4px] whitespace-nowrap max-md:hidden",children:new Date(i.next.published_at).toLocaleDateString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit"}).replace(/\s/g,"")})]})]}),e.jsxs("div",{className:"gap-[7px] w-full flex items-center justify-center",children:[y&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:L,className:"flex w-[100px] max-md:w-auto max-md:flex-1 h-10 items-center justify-center gap-[7px] px-[15px] py-2.5 bg-gray-500 rounded-[5px] hover:bg-gray-600 transition-colors",children:e.jsx("span",{className:"w-fit mt-[-3.00px] font-['Pretendard-Medium',Helvetica] font-medium text-x-ffffff text-base text-center leading-[22.4px] whitespace-nowrap tracking-[0]",children:"수정"})}),e.jsx("button",{onClick:C,className:"flex w-[100px] max-md:w-auto max-md:flex-1 h-10 items-center justify-center gap-[7px] px-[15px] py-2.5 bg-red-500 rounded-[5px] hover:bg-red-600 transition-colors",children:e.jsx("span",{className:"w-fit mt-[-3.00px] font-['Pretendard-Medium',Helvetica] font-medium text-x-ffffff text-base text-center leading-[22.4px] whitespace-nowrap tracking-[0]",children:"삭제"})})]}),e.jsx("button",{onClick:k,className:"flex w-[100px] max-md:w-auto max-md:flex-1 h-10 items-center justify-center gap-[7px] px-[15px] py-2.5 bg-green1-007062 rounded-[5px] hover:bg-green2-005248 transition-colors",children:e.jsx("span",{className:"w-fit mt-[-3.00px] font-['Pretendard-Medium',Helvetica] font-medium text-x-ffffff text-base text-center leading-[22.4px] whitespace-nowrap tracking-[0]",children:"목록"})})]})]})})]})]})};export{q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.