CodeFileListModal-a924902a-YN6VXLuB.js 3.9 KB

1
  1. import{f,r as T,ag as g,aq as C,ar as v,F as y,k as s,aD as p,at as M,aA as x,aC as b,G as u,au as F}from"./vue-vendor-Be68asQ6.js";import{co as R,u as _,ac as G,j as z,ad as I}from"./index-BFfnEkVs.js";import"./index-D68l__AG.js";import{B as N}from"./index-CETWS1o0.js";import{c4 as S}from"./antd-vue-vendor-DcqS7Wvq.js";import j from"./CodeFileViewModal-405e2b58-Cz3tjJU_.js";import{downloadByData as H}from"./download-CjoX0_mR.js";import"./vxe-table-vendor-DHF2TRpV.js";import"./BasicForm-Cv-dsB-e.js";import"./componentMap-BUTAcOmo.js";import"./useFormItem-CtGMPcLp.js";import"./index-BZ_MXCtW.js";import"./index-BIPzXG41.js";import"./index-CXEQnmRq.js";import"./useTimeout-Ca5eqGu-.js";import"./useIntersectionObserver-Bl62RIZ4.js";import"./BasicModal-D4gc2R81.js";import"./useWindowSizeFn-BTSGGcie.js";import"./index-D1703ozz.js";import"./index-Bi7PIj53.js";import"./useCountdown-B7iR27pS.js";import"./useFormItemSingle-nLM0QlcI.js";import"./JSelectUser-DCwPqRxp.js";import"./props-BPxWJPuD.js";import"./JSelectBiz-Be8KsC5j.js";import"./JAddInput-BBXQvvpq.js";import"./areaDataUtil-Cik-Rc_P.js";import"./index-BOEzG86y.js";import"./index-BNFwynfr.js";import"./bem-BvvqSl-N.js";import"./props-Cw7AfxGV.js";import"./useContextMenu-BDwmjIwb.js";import"./depart.api-CDwTvdwQ.js";import"./JSelectDept-DT6g7V5M.js";import"./JPopup-DKJW27Yk.js";import"./JEllipsis-C04xKxcI.js";import"./JUpload-cB_Qj2H2.js";import"./index-iuayQczx.js";import"./index-DJQB4_Pr.js";import"./useForm-kcRIHoe0.js";import"./JAreaLinkage-BNOKwn5l.js";import"./JCodeEditor-CSivhUhT.js";import"./htmlmixed-DNSd26j0.js";import"./vue-DbzutmLn.js";/* empty css */import"./EasyCronInput-wCv2YMHn.js";import"./base64Conver-24EVOS6V.js";var K=(m,e,a)=>new Promise((o,d)=>{var c=t=>{try{r(a.next(t))}catch(l){d(l)}},n=t=>{try{r(a.throw(t))}catch(l){d(l)}},r=t=>t.done?o(t.value):Promise.resolve(t.value).then(c,n);r((a=a.apply(m,e)).next())});const P={name:"CodeFileListModal",components:{BasicModal:N,InfoCircleTwoTone:S,CodeFileViewModal:j},emits:["register"],setup(){const{createMessage:m}=_(),e=f([]),a=window.innerHeight-150,o=T({overflowY:"auto",maxHeight:a+"px"}),d=f(!1),c=f(""),n=f(""),[r,{closeModal:t}]=G(i=>K(this,null,function*(){e.value=i.codeList,c.value=i.tableName,n.value=i.pathKey}));function l(){t()}function w(){let i=e.value;if(!i||i.length==0){m.warning("无代码!");return}let B=i.join(",");return z.post({url:"/online/cgform/api/downGenerateCode",params:{fileList:encodeURI(B),pathKey:n.value},responseType:"blob"},{isTransformResponse:!1}).then(h=>{if(!h||h.size==0){m.warning("导出代码失败!");return}let L="导到生成代码_"+c.value+"_"+new Date().getTime()+".zip";H(h,L,"application/zip")})}const[k,{openModal:D}]=I();function V(){let i=e.value;D(!0,{codeList:i,pathKey:n.value})}return{registerModal:r,registerCodeViewModal:k,divStyle:o,codeList:e,onDownloadGenerateCode:w,handleClose:l,handleView:V,loading:d}}};function U(m,e,a,o,d,c){const n=g("info-circle-two-tone"),r=g("a-button"),t=g("BasicModal"),l=g("code-file-view-modal");return v(),C(y,null,[s(t,{onRegister:o.registerModal,width:1200,defaultFullscreen:!1,canFullscreen:!1},{title:p(()=>[s(n),e[0]||(e[0]=u(" 代码生成结果 "))]),footer:p(()=>[s(r,{onClick:o.handleClose},{default:p(()=>e[2]||(e[2]=[u("关闭")])),_:1},8,["onClick"]),s(r,{type:"primary",ghost:"",onClick:o.handleView},{default:p(()=>e[3]||(e[3]=[u("在线预览")])),_:1},8,["onClick"]),s(r,{type:"primary",onClick:o.onDownloadGenerateCode,loading:o.loading},{default:p(()=>e[4]||(e[4]=[u("下载到本地")])),_:1},8,["onClick","loading"])]),default:p(()=>[M("div",{style:x(o.divStyle)},[M("p",null,[(v(!0),C(y,null,b(o.codeList,w=>(v(),C(y,null,[u(F(w),1),e[1]||(e[1]=M("br",null,null,-1))],64))),256))])],4)]),_:1},8,["onRegister"]),s(l,{onRegister:o.registerCodeViewModal,onDownload:o.onDownloadGenerateCode,onClose:o.handleClose},null,8,["onRegister","onDownload","onClose"])],64)}const Ne=R(P,[["render",U]]);export{Ne as default};