2 lines
6.1 KiB
JavaScript
2 lines
6.1 KiB
JavaScript
import{G as e,a as l,r as a,d as o,o as t,k as u,w as d,e as n,f as m,J as r,c as i,V as s,W as b,l as p,A as f,n as c,v}from"./index.e5c8b0d6.js";import{g as V,u as w}from"./gen.d20b2ee1.js";import{o as g}from"./type.b030370e.js";import h from"./basicInfoForm.fb504c61.js";import y from"./genInfoForm.88dcb9f6.js";import"./menu.a3f2b703.js";const U={style:{float:"left"}},_={style:{float:"right",color:"#8492a6","font-size":"13px"}},I={style:{"text-align":"center","margin-left":"-100px","margin-top":"10px"}},T=e({name:"GenEdit"}),E=Object.assign(T,{setup(e){const T=l(),{proxy:E}=v(),x=a("columnInfo"),j=a(document.documentElement.scrollHeight-245+"px"),N=a([]),C=a([]),L=a([]),k=a({});function D(e){return new Promise((l=>{e.validate((e=>{l(e)}))}))}function $(){const e={path:"/tool/gen",query:{t:Date.now(),pageNum:T.query.pageNum}};E.$tab.closeOpenPage(e)}return(()=>{const e=T.params&&T.params.tableId;e&&(V(e).then((e=>{C.value=e.data.rows,k.value=e.data.info,N.value=e.data.tables})),g().then((e=>{L.value=e.data})))})(),(e,l)=>{const a=o("el-tab-pane"),v=o("el-table-column"),V=o("el-input"),g=o("el-option"),T=o("el-select"),q=o("el-checkbox"),B=o("el-table"),F=o("el-tabs"),P=o("el-button"),G=o("el-form"),O=o("el-card");return t(),u(O,null,{default:d((()=>[n(F,{modelValue:m(x),"onUpdate:modelValue":l[0]||(l[0]=e=>r(x)?x.value=e:null)},{default:d((()=>[n(a,{label:"基本信息",name:"basic"},{default:d((()=>[n(m(h),{ref:"basicInfo",info:m(k)},null,8,["info"])])),_:1}),n(a,{label:"字段信息",name:"columnInfo"},{default:d((()=>[n(B,{ref:"dragTable",data:m(C),"row-key":"columnId","max-height":m(j)},{default:d((()=>[n(v,{label:"序号",type:"index","min-width":"5%"}),n(v,{label:"字段列名",prop:"columnName","min-width":"10%","show-overflow-tooltip":!0}),n(v,{label:"字段描述","min-width":"10%"},{default:d((e=>[n(V,{modelValue:e.row.columnComment,"onUpdate:modelValue":l=>e.row.columnComment=l},null,8,["modelValue","onUpdate:modelValue"])])),_:1}),n(v,{label:"物理类型",prop:"columnType","min-width":"10%","show-overflow-tooltip":!0}),n(v,{label:"Java类型","min-width":"11%"},{default:d((e=>[n(T,{modelValue:e.row.javaType,"onUpdate:modelValue":l=>e.row.javaType=l},{default:d((()=>[n(g,{label:"Long",value:"Long"}),n(g,{label:"String",value:"String"}),n(g,{label:"Integer",value:"Integer"}),n(g,{label:"Double",value:"Double"}),n(g,{label:"BigDecimal",value:"BigDecimal"}),n(g,{label:"Date",value:"Date"}),n(g,{label:"Boolean",value:"Boolean"})])),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:1}),n(v,{label:"java属性","min-width":"10%"},{default:d((e=>[n(V,{modelValue:e.row.javaField,"onUpdate:modelValue":l=>e.row.javaField=l},null,8,["modelValue","onUpdate:modelValue"])])),_:1}),n(v,{label:"插入","min-width":"5%"},{default:d((e=>[n(q,{"true-label":"1","false-label":"0",modelValue:e.row.isInsert,"onUpdate:modelValue":l=>e.row.isInsert=l},null,8,["modelValue","onUpdate:modelValue"])])),_:1}),n(v,{label:"编辑","min-width":"5%"},{default:d((e=>[n(q,{"true-label":"1","false-label":"0",modelValue:e.row.isEdit,"onUpdate:modelValue":l=>e.row.isEdit=l},null,8,["modelValue","onUpdate:modelValue"])])),_:1}),n(v,{label:"列表","min-width":"5%"},{default:d((e=>[n(q,{"true-label":"1","false-label":"0",modelValue:e.row.isList,"onUpdate:modelValue":l=>e.row.isList=l},null,8,["modelValue","onUpdate:modelValue"])])),_:1}),n(v,{label:"查询","min-width":"5%"},{default:d((e=>[n(q,{"true-label":"1","false-label":"0",modelValue:e.row.isQuery,"onUpdate:modelValue":l=>e.row.isQuery=l},null,8,["modelValue","onUpdate:modelValue"])])),_:1}),n(v,{label:"查询方式","min-width":"10%"},{default:d((e=>[n(T,{modelValue:e.row.queryType,"onUpdate:modelValue":l=>e.row.queryType=l},{default:d((()=>[n(g,{label:"=",value:"EQ"}),n(g,{label:"!=",value:"NE"}),n(g,{label:">",value:"GT"}),n(g,{label:">=",value:"GTE"}),n(g,{label:"<",value:"LT"}),n(g,{label:"<=",value:"LTE"}),n(g,{label:"LIKE",value:"LIKE"}),n(g,{label:"BETWEEN",value:"BETWEEN"})])),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:1}),n(v,{label:"必填","min-width":"5%"},{default:d((e=>[n(q,{"true-label":"1","false-label":"0",modelValue:e.row.isRequired,"onUpdate:modelValue":l=>e.row.isRequired=l},null,8,["modelValue","onUpdate:modelValue"])])),_:1}),n(v,{label:"显示类型","min-width":"12%"},{default:d((e=>[n(T,{modelValue:e.row.htmlType,"onUpdate:modelValue":l=>e.row.htmlType=l},{default:d((()=>[n(g,{label:"文本框",value:"input"}),n(g,{label:"文本域",value:"textarea"}),n(g,{label:"下拉框",value:"select"}),n(g,{label:"单选框",value:"radio"}),n(g,{label:"复选框",value:"checkbox"}),n(g,{label:"日期控件",value:"datetime"}),n(g,{label:"图片上传",value:"imageUpload"}),n(g,{label:"文件上传",value:"fileUpload"}),n(g,{label:"富文本控件",value:"editor"})])),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:1}),n(v,{label:"字典类型","min-width":"12%"},{default:d((e=>[n(T,{modelValue:e.row.dictType,"onUpdate:modelValue":l=>e.row.dictType=l,clearable:"",filterable:"",placeholder:"请选择"},{default:d((()=>[(t(!0),i(s,null,b(m(L),(e=>(t(),u(g,{key:e.dictType,label:e.dictName,value:e.dictType},{default:d((()=>[p("span",U,f(e.dictName),1),p("span",_,f(e.dictType),1)])),_:2},1032,["label","value"])))),128))])),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:1})])),_:1},8,["data","max-height"])])),_:1}),n(a,{label:"生成信息",name:"genInfo"},{default:d((()=>[n(m(y),{ref:"genInfo",info:m(k),tables:m(N)},null,8,["info","tables"])])),_:1})])),_:1},8,["modelValue"]),n(G,{"label-width":"100px"},{default:d((()=>[p("div",I,[n(P,{type:"primary",onClick:l[1]||(l[1]=e=>function(){const e=E.$refs.basicInfo.$refs.basicInfoForm,l=E.$refs.genInfo.$refs.genInfoForm;Promise.all([e,l].map(D)).then((e=>{if(e.every((e=>!!e))){const e=Object.assign({},k.value);e.columns=C.value,e.params={treeCode:k.value.treeCode,treeName:k.value.treeName,treeParentCode:k.value.treeParentCode,parentMenuId:k.value.parentMenuId},w(e).then((e=>{E.$modal.msgSuccess(e.msg),200===e.code&&$()}))}else E.$modal.msgError("表单校验未通过,请重新检查提交内容")}))}())},{default:d((()=>[c("提交")])),_:1}),n(P,{onClick:l[2]||(l[2]=e=>$())},{default:d((()=>[c("返回")])),_:1})])])),_:1})])),_:1})}}});export{E as default};
|