import{b as k,r as S,_ as C,x as $,Z as y,$ as h,e as O,o as w,f as D,w as n,c as o,i as m,t as r,a0 as E,a1 as T,n as B,v as M,a8 as A,B as I,al as q}from"./app-DGDivIsO.js";import{a as N}from"./apiAdmin-D4J8O5cP.js";import{S as U}from"./SaveOutlined-saF8VQQc.js";const R=()=>{const e="designations",{t:a}=k(),s={name:"",description:""},l=S([{title:a("designation.name"),dataIndex:"name"}]),t=[{key:"name",value:a("common.name")}];return{addEditUrl:e,initData:s,columns:l,filterableColumns:t}},V=$({props:["formData","data","visible","url","addEditType","pageTitle","successMessage"],components:{PlusOutlined:y,LoadingOutlined:h,SaveOutlined:U},setup(e,{emit:a}){const{addEditRequestAdmin:s,loading:l,rules:t}=N();return{loading:l,rules:t,onClose:()=>{t.value={},a("closed")},onSubmit:()=>{s({url:e.url,data:e.formData,successMessage:e.successMessage,success:i=>{a("addEditSuccess",i.xid)}})},drawerWidth:window.innerWidth<=991?"90%":"45%"}}});function W(e,a,s,l,t,c){const d=E,i=T,p=B,_=M,f=A,g=O("SaveOutlined"),u=I,v=q;return w(),D(v,{open:e.visible,closable:!1,centered:!0,title:e.pageTitle,onOk:e.onSubmit},{footer:n(()=>[o(u,{key:"submit",type:"primary",loading:e.loading,onClick:e.onSubmit},{icon:n(()=>[o(g)]),default:n(()=>[m(" "+r(e.addEditType=="add"?e.$t("common.create"):e.$t("common.update")),1)]),_:1},8,["loading","onClick"]),o(u,{key:"back",onClick:e.onClose},{default:n(()=>[m(r(e.$t("common.cancel")),1)]),_:1},8,["onClick"])]),default:n(()=>[o(f,{layout:"vertical"},{default:n(()=>[o(_,{gutter:16},{default:n(()=>[o(p,{xs:24,sm:24,md:24,lg:24},{default:n(()=>[o(i,{label:e.$t("designation.name"),name:"name",help:e.rules.name?e.rules.name.message:null,validateStatus:e.rules.name?"error":null,class:"required"},{default:n(()=>[o(d,{value:e.formData.name,"onUpdate:value":a[0]||(a[0]=b=>e.formData.name=b),placeholder:e.$t("common.placeholder_default_text",[e.$t("designation.name")])},null,8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1})]),_:1})]),_:1})]),_:1},8,["open","title","onOk"])}const Z=C(V,[["render",W]]);export{Z as A,R as f};
