diff --git a/dl_admin/ruoyi-admin/src/main/java/com/ruoyi/busi/vo/BusiCategoryVO.java b/dl_admin/ruoyi-admin/src/main/java/com/ruoyi/busi/vo/BusiCategoryVO.java index 5345cd2..f3d2086 100644 --- a/dl_admin/ruoyi-admin/src/main/java/com/ruoyi/busi/vo/BusiCategoryVO.java +++ b/dl_admin/ruoyi-admin/src/main/java/com/ruoyi/busi/vo/BusiCategoryVO.java @@ -7,6 +7,7 @@ import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.DlBaseEntity; import lombok.Data; +import java.util.ArrayList; import java.util.List; @@ -21,6 +22,6 @@ public class BusiCategoryVO extends BusiCategory { /** * 子集 */ - private List children; + private List children = new ArrayList<>(); } diff --git a/dl_vue/src/views/busi/category/form/categoryForm.vue b/dl_vue/src/views/busi/category/form/categoryForm.vue index c776615..3c294f6 100644 --- a/dl_vue/src/views/busi/category/form/categoryForm.vue +++ b/dl_vue/src/views/busi/category/form/categoryForm.vue @@ -52,6 +52,8 @@ export default { catgName:"", catgType:"", }, + //列表页入参 + query:{}, //表单校验规则 rules:{ code: [ @@ -66,10 +68,20 @@ export default { } } }, + created() { + this.query = this.$route.query + }, + methods:{ /**确定按钮*/ submitForm(){ + if (this.query.catgLevel){ + this.form.catgLevel = this.query.catgLevel + } + if (this.query.parentId){ + this.form.parentId = this.query.parentId + } addCategory(this.form).then((res) => { if (res.code == 200){ this.$modal.msgSuccess("保存成功"); diff --git a/dl_vue/src/views/busi/category/index.vue b/dl_vue/src/views/busi/category/index.vue index 9513fe0..552587b 100644 --- a/dl_vue/src/views/busi/category/index.vue +++ b/dl_vue/src/views/busi/category/index.vue @@ -26,23 +26,36 @@ - - - + + + + + - + + +