Procházet zdrojové kódy

修改一级菜单内包含新闻时查询错误

asd123a20 před 2 roky
rodič
revize
98a7f371fd
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      src/views/list.vue

+ 2 - 2
src/views/list.vue

@@ -52,11 +52,11 @@ export default {
     if (topahes) {
     if (topahes) {
       // 顶级菜单参数
       // 顶级菜单参数
       this.parentCode = this.$route.query.parentCode;
       this.parentCode = this.$route.query.parentCode;
-      await this.filterQuery();
       // 获取一例菜单
       // 获取一例菜单
       this.menu = this.$setChildrenSession({ menus: this.menusall, iscode: this.parentCode });
       this.menu = this.$setChildrenSession({ menus: this.menusall, iscode: this.parentCode });
       // 控制左侧菜单当前选项
       // 控制左侧菜单当前选项
       this.$refs.letnav.setIndex();
       this.$refs.letnav.setIndex();
+      await this.filterQuery();
     }
     }
   },
   },
   methods: {
   methods: {
@@ -64,7 +64,7 @@ export default {
     // 查询函数
     // 查询函数
     async filterQuery ({ filter = {}, paging = { page: 0, size: 10 } } = {}) {
     async filterQuery ({ filter = {}, paging = { page: 0, size: 10 } } = {}) {
       filter.bind = this.code;
       filter.bind = this.code;
-      if (this.code.length == 2) filter.parentCode = this.code;
+      if (this.code.length == 2 && this.menu.children) filter.parentCode = this.code;
       await this.contentsList({ filter, paging });
       await this.contentsList({ filter, paging });
     },
     },
     // 列表点击
     // 列表点击