MajorDetail.vue
6.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<template>
<!-- 一级专业详情 -->
<div class="major_detail">
<div class="major_det_box">
<!-- 面包屑 -->
<div class="major_title layout align_left">
<el-breadcrumb separator="|">
<el-breadcrumb-item @click.native="toMajorIndex">首页</el-breadcrumb-item>
<el-breadcrumb-item class="last_brand">学科介绍</el-breadcrumb-item>
</el-breadcrumb>
</div>
<!-- 信息 -->
<div class="major_det_msg clearfix">
<!-- 左侧专业详情 -->
<div class="major_det_l">
<div class="major_l_box layout align_left flex_diection">
<h1>{{majorName}}</h1>
<!-- 学科介绍 -->
<div class="subject_induction">{{summary}}</div>
<!-- 相近部门 -->
<div class="layout align_left flex_diection">
<h2>相近相关部门</h2>
<div class="layout flex_row similar_box">
<div
class="similar"
v-for="item in similarList"
:key="item.id"
@click="getMajorDetail(item.id)"
>{{item.name}}</div>
</div>
</div>
<!-- 兴趣类型 -->
<div class="layout align_left flex_diection">
<h2>兴趣类型</h2>
<ul class="similar_box type_box" >
<li class="type_li" v-for="(item,index) in typeList" :key="index">{{item}}</li>
</ul>
</div>
<!-- 需要能力 -->
<div class="layout align_left flex_diection">
<h2>需要能力</h2>
<ul class="similar_box type_box">
<li class="type_li" v-for="(item,index) in abilityList" :key="index">{{item}}</li>
</ul>
</div>
<!-- 包含专业类 -->
<div class="layout align_left flex_diection">
<h2>本学门包含的专业类({{includeList.length}})</h2>
<div class="clearfix similar_box type_box">
<div
class="include_category layout justify align_center"
v-for="item in includeList"
:key="item.id"
@click="secondMajor(item.id)"
>
<div class="include_name">{{item.name}}</div>
<div class="cate_num">
<div>专业数</div>
<div>{{item.count}}</div>
</div>
</div>
</div>
</div>
<!-- 生涯发展 -->
<div class="layout align_left flex_diection">
<h2>生涯发展</h2>
<div class="clearfix similar_box">
<div class="similar" v-for="item in developList" :key="item.id" @click="occupation(item)">{{item.name}}</div>
</div>
</div>
</div>
</div>
<!-- 右侧跳转链接 -->
<div class="major_link_r clearfix">
<div class="link_img" @click="classify()">
<img src="@/assets/img/major2.png" alt />
</div>
<!-- 热门专业 -->
<div class="link_hot_major clearfix" v-show="botList.length>0">
<!-- 上层标题 -->
<div class="hot_major_top layout align_center">
<h2 class="white_h2">热门专业</h2>
</div>
<!-- 下层内容 -->
<div class="hot_major_bot clearfix">
<div
class="bot_content"
v-for="item in botList"
:key="item.id"
@click="hotMajor(item)"
>{{item.name}}</div>
</div>
</div>
<!-- 重点学科 -->
<div class="link_img" @click="discipline()">
<img src="@/assets/img/major3.png" alt />
</div>
<!-- 双一流建设学科名单 -->
<div class="link_img" @click="doubleFirst()">
<img src="@/assets/img/major4.png" alt />
</div>
<!-- 高校学科评估结果 -->
<div class="link_img" @click="assessResult()">
<img src="@/assets/img/major5.png" alt />
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { post } from "@/api/http";
export default {
data() {
return {
id: "",
// 专业名称
majorName: "",
// 概述
summary: "",
// 相近部门
similarList: [],
// 兴趣类型
typeList: [],
// 需要能力
abilityList: [],
// 包含的类别
includeList: [],
// 生涯发展
developList: [],
// 热门专业
botList: []
};
},
methods: {
// 专业首页
toMajorIndex(){
this.$router.push({path:"/Major"})
},
// 职业详情
occupation(item){
// console.log(item.id)
this.$router.push({path:'/Occupation',query:{id:item.id}})
},
// 热门专业
hotMajor(item) {
this.$router.push({ path: "/HotMajor", query: { id: item.id } });
},
// 教育部专业分类
classify() {
this.$router.push({ path: "/Major" });
},
// 重点学科
discipline() {
this.$router.push({ path: "/KeyDiscipline" });
},
// 双一流学科
doubleFirst() {
this.$router.push({ path: "/DoubleFirst" });
},
// 高校学科评估结果
assessResult() {
this.$router.push({ path: "/AssessResult" });
},
// 一级专业详情
getMajorDetail(itemId) {
if (itemId) {
this.id = itemId;
}
let url = "/api/major/getMajorDetail/";
let params = {
id: this.id
};
post(url, params).then(res => {
// 专业名称
this.majorName = res.major.name;
// 概述
this.summary = res.major.summary;
// 相近部门
this.similarList = res.major.like;
// 兴趣类型
this.typeList = res.major.interest_sort;
// 需要的能力
this.abilityList = res.major.ability;
// 包含的类别
this.includeList = res.major.child;
// 生涯发展
this.developList = res.major.career;
});
},
// 热门专业
getHotList() {
let url = "/api/major/getHotList/";
post(url).then(res => {
this.botList = res.hot_list;
});
},
// 二级专业详情
secondMajor(secondId) {
this.$router.push({
path: "/SecondMajorDetail",
query: { secondId: secondId }
});
}
},
mounted() {
this.id = this.$route.query.id;
this.getMajorDetail();
this.getHotList();
},
watch:{
'$route'(to,from){
this.id = this.$route.query.id;
this.getMajorDetail();
}
},
};
</script>
<style scoped>
@import "../../../../style/majorDetail.css";
/* 左侧 */
.major_l_box {
padding: 21px 23px 13px 29px;
background-color: #fff;
}
</style>