|
@@ -264,6 +264,15 @@
|
|
security="restricted"
|
|
security="restricted"
|
|
sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts"></iframe>
|
|
sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts"></iframe>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="wheel" v-if="chapterlist[chapterIndex].type == 13"
|
|
|
|
+ style="height: 650px; width: 95%; margin: 0 auto">
|
|
|
|
+ <el-image
|
|
|
|
+ :src="chapterlist[chapterIndex].url"
|
|
|
|
+ fit="contain"
|
|
|
|
+ style="width: 100%; height: 100%; cursor: pointer"
|
|
|
|
+ @click="previewImg(chapterlist[chapterIndex].url)"
|
|
|
|
+ ></el-image>
|
|
|
|
+ </div>
|
|
<div class="wheel" v-if="chapterlist[chapterIndex].type == 9"
|
|
<div class="wheel" v-if="chapterlist[chapterIndex].type == 9"
|
|
style="height: 650px; width: 95%; margin: 0 auto">
|
|
style="height: 650px; width: 95%; margin: 0 auto">
|
|
<pdf :pdfUrl="chapterlist[chapterIndex].src" style="width: 100%; height: 100%; overflow: auto">
|
|
<pdf :pdfUrl="chapterlist[chapterIndex].src" style="width: 100%; height: 100%; overflow: auto">
|
|
@@ -532,7 +541,7 @@
|
|
</div>
|
|
</div>
|
|
<div v-if="tool.tool == 51" style="margin-top: 20px">
|
|
<div v-if="tool.tool == 51" style="margin-top: 20px">
|
|
<div class="vedioTaskBox">
|
|
<div class="vedioTaskBox">
|
|
- <div class="box_course" :class="'box_course' + toolIndex" v-if="tool.toolData.length > 0">
|
|
|
|
|
|
+ <div class="box_course" :class="'box_course' + toolIndex" v-if="tool.toolData.length > 0 && !tool.isNoFile">
|
|
<div class="wheel" v-if="tool.toolData[tool.sourceIndex].type == 2">
|
|
<div class="wheel" v-if="tool.toolData[tool.sourceIndex].type == 2">
|
|
<div class="workd_media" style="height: 100%">
|
|
<div class="workd_media" style="height: 100%">
|
|
<video-player class="video-player vjs-custom-skin" :playsinline="true"
|
|
<video-player class="video-player vjs-custom-skin" :playsinline="true"
|
|
@@ -567,6 +576,15 @@
|
|
:src="tool.toolData[tool.sourceIndex].src" security="restricted"
|
|
:src="tool.toolData[tool.sourceIndex].src" security="restricted"
|
|
sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts"></iframe>
|
|
sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts"></iframe>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="wheel" v-if="tool.toolData[tool.sourceIndex].type == 13"
|
|
|
|
+ style="height: 650px; width: 98%">
|
|
|
|
+ <el-image
|
|
|
|
+ :src="tool.toolData[tool.sourceIndex].url"
|
|
|
|
+ fit="contain"
|
|
|
|
+ style="width: 100%; height: 100%; cursor: pointer"
|
|
|
|
+ @click="previewImg(tool.toolData[tool.sourceIndex].url)"
|
|
|
|
+ ></el-image>
|
|
|
|
+ </div>
|
|
<div class="wheel" v-if="tool.toolData[tool.sourceIndex].type == 9"
|
|
<div class="wheel" v-if="tool.toolData[tool.sourceIndex].type == 9"
|
|
style="height: 650px; width: 98%">
|
|
style="height: 650px; width: 98%">
|
|
<pdf :pdfUrl="tool.toolData[tool.sourceIndex].url"
|
|
<pdf :pdfUrl="tool.toolData[tool.sourceIndex].url"
|
|
@@ -1855,7 +1873,14 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
if (_tool.tool == 51) {
|
|
if (_tool.tool == 51) {
|
|
- _tool.sourceIndex = 0;
|
|
|
|
|
|
+ let ic = 0
|
|
|
|
+ for(let ci = 0; ci < _tool.toolData.length; ci++){
|
|
|
|
+ if(_tool.toolData[ci].type != 12){
|
|
|
|
+ ic = ci
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ _tool.sourceIndex = ic;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2657,6 +2682,10 @@ export default {
|
|
this.dialogVisible5 = true;
|
|
this.dialogVisible5 = true;
|
|
},
|
|
},
|
|
setChapterIndex2(tool, index, toolIndex) {
|
|
setChapterIndex2(tool, index, toolIndex) {
|
|
|
|
+ if(tool.toolData[index].type == 12){
|
|
|
|
+ this.downloadFile2(tool.toolData[index])
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
tool.sourceIndex = index;
|
|
tool.sourceIndex = index;
|
|
this.$nextTick(function () {
|
|
this.$nextTick(function () {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -2669,6 +2698,53 @@ export default {
|
|
});
|
|
});
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
},
|
|
},
|
|
|
|
+ downloadFile2(f) {
|
|
|
|
+ const loading = this.$loading.service({
|
|
|
|
+ background: "rgba(255, 255, 255, 0.7)",
|
|
|
|
+ target: document.body,
|
|
|
|
+ text: "文件加载中...",
|
|
|
|
+ });
|
|
|
|
+ let url2 = f.url;
|
|
|
|
+ let _url2 = "";
|
|
|
|
+ if (
|
|
|
|
+ url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
|
|
|
|
+ ) {
|
|
|
|
+ _url2 = url2.split(
|
|
|
|
+ "https://view.officeapps.live.com/op/view.aspx?src="
|
|
|
|
+ )[1];
|
|
|
|
+ } else {
|
|
|
|
+ _url2 = url2;
|
|
|
|
+ }
|
|
|
|
+ let params = {
|
|
|
|
+ url: _url2,
|
|
|
|
+ name: f.name,
|
|
|
|
+ };
|
|
|
|
+ this.ajax
|
|
|
|
+ .get(this.$store.state.api + "download", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ loading.close();
|
|
|
|
+ let content = res.data.data.data;
|
|
|
|
+ let ab = new ArrayBuffer(content.length);
|
|
|
|
+ let view = new Uint8Array(ab);
|
|
|
|
+ for (var i = 0; i < content.length; ++i) {
|
|
|
|
+ view[i] = content[i];
|
|
|
|
+ }
|
|
|
|
+ let elink = document.createElement("a");
|
|
|
|
+ elink.download = f.name;
|
|
|
|
+ elink.style.display = "none";
|
|
|
|
+ let blob = new Blob([ab], {
|
|
|
|
+ type: res.data.response.headers["content-type"] + ";charset=UTF-8",
|
|
|
|
+ });
|
|
|
|
+ elink.href = URL.createObjectURL(blob);
|
|
|
|
+ document.body.appendChild(elink);
|
|
|
|
+ elink.click();
|
|
|
|
+ document.body.removeChild(elink);
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ loading.close();
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
setVHeight() {
|
|
setVHeight() {
|
|
this.$nextTick(function () {
|
|
this.$nextTick(function () {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -2679,10 +2755,37 @@ export default {
|
|
for (var z = 0; z < tool.length; z++) {
|
|
for (var z = 0; z < tool.length; z++) {
|
|
let _tool = tool[z];
|
|
let _tool = tool[z];
|
|
if (_tool.tool == 51) {
|
|
if (_tool.tool == 51) {
|
|
- var a = document.getElementsByClassName("box_course" + z)[0]
|
|
|
|
- .offsetHeight;
|
|
|
|
- document.getElementsByClassName("vedioList" + z)[0].style.height =
|
|
|
|
- a + "px";
|
|
|
|
|
|
+ let ci = 0
|
|
|
|
+ for(var li = 0;li<_tool.toolData.length;li++){
|
|
|
|
+ if(_tool.toolData[li].type != 12){
|
|
|
|
+ ci++
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(ci == 0){
|
|
|
|
+ _tool.isNoFile = true;
|
|
|
|
+ document.getElementsByClassName(
|
|
|
|
+ "vedioList" + z
|
|
|
|
+ )[0].style.height = 650 + "px";
|
|
|
|
+ document.getElementsByClassName(
|
|
|
|
+ "vedioList" + z
|
|
|
|
+ )[0].style.width = "100%";
|
|
|
|
+ }else{
|
|
|
|
+ _tool.isNoFile = false;
|
|
|
|
+ var a = document.getElementsByClassName("box_course" + z)[0] ? document.getElementsByClassName("box_course" + z)[0]
|
|
|
|
+ .offsetHeight : 650;
|
|
|
|
+ document.getElementsByClassName(
|
|
|
|
+ "vedioList" + z
|
|
|
|
+ )[0].style.height = a + "px";
|
|
|
|
+ document.getElementsByClassName(
|
|
|
|
+ "vedioList" + z
|
|
|
|
+ )[0].style.width = "calc(100% - 83%)";
|
|
|
|
+ }
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ // var a = document.getElementsByClassName("box_course" + z)[0]
|
|
|
|
+ // .offsetHeight;
|
|
|
|
+ // document.getElementsByClassName("vedioList" + z)[0].style.height =
|
|
|
|
+ // a + "px";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}, 0);
|
|
}, 0);
|