Files
qhmes/web-dist/js/CodeFileListModal-QC26EvT4.js
2026-06-16 18:19:57 +08:00

2 lines
3.6 KiB
Java

var h=(d,e,r)=>new Promise((o,p)=>{var c=t=>{try{n(r.next(t))}catch(a){p(a)}},l=t=>{try{n(r.throw(t))}catch(a){p(a)}},n=t=>t.done?o(t.value):Promise.resolve(t.value).then(c,l);n((r=r.apply(d,e)).next())});import{au as F,s as V,d as x}from"./index-X7Y8jykP.js";import"./helper-DcLcf4v6.js";import"./index-BzChaRPg.js";import"./BasicForm.vue_vue_type_style_index_0_lang-B29PWQy0.js";import"./breakpointEnum-BhAg6bcX.js";import{B as T}from"./index-BDvqZ5j4.js";import{C as N,I as R}from"./CodeFileViewModal-yJZr5i9q.js";import{downloadByData as z}from"./download-CygB1orH.js";import{a as G,u as K}from"./useModal-DaJ3Bflg.js";import{C as _,z as v,f as s,A as m,K as u,F as y,r as g,b as I,Q as M,T as S,D as H,E as f,G as E}from"./vue-vendor-DNhG1Cve.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./index-DO7ZhK45.js";import"./index-ByCwbQDV.js";import"./index-Upeu4GGa.js";import"./index-C4wWpZeQ.js";import"./useTimeout-D5AmIBZw.js";import"./index-M9QP6cvf.js";import"./Skeleton-CimgOdM7.js";import"./useScrollTo-0FPEw5-K.js";import"./useIntersectionObserver-BGOgyKyu.js";import"./BasicModal-xH56XuRZ.js";import"./ModalHeader-Sr8KwhJJ.js";import"./useWindowSizeFn-C-0M9_Ul.js";import"./useAppInject-DPZGPcR3.js";import"./index-CuWaQdlK.js";import"./index-C69VKHba.js";/* empty css */import"./DirectoryTree-nk_YTTIy.js";import"./FolderOpenOutlined-SzIPA7z0.js";import"./index-Cl-8Hzo4.js";import"./useMaxLevel-DE205ncc.js";import"./eagerComputed-BTlOruLW.js";import"./index-BuONesFs.js";import"./base64Conver-24EVOS6V.js";const j={name:"CodeFileListModal",components:{BasicModal:T,InfoCircleTwoTone:R,CodeFileViewModal:N},emits:["register"],setup(){const{createMessage:d}=V(),e=g([]),r=window.innerHeight-150,o=I({overflowY:"auto",maxHeight:r+"px"}),p=g(!1),c=g(""),l=g(""),[n,{closeModal:t}]=G(i=>h(null,null,function*(){e.value=i.codeList,c.value=i.tableName,l.value=i.pathKey}));function a(){t()}function w(){let i=e.value;if(!i||i.length==0){d.warning("无代码!");return}let k=i.join(",");return x.post({url:"/online/cgform/api/downGenerateCode",params:{fileList:encodeURI(k),pathKey:l.value},responseType:"blob"},{isTransformResponse:!1}).then(C=>{if(!C||C.size==0){d.warning("导出代码失败!");return}let B="导到生成代码_"+c.value+"_"+new Date().getTime()+".zip";z(C,B,"application/zip")})}const[D,{openModal:L}]=K();function b(){let i=e.value;L(!0,{codeList:i,pathKey:l.value})}return{registerModal:n,registerCodeViewModal:D,divStyle:o,codeList:e,onDownloadGenerateCode:w,handleClose:a,handleView:b,loading:p}}};function A(d,e,r,o,p,c){const l=u("info-circle-two-tone"),n=u("a-button"),t=u("BasicModal"),a=u("code-file-view-modal");return v(),_(y,null,[s(t,{onRegister:o.registerModal,width:1200,defaultFullscreen:!1,canFullscreen:!1},{title:m(()=>[s(l),e[0]||(e[0]=f(" 代码生成结果 ",-1))]),footer:m(()=>[s(n,{onClick:o.handleClose},{default:m(()=>[...e[2]||(e[2]=[f("关闭",-1)])]),_:1},8,["onClick"]),s(n,{type:"primary",ghost:"",onClick:o.handleView},{default:m(()=>[...e[3]||(e[3]=[f("在线预览",-1)])]),_:1},8,["onClick"]),s(n,{type:"primary",onClick:o.onDownloadGenerateCode,loading:o.loading},{default:m(()=>[...e[4]||(e[4]=[f("下载到本地",-1)])]),_:1},8,["onClick","loading"])]),default:m(()=>[M("div",{style:S(o.divStyle)},[M("p",null,[(v(!0),_(y,null,H(o.codeList,w=>(v(),_(y,null,[f(E(w),1),e[1]||(e[1]=M("br",null,null,-1))],64))),256))])],4)]),_:1},8,["onRegister"]),s(a,{onRegister:o.registerCodeViewModal,onDownload:o.onDownloadGenerateCode,onClose:o.handleClose},null,8,["onRegister","onDownload","onClose"])],64)}const Le=F(j,[["render",A]]);export{Le as default};