123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <template>
- <div class="app-container majorlib" ref="vocation">
- <el-card style="height:158px;margin: 10px auto;">
- <div :style="{'background-image':backimg}" class="back">
- <p style="color:#A6A6A6;font-size:24px;font-weight:bold;">MAJOR LIBRARY</p>
- <p style="color:#414141;font-size:24px;font-weight:bold;">专业库</p>
- <hr class="layui-bg-orange" style="width:40px;height:4px;margin-top:10px;" />
- </div>
- </el-card>
- <el-card class="box-card" >
- <div slot="header" >
- <span class="tabs-item" @click="type = '本科'" :class="{'bg-primary':type == '本科'}">本科</span>
- <span class="tabs-item" @click="type = '专科'" :class="{'bg-primary':type == '专科'}">专科</span>
- <p class="line"></p>
- <div class="tags-wrap">
- <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}`">
- <!-- 一级专业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">
- <!-- 二级专业 -->
- <p class="sub-title">{{`${subLevel.name} (${subLevel.code}) `}}</p>
- <!-- 三级专业 -->
- <div class="last-children-wrap" v-if="subLevel.children.length > 0">
- <span @click="goDetail(vocation.code)" class="last-children" v-for="vocation in subLevel.children">{{vocation.name}}</span>
- </div>
- </div>
- </div>
- </div>
- </el-card>
- </div>
- </template>
- <script>
- import {mapState} from 'vuex';
- 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: '本科',
- }
- },
- computed:{
- ...mapState({theme: state => state.settings.theme}),
- levelOne() {
- return this.majorList.map(item=>{
- return {
- code: item.code,
- name: item.name,
- }
- })
- },
- majorList() {
- if(this.type == '本科') return this.masterMajorList
- if(this.type == '专科') return this.specialtyMajorList
- }
- },
- watch:{
- theme:{
- immediate:true,
- handler(val){
- this.$nextTick(()=>{
- this.$refs.vocation.style.setProperty('--themeColor', val)
- })
- }
- },
- },
- methods:{
- goDetail(code){
- this.$router.push({path:'/career/plan/MajorDetail',query:{type:this.type,code:code}})
- },
- returnTop(id){
- document.getElementById(`#${id}`).scrollIntoView(true);
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .majorlib{
- .levelOne{
- padding-top:100px;
- margin-top:-100px;
- }
- .layui-bg-orange{
- background-color: var(--themeColor);
- margin-left:0;
- }
- .back{
- padding:30px;
- margin-top: 10px;background-color:white;background-repeat: no-repeat;background-position: bottom right;
- }
- .title{
- background-color: var(--themeColor);
- width: 162px;
- height: 37px;
- color: #fff;
- font-size: 16px;
- line-height: 37px;
- text-align: center;
- }
- .line {
- background-color: var(--themeColor);
- height: 4px;
- }
- .last-children-wrap{
- flex-wrap: wrap;
- display: flex;
- .last-children{
- flex: 25%;
- flex-grow: 0;
- margin-bottom: 10px;
- color: var(--themeColor);
- &:hover{
- text-decoration: underline;
- cursor: pointer;
- }
- }
- }
- .tabs-item{
- cursor: pointer;
- padding: 0 33px;
- border: 1px solid #f2f2f2;
- border-bottom: 0px;
- display: inline-block;
- line-height: 40px;
- &:hover{
- color:#47C6A2;
- }
- &.bg-primary{
- background: #47C6A2 ;
- color: white;
- border: 0px;
- }
- }
- .tags-wrap {
- overflow: hidden;
- box-sizing: border-box;
- border-top: 1px solid #e1e1e1;
- border-left: 1px solid #e1e1e1;
- display: flex;
- flex-flow: row wrap;
- justify-content: start;
- .tag{
- border-bottom: 1px solid #e1e1e1;
- border-right: 1px solid #e1e1e1;
- font-size: 12px;
- text-align: center;
- flex: 10%;
- text-align: center;
- flex-grow: 0;
- color: #555;
- height: 40px;
- line-height: 40px;
- cursor: pointer;
- &:hover{
- text-decoration: underline;
- cursor: pointer;
- }
- }
- }
- .sub-title{
- color: #333;
- line-height: 26px;
- padding: 5px 10px;
- background: #f3f3f3;
- margin-bottom: 2px;
- }
- .voca-title{
- border-left:4px solid var(--themeColor);
- padding:0px 5px;
- }
- .primaryColor{
- color: var(--themeColor);
- }
- .row{
- .rowHead{
- background-color:#a7e6d4;
- &:hover{
- background-color: var(--themeColor);
- hr{
- background-color: #ffffff;
- }
- }
- }
- }
- }
- </style>
|