dev_202412
yujialong 2 months ago
parent 3bf85a18bb
commit 08adddc010
  1. 4
      src/views/course/content/index.vue
  2. 38
      src/views/resourse/index.vue
  3. 1
      src/views/resourse/upload.vue

@ -211,7 +211,7 @@
</template> </template>
<script> <script>
import { Loading } from "element-ui"; import { Loading } from 'element-ui'
import Pdf from "@/components/pdf"; import Pdf from "@/components/pdf";
import Upload from '@/components/upload'; import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js' import Oss from '@/components/upload/upload.js'
@ -296,7 +296,7 @@ export default {
}; };
}, },
mounted () { mounted () {
this.insertScript(); this.insertScript()
this.id && this.getData(); this.id && this.getData();
// //
if (window.history && window.history.pushState) { if (window.history && window.history.pushState) {

@ -33,10 +33,10 @@
<ul class="filter"> <ul class="filter">
<li v-if="active !== 2"> <li v-if="active !== 2">
<label>课程</label> <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-option v-for="(item, i) in courses" :key="i" :label="item.curriculumName" :value="item.cid"></el-option>
</el-select> </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" <el-option v-for="(item, i) in theoreticalCourses" :key="i" :label="item.courseName"
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
@ -163,6 +163,7 @@
</template> </template>
<script> <script>
import { Loading } from 'element-ui'
import Setting from '@/setting' import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
import SourceConst from '@/const/source' import SourceConst from '@/const/source'
@ -285,6 +286,7 @@ export default {
} }
}, },
mounted () { mounted () {
this.insertScript()
this.getData() this.getData()
this.getCourse() this.getCourse()
}, },
@ -333,6 +335,7 @@ export default {
}, },
tabChange (id) { tabChange (id) {
this.active = id this.active = id
this.form.cid = ''
this.initData() this.initData()
this.getCourse() this.getCourse()
this.$router.push({ 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 "视频"; if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频";
return ext; 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) { preview (row) {
if (this.transferType(row.fileType) == "视频") { if (this.transferType(row.fileType) == "视频") {
// //
@ -472,6 +486,26 @@ export default {
}).catch(err => { }) }).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) { del (row) {
this.$confirm('删除后用户将无法再查看和使用此资源,确定删除?', '提示', { this.$confirm('删除后用户将无法再查看和使用此资源,确定删除?', '提示', {
type: 'warning' type: 'warning'

@ -120,6 +120,7 @@ export default {
beforeUpload (file) { beforeUpload (file) {
this.uploading = true this.uploading = true
this.form.originalFileName = file.name this.form.originalFileName = file.name
this.form.resourceName = file.name.substring(0, file.name.lastIndexOf('.'))
}, },
beforeRemove (file, fileList) { beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`) return this.$confirm(`确定移除 ${file.name}`)

Loading…
Cancel
Save