import{a as k}from"./apiAdmin-B6-2qm0d.js";import{_ as S,d as y,e as C,w as n,g as a,i as r,t as u,b as $,a0 as h,o as O,u as w,k as D}from"./app-D7zH3Nl5.js";import{I as E}from"./index-Cu62pBdq.js";import{_ as I,F as M}from"./index-DZxk72Vu.js";import{B as T}from"./useFlexGapSupport-CpBR-RD-.js";import{M as B}from"./index-fjGxdX_x.js";import{S as A}from"./SaveOutlined-jkHaLNj1.js";import{P as q}from"./index-BUzTR6QN.js";import{_ as F,a as N}from"./index-Cv7zOydE.js";const P=y({props:["formData","data","visible","url","addEditType","pageTitle","successMessage"],components:{PlusOutlined:q,LoadingOutlined:h,SaveOutlined:A},setup(e,{emit:o}){const{addEditRequestAdmin:s,loading:l,rules:t}=k();return{loading:l,rules:t,onClose:()=>{t.value={},o("closed")},onSubmit:()=>{s({url:e.url,data:e.formData,successMessage:e.successMessage,success:i=>{o("addEditSuccess",i.xid)}})},drawerWidth:window.innerWidth<=991?"90%":"45%"}}});function U(e,o,s,l,t,c){const m=E,i=I,p=N,_=F,f=M,g=$("SaveOutlined"),d=T,b=B;return O(),C(b,{open:e.visible,closable:!1,centered:!0,title:e.pageTitle,onOk:e.onSubmit},{footer:n(()=>[a(d,{key:"submit",type:"primary",loading:e.loading,onClick:e.onSubmit},{icon:n(()=>[a(g)]),default:n(()=>[r(" "+u(e.addEditType=="add"?e.$t("common.create"):e.$t("common.update")),1)]),_:1},8,["loading","onClick"]),a(d,{key:"back",onClick:e.onClose},{default:n(()=>[r(u(e.$t("common.cancel")),1)]),_:1},8,["onClick"])]),default:n(()=>[a(f,{layout:"vertical"},{default:n(()=>[a(_,{gutter:16},{default:n(()=>[a(p,{xs:24,sm:24,md:24,lg:24},{default:n(()=>[a(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(()=>[a(m,{value:e.formData.name,"onUpdate:value":o[0]||(o[0]=v=>e.formData.name=v),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 K=S(P,[["render",U]]),Q=()=>{const e="designations",{t:o}=w(),s={name:"",description:""},l=D([{title:o("designation.name"),dataIndex:"name"},{title:o("designation.total_employee"),dataIndex:"employee_count"}]),t=[{key:"name",value:o("common.name")}];return{addEditUrl:e,initData:s,columns:l,filterableColumns:t}};export{K as A,Q as f};
