import{a as k}from"./apiAdmin-CiAsr8eb.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-CgV11GBz.js";import{I as E}from"./index-CJx7RGCD.js";import{_ as I,F as M}from"./index-DX5UyTUL.js";import{B as T}from"./useFlexGapSupport-CWWB0EO1.js";import{M as B}from"./index-CNlVDwHo.js";import{S as A}from"./SaveOutlined-NNV7kkji.js";import{P as q}from"./index-B7-RTJOc.js";import{_ as F,a as N}from"./index-CyQQxPex.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};
