瀏覽代碼

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

asd123a20 2 年之前
父節點
當前提交
98a7f371fd
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/views/list.vue

+ 2 - 2
src/views/list.vue

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