import{u as S,_ as $,d as C,e as k,w as n,g as a,i as _,t as f,b as D,a0 as w,a as E,o as I}from"./app-D7zH3Nl5.js";import{a as M}from"./apiAdmin-B6-2qm0d.js";import{I as O}from"./index-Cu62pBdq.js";import{_ as T,F as B}from"./index-DZxk72Vu.js";import{B as A}from"./useFlexGapSupport-CpBR-RD-.js";import{S as U}from"./index-_ApNSgqk.js";import{M as q}from"./index-fjGxdX_x.js";import{S as F}from"./SaveOutlined-jkHaLNj1.js";import{P as N}from"./index-BUzTR6QN.js";import{_ as P,a as V}from"./index-Cv7zOydE.js";import{_ as W}from"./index-B7xF4QqD.js";const ee=()=>{const e="payees?fields=id,xid,name,phone_number",o="payees",{t}=S(),s={name:"",phone_number:""},l=[{title:t("payee.name"),dataIndex:"name"},{title:t("payee.phone_number"),dataIndex:"phone_number"},{title:t("common.action"),dataIndex:"action"}],m=[{key:"name",value:t("payee.name")}];return{url:e,addEditUrl:o,initData:s,columns:l,filterableColumns:m}},L=C({props:["formData","data","visible","url","addEditType","pageTitle","successMessage"],components:{PlusOutlined:N,LoadingOutlined:w,SaveOutlined:F},setup(e,{emit:o}){const{addEditRequestAdmin:t,loading:s,rules:l}=M(),{appSetting:m}=E();return{appSetting:m,loading:s,rules:l,onClose:()=>{l.value={},o("closed")},onSubmit:()=>{t({url:e.url,data:e.formData,successMessage:e.successMessage,success:r=>{o("addEditSuccess",r.xid)}})},drawerWidth:window.innerWidth<=991?"90%":"45%"}}});function R(e,o,t,s,l,m){const p=O,u=T,r=V,i=P,b=W,g=B,h=D("SaveOutlined"),c=A,v=U,y=q;return I(),k(y,{open:e.visible,closable:!1,centered:!0,title:e.pageTitle},{footer:n(()=>[a(v,null,{default:n(()=>[a(c,{key:"submit",type:"primary",loading:e.loading,onClick:e.onSubmit},{icon:n(()=>[a(h)]),default:n(()=>[_(" "+f(e.addEditType=="add"?e.$t("common.create"):e.$t("common.update")),1)]),_:1},8,["loading","onClick"]),a(c,{key:"back",onClick:e.onClose},{default:n(()=>[_(f(e.$t("common.cancel")),1)]),_:1},8,["onClick"])]),_:1})]),default:n(()=>[a(g,{layout:"vertical"},{default:n(()=>[a(i,{gutter:16},{default:n(()=>[a(r,{xs:24,sm:24,md:24,lg:24},{default:n(()=>[a(u,{label:e.$t("payee.name"),name:"name",help:e.rules.name?e.rules.name.message:null,validateStatus:e.rules.name?"error":null,class:"required"},{default:n(()=>[a(p,{value:e.formData.name,"onUpdate:value":o[0]||(o[0]=d=>e.formData.name=d),placeholder:e.$t("common.placeholder_default_text",[e.$t("payee.name")])},null,8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1})]),_:1}),a(i,{gutter:16},{default:n(()=>[a(r,{xs:24,sm:24,md:24,lg:24},{default:n(()=>[a(u,{label:e.$t("payee.phone_number"),name:"phone_number",help:e.rules.phone_number?e.rules.phone_number.message:null,validateStatus:e.rules.phone_number?"error":null},{default:n(()=>[a(b,{value:e.formData.phone_number,"onUpdate:value":o[1]||(o[1]=d=>e.formData.phone_number=d),placeholder:e.$t("common.placeholder_default_text",[e.$t("payee.phone_number")]),min:"0",style:{width:"100%"}},null,8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1})]),_:1})]),_:1})]),_:1},8,["open","title"])}const ne=$(L,[["render",R]]);export{ne as A,ee as f};
