import{d as R,n as J,r as i,o as m,c as k,i as u,w as r,a as t,j as _,C as A,l as g,F as D,k as E,t as H,y as T,ag as j,ah as q,H as z,U as B,K,J as L,N as P,_ as X,__tla as G}from"./index-8c6726e5.js";import{_ as Q,__tla as W}from"./Dialog-336bccec.js";import{C as Y}from"./constants-a1da293a.js";import{d as Z,D as $,__tla as aa}from"./dict-1c98488d.js";import{g as ea,c as la,u as ta,__tla as sa}from"./index-73c5938e.js";import{u as oa,__tla as ra}from"./useMessage-9f6930df.js";let w,ua=Promise.all([(()=>{try{return G}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return ra}catch{}})()]).then(async()=>{w=X(R({name:"MockChannelForm",__name:"MockChannelForm",emits:["success"],setup(na,{expose:b,emit:C}){const{t:f}=J(),p=oa(),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,U(l,a);try{const o=await ea(l,a);o&&o.id&&(e.value=o,e.value.config=JSON.parse(o.config)),v.value=e.value.id?"\u7F16\u8F91\u652F\u4ED8\u6E20\u9053":"\u521B\u5EFA\u652F\u4ED8\u6E20\u9053"}finally{c.value=!1}}});const x=C,S=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,x("success")}finally{c.value=!1}}},U=(l,a)=>{var o;e.value={appId:l,code:a,status:Y.ENABLE,remark:"",feeRate:0,config:{name:"mock-conf"}},(o=d.value)==null||o.resetFields()};return(l,a)=>{const o=j,F=q,y=z,M=B,N=K,h=L,I=Q,O=P;return m(),k("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:r(()=>[u(h,{disabled:t(c),type:"primary",onClick:S},{default:r(()=>[_("\u786E \u5B9A")]),_:1},8,["disabled"]),u(h,{onClick:a[2]||(a[2]=s=>n.value=!1)},{default:r(()=>[_("\u53D6 \u6D88")]),_:1})]),default:r(()=>[A((m(),g(N,{ref_key:"formRef",ref:d,model:t(e),rules:V,"label-width":"100px"},{default:r(()=>[u(y,{"label-width":"180px",label:"\u6E20\u9053\u72B6\u6001",prop:"status"},{default:r(()=>[u(F,{modelValue:t(e).status,"onUpdate:modelValue":a[0]||(a[0]=s=>t(e).status=s)},{default:r(()=>[(m(!0),k(D,null,E(t(Z)(t($).COMMON_STATUS),s=>(m(),g(o,{key:parseInt(s.value),label:parseInt(s.value)},{default:r(()=>[_(H(s.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(y,{"label-width":"180px",label:"\u5907\u6CE8",prop:"remark"},{default:r(()=>[u(M,{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"])),[[O,t(c)]])]),_:1},8,["modelValue","title","onClosed"])])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/pay/app/components/channel/MockChannelForm.vue"]])});export{ua as __tla,w as default};
