import{r as e,a2 as l,d as a,o as n,k as u,w as o,e as t,n as d,f as m,m as f,c as p,V as r,K as s,W as i,M as c,l as b,v as _}from"./index.e5c8b0d6.js";import{l as g}from"./menu.a3f2b703.js";const V=b("i",{class:"el-icon-arrow-down el-icon--right"},null,-1),N=b("h4",{class:"form-header"},"其他信息",-1),y=b("h4",{class:"form-header"},"关联信息",-1),h={__name:"genInfoForm",props:{info:{type:Object,default:null},tables:{type:Array,default:null}},setup(b){const h=b,v=e([]),k=e([]),{proxy:C}=_(),T=e({tplCategory:[{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 U(e){h.info.subTableFkName=""}function w(e){"sub"!==e&&(h.info.subTableName="",h.info.subTableFkName="")}return l((()=>h.info.subTableName),(e=>{!function(e){for(var l in h.tables)if(e===h.tables[l].tableName){v.value=h.tables[l].columns;break}}(e)})),g().then((e=>{k.value=C.handleTree(e.data,"menuId")})),(e,l)=>{const _=a("el-option"),g=a("el-select"),h=a("el-form-item"),C=a("el-col"),I=a("question-filled"),q=a("el-icon"),F=a("el-tooltip"),P=a("el-input"),j=a("tree-select"),x=a("el-radio"),M=a("el-button"),z=a("el-dropdown-item"),W=a("el-dropdown-menu"),A=a("el-dropdown"),K=a("el-row"),O=a("el-form");return n(),u(O,{ref:"genInfoForm",model:b.info,rules:m(T),"label-width":"150px"},{default:o((()=>[t(K,null,{default:o((()=>[t(C,{span:12},{default:o((()=>[t(h,{prop:"tplCategory"},{label:o((()=>[d("生成模板")])),default:o((()=>[t(g,{modelValue:b.info.tplCategory,"onUpdate:modelValue":l[0]||(l[0]=e=>b.info.tplCategory=e),onChange:w},{default:o((()=>[t(_,{label:"单表(增删改查)",value:"crud"}),t(_,{label:"树表(增删改查)",value:"tree"}),t(_,{label:"主子表(增删改查)",value:"sub"})])),_:1},8,["modelValue"])])),_:1})])),_:1}),t(C,{span:12},{default:o((()=>[t(h,{prop:"packageName"},{label:o((()=>[d(" 生成包路径 "),t(F,{content:"生成在哪个java包下,例如 com.ruoyi.system",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(P,{modelValue:b.info.packageName,"onUpdate:modelValue":l[1]||(l[1]=e=>b.info.packageName=e)},null,8,["modelValue"])])),_:1})])),_:1}),t(C,{span:12},{default:o((()=>[t(h,{prop:"moduleName"},{label:o((()=>[d(" 生成模块名 "),t(F,{content:"可理解为子系统名,例如 system",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(P,{modelValue:b.info.moduleName,"onUpdate:modelValue":l[2]||(l[2]=e=>b.info.moduleName=e)},null,8,["modelValue"])])),_:1})])),_:1}),t(C,{span:12},{default:o((()=>[t(h,{prop:"businessName"},{label:o((()=>[d(" 生成业务名 "),t(F,{content:"可理解为功能英文名,例如 user",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(P,{modelValue:b.info.businessName,"onUpdate:modelValue":l[3]||(l[3]=e=>b.info.businessName=e)},null,8,["modelValue"])])),_:1})])),_:1}),t(C,{span:12},{default:o((()=>[t(h,{prop:"functionName"},{label:o((()=>[d(" 生成功能名 "),t(F,{content:"用作类描述,例如 用户",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(P,{modelValue:b.info.functionName,"onUpdate:modelValue":l[4]||(l[4]=e=>b.info.functionName=e)},null,8,["modelValue"])])),_:1})])),_:1}),t(C,{span:12},{default:o((()=>[t(h,null,{label:o((()=>[d(" 上级菜单 "),t(F,{content:"分配到指定菜单下,例如 系统管理",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(j,{value:b.info.parentMenuId,"onUpdate:value":l[5]||(l[5]=e=>b.info.parentMenuId=e),options:m(k),objMap:{value:"menuId",label:"menuName",children:"children"},placeholder:"请选择系统菜单"},null,8,["value","options"])])),_:1})])),_:1}),t(C,{span:12},{default:o((()=>[t(h,{prop:"genType"},{label:o((()=>[d(" 生成代码方式 "),t(F,{content:"默认为zip压缩包下载,也可以自定义生成路径",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(x,{modelValue:b.info.genType,"onUpdate:modelValue":l[6]||(l[6]=e=>b.info.genType=e),label:"0"},{default:o((()=>[d("zip压缩包")])),_:1},8,["modelValue"]),t(x,{modelValue:b.info.genType,"onUpdate:modelValue":l[7]||(l[7]=e=>b.info.genType=e),label:"1"},{default:o((()=>[d("自定义路径")])),_:1},8,["modelValue"])])),_:1})])),_:1}),"1"==b.info.genType?(n(),u(C,{key:0,span:24},{default:o((()=>[t(h,{prop:"genPath"},{label:o((()=>[d(" 自定义路径 "),t(F,{content:"填写磁盘绝对路径,若不填写,则生成到当前Web项目下",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(P,{modelValue:b.info.genPath,"onUpdate:modelValue":l[9]||(l[9]=e=>b.info.genPath=e)},{append:o((()=>[t(A,null,{dropdown:o((()=>[t(W,null,{default:o((()=>[t(z,{onClick:l[8]||(l[8]=e=>b.info.genPath="/")},{default:o((()=>[d("恢复默认的生成基础路径")])),_:1})])),_:1})])),default:o((()=>[t(M,{type:"primary"},{default:o((()=>[d(" 最近路径快速选择 "),V])),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1})):f("",!0)])),_:1}),"tree"==b.info.tplCategory?(n(),p(r,{key:0},[N,s(t(K,null,{default:o((()=>[t(C,{span:12},{default:o((()=>[t(h,null,{label:o((()=>[d(" 树编码字段 "),t(F,{content:"树显示的编码字段名, 如:dept_id",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(g,{modelValue:b.info.treeCode,"onUpdate:modelValue":l[10]||(l[10]=e=>b.info.treeCode=e),placeholder:"请选择"},{default:o((()=>[(n(!0),p(r,null,i(b.info.columns,((e,l)=>(n(),u(_,{key:l,label:e.columnName+":"+e.columnComment,value:e.columnName},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1}),t(C,{span:12},{default:o((()=>[t(h,null,{label:o((()=>[d(" 树父编码字段 "),t(F,{content:"树显示的父编码字段名, 如:parent_Id",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(g,{modelValue:b.info.treeParentCode,"onUpdate:modelValue":l[11]||(l[11]=e=>b.info.treeParentCode=e),placeholder:"请选择"},{default:o((()=>[(n(!0),p(r,null,i(b.info.columns,((e,l)=>(n(),u(_,{key:l,label:e.columnName+":"+e.columnComment,value:e.columnName},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1}),t(C,{span:12},{default:o((()=>[t(h,null,{label:o((()=>[d(" 树名称字段 "),t(F,{content:"树节点的显示名称字段名, 如:dept_name",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(g,{modelValue:b.info.treeName,"onUpdate:modelValue":l[12]||(l[12]=e=>b.info.treeName=e),placeholder:"请选择"},{default:o((()=>[(n(!0),p(r,null,i(b.info.columns,((e,l)=>(n(),u(_,{key:l,label:e.columnName+":"+e.columnComment,value:e.columnName},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1})])),_:1},512),[[c,"tree"==b.info.tplCategory]])],64)):f("",!0),"sub"==b.info.tplCategory?(n(),p(r,{key:1},[y,t(K,null,{default:o((()=>[t(C,{span:12},{default:o((()=>[t(h,null,{label:o((()=>[d(" 关联子表的表名 "),t(F,{content:"关联子表的表名, 如:sys_user",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(g,{modelValue:b.info.subTableName,"onUpdate:modelValue":l[13]||(l[13]=e=>b.info.subTableName=e),placeholder:"请选择",onChange:U},{default:o((()=>[(n(!0),p(r,null,i(b.tables,((e,l)=>(n(),u(_,{key:l,label:e.tableName+":"+e.tableComment,value:e.tableName},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1}),t(C,{span:12},{default:o((()=>[t(h,null,{label:o((()=>[d(" 子表关联的外键名 "),t(F,{content:"子表关联的外键名, 如:user_id",placement:"top"},{default:o((()=>[t(q,null,{default:o((()=>[t(I)])),_:1})])),_:1})])),default:o((()=>[t(g,{modelValue:b.info.subTableFkName,"onUpdate:modelValue":l[14]||(l[14]=e=>b.info.subTableFkName=e),placeholder:"请选择"},{default:o((()=>[(n(!0),p(r,null,i(m(v),((e,l)=>(n(),u(_,{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{h as default};