|
@@ -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: {
|
|
|
}
|
|
|
}
|