|  | @@ -16,19 +16,17 @@
 | 
	
		
			
				|  |  |            </el-col>
 | 
	
		
			
				|  |  |          </el-row>
 | 
	
		
			
				|  |  |        </index-card>
 | 
	
		
			
				|  |  | -      <index-card title="资源库" class="mt20 index-block">
 | 
	
		
			
				|  |  | -        <mx-image-wrap :list="libraryFormatList" titleClass="text-white" titlePostion="left"></mx-image-wrap>
 | 
	
		
			
				|  |  | -      </index-card>
 | 
	
		
			
				|  |  | +      <index-card-res-library class="mt20 index-block"></index-card-res-library>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  |  import IndexCard from '@/views/index/components/index-card.vue'
 | 
	
		
			
				|  |  | -import MxImageWrap from '@/views/questioncenter/components/main-card/mx-image-wrap.vue'
 | 
	
		
			
				|  |  | +import IndexCardResLibrary from '@/views/index/components/index-card-res-library.vue'
 | 
	
		
			
				|  |  |  import { mapGetters } from 'vuex'
 | 
	
		
			
				|  |  |  import store from '@/store'
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  | -  components: { IndexCard, MxImageWrap },
 | 
	
		
			
				|  |  | +  components: { IndexCard, IndexCardResLibrary },
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  |        plan: [
 | 
	
	
		
			
				|  | @@ -63,38 +61,13 @@ export default {
 | 
	
		
			
				|  |  |            path: '/personalDatabase/class-task/system-notice'
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  |        ],
 | 
	
		
			
				|  |  | -      library: [
 | 
	
		
			
				|  |  | -        {
 | 
	
		
			
				|  |  | -          title: '个人资源库',
 | 
	
		
			
				|  |  | -          img:`${this.$imgBase}index/database/personal_library.png`,
 | 
	
		
			
				|  |  | -          path: '/personalDatabase/personalResources/index'
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -        {
 | 
	
		
			
				|  |  | -          title: '校本资源库',
 | 
	
		
			
				|  |  | -          img:`${this.$imgBase}index/database/school_library.png`,
 | 
	
		
			
				|  |  | -          path: '/personalDatabase/schoolResources/index'
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -        {
 | 
	
		
			
				|  |  | -          title: '云库',
 | 
	
		
			
				|  |  | -          img:`${this.$imgBase}index/database/cloud_library.png`,
 | 
	
		
			
				|  |  | -          path: '/personalDatabase/cloudTank/index'
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -      ],
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    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 {
 | 
	
	
		
			
				|  | @@ -104,20 +77,6 @@ export default {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    libraryFormatList(){
 | 
	
		
			
				|  |  | -      if(!this.middlebarRouters.length) return []
 | 
	
		
			
				|  |  | -      const listOptKey = Object.keys(this.listOpt)
 | 
	
		
			
				|  |  | -      let formatList = []
 | 
	
		
			
				|  |  | -      return this.middlebarRouters.filter((item) =>{
 | 
	
		
			
				|  |  | -        return this.library.findIndex(lib => lib.title == item.meta.title) != -1
 | 
	
		
			
				|  |  | -      }).map((item,idx) => {
 | 
	
		
			
				|  |  | -        return {
 | 
	
		
			
				|  |  | -          title: item.meta.title,
 | 
	
		
			
				|  |  | -          img:this.library[idx].img,
 | 
	
		
			
				|  |  | -          path:this.library.find(lib => lib.title == item.meta.title ).path,
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  |    }
 |