Kaynağa Gözat

修复代码生成上级菜单显示问题

RuoYi 1 yıl önce
ebeveyn
işleme
d02ba57ffb
1 değiştirilmiş dosya ile 10 ekleme ve 5 silme
  1. 10 5
      src/views/tool/gen/genInfoForm.vue

+ 10 - 5
src/views/tool/gen/genInfoForm.vue

@@ -91,11 +91,13 @@
               <el-icon><question-filled /></el-icon>
             </el-tooltip>
           </template>
-          <tree-select
-            v-model:value="info.parentMenuId"
-            :options="menuOptions"
-            :objMap="{ value: 'menuId', label: 'menuName', children: 'children' }"
+          <el-tree-select
+            v-model="info.parentMenuId"
+            :data="menuOptions"
+            :props="{ value: 'menuId', label: 'menuName', children: 'children' }"
+            value-key="menuId"
             placeholder="请选择系统菜单"
+            check-strictly
           />
         </el-form-item>
       </el-col>
@@ -287,6 +289,10 @@ function getMenuTreeselect() {
   });
 }
 
+onMounted(() => {
+  getMenuTreeselect();
+})
+
 watch(() => props.info.subTableName, val => {
   setSubTableColumns(val);
 });
@@ -297,5 +303,4 @@ watch(() => props.info.tplWebType, val => {
   }
 });
 
-getMenuTreeselect();
 </script>