2 lines
8.0 KiB
JavaScript
2 lines
8.0 KiB
JavaScript
|
import{z as pe,a as me,r as m,A as ce,L as fe,a8 as _e,d as r,K as T,o as _,c as F,C as d,D as L,f as l,e,w as n,i as I,B as Y,m as g,j as v,k as G,x as M,M as be,N as ge,a9 as ve,s as he}from"./index.7d345d00.js";import{a as ye,b as we,s as Ne,p as Ce,d as ke}from"./gen.c4fc5361.js";import Ve from"./importTable.a49f46c8.js";const xe={class:"app-container"},Se=pe({name:"Gen"}),Re=Object.assign(Se,{setup($e){const R=me(),{proxy:u}=he(),U=m([]),S=m(!0),k=m(!0),$=m([]),q=m(!0),K=m(!0),D=m(0),z=m([]),h=m([]),P=m(""),Q=ce({queryParams:{pageNum:1,pageSize:10,tableName:void 0,tableComment:void 0,dataName:"master"},preview:{open:!1,title:"\u4EE3\u7801\u9884\u89C8",data:{},activeName:"domain.java"}}),{queryParams:i,preview:c}=fe(Q);localStorage.setItem("dataName",i.value.dataName),_e(()=>{const o=R.query.t;o!=null&&o!=P.value&&(P.value=o,i.value.pageNum=Number(R.query.pageNum),h.value=[],u.resetForm("queryForm"),y())});function y(){S.value=!0,ye(u.addDateRange(i.value,h.value)).then(o=>{U.value=o.rows,D.value=o.total,S.value=!1})}function w(){localStorage.setItem("dataName",i.value.dataName),i.value.pageNum=1,y()}function O(o){const t=o.tableName||z.value;if(t==""){u.$modal.msgError("\u8BF7\u9009\u62E9\u8981\u751F\u6210\u7684\u6570\u636E");return}o.genType==="1"?we(o.tableName).then(V=>{u.$modal.msgSuccess("\u6210\u529F\u751F\u6210\u5230\u81EA\u5B9A\u4E49\u8DEF\u5F84\uFF1A"+o.genPath)}):u.$download.zip("/tool/gen/batchGenCode?tables="+t,"ruoyi.zip")}function A(o){const t=o.tableName;u.$modal.confirm('\u786E\u8BA4\u8981\u5F3A\u5236\u540C\u6B65"'+t+'"\u8868\u7ED3\u6784\u5417\uFF1F').then(function(){return Ne(t)}).then(()=>{u.$modal.msgSuccess("\u540C\u6B65\u6210\u529F")}).catch(()=>{})}function H(){u.$refs.importRef.show()}function J(){h.value=[],u.resetForm("queryRef"),w()}function W(o){Ce(o.tableId).then(t=>{c.value.data=t.data,c.value.open=!0,c.value.activeName="domain.java"})}function X(){u.$modal.msgSuccess("\u590D\u5236\u6210\u529F")}function Z(o){$.value=o.map(t=>t.tableId),z.value=o.map(t=>t.tableName),q.value=o.length!=1,K.value=!o.length}function B(o){const t=o.tableId||$.value[0];ve.push({path:"/tool/gen-edit/index/"+t,query:{pageNum:i.value.pageNum}})}function E(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 ke(t)}).then(()=>{y(),u.$modal.msgSuccess("\u5220\u9664\u6210\u529F")}).catch(()=>{})}return y(),(o,t)=>{const V=r("el-input"),N=r("el-form-item"),ee=r("el-date-picker"),s=r("el-button"),te=r("el-form"),x=r("el-col"),ae=r("right-toolbar"),le=r("el-row"),b=r("el-table-column"),C=r("el-tooltip"),ne=r("el-table"),oe=r("pagination"),ie=r("el-link"),re=r("el-tab-pane"),de=r("el-tabs"),ue=r("el-dialog"),f=T("hasPermi"),se=T("loading"),j=T("copyText");return _(),F("div",xe,[d(e(te,{model:l(i),ref:"queryRef",inline:!0},{default:n(()=>[e(N,{label:"\u6570\u636E\u6E90",prop:"dataName"},{default:n(()=>[e(V,{modelValue:l(i).dataName,"onUpdate:modelValue":t[0]||(t[0]=a=>l(i).dataName=a),placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u6E90\u540D\u79F0",clearable:"",style:{width:"200px"},onKeyup:I(w,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(N,{label:"\u8868\u540D\u79F0",prop:"tableName"},{default:n(()=>[e(V,{modelValue:l(i).tableName,"onUpdate:modelValue":t[1]||(t[1]=a=>l(i).tableName=a),placeholder:"\u8BF7\u8F93\u5165\u8868\u540D\u79F0",clearable:"",style:{width:"200px"},onKeyup:I(w,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(N,{label:"\u8868\u63CF\u8FF0",prop:"tableComment"},{default:n(()=>[e(V,{modelValue:l(i).tableComment,"onUpdate:modelValue":t[2]||(t[2]=a=>l(i).tableComment=a),placeholder:"\u8BF7\u8F93\u5165\u8868\u63CF\u8FF0",clearable:"",style:{width:"200px"},onKeyup:I(w,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(N,{label:"\u521B\u5EFA\u65F6\u95F4",style:{width:"308px"}},{default:n(()=>[e(ee,{modelValue:l(h),"onUpdate:modelValue":t[3]||(t[3]=a=>Y(h)?h.value=a:null),"value-format":"YYYY-MM-DD",type:"daterange","range-separator":"-","start-placeholder":"\u5F00\u59CB\u65E
|