import{G as C}from"./el-button-b67915d8.js";import{a as U,b as B,E as k}from"./el-breadcrumb-item-762e8056.js";import{E as N,a as R}from"./el-form-item-07a15cb5.js";import{E as T}from"./el-input-5189b047.js";import{a1 as F,Z as I,q as d,z as M,v as G,o as O,f as S,M as p,Q as e,w as t,N as v,O as j}from"./index-b2bcea28.js";import{a as V}from"./request-88e5850c.js";import{E as i}from"./el-message-447d52b9.js";import"./castArray-8eb82dce.js";import"./index-07bb2cc4.js";import"./_baseClone-49d9099a.js";import"./aria-60e0cdc6.js";const q=async()=>V("/config/getConfig","GET"),z=async f=>V("/config/updateConfig","POST",f),D={class:"main"},P={class:"breadcrumb-section"},Q=p("div",null,null,-1),Z={class:"demo-drawer__footer",style:{"text-align":"right"}},le={__name:"config",setup(f){F(),I();const g=d("insert"),_=d(!1),c=d(null),a=d({});M(async()=>{let u=await q();u.code===200?(a.value=u.data,g.value="update"):i({message:"取得資料失敗.",type:"error"})});const b=G({}),y=u=>{u&&u.validate(async l=>{if(l){let r,m;r=await z(a.value),m="修改成功.",r.code===200&&i({message:m,type:"success"})}else return i({message:"操作失敗.",type:"error"}),!1})};return(u,l)=>{const r=U,m=B,s=T,n=N,E=R,x=C,w=k;return O(),S("div",D,[p("div",P,[p("div",null,[e(m,{separator:"/"},{default:t(()=>[e(r,null,{default:t(()=>[v(" 站台設定 ")]),_:1})]),_:1})]),Q]),e(w,null,{default:t(()=>[e(E,{ref_key:"formRef",ref:c,model:a.value,"status-icon":"",rules:b,"label-width":"120px"},{default:t(()=>[e(n,{label:"公司名稱",prop:"company_name"},{default:t(()=>[e(s,{modelValue:a.value.company_name,"onUpdate:modelValue":l[0]||(l[0]=o=>a.value.company_name=o)},null,8,["modelValue"])]),_:1}),e(n,{label:"地址",prop:"address"},{default:t(()=>[e(s,{modelValue:a.value.address,"onUpdate:modelValue":l[1]||(l[1]=o=>a.value.address=o)},null,8,["modelValue"])]),_:1}),e(n,{label:"Email",prop:"email"},{default:t(()=>[e(s,{modelValue:a.value.email,"onUpdate:modelValue":l[2]||(l[2]=o=>a.value.email=o)},null,8,["modelValue"])]),_:1}),e(n,{label:"電話",prop:"tel"},{default:t(()=>[e(s,{modelValue:a.value.tel,"onUpdate:modelValue":l[3]||(l[3]=o=>a.value.tel=o)},null,8,["modelValue"])]),_:1}),e(n,{label:"傳真",prop:"fax"},{default:t(()=>[e(s,{modelValue:a.value.fax,"onUpdate:modelValue":l[4]||(l[4]=o=>a.value.fax=o)},null,8,["modelValue"])]),_:1}),e(n,{label:"產品與服務",prop:"products"},{default:t(()=>[e(s,{type:"textarea",rows:3,modelValue:a.value.products,"onUpdate:modelValue":l[5]||(l[5]=o=>a.value.products=o)},null,8,["modelValue"])]),_:1}),e(n,{label:"企業永續發展",prop:"development"},{default:t(()=>[e(s,{type:"textarea",rows:3,modelValue:a.value.development,"onUpdate:modelValue":l[6]||(l[6]=o=>a.value.development=o)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"]),p("div",Z,[e(x,{type:"primary",loading:_.value,onClick:l[7]||(l[7]=o=>y(c.value))},{default:t(()=>[v(j(_.value?"提交中 ...":"修改"),1)]),_:1},8,["loading"])])]),_:1})])}}};export{le as default};
