WalletChannelForm-11587f4c.js 3.0 KB

1
  1. import{d as A,h as D,r as i,o as m,c as k,f as o,w as u,a as t,n as _,x as W,v as w,F as q,q as E,t as J,O as M,ah as T,ai as z,A as j,V as B,D as H,C as L,I as P,_ as X,__tla as G}from"./index-11e4820e.js";import{_ as K,__tla as Q}from"./Dialog-bbfaf85c.js";import{C as Y}from"./constants-40f13f5e.js";import{d as Z,D as $,__tla as aa}from"./dict-4072dcec.js";import{g as ea,c as la,u as ta,__tla as sa}from"./index-c4eef55c.js";import{u as ra,__tla as ua}from"./useMessage-06ddf735.js";let b,oa=Promise.all([(()=>{try{return G}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return ua}catch{}})()]).then(async()=>{b=X(A({name:"WalletChannelForm",__name:"WalletChannelForm",emits:["success"],setup(na,{expose:g,emit:C}){const{t:f}=D(),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();g({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 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}}},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=T,I=z,y=j,O=B,U=H,h=L,N=K,R=P;return m(),k("div",null,[o(N,{modelValue:t(n),"onUpdate:modelValue":a[3]||(a[3]=s=>M(n)?n.value=s:null),title:t(v),onClosed:l.close,width:"800px"},{footer:u(()=>[o(h,{disabled:t(c),type:"primary",onClick:S},{default:u(()=>[_("\u786E \u5B9A")]),_:1},8,["disabled"]),o(h,{onClick:a[2]||(a[2]=s=>n.value=!1)},{default:u(()=>[_("\u53D6 \u6D88")]),_:1})]),default:u(()=>[W((m(),w(U,{ref_key:"formRef",ref:d,model:t(e),rules:V,"label-width":"100px"},{default:u(()=>[o(y,{"label-width":"180px",label:"\u6E20\u9053\u72B6\u6001",prop:"status"},{default:u(()=>[o(I,{modelValue:t(e).status,"onUpdate:modelValue":a[0]||(a[0]=s=>t(e).status=s)},{default:u(()=>[(m(!0),k(q,null,E(t(Z)(t($).COMMON_STATUS),s=>(m(),w(r,{key:parseInt(s.value),label:parseInt(s.value)},{default:u(()=>[_(J(s.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(y,{"label-width":"180px",label:"\u5907\u6CE8",prop:"remark"},{default:u(()=>[o(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"])),[[R,t(c)]])]),_:1},8,["modelValue","title","onClosed"])])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/pay/app/components/channel/WalletChannelForm.vue"]])});export{oa as __tla,b as default};