|
|
|
@ -86,9 +86,9 @@ |
|
|
|
|
<el-table-column label="操作" align="center" width="180"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<template v-if="scope.row.isDownload || active"> |
|
|
|
|
<el-button type="text" @click="edit(scope.row)">编辑</el-button> |
|
|
|
|
<el-button type="text" @click="download(scope.row)">下载</el-button> |
|
|
|
|
</template> |
|
|
|
|
<el-button type="text" @click="edit(scope.row)">编辑</el-button> |
|
|
|
|
<el-button type="text" @click="download(scope.row)">下载</el-button> |
|
|
|
|
</template> |
|
|
|
|
<el-button type="text" @click="preview(scope.row)">预览</el-button> |
|
|
|
|
<el-button v-if="scope.row.isDownload || active" type="text" @click="del(scope.row)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
@ -150,6 +150,7 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { mapState } from 'vuex' |
|
|
|
|
import { Loading } from 'element-ui' |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
import Util from '@/libs/util' |
|
|
|
@ -161,7 +162,7 @@ export default { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
active: +this.$route.query.type || 0, |
|
|
|
|
tabs: [ |
|
|
|
|
defaultTabs: [ |
|
|
|
|
{ |
|
|
|
|
id: 0, |
|
|
|
|
name: '教学课程' |
|
|
|
@ -175,6 +176,7 @@ export default { |
|
|
|
|
name: '文件素材' |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
tabs: [], |
|
|
|
|
timer: null, |
|
|
|
|
types: SourceConst.types, |
|
|
|
|
courses: [], |
|
|
|
@ -241,6 +243,11 @@ export default { |
|
|
|
|
uploadVisible: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
...mapState('auth', [ |
|
|
|
|
'btns' |
|
|
|
|
]) |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
"form.month": function (val) { |
|
|
|
|
if (val) { |
|
|
|
@ -268,11 +275,26 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
Setting.dynamicRoute && this.initTabs() |
|
|
|
|
this.insertScript() |
|
|
|
|
this.getData() |
|
|
|
|
this.getCourse() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
initTabs () { |
|
|
|
|
const { btns } = this |
|
|
|
|
const tab1 = btns.includes('/resourse/list:教学课程') |
|
|
|
|
const tab2 = btns.includes('/resourse/list:精品课程') |
|
|
|
|
const tab3 = btns.includes('/resourse/list:文件素材') |
|
|
|
|
|
|
|
|
|
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 () { |
|
|
|
|
this.loading = true |
|
|
|
|
try { |
|
|
|
|