import{U as u,a2 as v,ad as g,af as m,k as y,a4 as D,G as B,V as R,d as w,f}from"./vue-vendor-CxLCUzY4.js";import{c9 as V,a8 as _,h as C}from"./index-Cy4uayzW.js";import{B as b}from"./index-zKZnG1QC.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";var p=(e,d,a)=>new Promise((o,n)=>{var i=t=>{try{r(a.next(t))}catch(l){n(l)}},c=t=>{try{r(a.throw(t))}catch(l){n(l)}},r=t=>t.done?o(t.value):Promise.resolve(t.value).then(i,c);r((a=a.apply(e,d)).next())});const x=w({name:"FileSelectModal",components:{BasicModal:b},emits:["select","register"],setup(e,{emit:d}){const a=f(!0),o=f([]),n=f(""),i=f(!1),[c,{closeModal:r}]=_(()=>p(this,null,function*(){n.value="",o.value.length===0&&h()}));function t(){d("select",n.value),r()}function l(){r()}function h(){return p(this,null,function*(){a.value=!0,o.value=yield C.get({url:"/online/cgform/head/rootFile"}).finally(()=>{a.value=!1,i.value=!0})})}function S(s){return p(this,null,function*(){if(s.dataRef.children)return;let M={parentPath:s.dataRef.key};s.dataRef.children=yield C.get({url:"/online/cgform/head/fileTree",params:M}),o.value=[...o.value]})}function k(s){n.value=s[0]}return{loading:a,treeData:o,onLoadData:S,onSelect:k,onSubmit:t,onCancel:l,registerModal:c,hanldeRefresh:()=>{n.value="",i.value=!1,h()},directoryTreeShow:i}}}),T={class:"btnArea"};function N(e,d,a,o,n,i){const c=u("a-button"),r=u("a-directory-tree"),t=u("a-spin"),l=u("BasicModal");return v(),g(l,{onRegister:e.registerModal,title:"选择目录",width:500,onOk:e.onSubmit,onCancel:e.onCancel},{default:m(()=>[y(t,{spinning:e.loading},{default:m(()=>[D("div",T,[y(c,{onClick:e.hanldeRefresh},{default:m(()=>[B("刷新")]),_:1},8,["onClick"])]),e.directoryTreeShow?(v(),g(r,{key:0,treeData:e.treeData,loadData:e.onLoadData,onSelect:e.onSelect},null,8,["treeData","loadData","onSelect"])):R("",!0)]),_:1},8,["spinning"])]),_:1},8,["onRegister","onOk","onCancel"])}const K=V(x,[["render",N],["__scopeId","data-v-102e9e9f"]]);export{K as default};
