import{d as E,n as J,r as i,o as m,c as g,i as u,w as o,a as t,j as _,C as R,l as k,F as W,k as H,t as M,y as T,ag as j,ah as q,H as D,U as P,K as B,J as G,N as K,_ as L,__tla as z}from"./index-2c56227b.js";import{_ as Q,__tla as X}from"./Dialog-1050d437.js";import{C as Y}from"./constants-a1da293a.js";import{d as Z,D as $,__tla as aa}from"./dict-763dd292.js";import{g as ea,c as la,u as ta,__tla as sa}from"./index-5604c7b5.js";import{u as ra,__tla as oa}from"./useMessage-96878a4a.js";let w,ua=Promise.all([(()=>{try{return z}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return oa}catch{}})()]).then(async()=>{w=L(E({name:"WalletChannelForm",__name:"WalletChannelForm",emits:["success"],setup(na,{expose:b,emit:C}){const{t:f}=J(),p=ra(),n=i(!1),v=i(""),c=i(!1),e=i({appId:"",code:"",status:void 0,feeRate:0,remark:"",config:{name:"mock-conf"}}),V={status:[{required:!0,message:"\u6E20\u9053\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]},d=i();b({open:async(l,a)=>{n.value=!0,c.value=!0,F(l,a);try{const r=await ea(l,a);r&&r.id&&(e.value=r,e.value.config=JSON.parse(r.config)),v.value=e.value.id?"\u7F16\u8F91\u652F\u4ED8\u6E20\u9053":"\u521B\u5EFA\u652F\u4ED8\u6E20\u9053"}finally{c.value=!1}}});const S=C,x=async()=>{if(d&&await d.value.validate()){c.value=!0;try{const l={...e.value};l.config=JSON.stringify(e.value.config),l.id?(await ta(l),p.success(f("common.updateSuccess"))):(await la(l),p.success(f("common.createSuccess"))),n.value=!1,S("success")}finally{c.value=!1}}},F=(l,a)=>{var r;e.value={appId:l,code:a,status:Y.ENABLE,remark:"",feeRate:0,config:{name:"mock-conf"}},(r=d.value)==null||r.resetFields()};return(l,a)=>{const r=j,N=q,y=D,O=P,U=B,h=G,I=Q,A=K;return m(),g("div",null,[u(I,{modelValue:t(n),"onUpdate:modelValue":a[3]||(a[3]=s=>T(n)?n.value=s:null),title:t(v),onClosed:l.close,width:"800px"},{footer:o(()=>[u(h,{disabled:t(c),type:"primary",onClick:x},{default:o(()=>[_("\u786E \u5B9A")]),_:1},8,["disabled"]),u(h,{onClick:a[2]||(a[2]=s=>n.value=!1)},{default:o(()=>[_("\u53D6 \u6D88")]),_:1})]),default:o(()=>[R((m(),k(U,{ref_key:"formRef",ref:d,model:t(e),rules:V,"label-width":"100px"},{default:o(()=>[u(y,{"label-width":"180px",label:"\u6E20\u9053\u72B6\u6001",prop:"status"},{default:o(()=>[u(N,{modelValue:t(e).status,"onUpdate:modelValue":a[0]||(a[0]=s=>t(e).status=s)},{default:o(()=>[(m(!0),g(W,null,H(t(Z)(t($).COMMON_STATUS),s=>(m(),k(r,{key:parseInt(s.value),label:parseInt(s.value)},{default:o(()=>[_(M(s.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(y,{"label-width":"180px",label:"\u5907\u6CE8",prop:"remark"},{default:o(()=>[u(O,{modelValue:t(e).remark,"onUpdate:modelValue":a[1]||(a[1]=s=>t(e).remark=s),style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])),[[A,t(c)]])]),_:1},8,["modelValue","title","onClosed"])])}}}),[["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/pay/app/components/channel/WalletChannelForm.vue"]])});export{ua as __tla,w as default};
