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-Cy4uayzW.js";import"./index-BN26Feep.js";import{B as N}from"./index-zKZnG1QC.js";import{bO as S}from"./antd-vue-vendor-CahNzUUa.js";import H from"./CodeFileViewModal-9d4a5b5f-D2IlCCjt.js";import{downloadByData as K}from"./download-Bn4f3tzD.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useForm-DfoT2G6J.js";import"./componentMap-0iK4HQBq.js";import"./useFormItem-IOFWTdED.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-Bdn0r8CG.js";import"./index-CrdW4fN1.js";import"./useTimeout-gJpgadD6.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.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 Yo=R(j,[["render",Y]]);export{Yo as default};
