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