|  | @@ -1,6 +1,6 @@
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  | -  <index-card title="大数据选科" v-if="formatList.length">
 | 
	
		
			
				|  |  | -    <index-card-content :list="formatList" :line-size="lineSize">
 | 
	
		
			
				|  |  | +  <index-card simple title="大数据选科" v-if="electiveRoutes.length">
 | 
	
		
			
				|  |  | +    <index-card-content :list="electiveRoutes" :line-size="4">
 | 
	
		
			
				|  |  |        <template #default="{item}">
 | 
	
		
			
				|  |  |          <index-image-item v-bind="item"></index-image-item>
 | 
	
		
			
				|  |  |        </template>
 | 
	
	
		
			
				|  | @@ -9,86 +9,29 @@
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  | +import {mapGetters} from 'vuex'
 | 
	
		
			
				|  |  |  import IndexCard from '@/views/index/components/index-card'
 | 
	
		
			
				|  |  | -import loginCheckMixin from '@/views/index/blocks/index-login-interceptor-mixin'
 | 
	
		
			
				|  |  |  import IndexImageItem from '@/views/index/components/index-image-item'
 | 
	
		
			
				|  |  |  import IndexCardContent from '@/views/index/components/index-card-content'
 | 
	
		
			
				|  |  | -import { mapGetters } from 'vuex'
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  | -  components: { IndexImageItem, IndexCardContent, IndexCard },
 | 
	
		
			
				|  |  | -  mixins: [loginCheckMixin],
 | 
	
		
			
				|  |  | +  components: {IndexImageItem, IndexCardContent, IndexCard},
 | 
	
		
			
				|  |  |    name: 'index-card-elective',
 | 
	
		
			
				|  |  |    methods: {},
 | 
	
		
			
				|  |  |    computed: {
 | 
	
		
			
				|  |  |      ...mapGetters(['middlebarRouters']),
 | 
	
		
			
				|  |  | -    listOpt() {
 | 
	
		
			
				|  |  | -      const obj = {}
 | 
	
		
			
				|  |  | -      this.list.map(item => {
 | 
	
		
			
				|  |  | -        obj[`${item.title}${item.path}`] = { desc: item.desc }
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | -      return obj
 | 
	
		
			
				|  |  | +    electiveParentRoute() {
 | 
	
		
			
				|  |  | +      return this.middlebarRouters.find(r => r.meta.nodeType === 'ElectiveContent') || {children: []}
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    formatList() {
 | 
	
		
			
				|  |  | -      if (!this.middlebarRouters.length) return []
 | 
	
		
			
				|  |  | -      return this.middlebarRouters[1]?.children?.slice(0, 4).map((item, idx) => {
 | 
	
		
			
				|  |  | -        return {
 | 
	
		
			
				|  |  | -          title: item.meta.title,
 | 
	
		
			
				|  |  | -          desc: this.listOpt[`${item.meta.title}${item.path}`]?.desc,
 | 
	
		
			
				|  |  | -          src: this.list[idx].src,
 | 
	
		
			
				|  |  | -          path: item.path,
 | 
	
		
			
				|  |  | -          ...this.styleStatic
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -      }) || []
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -  },
 | 
	
		
			
				|  |  | -  data() {
 | 
	
		
			
				|  |  | -    return {
 | 
	
		
			
				|  |  | -      lineSize: 4,
 | 
	
		
			
				|  |  | -      styleStatic: {
 | 
	
		
			
				|  |  | -        titleStyle: {
 | 
	
		
			
				|  |  | -          top: '30px',
 | 
	
		
			
				|  |  | -          left: '20px',
 | 
	
		
			
				|  |  | -          fontSize: '24px',
 | 
	
		
			
				|  |  | -          color: '#000'
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -        descStyle: {
 | 
	
		
			
				|  |  | -          top: '70px',
 | 
	
		
			
				|  |  | -          left: '20px',
 | 
	
		
			
				|  |  | -          color: '#000'
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -        titleClasses: ['absolute', 'bold'],
 | 
	
		
			
				|  |  | -        descClasses: ['absolute', 'bold', 'f12']
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | -      list: [
 | 
	
		
			
				|  |  | -        {
 | 
	
		
			
				|  |  | -          title: '智能选科报名',
 | 
	
		
			
				|  |  | -          src: `${this.$imgBase}index/elective/elective_apply.png`,
 | 
	
		
			
				|  |  | -          desc: '通过意向的院校和专业推荐选科方案',
 | 
	
		
			
				|  |  | -          path: '/new-gaokao/bigdataSelectCourse/round-select'
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -        {
 | 
	
		
			
				|  |  | -          title: '个人分班信息',
 | 
	
		
			
				|  |  | -          src: `${this.$imgBase}index/elective/elective_dispatch.png`,
 | 
	
		
			
				|  |  | -          desc: '通过意向的院校和专业推荐',
 | 
	
		
			
				|  |  | -          path: '/new-gaokao/bigdataSelectCourse/personalDivideClass'
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -        {
 | 
	
		
			
				|  |  | -          title: '个人选科报告',
 | 
	
		
			
				|  |  | -          src: `${this.$imgBase}index/elective/elective_report.png`,
 | 
	
		
			
				|  |  | -          desc: '通过大学/专业维度查询选考科目要求',
 | 
	
		
			
				|  |  | -          path: '/new-gaokao/bigdataSelectCourse/personalSelectCourseReport'
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -        {
 | 
	
		
			
				|  |  | -          title: '个人课程表',
 | 
	
		
			
				|  |  | -          src: `${this.$imgBase}index/elective/elective_table.png`,
 | 
	
		
			
				|  |  | -          desc: '通过意向的院校和专业推荐',
 | 
	
		
			
				|  |  | -          path: '/new-gaokao/bigdataSelectCourse/personalClassCategory'
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -      ]
 | 
	
		
			
				|  |  | +    electiveRoutes() {
 | 
	
		
			
				|  |  | +      const routes = this.electiveParentRoute.children || []
 | 
	
		
			
				|  |  | +      return routes.map(r => ({
 | 
	
		
			
				|  |  | +        imgStyle: {borderRadius: '8px', overflow: 'hidden'},
 | 
	
		
			
				|  |  | +        src: require('@/assets/images/index/elective/' + r.meta.icon),
 | 
	
		
			
				|  |  | +        path: r.path
 | 
	
		
			
				|  |  | +      }))
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 |