import{U as f,a2 as h,a3 as v,k as p,af as s,a4 as M,F as y,ae as L,G as u,a5 as T,ac as x,f as g,r as F}from"./vue-vendor-CxLCUzY4.js";import{c9 as R,a8 as _,a9 as G,u as z,h as I}from"./index-CYriLmQo.js";import"./index-BkgeZpOO.js";import{B as N}from"./index-CF_FJn6P.js";import{bO as S}from"./antd-vue-vendor-CDWW6V_M.js";import H from"./CodeFileViewModal-9d4a5b5f-FyviorR7.js";import{downloadByData as K}from"./download-CkbK5et1.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./useForm-8o5KRzWo.js";import"./componentMap-7D1QIeNI.js";import"./useFormItem-CWa0w7fA.js";import"./index-BRTtls-l.js";import"./index-DOuVMe-q.js";import"./index-CxQILSKV.js";import"./index-ByLO0zSl.js";import"./useTimeout-DC8132dd.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./index-QMJkXEyl.js";import"./index-Bb_NRLur.js";import"./useCountdown-C3-PRPLY.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-nVFm3ao2.js";import"./props-DoGpHXAD.js";import"./JSelectBiz-BW6f3e--.js";import"./JAddInput-CXT54-j9.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-BTSd5ebC.js";import"./index-BTAl55Kt.js";import"./bem-2ra1afoV.js";import"./props-BLY2qIO5.js";import"./useContextMenu-DYyhcDf7.js";import"./depart.api-C9T5xfw6.js";import"./JDictSelectTag-Jqy9TBcS.js";import"./JSelectDept-DorRVguN.js";import"./JPopup-KP1kIsae.js";import"./JEllipsis-287cEHxd.js";import"./JUpload-pyrTRFCz.js";import"./index-Bx9Mnn3N.js";import"./index-B1-pj6uh.js";import"./index-isxCPgHp.js";import"./JAreaLinkage-DFTeDmm8.js";import"./JCodeEditor-_KZ8XnNK.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-XK54XB3r.js";import"./base64Conver-24EVOS6V.js";var U=(m,i,a)=>new Promise((o,d)=>{var c=e=>{try{t(a.next(e))}catch(l){d(l)}},n=e=>{try{t(a.throw(e))}catch(l){d(l)}},t=e=>e.done?o(e.value):Promise.resolve(e.value).then(c,n);t((a=a.apply(m,i)).next())});const j={name:"CodeFileListModal",components:{BasicModal:N,InfoCircleTwoTone:S,CodeFileViewModal:H},emits:["register"],setup(){const{createMessage:m}=z(),i=g([]),a=window.innerHeight-150,o=F({overflowY:"auto",maxHeight:a+"px"}),d=g(!1),c=g(""),n=g(""),[t,{closeModal:e}]=_(r=>U(this,null,function*(){i.value=r.codeList,c.value=r.tableName,n.value=r.pathKey}));function l(){e()}function w(){let r=i.value;if(!r||r.length==0){m.warning("无代码！");return}let b=r.join(",");return I.post({url:"/online/cgform/api/downGenerateCode",params:{fileList:encodeURI(b),pathKey:n.value},responseType:"blob"},{isTransformResponse:!1}).then(C=>{if(!C||C.size==0){m.warning("导出代码失败！");return}let B="导到生成代码_"+c.value+"_"+new Date().getTime()+".zip";K(C,B,"application/zip")})}const[k,{openModal:D}]=G();function V(){let r=i.value;D(!0,{codeList:r,pathKey:n.value})}return{registerModal:t,registerCodeViewModal:k,divStyle:o,codeList:i,onDownloadGenerateCode:w,handleClose:l,handleView:V,loading:d}}},P=M("br",null,null,-1);function Y(m,i,a,o,d,c){const n=f("info-circle-two-tone"),t=f("a-button"),e=f("BasicModal"),l=f("code-file-view-modal");return h(),v(y,null,[p(e,{onRegister:o.registerModal,width:1200,defaultFullscreen:!1,canFullscreen:!1},{title:s(()=>[p(n),u(" 代码生成结果 ")]),footer:s(()=>[p(t,{onClick:o.handleClose},{default:s(()=>[u("关闭")]),_:1},8,["onClick"]),p(t,{type:"primary",ghost:"",onClick:o.handleView},{default:s(()=>[u("在线预览")]),_:1},8,["onClick"]),p(t,{type:"primary",onClick:o.onDownloadGenerateCode,loading:o.loading},{default:s(()=>[u("下载到本地")]),_:1},8,["onClick","loading"])]),default:s(()=>[M("div",{style:x(o.divStyle)},[M("p",null,[(h(!0),v(y,null,L(o.codeList,w=>(h(),v(y,null,[u(T(w),1),P],64))),256))])],4)]),_:1},8,["onRegister"]),p(l,{onRegister:o.registerCodeViewModal,onDownload:o.onDownloadGenerateCode,onClose:o.handleClose},null,8,["onRegister","onDownload","onClose"])],64)}const Po=R(j,[["render",Y]]);export{Po as default};
