|
|
@ -161,7 +161,7 @@ export default { |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
active: +this.$route.query.type || 0, |
|
|
|
active: +this.$route.query.type || 0, |
|
|
|
tabs: [ |
|
|
|
defaultTabs: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
id: 0, |
|
|
|
id: 0, |
|
|
|
name: '教学课程' |
|
|
|
name: '教学课程' |
|
|
@ -175,6 +175,7 @@ export default { |
|
|
|
name: '文件素材' |
|
|
|
name: '文件素材' |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
tabs: [], |
|
|
|
timer: null, |
|
|
|
timer: null, |
|
|
|
types: SourceConst.types, |
|
|
|
types: SourceConst.types, |
|
|
|
courses: [], |
|
|
|
courses: [], |
|
|
@ -268,11 +269,26 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
|
|
|
|
|
Setting.dynamicRoute && this.initTabs() |
|
|
|
this.insertScript() |
|
|
|
this.insertScript() |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
this.getCourse() |
|
|
|
this.getCourse() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
initTabs () { |
|
|
|
|
|
|
|
const { btns } = this.$store.state |
|
|
|
|
|
|
|
const tab1 = btns.includes('/resourse:教学课程') |
|
|
|
|
|
|
|
const tab2 = btns.includes('/resourse:精品课程') |
|
|
|
|
|
|
|
const tab3 = btns.includes('/resourse:文件素材') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const tabs = this.defaultTabs |
|
|
|
|
|
|
|
tab1 && this.tabs.push(tabs[0]) |
|
|
|
|
|
|
|
tab2 && this.tabs.push(tabs[1]) |
|
|
|
|
|
|
|
tab3 && this.tabs.push(tabs[2]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const type = +this.$route.query.type |
|
|
|
|
|
|
|
this.active = this.tabs.find(e => e.id === type) ? type : this.tabs[0].id |
|
|
|
|
|
|
|
}, |
|
|
|
async getData () { |
|
|
|
async getData () { |
|
|
|
this.loading = true |
|
|
|
this.loading = true |
|
|
|
try { |
|
|
|
try { |
|
|
|