PageSourceSearch

https://sarangjeil.com/_nuxt/BMGmAdwG.js

js sarangjeil.com collected 2026-10-02 19:52:13 UTC 9,662 bytes, 1 lines download raw bytes

1import{U as Z,c as r,L as h,P as a,$ as F,a0 as ee,u as d,l as B,a1 as I,E as te,F as $,V as E,B as x,R as ae,Q as oe}from"./CbBncVPZ.js";import{E as le}from"./DAXu2tdZ.js";import{S as L}from"./BGf-Fe8G.js";import{_ as se,c as D,b as y,d as ne,u as re,a as ie}from"./eLFpW619.js";const ce={class:""},ue={class:"flex flex-1 flex-col md:pl-64 min-h-screen"},de={class:"flex-1"},pe={class:"py-6"},fe={class:"mx-auto max-w-7xl px-4 sm:px-6 md:px-8"},ge={class:"py-4"},me={class:"flex space-x-4"},ve={class:"w-1/3"},he={class:"w-1/3"},xe={class:"flex flex-col"},ye={class:"flex flex-col"},be={class:"mt-[17px] mb-[17px] grid grid-cols-3 lg:grid-cols-4 gap-[12px]"},we={class:"rounded-[4px] relative bg-white"},ke=["src"],_e=["onClick"],Be={class:"relative w-full bg-[#f5f5f5] rounded-[4px] aspect-[1/1.13]"},De={class:"mt-[17px] mb-[17px] grid grid-cols-1 lg:grid-cols-1 gap-[12px]"},Ce={class:"rounded-[4px] relative bg-gray-50 py-[10px] px-[10px] font-[R] text-[16px]"},Fe=["onClick"],Ae={class:"relative w-full rounded-[4px] bg-gray-500 text-white py-[10px]"},Me={class:"flex mt-3 justify-center"},Ue={__name:"update",setup(Re){Z(()=>{T()});async function T(){try{const o=await D.get(y().public.backendUrl+`/api/content/${A.query.id}`,{headers:{Authorization:`Bearer ${b.token.value}`}}),t=o.data.content;console.log(o.data.data),p.value=t.contentName,i.value=t.contentText,c.value=t.subCategory1,f.value=t.category,g.value=t.subCategory1,C.value=t.weekInform,u.value=t.date.slice(0,16),M.value=t.scripture,N.value=t.contentUrl;for(let l=0;l<t.contentAttachedFile.length;l++)H(t.contentAttachedFile[l],t.contentAttachedFile[l].replace(U,""));for(let l=0;l<t.contentImage.length;l++)J(t.contentImage[l],t.contentImage[l].replace(U,""));w.value=t.contentImage}catch(o){console.log(o)}}const A=ne(),V=re(),b=ie(),p=r(""),i=r(""),N=r("");r("");const C=r(""),M=r(""),c=r(""),f=r("선택"),g=r(""),j=()=>{c.value=="공지사항"?(f.value="공지",g.value="공지사항"):c.value=="보도자료"?(f.value="공지",g.value="보도자료"):c.value=="자료실"&&(f.value="자료실",g.value="자료실")},u=r(""),z=["첫째","둘째","셋째","넷째","다섯째"],O=()=>{if(!u.value)return;const o=new Date(u.value),t=new Date(o.getFullYear(),o.getMonth(),1),l=o.getDate(),s=t.getDay(),n=Math.floor((l+s-1)/7);C.value=`${o.getMonth()+1}월 ${z[n]}주`},w=r([]),k=r([]);function q(o){k.value.push(o.target.files[0]);const t=new FileReader;t.readAsDataURL(o.target.files[0]),t.onload=l=>{w.value.push(l.target.result)}}const S=o=>{w.value.splice(o,1),k.value.splice(o,1)},m=r([]),U=/^https:\/\/primary-bucket-all\.s3\.amazonaws\.com\/attachments\//;function W(o){m.value.push(o.target.files[0])}const G=o=>{m.value.splice(o,1)};function K(){L.fire({title:"게시글을 수정 하시겠습니까?",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"수정",cancelButtonText:"취소"}).then(async o=>{o.isConfirmed&&await Q()})}function P(){if(c.value==""){alert("카테고리를 선택해주세요.");return}else if(p.value==""){alert("제목을 입력해주세요.");return}else if(i.value==""){alert("내용을 입력해주세요.");return}else if(u.value==""){alert("날짜를 선택해주세요.");return}K()}async function Q(){let o=new FormData;o.append("category",f.value),o.append("subCategory1",g.value),o.append("contentName",p.value),o.append("contentText",i.value),o.append("date",u.value),o.append("weekInform",C.value),o.append("scripture",M.value),o.append("publicOrNot","전체공개"),k.value.forEach((t,l)=>{o.append("images",t)}),m.value.forEach((t,l)=>{o.append("attachments",t)});try{(await D.put(y().public.backendUrl+`/api/content/${A.query.id}`,o,{headers:{"Content-Type":"multipart/form-data",Authorization:`Bearer ${b.token.value}`}})).data.error==!1&&(L.fire("수정 되었습니다.","성공"),V.push("/admin/gsp"))}catch{console.log(e),alert(e.response.data.message)}}const Y={height:700,content_css:y().public.frontendUrl+"/font.css",plugins:" lists image link searchreplace emoticons table code media",toolbar:" image imagetools undo redo | fontfamily fontsize forecolor backcolor styleselect | bold italic charmap | alignleft aligncenter alignright al
1ignjustify link | lists numlist outdent indent | media emoticons code",font_family_formats:"Light=L; Regular=R; Medium=M; SemiBold=SM; Bold=B; ExtraBold=EB; Black=Black;",language:"ko_KR",file_picker_types:"file image media",image_title:!0,automatic_uploads:!0,images_reuse_filename:!0,paste_data_images:!0,paste_preprocess:async(o,t)=>{if(/<img[^>]*src=[^>]*>/.test(t.content)){const s=t.content.split('"')[1];t.content="",await fetch(s).then(n=>n.blob()).then(async n=>{t.content="1";let v=new FormData;v.append("file",n);const _=await D.post(y().public.backendUrl+"/api/upload",v,{headers:{Authorization:`Bearer ${b.token.value}`}});i.value=i.value.concat(`<img src=${_.data.data.accessUrl} />`)}).catch(n=>{console.log(n),alert(n.response.data.message)})}},file_picker_callback:(o,t,l)=>{const s=document.createElement("input");s.setAttribute("type","file"),s.setAttribute("accept","image/*"),s.addEventListener("change",async n=>{const v=n.target.files[0];let _,R=new FormData;R.append("images",v);try{_=(await D.post(y().public.backendUrl+"/api/content/registerWithImage3",R,{headers:{Authorization:`Bearer ${b.token.value}`}})).data.content.contentImage[0]}catch{console.log(n),alert(n.response.data.message)}o(_,{title:v.name})}),s.click()},content_style:"body{font-family:'R'} img { max-width:600px; maxw-height:300px}"};function H(o,t){fetch(o).then(l=>l.blob()).then(l=>{const s=new File([l],t,{type:l.type});return m.value.push(s),s})}function J(o,t){fetch(o).then(l=>l.blob()).then(l=>{const s=new File([l],t,{type:l.type});return k.value.push(s),s})}return(o,t)=>(x(),h("div",ce,[a("div",ue,[a("main",de,[a("div",pe,[a("div",fe,[t[15]||(t[15]=a("div",{class:"text-[24px] font-[M] text-[#111]"},"게시글 작성",-1)),a("div",ge,[a("div",me,[a("div",ve,[t[5]||(t[5]=a("label",{for:"title",class:"leading-loose"},"카테고리",-1)),F(a("select",{"onUpdate:modelValue":t[0]||(t[0]=l=>B(c)?c.value=l:null),onChange:j,class:"px-4 h-[40px] py-2 border focus:ring-gray-500 focus:border-gray-900 w-full sm:text-sm border-gray-300 rounded-md mb-3"},t[4]||(t[4]=[a("option",{value:"공지사항"},"공지",-1),a("option",{value:"보도자료"},"보도자료",-1),a("option",{value:"자료실"},"자료실",-1)]),544),[[ee,d(c)]])]),a("div",he,[t[6]||(t[6]=a("label",{for:"title",class:"leading-loose"},"날짜",-1)),F(a("input",{type:"datetime-local","onUpdate:modelValue":t[1]||(t[1]=l=>B(u)?u.value=l:null),onChange:O,class:"px-4 py-2 border focus:ring-gray-500 focus:border-gray-900 w-full sm:text-sm border-gray-300 rounded-md mb-3"},null,544),[[I,d(u)]])])]),a("div",xe,[t[7]||(t[7]=a("label",{for:"title",class:"leading-loose"},"제목",-1)),F(a("input",{type:"text",id:"title",name:"title",placeholder:"제목을 입력하세요","onUpdate:modelValue":t[2]||(t[2]=l=>B(p)?p.value=l:null),class:"px-4 py-2 border focus:ring-gray-500 focus:border-gray-900 w-full sm:text-sm border-gray-300 rounded-md mb-3"},null,512),[[I,d(p)]])]),a("div",ye,[t[8]||(t[8]=a("label",{for:"content",class:"leading-loose"},"내용",-1)),te(d(le),{modelValue:d(i),"onUpdate:modelValue":t[3]||(t[3]=l=>B(i)?i.value=l:null),"api-key":"gydmxr4by8tp0qh2qr7sg95qfmqsn3tir7uapl8hlg35gufz",init:Y},null,8,["modelValue"])]),t[13]||(t[13]=a("div",{class:"font-[R] text-[16px] text-[#111]"}," 이미지(첫번째 사진 썸네일) ",-1)),a("div",be,[(x(!0),h($,null,E(d(w),(l,s)=>(x(),h("div",we,[a("img",{class:"rounded-[4px] aspect-[1/1.13] w-full object-cover",src:l},null,8,ke),a("div",{onClick:n=>S(s),class:"absolute top-[-12px] right-[-12px]"},t[9]||(t[9]=[a("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a("circle",{cx:"12",cy:"12",r:"12",fill:"#DBDBDB"}),a("path",{d:"M15.6004 7.20001L8.40039 16.8M8.40039 7.20001L15.6004 16.8",stroke:"#FAFAFA","stroke-width":"1.5","stroke-linecap":"round"})],-1)]),8,_e)]))),256)),a("div",Be,[a("input",{type:"file",accept:"image/*",class:"absolute inset-0 opacity-0 cursor-pointer",onChange:q},null,32),t[10]||(t[10]=a("div",{class:"flex h-full justify-center items-center"},[a("svg",{width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a("rect",{y:"20",width:"44",height:"4",rx:"2",fill:"#DBDBDB"}),a("rect",{x:"24",width:"44",height:"4",rx:"2",transform:"rotate(90 24 0)",fill:"#DBDBDB"})])],-1))])]),t[14]||(t[14]=a("div",{class:"font-[R] text-[16px] text-[#111]"}," 파일 업로드 ",-1)),a("div",De,[(x(!0),h($,null,E(d(m),(l,s)=>(x(),h("div",Ce,[ae(oe(l.name)+" ",1),a("div",{onClick:n=>G(s),class:"absolute top-[-12px] right-[-12px]"},t[11]||(t[11]=[a("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a("circle",{cx:"12",cy:"12",r:"12",fill:"#DBDBDB"}),a("path",{d:"M15.6004 7.20001L8.40039 16.8M8.40039 7.20001L15.6004 16.8",stroke:"#FAFAFA","stroke-width":"1.5","stroke-linecap":"round"})],-1)]),8,Fe)]))),256)),a("div",Ae,[a("input",{type:"file",class:"absolute inset-0 opacity-0 cursor-pointer",onChange:W},null,32),t[12]||(t[12]=a("div",{class:"flex h-full justify-center items-center"}," 파일추가 ",-1))])]),a("div",Me,[a("button",{type:"button",class:"mt-3 inline-flex w-full justify-center rounded-md bg-blue-600 px-10 py-3.5 font-semibold text-white shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-blue-500 sm:mt-0 sm:w-auto",onClick:P,ref:"cancelButtonRef"}
1,"수정",512)])])])])])])]))}},Te=se(Ue,[["__scopeId","data-v-7deb2a06"]]);export{Te 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.