import{_ as k}from"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import{b as w,c as T}from"./documentManagement-CH33LgfO.js";import{d as O,r as m,u as R,V as y,c as I,o as $,l as a,w as j,j as B,k as C,aj as D}from"./index-9PRMimni.js";import{u as N}from"./useModal-CO65vga3.js";const q=O({__name:"TreeModal",emits:["success"],setup(V,{expose:i,emit:u}){const d=u,o=m(0),r=m(!1),p=R(),{t:s}=y();let e=m();const[f,{openModal:_,closeModal:v,setSubLoading:n,setProps:g}]=N({title:"",width:500});function h(l,t,c=!1){o.value=t.level,r.value=c,g({title:l}),_(),e.value=D(t||{})}async function x(){if(!e.value?.name){p.error(`${s("common.inputText")} ${s("document.documentManagement.folderName")}`),n(!1);return}try{e.value?.id?await w(e.value):await T(e.value),v(),n(!1),d("success")}catch{n(!1)}}return i({handleOpenModal:h}),(l,t)=>{const c=C,M=k;return $(),I(M,{ref:"modalRef",onRegister:a(f),onOnOk:x},{default:j(()=>[B(c,{disabled:a(o)===0||a(o)===1&&a(r),value:a(e).name,"onUpdate:value":t[0]||(t[0]=b=>a(e).name=b),placeholder:a(s)("common.inputText"),maxlength:50,"show-count":"",type:"text"},null,8,["disabled","value","placeholder"])]),_:1},8,["onRegister"])}}});export{q as _};
