import{M as ce,a as me,r as c,aa as fe,ae as _e,ax as be,e as i,D as T,o as _,c as G,F as s,K as Y,h as n,f as e,w as a,k as j,ab as L,p as g,l as v,m as M,z as Q,G as ge,H as ve,ay as he,v as ye}from"./index.82404a61.js";import{a as we,b as Ne,s as Ce,p as ke,d as xe}from"./gen.84b5e608.js";import Se from"./importTable.c2ce8793.js";const Ve={class:"app-container"},$e=ce({name:"Gen"}),qe=Object.assign($e,{setup(De){const R=me(),{proxy:u}=ye(),I=c([]),V=c(!0),k=c(!0),$=c([]),q=c(!0),z=c(!0),D=c(0),U=c([]),h=c([]),P=c(""),K=c([]),A=fe({queryParams:{pageNum:1,pageSize:10,tableName:void 0,tableComment:void 0},preview:{open:!1,title:"\u4EE3\u7801\u9884\u89C8",data:{},activeName:"domain.java"}}),{queryParams:r,preview:m}=_e(A);be(()=>{const o=R.query.t;o!=null&&o!=P.value&&(P.value=o,r.value.pageNum=Number(R.query.pageNum),h.value=[],u.resetForm("queryForm"),y())});function y(){V.value=!0,we(u.addDateRange(r.value,h.value)).then(o=>{I.value=o.data,D.value=o.total,V.value=!1})}function w(){r.value.pageNum=1,y()}function O(o){const t=o.tableName||U.value;if(t==""){u.$modal.msgError("\u8BF7\u9009\u62E9\u8981\u751F\u6210\u7684\u6570\u636E");return}if(o.genType==="1")Ne(o.tableName).then(N=>{u.$modal.msgSuccess("\u6210\u529F\u751F\u6210\u5230\u81EA\u5B9A\u4E49\u8DEF\u5F84\uFF1A"+o.genPath)});else{let N=t.length>1?"newfiber.zip":`${K.value[0].functionName}.zip`;u.$download.zip("/code/gen/batchGenCode?tables="+t,N)}}function H(o){const t=o.tableName;u.$modal.confirm('\u786E\u8BA4\u8981\u5F3A\u5236\u540C\u6B65"'+t+'"\u8868\u7ED3\u6784\u5417\uFF1F').then(function(){return Ce(t)}).then(()=>{u.$modal.msgSuccess("\u540C\u6B65\u6210\u529F")}).catch(()=>{})}function J(){u.$refs.importRef.show()}function W(){h.value=[],u.resetForm("queryRef"),w()}function X(o){ke(o.tableId).then(t=>{m.value.data=t.data,m.value.open=!0,m.value.activeName="domain.java"})}function Z(){u.$modal.msgSuccess("\u590D\u5236\u6210\u529F")}function ee(o){$.value=o.map(t=>t.tableId),U.value=o.map(t=>t.tableName),q.value=o.length!=1,z.value=!o.length,K.value=o}function E(o){const t=o.tableId||$.value[0];he.push({path:"/tool/gen-edit/index/"+t,query:{pageNum:r.value.pageNum}})}function F(o){const t=o.tableId||$.value;u.$modal.confirm('\u662F\u5426\u786E\u8BA4\u5220\u9664\u8868\u7F16\u53F7\u4E3A"'+t+'"\u7684\u6570\u636E\u9879\uFF1F').then(function(){return xe(t)}).then(()=>{y(),u.$modal.msgSuccess("\u5220\u9664\u6210\u529F")}).catch(()=>{})}return y(),(o,t)=>{const N=i("el-input"),x=i("el-form-item"),te=i("el-date-picker"),d=i("el-button"),ae=i("el-form"),S=i("el-col"),le=i("right-toolbar"),ne=i("el-row"),b=i("el-table-column"),C=i("el-tooltip"),oe=i("el-table"),ie=i("pagination"),re=i("el-link"),se=i("el-tab-pane"),ue=i("el-tabs"),de=i("el-dialog"),f=T("hasPermi"),pe=T("loading"),B=T("copyText");return _(),G("div",Ve,[s(e(ae,{model:n(r),ref:"queryRef",inline:!0},{default:a(()=>[e(x,{label:"\u8868\u540D\u79F0",prop:"tableName"},{default:a(()=>[e(N,{modelValue:n(r).tableName,"onUpdate:modelValue":t[0]||(t[0]=l=>n(r).tableName=l),placeholder:"\u8BF7\u8F93\u5165\u8868\u540D\u79F0",clearable:"",style:{width:"200px"},onKeyup:j(w,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(x,{label:"\u8868\u63CF\u8FF0",prop:"tableComment"},{default:a(()=>[e(N,{modelValue:n(r).tableComment,"onUpdate:modelValue":t[1]||(t[1]=l=>n(r).tableComment=l),placeholder:"\u8BF7\u8F93\u5165\u8868\u63CF\u8FF0",clearable:"",style:{width:"200px"},onKeyup:j(w,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(x,{label:"\u521B\u5EFA\u65F6\u95F4",style:{width:"308px"}},{default:a(()=>[e(te,{modelValue:n(h),"onUpdate:modelValue":t[2]||(t[2]=l=>L(h)?h.value=l:null),"value-format":"YYYY-MM-DD",type:"daterange","range-separator":"-","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F"},null,8,["modelValue"])]),_:1}),e(x,null,{default:a(()=>[e(d,{type:"primary",icon:"Search",onClick:w},{default:a(()=>[g("\u641C\u7D22")]),_:1}),e(d,{icon:"Refresh",onClick:W},{default:a(()=>[g("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1},8,["model"]),[[Y,n(k)]]),e(ne,{gutter:10,class:"mb8"},{default:a(()=>[e(S,{span:1.5},{default:a(()=>[s((_(),v(d,{type:"primary",plain:"",icon:"Download",onClick:O},{default:a(()=>[g("\u751F\u6210")]),_:1})),[[f,["tool:gen:code"]]])]),_:1},8,["span"]),e(S,{span:1.5},{default:a(()=>[s((_(),v(d,{type:"info",plain:"",icon:"Upload",onClick:J},{default:a(()=>[g("\u5BFC\u5165")]),_:1})),[[f,["tool:gen:import"]]])]),_:1},8,["span"]),e(S,{span:1.5},{default:a(()=>[s((_(),v(d,{type:"success",plain:"",icon:"Edit",disabled:n(q),onClick:E},{default:a(()=>[g("\u4FEE\u6539")]),_:1},8,["disabled"])),[[f,["tool:gen:edit"]]])]),_:1},8,["span"]),e(S,{span:1.5},{default:a(()=>[s((_(),v(d,{type:"danger",plain:"",icon:"Delete",disabled:n(z),onClick:F},{default:a(()=>[g("\u5220\u9664")]),_:1},8,["disabled"])),[[f,["tool:gen:remove"]]])]),_:1},8,["span"]),e(le,{showSearch:n(k),"onUpdate:showSearch":t[3]||(t[3]=l=>L(k)?k.value=l:null),onQueryTable:y},null,8,["showSearch"])]),_:1}),s((_(),v(oe,{data:n(I),onSelectionChange:ee},{default:a(()=>[e(b,{type:"selection",align:"center",width:"55"}),e(b,{label:"\u5E8F\u53F7",type:"index",width:"50",align:"center"},{default:a(l=>[M("span",null,Q((n(r).pageNum-1)*n(r).pageSize+l.$index+1),1)]),_:1}),e(b,{label:"\u8868\u540D\u79F0",align:"center",prop:"tableName","show-overflow-tooltip":!0}),e(b,{label:"\u8868\u63CF\u8FF0",align:"center",prop:"tableComment","show-overflow-tooltip":!0}),e(b,{label:"\u5B9E\u4F53",align:"center",prop:"className","show-overflow-tooltip":!0}),e(b,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"160"}),e(b,{label:"\u66F4\u65B0\u65F6\u95F4",align:"center",prop:"updateTime",width:"160"}),e(b,{label:"\u64CD\u4F5C",align:"center",width:"330","class-name":"small-padding fixed-width"},{default:a(l=>[e(C,{content:"\u9884\u89C8",placement:"top"},{default:a(()=>[s(e(d,{link:"",type:"primary",icon:"View",onClick:p=>X(l.row)},null,8,["onClick"]),[[f,["tool:gen:preview"]]])]),_:2},1024),e(C,{content:"\u7F16\u8F91",placement:"top"},{default:a(()=>[s(e(d,{link:"",type:"primary",icon:"Edit",onClick:p=>E(l.row)},null,8,["onClick"]),[[f,["tool:gen:edit"]]])]),_:2},1024),e(C,{content:"\u5220\u9664",placement:"top"},{default:a(()=>[s(e(d,{link:"",type:"primary",icon:"Delete",onClick:p=>F(l.row)},null,8,["onClick"]),[[f,["tool:gen:remove"]]])]),_:2},1024),e(C,{content:"\u540C\u6B65",placement:"top"},{default:a(()=>[s(e(d,{link:"",type:"primary",icon:"Refresh",onClick:p=>H(l.row)},null,8,["onClick"]),[[f,["tool:gen:edit"]]])]),_:2},1024),e(C,{content:"\u751F\u6210\u4EE3\u7801",placement:"top"},{default:a(()=>[s(e(d,{link:"",type:"primary",icon:"Download",onClick:p=>O(l.row)},null,8,["onClick"]),[[f,["tool:gen:code"]]])]),_:2},1024)]),_:1})]),_:1},8,["data"])),[[pe,n(V)]]),s(e(ie,{total:n(D),page:n(r).pageNum,"onUpdate:page":t[4]||(t[4]=l=>n(r).pageNum=l),limit:n(r).pageSize,"onUpdate:limit":t[5]||(t[5]=l=>n(r).pageSize=l),onPagination:y},null,8,["total","page","limit"]),[[Y,n(D)>0]]),e(de,{title:n(m).title,modelValue:n(m).open,"onUpdate:modelValue":t[7]||(t[7]=l=>n(m).open=l),width:"80%",top:"5vh","append-to-body":"","custom-class":"scrollbar"},{default:a(()=>[e(ue,{modelValue:n(m).activeName,"onUpdate:modelValue":t[6]||(t[6]=l=>n(m).activeName=l)},{default:a(()=>[(_(!0),G(ge,null,ve(n(m).data,(l,p)=>(_(),v(se,{label:p.substring(p.lastIndexOf("/")+1,p.indexOf(".vm")),name:p.substring(p.lastIndexOf("/")+1,p.indexOf(".vm")),key:l},{default:a(()=>[s((_(),v(re,{underline:!1,icon:"DocumentCopy",style:{float:"right"}},{default:a(()=>[g("\xA0\u590D\u5236")]),_:2},1024)),[[B,l],[B,Z,"callback"]]),M("pre",null,Q(l),1)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["title","modelValue"]),e(n(Se),{ref:"importRef",onOk:w},null,512)])}}});export{qe as default};