import{u as b,_ as k,d as C,a0 as S,e as $,w as o,g as a,i as u,t as c,b as h,o as O}from"./app-CgV11GBz.js";import{a as w}from"./apiAdmin-CiAsr8eb.js";import{S as D}from"./SaveOutlined-NNV7kkji.js";import{P as E}from"./index-B7-RTJOc.js";import{I}from"./index-CJx7RGCD.js";import{_ as M,F as T}from"./index-DX5UyTUL.js";import{B}from"./useFlexGapSupport-CWWB0EO1.js";import{M as A}from"./index-CNlVDwHo.js";import{_ as q,a as F}from"./index-CyQQxPex.js";const J=()=>{const e="asset-types?fields=id,xid,name",t="asset-types",{t:n}=b(),l={name:""},s=[{title:n("asset_type.name"),dataIndex:"name"},{title:n("common.action"),dataIndex:"action"}],i=[{key:"name",value:n("asset_type.name")}];return{url:e,addEditUrl:t,initData:l,columns:s,filterableColumns:i}},N=C({props:["formData","data","visible","url","addEditType","pageTitle","successMessage"],components:{PlusOutlined:E,LoadingOutlined:S,SaveOutlined:D},setup(e,{emit:t}){const{addEditRequestAdmin:n,loading:l,rules:s}=w();return{loading:l,rules:s,onClose:()=>{s.value={},t("closed")},onSubmit:()=>{n({url:e.url,data:e.formData,successMessage:e.successMessage,success:m=>{t("addEditSuccess",m.xid)}})},drawerWidth:window.innerWidth<=991?"90%":"45%"}}});function P(e,t,n,l,s,i){const d=I,m=M,p=F,_=q,f=T,g=h("SaveOutlined"),r=B,y=A;return O(),$(y,{open:e.visible,closable:!1,centered:!0,title:e.pageTitle,onOk:e.onClose},{footer:o(()=>[a(r,{key:"submit",type:"primary",loading:e.loading,onClick:e.onSubmit},{icon:o(()=>[a(g)]),default:o(()=>[u(" "+c(e.addEditType=="add"?e.$t("common.create"):e.$t("common.update")),1)]),_:1},8,["loading","onClick"]),a(r,{key:"back",onClick:e.onClose},{default:o(()=>[u(c(e.$t("common.cancel")),1)]),_:1},8,["onClick"])]),default:o(()=>[a(f,{layout:"vertical"},{default:o(()=>[a(_,{gutter:16},{default:o(()=>[a(p,{xs:24,sm:24,md:24,lg:24},{default:o(()=>[a(m,{label:e.$t("asset_type.name"),name:"name",help:e.rules.name?e.rules.name.message:null,validateStatus:e.rules.name?"error":null,class:"required"},{default:o(()=>[a(d,{value:e.formData.name,"onUpdate:value":t[0]||(t[0]=v=>e.formData.name=v),placeholder:e.$t("common.placeholder_default_text",[e.$t("asset_type.name")])},null,8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1})]),_:1})]),_:1})]),_:1},8,["open","title","onOk"])}const K=k(N,[["render",P]]);export{K as A,J as f};
