|
@@ -0,0 +1,65 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="professDetail">
|
|
|
|
+ <index-card v-for="detail in details" :key="detail.code" :title="majors[detail.code]" class="index-card">
|
|
|
|
+ <el-divider content-position="left"><span class="f28">专业概况</span></el-divider>
|
|
|
|
+ <major-introduce-info :major-detail="detail.overview"></major-introduce-info>
|
|
|
|
+ <el-divider content-position="left"><span class="f28">就业前景</span></el-divider>
|
|
|
|
+ <major-introduce-job :prospects="detail.prospects"></major-introduce-job>
|
|
|
|
+ </index-card>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { getMajorDetailByCodes } from '@/api/webApi/professlib'
|
|
|
|
+import IndexCard from '@/views/index/components/index-card'
|
|
|
|
+import MajorIntroduceInfo from '@/views/career/plan/compoents/major-introduce-info'
|
|
|
|
+import MajorIntroduceJob from '@/views/career/plan/compoents/major-introduce-job'
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: 'major-introduce-batch',
|
|
|
|
+ components: { MajorIntroduceJob, MajorIntroduceInfo, IndexCard },
|
|
|
|
+ inject: ['getOptionalMajors'],
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ details: []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ majors() {
|
|
|
|
+ const all = this.getOptionalMajors()
|
|
|
|
+ if (!all.length) return []
|
|
|
|
+ const distinctMajors = {}
|
|
|
|
+ all.forEach(item => {
|
|
|
|
+ if (!item.majors) return
|
|
|
|
+ const codes = Object.keys(item.majors)
|
|
|
|
+ if (!codes.length) return
|
|
|
|
+ codes.forEach(code => {
|
|
|
|
+ distinctMajors[code] = item.majors[code]
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ return distinctMajors
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ 'majors': function(newVal) {
|
|
|
|
+ if (!newVal) return
|
|
|
|
+ const codes = Object.keys(newVal)
|
|
|
|
+ if (!codes.length) return
|
|
|
|
+ this.loadOverviewAndProspects(codes)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ loadOverviewAndProspects(codes) {
|
|
|
|
+ getMajorDetailByCodes({ codes: codes.toString() }).then(res => {
|
|
|
|
+ this.details = res.data
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+.index-card + .index-card {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+}
|
|
|
|
+</style>
|