mirror of
https://gitee.com/myxzgzs/boyuehasfj-vue3.git
synced 2025-08-08 15:12:41 +08:00
2 lines
9.3 KiB
JavaScript
2 lines
9.3 KiB
JavaScript
import{r as e,d as l,a3 as a,j as n,h as u,o,w as t,e as d,c as m,i as f,m as p,f as r,k as s,I as i,F as b,J as c,R as _}from"./index-C-c3zR6K.js";import{l as g}from"./menu-CCkCIpie.js";const V={__name:"genInfoForm",props:{info:{type:Object,default:null},tables:{type:Array,default:null}},setup(V){const N=e([]),y=e([]),{proxy:v}=l(),h=V,T=e({tplCategory:[{required:!0,message:"请选择生成模板",trigger:"blur"}],tplWebType:[{required:!0,message:"请选择生成模板类型",trigger:"blur"}],packageName:[{required:!0,message:"请输入生成包路径",trigger:"blur"}],moduleName:[{required:!0,message:"请输入生成模块名",trigger:"blur"}],businessName:[{required:!0,message:"请输入生成业务名",trigger:"blur"}],functionName:[{required:!0,message:"请输入生成功能名",trigger:"blur"}]});function k(e){h.info.subTableFkName=""}function C(e){"sub"!==e&&(h.info.subTableName="",h.info.subTableFkName="")}return a((()=>h.info.subTableName),(e=>{!function(e){for(var l in h.tables)if(e===h.tables[l].tableName){N.value=h.tables[l].columns;break}}(e)})),a((()=>h.info.tplWebType),(e=>{""===e&&(h.info.tplWebType="element-ui")})),g().then((e=>{y.value=v.handleTree(e.data,"menuId")})),(e,l)=>{const a=n("el-option"),g=n("el-select"),v=n("el-form-item"),h=n("el-col"),U=n("question-filled"),w=n("el-icon"),I=n("el-tooltip"),q=n("el-input"),F=n("el-radio"),P=n("tree-select"),W=n("el-button"),j=n("el-dropdown-item"),x=n("el-dropdown-menu"),M=n("el-dropdown"),z=n("el-row"),E=n("el-form");return o(),u(E,{ref:"genInfoForm",model:V.info,rules:s(T),"label-width":"150px"},{default:t((()=>[d(z,null,{default:t((()=>[d(h,{span:12},{default:t((()=>[d(v,{prop:"tplCategory"},{label:t((()=>l[16]||(l[16]=[p("生成模板")]))),default:t((()=>[d(g,{modelValue:V.info.tplCategory,"onUpdate:modelValue":l[0]||(l[0]=e=>V.info.tplCategory=e),onChange:C},{default:t((()=>[d(a,{label:"单表(增删改查)",value:"crud"}),d(a,{label:"树表(增删改查)",value:"tree"}),d(a,{label:"主子表(增删改查)",value:"sub"})])),_:1},8,["modelValue"])])),_:1})])),_:1}),d(h,{span:12},{default:t((()=>[d(v,{prop:"tplWebType"},{label:t((()=>l[17]||(l[17]=[p("前端类型")]))),default:t((()=>[d(g,{modelValue:V.info.tplWebType,"onUpdate:modelValue":l[1]||(l[1]=e=>V.info.tplWebType=e)},{default:t((()=>[d(a,{label:"Vue2 Element UI 模版",value:"element-ui"}),d(a,{label:"Vue3 Element Plus 模版",value:"element-plus"})])),_:1},8,["modelValue"])])),_:1})])),_:1}),d(h,{span:12},{default:t((()=>[d(v,{prop:"packageName"},{label:t((()=>[l[18]||(l[18]=p(" 生成包路径 ")),d(I,{content:"生成在哪个java包下,例如 com.boyue.system",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(q,{modelValue:V.info.packageName,"onUpdate:modelValue":l[2]||(l[2]=e=>V.info.packageName=e)},null,8,["modelValue"])])),_:1})])),_:1}),d(h,{span:12},{default:t((()=>[d(v,{prop:"moduleName"},{label:t((()=>[l[19]||(l[19]=p(" 生成模块名 ")),d(I,{content:"可理解为子系统名,例如 system",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(q,{modelValue:V.info.moduleName,"onUpdate:modelValue":l[3]||(l[3]=e=>V.info.moduleName=e)},null,8,["modelValue"])])),_:1})])),_:1}),d(h,{span:12},{default:t((()=>[d(v,{prop:"businessName"},{label:t((()=>[l[20]||(l[20]=p(" 生成业务名 ")),d(I,{content:"可理解为功能英文名,例如 user",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(q,{modelValue:V.info.businessName,"onUpdate:modelValue":l[4]||(l[4]=e=>V.info.businessName=e)},null,8,["modelValue"])])),_:1})])),_:1}),d(h,{span:12},{default:t((()=>[d(v,{prop:"functionName"},{label:t((()=>[l[21]||(l[21]=p(" 生成功能名 ")),d(I,{content:"用作类描述,例如 用户",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(q,{modelValue:V.info.functionName,"onUpdate:modelValue":l[5]||(l[5]=e=>V.info.functionName=e)},null,8,["modelValue"])])),_:1})])),_:1}),d(h,{span:12},{default:t((()=>[d(v,{prop:"genType"},{default:t((()=>[r("span",null,[l[23]||(l[23]=p(" 生成代码方式 ")),d(I,{content:"默认为zip压缩包下载,也可以自定义生成路径",placement:"top"},{default:t((()=>l[22]||(l[22]=[r("i",{class:"el-icon-question"},null,-1)]))),_:1})]),d(F,{modelValue:V.info.genType,"onUpdate:modelValue":l[6]||(l[6]=e=>V.info.genType=e),value:"0"},{default:t((()=>l[24]||(l[24]=[p("zip压缩包")]))),_:1},8,["modelValue"]),d(F,{modelValue:V.info.genType,"onUpdate:modelValue":l[7]||(l[7]=e=>V.info.genType=e),value:"1"},{default:t((()=>l[25]||(l[25]=[p("自定义路径")]))),_:1},8,["modelValue"])])),_:1})])),_:1}),d(h,{span:12},{default:t((()=>[d(v,null,{label:t((()=>[l[26]||(l[26]=p(" 上级菜单 ")),d(I,{content:"分配到指定菜单下,例如 系统管理",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(P,{value:V.info.parentMenuId,"onUpdate:value":l[8]||(l[8]=e=>V.info.parentMenuId=e),options:s(y),objMap:{value:"menuId",label:"menuName",children:"children"},placeholder:"请选择系统菜单"},null,8,["value","options"])])),_:1})])),_:1}),"1"==V.info.genType?(o(),u(h,{key:0,span:24},{default:t((()=>[d(v,{prop:"genPath"},{label:t((()=>[l[27]||(l[27]=p(" 自定义路径 ")),d(I,{content:"填写磁盘绝对路径,若不填写,则生成到当前Web项目下",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(q,{modelValue:V.info.genPath,"onUpdate:modelValue":l[10]||(l[10]=e=>V.info.genPath=e)},{append:t((()=>[d(M,null,{dropdown:t((()=>[d(x,null,{default:t((()=>[d(j,{onClick:l[9]||(l[9]=e=>V.info.genPath="/")},{default:t((()=>l[29]||(l[29]=[p("恢复默认的生成基础路径")]))),_:1})])),_:1})])),default:t((()=>[d(W,{type:"primary"},{default:t((()=>l[28]||(l[28]=[p(" 最近路径快速选择 "),r("i",{class:"el-icon-arrow-down el-icon--right"},null,-1)]))),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1})):f("",!0)])),_:1}),"tree"==V.info.tplCategory?(o(),m(i,{key:0},[l[33]||(l[33]=r("h4",{class:"form-header"},"其他信息",-1)),b(d(z,null,{default:t((()=>[d(h,{span:12},{default:t((()=>[d(v,null,{label:t((()=>[l[30]||(l[30]=p(" 树编码字段 ")),d(I,{content:"树显示的编码字段名, 如:dept_id",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(g,{modelValue:V.info.treeCode,"onUpdate:modelValue":l[11]||(l[11]=e=>V.info.treeCode=e),placeholder:"请选择"},{default:t((()=>[(o(!0),m(i,null,c(V.info.columns,((e,l)=>(o(),u(a,{key:l,label:e.columnName+":"+e.columnComment,value:e.columnName},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1}),d(h,{span:12},{default:t((()=>[d(v,null,{label:t((()=>[l[31]||(l[31]=p(" 树父编码字段 ")),d(I,{content:"树显示的父编码字段名, 如:parent_Id",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(g,{modelValue:V.info.treeParentCode,"onUpdate:modelValue":l[12]||(l[12]=e=>V.info.treeParentCode=e),placeholder:"请选择"},{default:t((()=>[(o(!0),m(i,null,c(V.info.columns,((e,l)=>(o(),u(a,{key:l,label:e.columnName+":"+e.columnComment,value:e.columnName},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1}),d(h,{span:12},{default:t((()=>[d(v,null,{label:t((()=>[l[32]||(l[32]=p(" 树名称字段 ")),d(I,{content:"树节点的显示名称字段名, 如:dept_name",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(g,{modelValue:V.info.treeName,"onUpdate:modelValue":l[13]||(l[13]=e=>V.info.treeName=e),placeholder:"请选择"},{default:t((()=>[(o(!0),m(i,null,c(V.info.columns,((e,l)=>(o(),u(a,{key:l,label:e.columnName+":"+e.columnComment,value:e.columnName},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1})])),_:1},512),[[_,"tree"==V.info.tplCategory]])],64)):f("",!0),"sub"==V.info.tplCategory?(o(),m(i,{key:1},[l[36]||(l[36]=r("h4",{class:"form-header"},"关联信息",-1)),d(z,null,{default:t((()=>[d(h,{span:12},{default:t((()=>[d(v,null,{label:t((()=>[l[34]||(l[34]=p(" 关联子表的表名 ")),d(I,{content:"关联子表的表名, 如:sys_user",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(g,{modelValue:V.info.subTableName,"onUpdate:modelValue":l[14]||(l[14]=e=>V.info.subTableName=e),placeholder:"请选择",onChange:k},{default:t((()=>[(o(!0),m(i,null,c(V.tables,((e,l)=>(o(),u(a,{key:l,label:e.tableName+":"+e.tableComment,value:e.tableName},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1}),d(h,{span:12},{default:t((()=>[d(v,null,{label:t((()=>[l[35]||(l[35]=p(" 子表关联的外键名 ")),d(I,{content:"子表关联的外键名, 如:user_id",placement:"top"},{default:t((()=>[d(w,null,{default:t((()=>[d(U)])),_:1})])),_:1})])),default:t((()=>[d(g,{modelValue:V.info.subTableFkName,"onUpdate:modelValue":l[15]||(l[15]=e=>V.info.subTableFkName=e),placeholder:"请选择"},{default:t((()=>[(o(!0),m(i,null,c(s(N),((e,l)=>(o(),u(a,{key:l,label:e.columnName+":"+e.columnComment,value:e.columnName},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1})])),_:1})],64)):f("",!0)])),_:1},8,["model","rules"])}}};export{V as default};
|