import{G as I}from"./el-button-7b435908.js";import{a as R,b as U,E as B}from"./el-breadcrumb-item-0c010d2b.js";import{E as T,a as F}from"./el-form-item-563dc716.js";import{E as N}from"./el-input-5a355fec.js";import{a1 as z,Z as L,q as u,z as M,v as O,L as A,o as G,f as $,M as p,Q as e,w as t,N as g,a as j,O as q,a7 as D,a8 as K}from"./index-11843334.js";import{C as P}from"./ckeditor-8ca0487d.js";import{a as v}from"./request-79887494.js";import{E as f}from"./el-message-c3316f84.js";import{_ as Q}from"./_plugin-vue_export-helper-c27b6911.js";import"./castArray-80791487.js";import"./index-58150f7d.js";import"./_baseClone-07904f92.js";import"./aria-60e0cdc6.js";const X=async()=>v("/config/getConfig","GET"),Z=async n=>v("/config/updateConfig","POST",n);const h=n=>(D("data-v-f49ddece"),n=n(),K(),n),H={class:"main"},J={class:"breadcrumb-section"},W=h(()=>p("div",null,null,-1)),Y={class:"demo-drawer__footer",style:{"text-align":"right"}},ee={__name:"config",setup(n){z(),L();const y=u("insert"),c=u(!1),_=u(null),o=u({}),V=P,b=u({simpleUpload:{uploadUrl:"https://prodio.zltest.com.tw/adminapi/article/uploadImage",headers:{"X-CSRF-TOKEN":"CSFR-Token",Authorization:`${sessionStorage.getItem("token")}`}},image:{resize:!0,toolbar:["imageTextAlternative","|","imageStyle:alignLeft","imageStyle:alignRight","|","imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"],styles:["full","alignLeft","alignRight"]}});M(async()=>{let r=await X();r.code===200?(o.value=r.data,y.value="update"):f({message:"取得資料失敗.",type:"error"})});const E=O({}),x=r=>{r&&r.validate(async l=>{if(l){let m,i;m=await Z(o.value),i="修改成功.",m.code===200&&f({message:i,type:"success"})}else return f({message:"操作失敗.",type:"error"}),!1})};return(r,l)=>{const m=R,i=U,d=N,s=T,C=A("ckeditor"),S=F,k=I,w=B;return G(),$("div",H,[p("div",J,[p("div",null,[e(i,{separator:"/"},{default:t(()=>[e(m,null,{default:t(()=>[g(" 站台設定 ")]),_:1})]),_:1})]),W]),e(w,null,{default:t(()=>[e(S,{ref_key:"formRef",ref:_,model:o.value,"status-icon":"",rules:E,"label-width":"120px"},{default:t(()=>[e(s,{label:"公司名稱",prop:"company_name"},{default:t(()=>[e(d,{modelValue:o.value.company_name,"onUpdate:modelValue":l[0]||(l[0]=a=>o.value.company_name=a)},null,8,["modelValue"])]),_:1}),e(s,{label:"地址",prop:"address"},{default:t(()=>[e(d,{modelValue:o.value.address,"onUpdate:modelValue":l[1]||(l[1]=a=>o.value.address=a)},null,8,["modelValue"])]),_:1}),e(s,{label:"Email",prop:"email"},{default:t(()=>[e(d,{modelValue:o.value.email,"onUpdate:modelValue":l[2]||(l[2]=a=>o.value.email=a)},null,8,["modelValue"])]),_:1}),e(s,{label:"電話",prop:"tel"},{default:t(()=>[e(d,{modelValue:o.value.tel,"onUpdate:modelValue":l[3]||(l[3]=a=>o.value.tel=a)},null,8,["modelValue"])]),_:1}),e(s,{label:"傳真",prop:"fax"},{default:t(()=>[e(d,{modelValue:o.value.fax,"onUpdate:modelValue":l[4]||(l[4]=a=>o.value.fax=a)},null,8,["modelValue"])]),_:1}),e(s,{label:"產品與服務",prop:"products"},{default:t(()=>[e(d,{type:"textarea",rows:3,modelValue:o.value.products,"onUpdate:modelValue":l[5]||(l[5]=a=>o.value.products=a)},null,8,["modelValue"])]),_:1}),e(s,{label:"首頁下方區塊",prop:"development"},{default:t(()=>[e(C,{editor:j(V),modelValue:o.value.development,"onUpdate:modelValue":l[6]||(l[6]=a=>o.value.development=a),config:b.value},null,8,["editor","modelValue","config"])]),_:1})]),_:1},8,["model","rules"]),p("div",Y,[e(k,{type:"primary",loading:c.value,onClick:l[7]||(l[7]=a=>x(_.value))},{default:t(()=>[g(q(c.value?"提交中 ...":"修改"),1)]),_:1},8,["loading"])])]),_:1})])}}},ce=Q(ee,[["__scopeId","data-v-f49ddece"]]);export{ce as default};
