|
|
|
@ -33,10 +33,10 @@ |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li v-if="active !== 2"> |
|
|
|
|
<label>课程:</label> |
|
|
|
|
<el-select v-if="!active" v-model="form.resourceType" clearable @change="initData"> |
|
|
|
|
<el-select v-if="!active" v-model="form.cid" filterable clearable @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in courses" :key="i" :label="item.curriculumName" :value="item.cid"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-select v-else v-model="form.resourceType" clearable @change="initData"> |
|
|
|
|
<el-select v-else v-model="form.cid" filterable clearable @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in theoreticalCourses" :key="i" :label="item.courseName" |
|
|
|
|
:value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
@ -163,6 +163,7 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { Loading } from 'element-ui' |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
import Util from '@/libs/util' |
|
|
|
|
import SourceConst from '@/const/source' |
|
|
|
@ -285,6 +286,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
this.insertScript() |
|
|
|
|
this.getData() |
|
|
|
|
this.getCourse() |
|
|
|
|
}, |
|
|
|
@ -333,6 +335,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
tabChange (id) { |
|
|
|
|
this.active = id |
|
|
|
|
this.form.cid = '' |
|
|
|
|
this.initData() |
|
|
|
|
this.getCourse() |
|
|
|
|
this.$router.push({ |
|
|
|
@ -416,6 +419,17 @@ export default { |
|
|
|
|
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频"; |
|
|
|
|
return ext; |
|
|
|
|
}, |
|
|
|
|
insertScript () { |
|
|
|
|
const linkTag = document.createElement("link"); |
|
|
|
|
linkTag.rel = "stylesheet"; |
|
|
|
|
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"; |
|
|
|
|
document.body.appendChild(linkTag); |
|
|
|
|
|
|
|
|
|
const scriptTag = document.createElement("script"); |
|
|
|
|
scriptTag.type = "text/javascript"; |
|
|
|
|
scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"; |
|
|
|
|
document.body.appendChild(scriptTag); |
|
|
|
|
}, |
|
|
|
|
preview (row) { |
|
|
|
|
if (this.transferType(row.fileType) == "视频") { |
|
|
|
|
// 阿里云视频点播 |
|
|
|
@ -472,6 +486,26 @@ export default { |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
iframeOnload () { |
|
|
|
|
document.querySelector("#fileIframe").onload = e => { |
|
|
|
|
if (this.isPPT) { |
|
|
|
|
this.showMask = true; |
|
|
|
|
} else { |
|
|
|
|
this.showMask = false; |
|
|
|
|
} |
|
|
|
|
if (this.isWord) { |
|
|
|
|
this.showMask1 = true; |
|
|
|
|
} else { |
|
|
|
|
this.showMask1 = false; |
|
|
|
|
} |
|
|
|
|
if (this.isExcel) { |
|
|
|
|
this.showMask2 = true; |
|
|
|
|
} else { |
|
|
|
|
this.showMask2 = false; |
|
|
|
|
} |
|
|
|
|
this.loadIns.close(); |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
del (row) { |
|
|
|
|
this.$confirm('删除后用户将无法再查看和使用此资源,确定删除?', '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|