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-B_2CoVdl.js";import"./index-ARbUvvsq.js";import{B as N}from"./index-D2AmS0aU.js";import{bO as S}from"./antd-vue-vendor-CDWW6V_M.js";import H from"./CodeFileViewModal-9d4a5b5f-DodAcEZ4.js";import{downloadByData as K}from"./download-2tYEzlDW.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./useForm-CcjrODHR.js";import"./componentMap-CzCGDP7x.js";import"./useFormItem-CWa0w7fA.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-DAURrYyA.js";import"./index-ByLO0zSl.js";import"./useTimeout-CB9F1PLu.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useWindowSizeFn-C3WExEpc.js";import"./index-Cgt544dC.js";import"./index-BZ9ST2iq.js";import"./useCountdown-ImUE7YaG.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-BQIJUcBR.js";import"./props-BCVPj-bG.js";import"./JSelectBiz-CJyWq5s2.js";import"./JAddInput-YFlAniYT.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-CkL00Q0a.js";import"./index-BKs2x_To.js";import"./bem-C6eT35UB.js";import"./props-BLY2qIO5.js";import"./useContextMenu-CSt5a1-F.js";import"./depart.api-0qTriT9h.js";import"./JDictSelectTag-CxpDdimB.js";import"./JSelectDept-wKz_Qtmc.js";import"./JPopup-BJBYqoWe.js";import"./JEllipsis-Cn7GCKHR.js";import"./JUpload-DzM-D4DX.js";import"./index-khU3p_On.js";import"./index-DPEnuI0R.js";import"./index-Cnb8BkwG.js";import"./JAreaLinkage-CSgDAlrn.js";import"./JCodeEditor-esTLnfS3.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-DclSHT47.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};
