Selaa lähdekoodia

个人数据库首页菜单权限

shilipojs 2 vuotta sitten
vanhempi
commit
1217b4709b

+ 25 - 2
src/views/accurateTeaching/main.vue

@@ -4,9 +4,9 @@
       <el-image :src="`${$imgBase}index/banner/personal_database.png`" fit="cover"></el-image>
     </div>
     <div class="fx-column fx-cen-cen pb20">
-      <index-card title="班级任务" class="mt20 index-block">
+      <index-card title="班级任务" class="mt20 index-block" v-if="formatList.length">
         <el-row :gutter="20">
-          <el-col class="relative fx-cen-cen fx-column"   :span="4" v-for="item in plan" >
+          <el-col class="relative fx-cen-cen fx-column"   :span="4" v-for="item in formatList" >
             <div class="plan_item pointer" @click="$router.push(item.path)">
               <div class="img-wrap">
                 <img  :src="item.img"/>
@@ -82,6 +82,29 @@ export default {
       ],
     }
   },
+  computed:{
+    ...mapGetters(['middlebarRouters']),
+    listOpt() {
+      const obj = {}
+      this.plan.map(item => {
+        obj[`${item.title}${item.path}`] = item
+      })
+      return obj
+    },
+    formatList() {
+      if(!this.middlebarRouters.length) return []
+      if(!this.middlebarRouters.find(item => item.meta.title == '班级任务'))  return  []
+      const listOptKey = Object.keys(this.listOpt)
+      let formatList = []
+      return this.middlebarRouters.find(item => item.meta.title == '班级任务').children.slice(0,6).map((item,idx) =>{
+        return {
+          title: item.meta.title,
+          img:this.plan[idx].img,
+          path:item.path,
+        }
+      })
+    }
+  },
   methods: {
   }
 }

+ 0 - 1
src/views/index/components/index-card-elective.vue

@@ -34,7 +34,6 @@ export default {
       const listOptKey = Object.keys(this.listOpt)
       let formatList = []
       return this.middlebarRouters[1].children.slice(0,4).map((item,idx) =>{
-        debugger
         return {
           title: item.meta.title,
           desc:this.listOpt[`${item.meta.title}${item.path}`]?.desc,