|
|
|
@ -10,6 +10,10 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="station"> |
|
|
|
|
<div class="inner"> |
|
|
|
|
<div class="tab"> |
|
|
|
|
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{active: item.id == active}" @click="tabChange(item)">{{ item.name }}</a> |
|
|
|
|
</div> |
|
|
|
|
<div class="curs"> |
|
|
|
|
<template v-if="curriculumList.length"> |
|
|
|
|
<template v-for="(item,index) in curriculumList"> |
|
|
|
|
<div class="item" :title="item.curriculumName" @click="goPreview(item)" :key="index" v-if="!keyword || item.curriculumName.includes(keyword)"> |
|
|
|
@ -30,6 +34,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
@ -38,6 +43,17 @@ export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
keyword: "", |
|
|
|
|
active: 0, |
|
|
|
|
tabs: [ |
|
|
|
|
{ |
|
|
|
|
id: 0, |
|
|
|
|
name: '实验课程' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: '最近使用' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
curriculumList: [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -46,6 +62,13 @@ export default { |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getschoolCourse() { // 获取课程列表 |
|
|
|
|
this.active ? |
|
|
|
|
this.$post(this.api.recentUse, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 100 |
|
|
|
|
}).then(({ page }) => { |
|
|
|
|
this.curriculumList = page.records |
|
|
|
|
}).catch(err => {}) : |
|
|
|
|
this.$get(this.api.schoolCourse).then(res => { |
|
|
|
|
this.curriculumList = res.data; |
|
|
|
|
}).catch(err => { |
|
|
|
@ -55,6 +78,11 @@ export default { |
|
|
|
|
goPreview(item) { |
|
|
|
|
this.$router.push(`/station/preview?courseId=${item.cid}&curriculumName=${item.curriculumName}`); |
|
|
|
|
}, |
|
|
|
|
// tab切换 |
|
|
|
|
tabChange(item) { |
|
|
|
|
this.active = item.id |
|
|
|
|
this.getschoolCourse() |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
@ -96,17 +124,39 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tab { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|
.item { |
|
|
|
|
padding: 0 20px; |
|
|
|
|
margin-right: 16px; |
|
|
|
|
font-size: 17px; |
|
|
|
|
text-align: center; |
|
|
|
|
color: #333; |
|
|
|
|
line-height: 50px; |
|
|
|
|
border-bottom: 3px solid transparent; |
|
|
|
|
cursor: pointer; |
|
|
|
|
&.active { |
|
|
|
|
color: #007EFF; |
|
|
|
|
border-color: #007EFF; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.station { |
|
|
|
|
min-height: calc(100vh - 520px); |
|
|
|
|
background: url(../../../assets/img/station1.png) (top left)/auto no-repeat, |
|
|
|
|
url(../../../assets/img/station2.png) bottom right/auto no-repeat; |
|
|
|
|
.inner { |
|
|
|
|
width: 1072px; |
|
|
|
|
margin: 0 auto; |
|
|
|
|
} |
|
|
|
|
.curs { |
|
|
|
|
display: flex; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
width: 1072px; |
|
|
|
|
padding-top: 60px; |
|
|
|
|
margin: 0 auto; |
|
|
|
|
} |
|
|
|
|
.item { |
|
|
|
|
position: relative; |
|
|
|
|
padding: 0 10px; |
|
|
|
@ -152,6 +202,7 @@ export default { |
|
|
|
|
border: 1px solid #DADADA; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.empty{ |
|
|
|
|
display: flex; |
|
|
|
|