PageSourceSearch

https://bngts.com/_nuxt/FQjjOQ6f.js

js bngts.com collected 2026-10-02 01:26:29 UTC 12,082 bytes, 1 lines download raw bytes

1import{_ as ye,M as ge}from"./DAO-TjI4.js";import{c as _e,d as he,x as ke,y as we,B as Ce,P as De,a6 as Te,C as xe,T as Ee,a as Ae,b as r,f as b,e as o,k as h,i as t,t as d,h as y,N as E,g,F as Z,I as ee,r as Ie,M as te,D as A,E as F,K as ae,V as Ne,A as c,S as k,j as M,X as Se,o as n,Q as oe,p as ze}from"./DrlufBBD.js";import{u as Me}from"./XAl1oJda.js";import{u as Ue}from"./WDUnacGD.js";import{u as se}from"./BYDppTfa.js";import{P as $e}from"./B_pInIwK.js";import{U as Le}from"./Otm7Gi5C.js";import{L as P}from"./DTjZY--c.js";import{C as Oe}from"./COn_dm41.js";import{T as Re}from"./yH6OnAzg.js";import{X as Ve}from"./BMBNO0uF.js";import{S as Be}from"./tnS9CuL2.js";import"./CxMLhyG2.js";import"./BiJ_nWCi.js";import"./IKHjXg6d.js";import"./Cev5nn2e.js";import"./3cZfB477.js";import"./BHU64gSO.js";const Fe=_e("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),Pe={class:"notice-manage-page"},qe={class:"page-heading"},Ke=["disabled"],je={class:"publisher-guide","aria-labelledby":"publisher-guide-title"},He={id:"publisher-guide-title"},Xe={key:0,class:"page-state",role:"status","aria-live":"polite","aria-busy":"true"},Je={key:0},Qe=["disabled"],We=["role","tabindex"],Ge={key:1,class:"notice-list","aria-label":"등록된 전달사항"},Ye={class:"notice-top"},Ze={key:0,class:"important-badge"},et={class:"user-badge"},tt={key:1,class:"inactive-badge"},at=["datetime"],ot={class:"notice-actions"},st=["aria-label","onClick"],nt=["disabled","aria-label","onClick"],it={key:2,class:"page-state empty","aria-labelledby":"empty-title"},lt=["aria-describedby","aria-busy"],rt=["disabled"],dt={class:"modal-kicker"},ut={id:"notice-dialog-title"},ct=["disabled"],pt={id:"notice-title-count",class:"field-count"},mt=["disabled"],ft={id:"notice-content-count",class:"field-count"},vt={class:"form-row"},bt={class:"date-field"},yt=["disabled"],gt={class:"checks"},_t=["disabled"],ht=["disabled"],kt={key:0,class:"dirty-state",role:"status"},wt={class:"form-actions"},Ct=["disabled"],Dt=["disabled"],Tt=he({__name:"notices",async setup(xt){let I,q;const ne=ke(),ie=Me(),f=M(()=>String(ne.params.id)),le=Ue(),{data:K,pending:U,error:N,refresh:re}=([I,q]=we(()=>Se(()=>`studio-content-notices:${f.value}`,()=>le(`/api/manage/contents/${encodeURIComponent(f.value)}/notices?includeMeta=1`),{watch:[f],dedupe:"defer"})),I=await I,q(),I),p=c([]),D=c(!1),_=c(""),l=c(!1),m=c(""),S=c(""),v=c(new Set),$=c(""),T=c(!1),j=c(null),L=E("noticeDialog"),O=E("titleInput"),R=E("formErrorAlert"),H=E("loadErrorAlert"),X=E("pageMessageAlert"),de=M(()=>K.value?.content.name||f.value),V=M(()=>Number(N.value?.statusCode)===403);Ce(K,a=>{a&&(p.value=a.notices)},{immediate:!0});const J=(a=new Date)=>{const e=a instanceof Date?a:new Date(a);if(Number.isNaN(e.getTime()))return"";const u=e.getTimezoneOffset()*6e4;return new Date(e.getTime()-u).toISOString().slice(0,16)},Q=()=>({title:"",content:"",noticeDate:J(),important:!1,isActive:!0}),i=De(Q()),z=()=>JSON.stringify({...i}),w=M(()=>D.value&&z()!==S.value),W=a=>{const e=a?.currentTarget;j.value=e instanceof HTMLElement?e:null},G=async a=>{W(a),_.value="",Object.assign(i,Q()),S.value=z(),m.value="",D.value=!0,await k(),O.value?.focus()},ue=async(a,e)=>{W(e),_.value=a.id,Object.assign(i,{title:a.title,content:a.content,noticeDate:a.notice_date?J(a.notice_date):"",important:a.type==="important",isActive:a.is_active}),S.value=z(),m.value="",D.value=!0,await k(),O.value?.focus()},x=async(a=!1)=>{l.value&&!a||!a&&w.value&&!window.confirm("저장하지 않은 변경사항이 있습니다. 작성 창을 닫을까요?")||(D.value=!1,m.value="",await k(),j.value?.focus())},ce=()=>{p.value.sort((a,e)=>new Date(e.notice_date).getTime()-new Date(a.notice_date).getTime())},B=async(a,e=!1)=>{$.value=a,T.value=e,e&&(await k(),X.value?.focus())},pe=async()=>{if(!(l.value||!w.value)){if(!i.title.trim()||!i.content.trim()){m.value="제목과 내용을 입력해 주세요.",await k(),R.value?.focus();return}l.value=!0,m.value="";try{const a={title:i.title,content:i.content,noticeDate:i.noticeDate,type:i.important?"important":"info",isActive:i.isActive},e=_.value?`/api/manage/contents/${encodeURIComponent(f.value)}/notices/${encodeURIComponent(_.value)}`:`/api/manage/contents/${encodeURIComponent(f.value)}/notices`,u=await $fetch(e,{method:_.value?"PUT":"POST",body:a}),s=p.value.findIndex(C=>C.id===u.notice.id);s>=0?p.value.splice(s,1,u.notice):p.value.unshift(u.notice),ce(),S.value=z(),await x(!0),await B("전달사항을 저장했습니다."),se().success("전달사항을 저장했습니다.")}catch(a){m.value=a.data?.message||"저장하지 못했습니다. 입력한 내용은 유지됩니다.",await k(),R.value?.focus()}finally{l.value=!1}}},me=async a=>{if(!v.value.has(a.id)&&window.confirm(`'${a.title}' 전달사항을 삭제할까요?`)){v.value=new Set(v.value).add(a.id);try{await $fetch(`/api/manage/contents/${encodeURIComponent(f.value)}/notices/${encodeURIComponent(a.id)}`,{method:"DELETE"}),p.value=p.value.filter(e=>e.id!==a.id),await B("전달사항을 삭제했습니다."),se().success("전달사항을 삭제했습니다.")}catch(e){await B(e.data?.message||"전달사항을 삭제하지 못했습니다. 다시 시도해 주세요.",!0)}finally{const e=new Set(v.value);e.delete(a.id),v.value=e}}},fe=async()=>
1{await re(),N.value&&(await k(),H.value?.focus())},ve=a=>{if(a.key==="Escape"){a.preventDefault(),x();return}if(a.key!=="Tab"||!L.value)return;const e=[...L.value.querySelectorAll('button:not(:disabled), input:not(:disabled), textarea:not(:disabled), [href], [tabindex]:not([tabindex="-1"])')].filter(C=>!C.hasAttribute("hidden"));if(!e.length)return;const u=e[0],s=e[e.length-1];a.shiftKey&&document.activeElement===u?(a.preventDefault(),s.focus()):!a.shiftKey&&document.activeElement===s&&(a.preventDefault(),u.focus())},Y=a=>{!w.value||l.value||(a.preventDefault(),a.returnValue="")};Te(()=>!w.value||l.value?!0:window.confirm("저장하지 않은 전달사항 변경이 있습니다. 이 페이지를 나갈까요?")),xe(()=>window.addEventListener("beforeunload",Y)),Ee(()=>window.removeEventListener("beforeunload",Y));const be=a=>a?new Date(a).toLocaleString("ko-KR"):"";return Ae({title:"전달사항 관리 | 방통실",meta:[{name:"robots",content:"noindex, nofollow"}]}),(a,e)=>{const u=ye;return n(),r("div",Pe,[b(u,{"content-id":t(f),active:"notices"},null,8,["content-id"]),o("header",qe,[o("div",null,[e[8]||(e[8]=o("span",null,"CONTENT NOTICE",-1)),e[9]||(e[9]=o("h1",null,"전달사항 관리",-1)),o("p",null,d(t(de))+" 시청자에게 보여줄 전달사항을 등록합니다.",1)]),o("button",{type:"button",disabled:t(U)||!!t(N),onClick:G},[b(t($e),{size:17,"aria-hidden":"true"}),e[10]||(e[10]=y(" 새 전달사항 ",-1))],8,Ke)]),o("section",je,[b(t(Le),{size:20,"aria-hidden":"true"}),o("div",null,[o("strong",He,d(t(ie).displayName)+" 관리자 게시",1),e[11]||(e[11]=o("p",null,"작성한 전달사항은 ‘유저 관리자’로 구분되며 방통실 공식 공지가 아님을 함께 표시합니다.",-1))])]),t(U)?(n(),r("div",Xe,[b(t(P),{size:23,class:"spin","aria-hidden":"true"}),e[12]||(e[12]=y(" 전달사항을 불러오는 중... ",-1))])):t(N)?(n(),r("div",{key:1,ref_key:"loadErrorAlert",ref:H,class:"page-state state-error",role:"alert",tabindex:"-1"},[b(t(oe),{size:24,"aria-hidden":"true"}),o("strong",null,d(t(V)?"전달사항을 관리할 권한이 없습니다.":"전달사항을 불러오지 못했습니다."),1),t(V)?g("",!0):(n(),r("p",Je,"잠시 후 다시 시도해 주세요.")),t(V)?g("",!0):(n(),r("button",{key:1,type:"button",disabled:t(U),onClick:fe}," 다시 시도 ",8,Qe))],512)):(n(),r(Z,{key:2},[t($)?(n(),r("div",{key:0,ref_key:"pageMessageAlert",ref:X,class:ee(["page-message",{error:t(T)}]),role:t(T)?"alert":"status",tabindex:t(T)?-1:void 0,"aria-live":"polite"},[t(T)?(n(),h(t(oe),{key:0,size:18,"aria-hidden":"true"})):(n(),h(t(Oe),{key:1,size:18,"aria-hidden":"true"})),y(" "+d(t($)),1)],10,We)):g("",!0),t(p).length?(n(),r("section",Ge,[(n(!0),r(Z,null,Ie(t(p),s=>(n(),r("article",{key:s.id,class:ee({inactive:!s.is_active,important:s.type==="important"})},[o("div",Ye,[o("div",null,[s.type==="important"?(n(),r("span",Ze,"중요")):g("",!0),o("span",et,d(s.publisher_name||"콘텐츠 관리자")+" · 유저 관리자",1),s.is_active?g("",!0):(n(),r("span",tt,"게시 중단"))]),o("time",{datetime:s.notice_date},d(be(s.notice_date)),9,at)]),o("h2",null,d(s.title),1),o("p",null,d(s.content),1),o("div",ot,[o("button",{type:"button","aria-label":`${s.title} 수정`,onClick:C=>ue(s,C)},[b(t(Fe),{size:15,"aria-hidden":"true"}),e[13]||(e[13]=y(" 수정 ",-1))],8,st),o("button",{type:"button",disabled:t(v).has(s.id),"aria-label":`${s.title} 삭제`,onClick:C=>me(s)},[t(v).has(s.id)?(n(),h(t(P),{key:0,size:15,class:"spin","aria-hidden":"true"})):(n(),h(t(Re),{key:1,size:15,"aria-hidden":"true"})),y(" "+d(t(v).has(s.id)?"삭제 중...":"삭제"),1)],8,nt)])],2))),128))])):(n(),r("section",it,[b(t(ge),{size:28,"aria-hidden":"true"}),e[14]||(e[14]=o("strong",{id:"empty-title"},"등록된 전달사항이 없습니다.",-1)),e[15]||(e[15]=o("p",null,"첫 전달사항을 작성해 시청자에게 운영 소식을 알려보세요.",-1)),o("button",{type:"button",onClick:G},"전달사항 등록")]))],64)),(n(),h(Ne,{to:"body"},[t(D)?(n(),r("div",{key:0,class:"modal-backdrop",onClick:e[7]||(e[7]=te(s=>x(),["self"])),onKeydown:ve},[o("form",{ref_key:"noticeDialog",ref:L,class:"notice-modal",role:"dialog","aria-modal":"true","aria-labelledby":"notice-dialog-title","aria-describedby":t(m)?"notice-form-error":void 0,"aria-busy":t(l),onSubmit:te(pe,["prevent"])},[o("button",{type:"button",class:"modal-close","aria-label":"전달사항 작성 창 닫기",disabled:t(l),onClick:e[0]||(e[0]=s=>x())},[b(t(Ve),{size:19,"aria-hidden":"true"})],8,rt),o("span",dt,d(t(_)?"EDIT NOTICE":"NEW NOTICE"),1),o("h2",ut,d(t(_)?"전달사항 수정":"새 전달사항 등록"),1),e[20]||(e[20]=o("label",{for:"notice-title"},"제목",-1)),A(o("input",{id:"notice-title",ref_key:"titleInput",ref:O,"onUpdate:modelValue":e[1]||(e[1]=s=>t(i).title=s),required:"",maxlength:"80",disabled:t(l),"aria-describedby":"notice-title-count"},null,8,ct),[[F,t(i).title,void 0,{trim:!0}]]),o("small",pt,d(t(i).title.length)+" / 80자",1),e[21]||(e[21]=o("label",{for:"notice-content"},"내용",-1)),A(o("textarea",{id:"notice-content","onUpdate:modelValue":e[2]||(e[2]=s=>t(i).content=s),required:"",maxlength:"3000",rows:"7",disabled:t(l),"aria-describedby":"notice-content-count"},null,8,mt),[[F,t(i).content]]),o("small",ft,d(t(i).content.length)+" / 3,000자",1),o("div",vt,[o("div",bt,[e[16]||(e[16]=o("label",{for:"notice-date"},"게시일",-1)),A(o("input",{id:"notice-date","onUpdate:modelValue":e[3]||(e[3]=s=>t(i).noticeDate=s),type:"datetime-local",disabled:t(l)},null,8,yt),[[F,t(i).noticeDate]])]),o("fieldset",gt,[e[19]||(e[19]=o("legend",null,"게시 설정",-1)),o("label",null,[A(o("input",{"onUpdate:modelValue":e[4]||(e[4]=s=>t(i).important=s),type:"checkbox",disabled:t(l)},null,8,_t),[[ae,t(i).important]]),e[17]||(e[17]=y(" 중요",-1))]),o("label",null,[A(o("input",{"onUpdate:modelValue":e[5]||(e[5]=s=>t(i).isActive=s),type:"checkbox",disabled:t(l)},null,8,ht),[[ae,t(i).isActive]]),e[18]||(e[18]=y(" 게시 중",-1))])])]),t(w)?(n(),r("p",kt,"저장하지 않은 변경사항이 있습니다.")):g("",!0),t(m)?(n(),r("p",{key:1,id:"notice-form-error",ref_key:"formErrorAlert",ref:R,class:"form-error",role:"alert",tabindex:"-1"},d(t(m)),513)):g("",!0),o("div",wt,[o("button",{type:"button",disabled:t(l),onClick:e[6]||(e[6]=s=>x())},"취소",8,Ct),o("button",{type:"submit",disabled:t(l)||!t(w)},[t(l)?(n(),h(t(P),{key:0,size:16,class:"spin","aria-hidden":"true"})):(n(),h(t(Be),{key:1,size:16,"aria-hidden":"true"})),y(" "+d(t(l)?"저장 중...":"저장"),1)],8,Dt)])],40,lt)],32)):g("",!0)]))])}}}),jt=ze(Tt,[["__scopeId","data-v-d559ae73"]]);export{jt 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.