2023-09-19 14:34:21 +08:00
|
|
|
import{B as pe,a as ce,r as c,D as me,P as fe,a2 as _e,d as i,O as T,o as _,c as K,G as s,H as j,f as n,e,w as l,i as G,F as Q,m as g,j as v,k as Y,x as L,Q as be,R as ge,ac as ve,s as he}from"./index.42ab3fdc.js";import{a as ye,b as we,s as Ce,p as Ne,d as ke}from"./gen.97664eb6.js";import xe from"./importTable.4b69979b.js";const Se={class:"app-container"},Ve=pe({name:"Gen"}),Ie=Object.assign(Ve,{setup($e){const R=ce(),{proxy:u}=he(),I=c([]),S=c(!0),N=c(!0),V=c([]),q=c(!0),U=c(!0),$=c(0),P=c([]),h=c([]),O=c(""),M=me({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}=fe(M);_e(()=>{const o=R.query.t;o!=null&&o!=O.value&&(O.value=o,r.value.pageNum=Number(R.query.pageNum),h.value=[],u.resetForm("queryForm"),y())});function y(){S.value=!0,ye(u.addDateRange(r.value,h.value)).then(o=>{I.value=o.rows,$.value=o.total,S.value=!1})}function w(){r.value.pageNum=1,y()}function z(o){const t=o.tableName||P.value;if(t==""){u.$modal.msgError("\u8BF7\u9009\u62E9\u8981\u751F\u6210\u7684\u6570\u636E");return}o.genType==="1"?we(o.tableName).then(D=>{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 Ce(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){Ne(o.tableId).then(t=>{m.value.data=t.data,m.value.open=!0,m.value.activeName="domain.java"})}function X(){u.$modal.msgSuccess("\u590D\u5236\u6210\u529F")}function Z(o){V.value=o.map(t=>t.tableId),P.value=o.map(t=>t.tableName),q.value=o.length!=1,U.value=!o.length}function B(o){const t=o.tableId||V.value[0];ve.push({path:"/tool/gen-edit/index/"+t,query:{pageNum:r.value.pageNum}})}function E(o){const t=o.tableId||V.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 D=i("el-input"),k=i("el-form-item"),ee=i("el-date-picker"),d=i("el-button"),te=i("el-form"),x=i("el-col"),le=i("right-toolbar"),ae=i("el-row"),b=i("el-table-column"),C=i("el-tooltip"),ne=i("el-table"),oe=i("pagination"),ie=i("el-link"),re=i("el-tab-pane"),se=i("el-tabs"),ue=i("el-dialog"),f=T("hasPermi"),de=T("loading"),F=T("copyText");return _(),K("div",Se,[s(e(te,{model:n(r),ref:"queryRef",inline:!0},{default:l(()=>[e(k,{label:"\u8868\u540D\u79F0",prop:"tableName"},{default:l(()=>[e(D,{modelValue:n(r).tableName,"onUpdate:modelValue":t[0]||(t[0]=a=>n(r).tableName=a),placeholder:"\u8BF7\u8F93\u5165\u8868\u540D\u79F0",clearable:"",style:{width:"200px"},onKeyup:G(w,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(k,{label:"\u8868\u63CF\u8FF0",prop:"tableComment"},{default:l(()=>[e(D,{modelValue:n(r).tableComment,"onUpdate:modelValue":t[1]||(t[1]=a=>n(r).tableComment=a),placeholder:"\u8BF7\u8F93\u5165\u8868\u63CF\u8FF0",clearable:"",style:{width:"200px"},onKeyup:G(w,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(k,{label:"\u521B\u5EFA\u65F6\u95F4",style:{width:"308px"}},{default:l(()=>[e(ee,{modelValue:n(h),"onUpdate:modelValue":t[2]||(t[2]=a=>Q(h)?h.value=a: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(k,null,{default:l(()=>[e(d,{type:"primary",icon:"Search",onClick:w},{default:l(()=>[g("\u641C\u7D22")]),_:1}),e(d,{icon:"Refresh",onClick:J},{default:l(()=>[g("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1},8,["model"]),[[j,n(N)]]),e(ae,{gutter:10,class:"mb8"},{default:l(()=>[e(x,{span:1.5},{default:l(()=>[s((_(),v(d,{type:"primary",plain:"",icon:"D
|