import{d as I,v as T,r as w,l as C,S as E,h as y,c as S,e as s,w as l,a,t as _,u as e,k as t,J as D,m as F,i as P,aW as B,K,D as N,G as R,H as U,E as L,L as M}from"./index-f5d841af.js";/* empty css *//* empty css *//* empty css */import{_ as $}from"./index.vue_vue_type_style_index_0_lang-3c1b8cd7.js";import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css */import{a4 as j,a5 as A}from"./sys-4eb1a831.js";/* empty css *//* empty css */const G={class:"main-container"},H={class:"flex justify-between items-center"},J={class:"text-page-title"},W={class:"mt-[20px]"},q={class:"!text-[14px]"},z={class:"panel-title !text-sm"},O={class:"form-tip"},Q={class:"form-tip"},X={class:"input-width"},Y={class:"form-tip"},Z={class:"input-width"},ee={class:"form-tip"},te={class:"fixed-footer-wrap"},ae={class:"fixed-footer"},ge=I({__name:"transfer",setup(oe){const g=T().meta.title,i=w(!1),o=C({...{wechatpay_config:{mch_id:"",mch_secret_key:"",mch_secret_cert:"",mch_public_cert_path:""},alipay_config:{app_secret_cert:"",app_public_cert_path:"",alipay_public_cert_path:"",alipay_root_cert_path:"",app_id:""}}});(async()=>{i.value=!0;const r=await(await j("transfer")).data;r&&r.length&&(o.wechatpay_config=r[0].config,o.alipay_config=r[1].config),i.value=!1})();const m=w(),v=E(()=>({})),b=async r=>{i.value||!r||await r.validate(async c=>{c&&(i.value=!0,A(o).then(d=>{i.value=!1}).catch(()=>{i.value=!1}))})};return(r,c)=>{const h=B,d=K,f=N,p=R,u=$,x=U,V=L,k=M;return y(),S("div",G,[s(d,{class:"box-card !border-none",shadow:"never"},{default:l(()=>[a("div",H,[a("span",J,_(e(g)),1)]),a("div",W,[s(h,{description:e(t)("transferTips"),type:"warning","show-icon":""},{title:l(()=>[a("span",q,_(e(t)("operationTip")),1)]),_:1},8,["description"])])]),_:1}),D((y(),F(x,{class:"page-form",model:o,"label-width":"200px",ref_key:"formRef",ref:m,rules:e(v)},{default:l(()=>[s(d,{class:"box-card mt-[15px] !border-none",shadow:"never"},{default:l(()=>[a("h3",z,_(e(t)("wechatpay")),1),s(p,{label:e(t)("mchId"),prop:"wechatpay_config.mch_id"},{default:l(()=>[s(f,{modelValue:o.wechatpay_config.mch_id,"onUpdate:modelValue":c[0]||(c[0]=n=>o.wechatpay_config.mch_id=n),modelModifiers:{trim:!0},placeholder:e(t)("mchIdPlaceholder"),class:"input-width",maxlength:"32","show-word-limit":"",clearable:""},null,8,["modelValue","placeholder"]),a("div",O,_(e(t)("mchIdTips")),1)]),_:1},8,["label"]),s(p,{label:e(t)("mchSecretKey"),prop:"wechatpay_config.mch_secret_key"},{default:l(()=>[s(f,{modelValue:o.wechatpay_config.mch_secret_key,"onUpdate:modelValue":c[1]||(c[1]=n=>o.wechatpay_config.mch_secret_key=n),modelModifiers:{trim:!0},placeholder:e(t)("mchSecretKeyPlaceholder"),class:"input-width",maxlength:"32","show-word-limit":"",clearable:""},null,8,["modelValue","placeholder"]),a("div",Q,_(e(t)("mchSecretKeyTips")),1)]),_:1},8,["label"]),s(p,{label:e(t)("mchSecretCert"),prop:"wechatpay_config.mch_secret_cert"},{default:l(()=>[a("div",X,[s(u,{modelValue:o.wechatpay_config.mch_secret_cert,"onUpdate:modelValue":c[2]||(c[2]=n=>o.wechatpay_config.mch_secret_cert=n),api:"sys/document/wechat"},null,8,["modelValue"])]),a("div",Y,_(e(t)("mchSecretCertTips")),1)]),_:1},8,["label"]),s(p,{label:e(t)("mchPublicCertPath"),prop:"wechatpay_config.mch_public_cert_path"},{default:l(()=>[a("div",Z,[s(u,{modelValue:o.wechatpay_config.mch_public_cert_path,"onUpdate:modelValue":c[3]||(c[3]=n=>o.wechatpay_config.mch_public_cert_path=n),api:"sys/document/wechat"},null,8,["modelValue"])]),a("div",ee,_(e(t)("mchPublicCertPathTips")),1)]),_:1},8,["label"])]),_:1})]),_:1},8,["model","rules"])),[[k,i.value]]),a("div",te,[a("div",ae,[s(V,{type:"primary",loading:i.value,onClick:c[4]||(c[4]=n=>b(m.value))},{default:l(()=>[P(_(e(t)("save")),1)]),_:1},8,["loading"])])])])}}});export{ge as default};