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-CgV11GBz.js";import{a as M}from"./apiAdmin-CiAsr8eb.js";import{I as O}from"./index-CJx7RGCD.js";import{_ as T,F as B}from"./index-DX5UyTUL.js";import{B as A}from"./useFlexGapSupport-CWWB0EO1.js";import{S as U}from"./index-4wtx7HnJ.js";import{M as q}from"./index-CNlVDwHo.js";import{S as F}from"./SaveOutlined-NNV7kkji.js";import{P as N}from"./index-B7-RTJOc.js";import{_ as P,a as V}from"./index-CyQQxPex.js";import{_ as W}from"./index-BQTtg983.js";const ee=()=>{const e="payers?fields=id,xid,name,phone_number",o="payers",{t}=S(),s={name:"",phone_number:""},l=[{title:t("payer.name"),dataIndex:"name"},{title:t("payer.phone_number"),dataIndex:"phone_number"},{title:t("common.action"),dataIndex:"action"}],r=[{key:"name",value:t("payer.name")}];return{url:e,addEditUrl:o,initData:s,columns:l,filterableColumns:r}},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:r}=E();return{appSetting:r,loading:s,rules:l,onClose:()=>{l.value={},o("closed")},onSubmit:()=>{t({url:e.url,data:e.formData,successMessage:e.successMessage,success:m=>{o("addEditSuccess",m.xid)}})},drawerWidth:window.innerWidth<=991?"90%":"45%"}}});function R(e,o,t,s,l,r){const p=O,u=T,m=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(m,{xs:24,sm:24,md:24,lg:24},{default:n(()=>[a(u,{label:e.$t("payer.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("payer.name")])},null,8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1})]),_:1}),a(i,{gutter:16},{default:n(()=>[a(m,{xs:24,sm:24,md:24,lg:24},{default:n(()=>[a(u,{label:e.$t("payer.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("payer.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};
