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

2 lines
7.2 KiB
JavaScript
Raw Normal View History

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((