|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
- <index-card title="个人资源库">
|
|
|
|
- <index-card-content :list="libraryFormatList" :line-size="3">
|
|
|
|
|
|
+ <index-card v-if="libraryRoutes.length" title="个人资源库">
|
|
|
|
+ <index-card-content :list="libraryRoutes" :line-size="3">
|
|
<template #default="{item}">
|
|
<template #default="{item}">
|
|
<index-image-item v-bind="item"/>
|
|
<index-image-item v-bind="item"/>
|
|
</template>
|
|
</template>
|
|
@@ -12,55 +12,30 @@
|
|
import IndexCard from '@/views/index/components/index-card'
|
|
import IndexCard from '@/views/index/components/index-card'
|
|
import IndexCardContent from '@/views/index/components/index-card-content'
|
|
import IndexCardContent from '@/views/index/components/index-card-content'
|
|
import IndexImageItem from '@/views/index/components/index-image-item'
|
|
import IndexImageItem from '@/views/index/components/index-image-item'
|
|
-import { mapGetters } from 'vuex'
|
|
|
|
|
|
+import {mapGetters} from 'vuex'
|
|
|
|
+import request from "@/utils/request";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'index-card-generating',
|
|
name: 'index-card-generating',
|
|
- components: { IndexImageItem, IndexCardContent, IndexCard },
|
|
|
|
|
|
+ components: {IndexImageItem, IndexCardContent, IndexCard},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- library: [
|
|
|
|
- {
|
|
|
|
- title: '个人资源库',
|
|
|
|
- src:`${this.$imgBase}index/database/personal_library.png`,
|
|
|
|
- path: '/personalDatabase/personalResources/index',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '校本资源库',
|
|
|
|
- src:`${this.$imgBase}index/database/school_library.png`,
|
|
|
|
- path: '/personalDatabase/schoolResources/index',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '云库',
|
|
|
|
- src:`${this.$imgBase}index/database/cloud_library.png`,
|
|
|
|
- path: '/personalDatabase/cloudTank/index',
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ libraries: ['个人资源库', '校本资源库', '云库']
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- computed:{
|
|
|
|
|
|
+ computed: {
|
|
...mapGetters(['middlebarRouters']),
|
|
...mapGetters(['middlebarRouters']),
|
|
- libraryFormatList(){
|
|
|
|
- if(!this.middlebarRouters.length) return []
|
|
|
|
- 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,
|
|
|
|
- src:this.library[idx].src,
|
|
|
|
- path:this.library.find(lib => lib.title == item.meta.title ).path,
|
|
|
|
- titleStyle:{
|
|
|
|
- left: '20px',
|
|
|
|
- bottom: '20px',
|
|
|
|
- width:'auto'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ libraryRoutes() {
|
|
|
|
+ return this.middlebarRouters
|
|
|
|
+ .filter(r => this.libraries.includes(r.meta.title))
|
|
|
|
+ .map(r => ({
|
|
|
|
+ src: require('@/assets/images/index/lib/' + r.meta.imgName + '.png'),
|
|
|
|
+ imgClasses: 'rd8',
|
|
|
|
+ path: r.children.first().path // TODO: should copy logic from voluntary-ui `AccessDeepMenu`
|
|
|
|
+ }))
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- methods: {
|
|
|
|
- }
|
|
|
|
|
|
+ methods: {}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|