WalletChannelForm-5f5c7e48.js 3.0 KB

1
  1. import{d as W,h as z,r as d,o as m,c as k,f as o,w as u,a as t,y as _,z as A,x as w,F as D,v as E,t as H,l as J,ad as M,ae as T,C as j,R as q,H as B,G,K,_ as L,__tla as P}from"./index-8dc1e40a.js";import{_ as X,__tla as Q}from"./Dialog-41802231.js";import{C as Y}from"./constants-a1da293a.js";import{d as Z,D as $,__tla as aa}from"./dict-f13a3c8f.js";import{g as ea,c as la,u as ta,__tla as sa}from"./index-5e04dd39.js";import{u as ra,__tla as ua}from"./useMessage-7a27dd80.js";let b,oa=Promise.all([(()=>{try{return P}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return ua}catch{}})()]).then(async()=>{b=L(W({name:"WalletChannelForm",__name:"WalletChannelForm",emits:["success"],setup(na,{expose:g,emit:C}){const{t:f}=z(),p=ra(),n=d(!1),v=d(""),c=d(!1),e=d({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"}]},i=d();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(i&&await i.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=i.value)==null||r.resetFields()};return(l,a)=>{const r=M,R=T,y=j,U=q,O=B,h=G,I=X,N=K;return m(),k("div",null,[o(I,{modelValue:t(n),"onUpdate:modelValue":a[3]||(a[3]=s=>J(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(()=>[A((m(),w(O,{ref_key:"formRef",ref:i,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(R,{modelValue:t(e).status,"onUpdate:modelValue":a[0]||(a[0]=s=>t(e).status=s)},{default:u(()=>[(m(!0),k(D,null,E(t(Z)(t($).COMMON_STATUS),s=>(m(),w(r,{key:parseInt(s.value),label:parseInt(s.value)},{default:u(()=>[_(H(s.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(y,{"label-width":"180px",label:"\u5907\u6CE8",prop:"remark"},{default:u(()=>[o(U,{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"])),[[N,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};