|
@@ -13,12 +13,12 @@
|
|
|
<span class="tabs-item" @click="type = '专科'" :class="{'bg-primary':type == '专科'}">专科</span>
|
|
|
<p class="line"></p>
|
|
|
<div class="tags-wrap">
|
|
|
- <a :href="`#${item.code}`" class="tag" v-for="item in levelOne">{{ item.name }}</a>
|
|
|
+ <a @click="returnTop(item.code)" class="tag" v-for="item in levelOne">{{ item.name }}</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="list-wrap">
|
|
|
<!-- 一级 -->
|
|
|
- <div class="levelOne" v-for="item in majorList" :id="item.code">
|
|
|
+ <div class="levelOne" v-for="item in majorList" :id="`#${item.code}`">
|
|
|
<!-- 一级专业title-->
|
|
|
<p class="voca-title mt10 mb10" > <span class="primaryColor bold">{{`${item.name} (${item.code}) `}} </span><span class="f14 f-666">{{ `${item.childCount}4个专业类,${item.grandchildCount}个专科专业` }}</span></p>
|
|
|
<div class="last-level" v-for="subLevel in item.children">
|
|
@@ -37,15 +37,15 @@
|
|
|
|
|
|
<script>
|
|
|
import {mapState} from 'vuex';
|
|
|
-import { allMajor } from '@/api/webApi/professlib';
|
|
|
+import MxMajorTreeTranslateMixin from '@/components/Cache/modules/mx-major-tree-translate-mixin'
|
|
|
+
|
|
|
export default {
|
|
|
name: "index",
|
|
|
+ mixins:[MxMajorTreeTranslateMixin],
|
|
|
data(){
|
|
|
return {
|
|
|
backimg:'url('+require('@/assets/images/icon_pro.png')+')',
|
|
|
type: '本科',
|
|
|
- masterMajorList: [], // 本科
|
|
|
- specialtyMajorList: [], // 专科
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
@@ -72,31 +72,13 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- type: {
|
|
|
- immediate:true,
|
|
|
- handler(val){
|
|
|
- console.log(val)
|
|
|
- if((val == '本科' && this.masterMajorList.length == 0) || (val == '专科' && this.specialtyMajorList.length == 0)){
|
|
|
- this.getAllMajor()
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
methods:{
|
|
|
goDetail(code){
|
|
|
this.$router.push({path:'/career/plan/ProfessLibDetail',query:{type:this.type,code:code}})
|
|
|
},
|
|
|
- getAllMajor() {
|
|
|
- allMajor({
|
|
|
- type: this.type
|
|
|
- }).then(res => {
|
|
|
- if(this.type == '本科'){
|
|
|
- this.masterMajorList = res.data
|
|
|
- }
|
|
|
- if(this.type == '专科'){
|
|
|
- this.specialtyMajorList = res.data
|
|
|
- }
|
|
|
- })
|
|
|
+ returnTop(id){
|
|
|
+ document.getElementById(`#${id}`).scrollIntoView(true);
|
|
|
}
|
|
|
}
|
|
|
}
|