2024-08-06 15:05:43 +08:00
|
|
|
import{G as D,a as q,r as p,d,o as g,k as x,w as o,e,f as r,J as G,c as P,V as R,W as O,l as h,A as E,n as N,v as S}from"./index.9f28707e.js";import{g as Q,u as W}from"./gen.9697226b.js";import{o as H}from"./type.094b0562.js";import J from"./basicInfoForm.58304ece.js";import K from"./genInfoForm.0751b036.js";import"./menu.eace900a.js";const M={style:{float:"left"}},z={style:{float:"right",color:"#8492a6","font-size":"13px"}},A={style:{"text-align":"center","margin-left":"-100px","margin-top":"10px"}},X=D({name:"GenEdit"}),ne=Object.assign(X,{setup(Y){const v=q(),{proxy:c}=S(),V=p("columnInfo"),C=p(document.documentElement.scrollHeight-245+"px"),y=p([]),w=p([]),U=p([]),i=p({});function k(){const m=c.$refs.basicInfo.$refs.basicInfoForm,n=c.$refs.genInfo.$refs.genInfoForm;Promise.all([m,n].map($)).then(b=>{if(b.every(s=>!!s)){const s=Object.assign({},i.value);s.columns=w.value,s.params={treeCode:i.value.treeCode,treeName:i.value.treeName,treeParentCode:i.value.treeParentCode,parentMenuId:i.value.parentMenuId},W(s).then(a=>{c.$modal.msgSuccess(a.msg),a.code===200&&T()})}else c.$modal.msgError("\u8868\u5355\u6821\u9A8C\u672A\u901A\u8FC7\uFF0C\u8BF7\u91CD\u65B0\u68C0\u67E5\u63D0\u4EA4\u5185\u5BB9")})}function $(m){return new Promise(n=>{m.validate(b=>{n(b)})})}function T(){const m={path:"/tool/gen",query:{t:Date.now(),pageNum:v.query.pageNum}};c.$tab.closeOpenPage(m)}return(()=>{const m=v.params&&v.params.tableId;m&&(Q(m).then(n=>{w.value=n.data.rows,i.value=n.data.info,y.value=n.data.tables}),H().then(n=>{U.value=n.data}))})(),(m,n)=>{const b=d("el-tab-pane"),u=d("el-table-column"),s=d("el-input"),a=d("el-option"),_=d("el-select"),f=d("el-checkbox"),B=d("el-table"),F=d("el-tabs"),I=d("el-button"),L=d("el-form"),j=d("el-card");return g(),x(j,null,{default:o(()=>[e(F,{modelValue:r(V),"onUpdate:modelValue":n[0]||(n[0]=l=>G(V)?V.value=l:null)},{default:o(()=>[e(b,{label:"\u57FA\u672C\u4FE1\u606F",name:"basic"},{default:o(()=>[e(r(J),{ref:"basicInfo",info:r(i)},null,8,["info"])]),_:1}),e(b,{label:"\u5B57\u6BB5\u4FE1\u606F",name:"columnInfo"},{default:o(()=>[e(B,{ref:"dragTable",data:r(w),"row-key":"columnId","max-height":r(C)},{default:o(()=>[e(u,{label:"\u5E8F\u53F7",type:"index","min-width":"5%"}),e(u,{label:"\u5B57\u6BB5\u5217\u540D",prop:"columnName","min-width":"10%","show-overflow-tooltip":!0}),e(u,{label:"\u5B57\u6BB5\u63CF\u8FF0","min-width":"10%"},{default:o(l=>[e(s,{modelValue:l.row.columnComment,"onUpdate:modelValue":t=>l.row.columnComment=t},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(u,{label:"\u7269\u7406\u7C7B\u578B",prop:"columnType","min-width":"10%","show-overflow-tooltip":!0}),e(u,{label:"Java\u7C7B\u578B","min-width":"11%"},{default:o(l=>[e(_,{modelValue:l.row.javaType,"onUpdate:modelValue":t=>l.row.javaType=t},{default:o(()=>[e(a,{label:"Long",value:"Long"}),e(a,{label:"String",value:"String"}),e(a,{label:"Integer",value:"Integer"}),e(a,{label:"Double",value:"Double"}),e(a,{label:"BigDecimal",value:"BigDecimal"}),e(a,{label:"Date",value:"Date"}),e(a,{label:"Boolean",value:"Boolean"})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:1}),e(u,{label:"java\u5C5E\u6027","min-width":"10%"},{default:o(l=>[e(s,{modelValue:l.row.javaField,"onUpdate:modelValue":t=>l.row.javaField=t},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(u,{label:"\u63D2\u5165","min-width":"5%"},{default:o(l=>[e(f,{"true-label":"1","false-label":"0",modelValue:l.row.isInsert,"onUpdate:modelValue":t=>l.row.isInsert=t},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(u,{label:"\u7F16\u8F91","min-width":"5%"},{default:o(l=>[e(f,{"true-label":"1","false-label":"0",modelValue:l.row.isEdit,"onUpdate:modelValue":t=>l.row.isEdit=t},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(u,{label:"\u5217\u8868","min-width":"5%"},{default:o(l=>[e(f,{"true-label":"1","false-label":"0",modelValue:l.row.isList,"onUpdate:modelValue":t=>l.row.isList=t},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(u,{label:"\u67E5\u8BE2","min-width":"5%"},{default:o(l=>[e(f,{"true-label":"1","false-label":"0",modelValue:l.row.isQuery,"onU
|