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-CLZzJyTP.js";import"./index-ByX9XNkE.js";import{B as N}from"./index-XZKTTfG1.js";import{bO as S}from"./antd-vue-vendor-CahNzUUa.js";import H from"./CodeFileViewModal-9d4a5b5f-BitP96vf.js";import{downloadByData as K}from"./download-DopMSmFN.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useForm-Dx3lJ3DG.js";import"./componentMap-DpsJvoqz.js";import"./useFormItem-IOFWTdED.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-DvqyyN77.js";import"./index-CrdW4fN1.js";import"./useTimeout-KpZCXEcl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useWindowSizeFn-D9PllI8g.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JAddInput-B36c3B5x.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-C7yPiS0L.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./depart.api-DHG2p2Yd.js";import"./JImageUpload-BFwNYdm5.js";import"./JDictSelectTag-CfF54ALX.js";import"./JSelectDept-CaEHrQp6.js";import"./JPopup-BvqhHpPl.js";import"./JEllipsis-C_gT_vEQ.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./JAreaLinkage-M9TGy8nY.js";import"./JCodeEditor-CR57XeIe.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CWOTSpxK.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};
