116116
117117 <el-row >
118118 <el-col :span =" 12" >
119- <el-form-item label =" 模块名 " >
119+ <el-form-item label =" 包名 " >
120120 <el-input
121- v-model =" genConfigFormData.moduleName "
122- placeholder =" system "
121+ v-model =" genConfigFormData.packageName "
122+ placeholder =" com.youlai.boot "
123123 />
124124 </el-form-item >
125125 </el-col >
126126 <el-col :span =" 12" >
127- <el-form-item label =" 包名 " >
127+ <el-form-item label =" 模块名 " >
128128 <el-input
129- v-model =" genConfigFormData.packageName "
130- placeholder =" com.youlai.boot "
129+ v-model =" genConfigFormData.moduleName "
130+ placeholder =" system "
131131 />
132132 </el-form-item >
133133 </el-col >
154154
155155 <el-row >
156156 <el-col :span =" 12" >
157- <el-form-item label =" 上级菜单" >
157+ <el-form-item >
158+ <template #label >
159+ <div class =" flex-y-between" >
160+ <span >上级菜单</span >
161+ <el-tooltip effect =" dark" >
162+ <template #content >
163+ 选择上级菜单,生成代码后会自动创建对应菜单。
164+ <br />
165+ 注意1:生成菜单后需分配权限给角色,否则菜单将无法显示。
166+ <br />
167+ 注意2:演示环境默认不生成菜单,如需生成,请在本地部署数据库。
168+ </template >
169+ <i-ep-QuestionFilled class =" cursor-pointer" />
170+ </el-tooltip >
171+ </div >
172+ </template >
173+
158174 <el-tree-select
159175 v-model =" genConfigFormData.parentMenuId"
160176 placeholder =" 选择上级菜单"
@@ -435,6 +451,13 @@ import GeneratorAPI, {
435451import DictAPI from " @/api/dict" ;
436452import MenuAPI from " @/api/menu" ;
437453
454+ interface TreeNode {
455+ label: string ;
456+ content? : string ;
457+ children? : TreeNode [];
458+ }
459+ const treeData = ref <TreeNode []>([]);
460+
438461const queryFormRef = ref (ElForm );
439462const queryParams = reactive <TablePageQuery >({
440463 pageNum: 1 ,
@@ -473,12 +496,12 @@ const active = ref(0);
473496const currentTableName = ref (" " );
474497const sortFlag = ref <Object >();
475498
476- interface TreeNode {
477- label : string ;
478- content ? : string ;
479- children ? : TreeNode [] ;
480- }
481- const treeData = ref < TreeNode []>([] );
499+ // 查询是否全选
500+ const isCheckAllQuery = ref ( false ) ;
501+ // 列表是否全选
502+ const isCheckAllList = ref ( false ) ;
503+ // 表单是否全选
504+ const isCheckAllForm = ref ( false );
482505
483506watch (active , (val ) => {
484507 if (val === 0 ) {
@@ -550,6 +573,7 @@ const setNodeSort = (oldIndex: number, newIndex: number) => {
550573 });
551574};
552575
576+ /** 上一步 */
553577function handlePrevClick() {
554578 if (active .value === 2 ) {
555579 // 这里需要重新获取一次数据,如果第一次生成代码后,再次点击上一步,数据不重新获取,再次点击下一步,会再次插入数据,导致索引重复报错
@@ -571,6 +595,7 @@ function handlePrevClick() {
571595 if (active .value -- <= 0 ) active .value = 0 ;
572596}
573597
598+ /** 下一步 */
574599function handleNextClick() {
575600 if (active .value === 0 ) {
576601 initSort ();
@@ -680,6 +705,7 @@ function handleResetConfig(tableName: string) {
680705
681706type FieldConfigKey = " isShowInQuery" | " isShowInList" | " isShowInForm" ;
682707
708+ /** 全选 */
683709const toggleCheckAll = (key : FieldConfigKey , value : boolean ) => {
684710 const fieldConfigs = genConfigFormData .value ?.fieldConfigs ;
685711
@@ -690,10 +716,6 @@ const toggleCheckAll = (key: FieldConfigKey, value: boolean) => {
690716 }
691717};
692718
693- const isCheckAllQuery = ref (false );
694- const isCheckAllList = ref (false );
695- const isCheckAllForm = ref (false );
696-
697719const checkAllSelected = (key : keyof FieldConfig , isCheckAllRef : any ) => {
698720 const fieldConfigs = genConfigFormData .value ?.fieldConfigs || [];
699721 isCheckAllRef .value = fieldConfigs .every (
@@ -740,7 +762,6 @@ function buildTree(
740762 const parts = item .path .split (separator );
741763
742764 // 定义特殊路径
743- // TODO: 如果菜单有多个节点,需要将此菜单作为独立一级的节点,而不是合并到上一级。 按照此规则, com.youlai.system 则是三个节点,而不是合并到一起,但是这里需要将 com.youlai.system 合并到一起,所以需要特殊处理
744765 const specialPaths = [
745766 " src" + separator + " main" ,
746767 " java" ,
@@ -753,8 +774,6 @@ function buildTree(
753774 ).replace (/ \. / g , separator ),
754775 ];
755776
756- console .log (" specialPaths" , specialPaths );
757-
758777 // 检查路径中的特殊部分并合并它们
759778 const mergedParts: string [] = [];
760779 let buffer: string [] = [];
0 commit comments