Agriculture-front-end/dist/assets/index.712c1ac1.js

2 lines
7.2 KiB
JavaScript

import{G as e,a,r as l,I as t,U as n,ab as o,d as i,T as u,o as d,c as p,K as r,M as c,f as s,e as m,w as f,j as g,J as b,n as v,k as h,l as y,A as w,V as _,W as k,al as C,v as N}from"./index.e5c8b0d6.js";import{a as V,b as x,s as S,p as U,d as $}from"./gen.d20b2ee1.js";import q from"./importTable.846fddd4.js";const D={class:"app-container"},j=e({name:"Gen"}),I=Object.assign(j,{setup(e){const j=a(),{proxy:I}=N(),R=l([]),T=l(!0),z=l(!0),O=l([]),K=l(!0),P=l(!0),Y=l(0),E=l([]),F=l([]),G=l(""),M=t({queryParams:{pageNum:1,pageSize:10,tableName:void 0,tableComment:void 0},preview:{open:!1,title:"代码预览",data:{},activeName:"domain.java"}}),{queryParams:A,preview:J}=n(M);function Q(){T.value=!0,V(I.addDateRange(A.value,F.value)).then((e=>{R.value=e.rows,Y.value=e.total,T.value=!1}))}function W(){A.value.pageNum=1,Q()}function B(e){const a=e.tableName||E.value;""!=a?"1"===e.genType?x(e.tableName).then((a=>{I.$modal.msgSuccess("成功生成到自定义路径:"+e.genPath)})):I.$download.zip("/tool/gen/batchGenCode?tables="+a,"ruoyi.zip"):I.$modal.msgError("请选择要生成的数据")}function H(){I.$refs.importRef.show()}function L(){F.value=[],I.resetForm("queryRef"),W()}function X(){I.$modal.msgSuccess("复制成功")}function Z(e){O.value=e.map((e=>e.tableId)),E.value=e.map((e=>e.tableName)),K.value=1!=e.length,P.value=!e.length}function ee(e){const a=e.tableId||O.value[0];C.push({path:"/tool/gen-edit/index/"+a,query:{pageNum:A.value.pageNum}})}function ae(e){const a=e.tableId||O.value;I.$modal.confirm('是否确认删除表编号为"'+a+'"的数据项?').then((function(){return $(a)})).then((()=>{Q(),I.$modal.msgSuccess("删除成功")})).catch((()=>{}))}return o((()=>{const e=j.query.t;null!=e&&e!=G.value&&(G.value=e,A.value.pageNum=Number(j.query.pageNum),F.value=[],I.resetForm("queryForm"),Q())})),Q(),(e,a)=>{const l=i("el-input"),t=i("el-form-item"),n=i("el-date-picker"),o=i("el-button"),C=i("el-form"),N=i("el-col"),V=i("right-toolbar"),x=i("el-row"),$=i("el-table-column"),j=i("el-tooltip"),O=i("el-table"),E=i("pagination"),G=i("el-link"),M=i("el-tab-pane"),le=i("el-tabs"),te=i("el-dialog"),ne=u("hasPermi"),oe=u("loading"),ie=u("copyText");return d(),p("div",D,[r(m(C,{model:s(A),ref:"queryRef",inline:!0},{default:f((()=>[m(t,{label:"表名称",prop:"tableName"},{default:f((()=>[m(l,{modelValue:s(A).tableName,"onUpdate:modelValue":a[0]||(a[0]=e=>s(A).tableName=e),placeholder:"请输入表名称",clearable:"",style:{width:"200px"},onKeyup:g(W,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),m(t,{label:"表描述",prop:"tableComment"},{default:f((()=>[m(l,{modelValue:s(A).tableComment,"onUpdate:modelValue":a[1]||(a[1]=e=>s(A).tableComment=e),placeholder:"请输入表描述",clearable:"",style:{width:"200px"},onKeyup:g(W,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),m(t,{label:"创建时间",style:{width:"308px"}},{default:f((()=>[m(n,{modelValue:s(F),"onUpdate:modelValue":a[2]||(a[2]=e=>b(F)?F.value=e:null),"value-format":"YYYY-MM-DD",type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},null,8,["modelValue"])])),_:1}),m(t,null,{default:f((()=>[m(o,{type:"primary",icon:"Search",onClick:W},{default:f((()=>[v("搜索")])),_:1}),m(o,{icon:"Refresh",onClick:L},{default:f((()=>[v("重置")])),_:1})])),_:1})])),_:1},8,["model"]),[[c,s(z)]]),m(x,{gutter:10,class:"mb8"},{default:f((()=>[m(N,{span:1.5},{default:f((()=>[r((d(),h(o,{type:"primary",plain:"",icon:"Download",onClick:B},{default:f((()=>[v("生成")])),_:1})),[[ne,["tool:gen:code"]]])])),_:1},8,["span"]),m(N,{span:1.5},{default:f((()=>[r((d(),h(o,{type:"info",plain:"",icon:"Upload",onClick:H},{default:f((()=>[v("导入")])),_:1})),[[ne,["tool:gen:import"]]])])),_:1},8,["span"]),m(N,{span:1.5},{default:f((()=>[r((d(),h(o,{type:"success",plain:"",icon:"Edit",disabled:s(K),onClick:ee},{default:f((()=>[v("修改")])),_:1},8,["disabled"])),[[ne,["tool:gen:edit"]]])])),_:1},8,["span"]),m(N,{span:1.5},{default:f((()=>[r((d(),h(o,{type:"danger",plain:"",icon:"Delete",disabled:s(P),onClick:ae},{default:f((()=>[v("删除")])),_:1},8,["disabled"])),[[ne,["tool:gen:remove"]]])])),_:1},8,["span"]),m(V,{showSearch:s(z),"onUpdate:showSearch":a[3]||(a[3]=e=>b(z)?z.value=e:null),onQueryTable:Q},null,8,["showSearch"])])),_:1}),r((d(),h(O,{data:s(R),onSelectionChange:Z},{default:f((()=>[m($,{type:"selection",align:"center",width:"55"}),m($,{label:"序号",type:"index",width:"50",align:"center"},{default:f((e=>[y("span",null,w((s(A).pageNum-1)*s(A).pageSize+e.$index+1),1)])),_:1}),m($,{label:"表名称",align:"center",prop:"tableName","show-overflow-tooltip":!0}),m($,{label:"表描述",align:"center",prop:"tableComment","show-overflow-tooltip":!0}),m($,{label:"实体",align:"center",prop:"className","show-overflow-tooltip":!0}),m($,{label:"创建时间",align:"center",prop:"createTime",width:"160"}),m($,{label:"更新时间",align:"center",prop:"updateTime",width:"160"}),m($,{label:"操作",align:"center",width:"330","class-name":"small-padding fixed-width"},{default:f((e=>[m(j,{content:"预览",placement:"top"},{default:f((()=>[r(m(o,{link:"",type:"primary",icon:"View",onClick:a=>{return l=e.row,void U(l.tableId).then((e=>{J.value.data=e.data,J.value.open=!0,J.value.activeName="domain.java"}));var l}},null,8,["onClick"]),[[ne,["tool:gen:preview"]]])])),_:2},1024),m(j,{content:"编辑",placement:"top"},{default:f((()=>[r(m(o,{link:"",type:"primary",icon:"Edit",onClick:a=>ee(e.row)},null,8,["onClick"]),[[ne,["tool:gen:edit"]]])])),_:2},1024),m(j,{content:"删除",placement:"top"},{default:f((()=>[r(m(o,{link:"",type:"primary",icon:"Delete",onClick:a=>ae(e.row)},null,8,["onClick"]),[[ne,["tool:gen:remove"]]])])),_:2},1024),m(j,{content:"同步",placement:"top"},{default:f((()=>[r(m(o,{link:"",type:"primary",icon:"Refresh",onClick:a=>function(e){const a=e.tableName;I.$modal.confirm('确认要强制同步"'+a+'"表结构吗?').then((function(){return S(a)})).then((()=>{I.$modal.msgSuccess("同步成功")})).catch((()=>{}))}(e.row)},null,8,["onClick"]),[[ne,["tool:gen:edit"]]])])),_:2},1024),m(j,{content:"生成代码",placement:"top"},{default:f((()=>[r(m(o,{link:"",type:"primary",icon:"Download",onClick:a=>B(e.row)},null,8,["onClick"]),[[ne,["tool:gen:code"]]])])),_:2},1024)])),_:1})])),_:1},8,["data"])),[[oe,s(T)]]),r(m(E,{total:s(Y),page:s(A).pageNum,"onUpdate:page":a[4]||(a[4]=e=>s(A).pageNum=e),limit:s(A).pageSize,"onUpdate:limit":a[5]||(a[5]=e=>s(A).pageSize=e),onPagination:Q},null,8,["total","page","limit"]),[[c,s(Y)>0]]),m(te,{title:s(J).title,modelValue:s(J).open,"onUpdate:modelValue":a[7]||(a[7]=e=>s(J).open=e),width:"80%",top:"5vh","append-to-body":"",class:"scrollbar"},{default:f((()=>[m(le,{modelValue:s(J).activeName,"onUpdate:modelValue":a[6]||(a[6]=e=>s(J).activeName=e)},{default:f((()=>[(d(!0),p(_,null,k(s(J).data,((e,a)=>(d(),h(M,{label:a.substring(a.lastIndexOf("/")+1,a.indexOf(".vm")),name:a.substring(a.lastIndexOf("/")+1,a.indexOf(".vm")),key:e},{default:f((()=>[r((d(),h(G,{underline:!1,icon:"DocumentCopy",style:{float:"right"}},{default:f((()=>[v(" 复制")])),_:2},1024)),[[ie,e],[ie,X,"callback"]]),y("pre",null,w(e),1)])),_:2},1032,["label","name"])))),128))])),_:1},8,["modelValue"])])),_:1},8,["title","modelValue"]),m(s(q),{ref:"importRef",onOk:W},null,512)])}}});export{I as default};