|
@@ -1260,20 +1260,6 @@
|
|
|
style="position: absolute; right: 55px"
|
|
|
></div>
|
|
|
</div>
|
|
|
- <div v-if="itemTool.tool != 51">
|
|
|
- <textarea
|
|
|
- rows="3"
|
|
|
- type="text"
|
|
|
- placeholder="添加工具描述"
|
|
|
- class="binfo_input"
|
|
|
- style="
|
|
|
- margin: 20px 0 0;
|
|
|
- resize: none;
|
|
|
- width: 71.5% !important;
|
|
|
- "
|
|
|
- v-model="itemTool.toolDetail"
|
|
|
- ></textarea>
|
|
|
- </div>
|
|
|
<div style="margin-top: 10px">
|
|
|
<div class="tool" v-if="itemTool.tool == 1">
|
|
|
<div
|
|
@@ -1536,7 +1522,7 @@
|
|
|
:class="
|
|
|
'box_course' + itemTaskIndex + toolIndex
|
|
|
"
|
|
|
- v-if="itemTool.toolData.length > 0"
|
|
|
+ v-if="itemTool.toolData.length > 0 && !itemTool.isNoFile"
|
|
|
>
|
|
|
<div
|
|
|
class="wheel"
|
|
@@ -1639,6 +1625,21 @@
|
|
|
sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts"
|
|
|
></iframe>
|
|
|
</div>
|
|
|
+ <div
|
|
|
+ class="wheel"
|
|
|
+ v-if="
|
|
|
+ itemTool.toolData[itemTool.sourceIndex]
|
|
|
+ .type == 13
|
|
|
+ "
|
|
|
+ style="height: 650px; width: 99%"
|
|
|
+ >
|
|
|
+ <el-image
|
|
|
+ :src="itemTool.toolData[itemTool.sourceIndex].url"
|
|
|
+ fit="contain"
|
|
|
+ style="width: 100%; height: 100%; cursor: pointer"
|
|
|
+ @click="previewImg(itemTool.toolData[itemTool.sourceIndex].url)"
|
|
|
+ ></el-image>
|
|
|
+ </div>
|
|
|
<div
|
|
|
class="wheel"
|
|
|
v-if="
|
|
@@ -1769,6 +1770,20 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div v-if="itemTool.tool != 51">
|
|
|
+ <textarea
|
|
|
+ rows="3"
|
|
|
+ type="text"
|
|
|
+ placeholder="添加工具描述"
|
|
|
+ class="binfo_input"
|
|
|
+ style="
|
|
|
+ margin: 0 0 20px;
|
|
|
+ resize: none;
|
|
|
+ width: 71.5% !important;
|
|
|
+ "
|
|
|
+ v-model="itemTool.toolDetail"
|
|
|
+ ></textarea>
|
|
|
+ </div>
|
|
|
<div
|
|
|
v-if="itemTool.toolPhoto.length"
|
|
|
style="margin-top: 10px"
|
|
@@ -3222,7 +3237,7 @@
|
|
|
<div style="margin: 5px 0">拍照</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="tool">
|
|
|
+ <!-- <div class="tool">
|
|
|
<div class="whiteBIcon" @click="addToolFun(55)">
|
|
|
<img
|
|
|
src="../../../assets/icon/fourthToolList/zip.png"
|
|
@@ -3230,7 +3245,7 @@
|
|
|
/>
|
|
|
<div style="margin: 5px 0">文件</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div class="tool">
|
|
|
<div class="whiteBIcon" @click="addToolFun(56)">
|
|
|
<img src="../../../assets/icon/thirdToolList/ask.png" alt />
|
|
@@ -3305,6 +3320,8 @@
|
|
|
item.type == 3 ||
|
|
|
item.type == 9 ||
|
|
|
item.type == 6 ||
|
|
|
+ item.type == 12 ||
|
|
|
+ item.type == 13 ||
|
|
|
item.type == 7
|
|
|
"
|
|
|
class="chapter_upload_l_i5"
|
|
@@ -3341,6 +3358,8 @@
|
|
|
item.type == 2 ||
|
|
|
item.type == 3 ||
|
|
|
item.type == 9 ||
|
|
|
+ item.type == 12 ||
|
|
|
+ item.type == 13 ||
|
|
|
item.type == 7
|
|
|
"
|
|
|
:placeholder="item.name"
|
|
@@ -3402,8 +3421,11 @@
|
|
|
</div>
|
|
|
<div class="add_info_box">
|
|
|
<button class="info_btn" @click="addImg($event)">
|
|
|
+ 添加文件
|
|
|
+ <input type="file" accept="*" style="display: none" v-if="inputShow" @change="beforeUpload3($event, 13)" />
|
|
|
+ </button>
|
|
|
+ <!-- <button class="info_btn" @click="addImg($event)">
|
|
|
添加视频
|
|
|
- <!-- capture="camera" -->
|
|
|
<input
|
|
|
type="file"
|
|
|
accept="video/mp4, video/quicktime, video/x-msvideo"
|
|
@@ -3421,11 +3443,19 @@
|
|
|
v-if="inputShow"
|
|
|
@change="beforeUpload3($event, 3)"
|
|
|
/>
|
|
|
- </button>
|
|
|
+ </button> -->
|
|
|
<button class="info_btn" @click="addAttText()">
|
|
|
添加图文
|
|
|
</button>
|
|
|
- <button class="info_btn" @click="openLine()">添加链接</button>
|
|
|
+ <button class="info_btn" @click="openLine()">
|
|
|
+ 添加链接
|
|
|
+ </button>
|
|
|
+ <button class="info_btn" @click="pasteLine()">
|
|
|
+ 嵌入代码
|
|
|
+ </button>
|
|
|
+ <button class="info_btn" @click="openSource()">
|
|
|
+ 添加资源
|
|
|
+ </button>
|
|
|
</div>
|
|
|
<div v-if="proVisible" class="mask">
|
|
|
<div class="progressBox">
|
|
@@ -3901,6 +3931,16 @@
|
|
|
<el-button @click="dialogVisibleVote3 = false">关 闭</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="添加资源" :visible.sync="dialogVisibleSource2" :append-to-body="true" width="100%"
|
|
|
+ :before-close="handleClose" class="dialog_diy source_diy">
|
|
|
+ <div>
|
|
|
+ <sourceDialog :sourceData.sync="sourceData"></sourceDialog>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisibleSource2 = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="addSource">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -3920,10 +3960,13 @@ import graph from "../components/graph.vue";
|
|
|
import pdf from "../components/vpdf";
|
|
|
import * as imageConversion from "image-conversion";
|
|
|
import courseDetailVue from "../courseDetail.vue";
|
|
|
+import sourceDialog from "../teacherSource/dialog.vue";
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
EditorBar,
|
|
|
EditorBar2,
|
|
|
+ sourceDialog,
|
|
|
Mind,
|
|
|
Sunburst,
|
|
|
SeeBoard,
|
|
@@ -3997,6 +4040,7 @@ export default {
|
|
|
dialogVisibleChoice: false,
|
|
|
dialogVisibleTool: false,
|
|
|
dialogVisibleSource: false,
|
|
|
+ dialogVisibleSource2: false,
|
|
|
answerDialogVisible: false,
|
|
|
dialogVisibleFile: false,
|
|
|
dialogVisibleText: false,
|
|
@@ -4217,6 +4261,7 @@ export default {
|
|
|
pageSize:20,
|
|
|
total:0,
|
|
|
page:0,
|
|
|
+ sourceData:{}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -5248,6 +5293,101 @@ export default {
|
|
|
this.$forceUpdate();
|
|
|
this.dialogVisible6 = true;
|
|
|
},
|
|
|
+ openSource(i) {
|
|
|
+ this.lineCount = i;
|
|
|
+ this.sourceData = {};
|
|
|
+ this.dialogVisibleSource2 = true;
|
|
|
+ },
|
|
|
+ addSource() {
|
|
|
+ if (!Object.keys(this.sourceData).length) {
|
|
|
+ this.$message.error("请选择要上传的资源");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let keys = Object.keys(this.sourceData);
|
|
|
+ for (var i = 0; i < keys.length; i++) {
|
|
|
+ this.sourcesData.push({
|
|
|
+ name: "链接",
|
|
|
+ title: this.sourceData[keys[i]].name,
|
|
|
+ src: this.sourceData[keys[i]].url,
|
|
|
+ type: 8,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.$forceUpdate();
|
|
|
+ this.dialogVisibleSource2 = false;
|
|
|
+ },
|
|
|
+ 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);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ pasteLine(i) {
|
|
|
+ navigator.clipboard
|
|
|
+ .readText()
|
|
|
+ .then((v) => {
|
|
|
+ console.log("获取剪贴板成功:", v);
|
|
|
+ const html = v;
|
|
|
+ const regex = /src="(.*?)"/g;
|
|
|
+ const match = regex.exec(html);
|
|
|
+ if (match && match[1]) {
|
|
|
+ console.log(match[1]);
|
|
|
+ this.$message.success("粘贴成功");
|
|
|
+ this.sourcesData.push({
|
|
|
+ name: "链接",
|
|
|
+ title: "嵌入代码",
|
|
|
+ src: match[1],
|
|
|
+ type: 8,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // console.log("未找到包含 src 属性的 iframe");
|
|
|
+ this.$message.error("没有找到粘贴的链接");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((v) => {
|
|
|
+ console.log("获取剪贴板失败: ", v);
|
|
|
+ });
|
|
|
+ },
|
|
|
openLine(i) {
|
|
|
this.line = "";
|
|
|
this.lineTitle = "";
|
|
@@ -5680,7 +5820,115 @@ export default {
|
|
|
if (err) {
|
|
|
_this.$message.error("上传失败");
|
|
|
} else {
|
|
|
- if (type == 2 || type == 3) {
|
|
|
+ if (type == 13) {
|
|
|
+ let _type = 2;
|
|
|
+ let src = "";
|
|
|
+ var imgA = [
|
|
|
+ "png",
|
|
|
+ "jpg",
|
|
|
+ "jpeg",
|
|
|
+ "bmp",
|
|
|
+ "gif",
|
|
|
+ "webp",
|
|
|
+ "psd",
|
|
|
+ "svg",
|
|
|
+ "tiff",
|
|
|
+ ];
|
|
|
+ var fileA = [
|
|
|
+ "DOC",
|
|
|
+ "DOCX",
|
|
|
+ "DOCM",
|
|
|
+ "DOTM",
|
|
|
+ "DOTX",
|
|
|
+ "PPTX",
|
|
|
+ "PPSX",
|
|
|
+ "PPT",
|
|
|
+ "PPS",
|
|
|
+ "PPTM",
|
|
|
+ "POTM",
|
|
|
+ "PPAM",
|
|
|
+ "POTX",
|
|
|
+ "PPSM",
|
|
|
+ "XLSX",
|
|
|
+ "XLS",
|
|
|
+ ];
|
|
|
+ var videoA = [
|
|
|
+ "AVI",
|
|
|
+ "NAVI",
|
|
|
+ "MPEG",
|
|
|
+ "ASF",
|
|
|
+ "MOV",
|
|
|
+ "WMV",
|
|
|
+ "3GP",
|
|
|
+ "RM",
|
|
|
+ "RMVB",
|
|
|
+ "FLV",
|
|
|
+ "F4V",
|
|
|
+ "H.264",
|
|
|
+ "H.265",
|
|
|
+ "REAL VIDEO",
|
|
|
+ "MKV",
|
|
|
+ "WebM",
|
|
|
+ "HDDVD",
|
|
|
+ "MP4",
|
|
|
+ "MPG",
|
|
|
+ "M4V",
|
|
|
+ "MGV",
|
|
|
+ "OGV",
|
|
|
+ "QTM",
|
|
|
+ "STR",
|
|
|
+ "AMC",
|
|
|
+ "DVX",
|
|
|
+ "EVO",
|
|
|
+ "DAT",
|
|
|
+ "OGG",
|
|
|
+ "OGM",
|
|
|
+ ];
|
|
|
+ if (
|
|
|
+ fileA.indexOf(
|
|
|
+ data.Location.split(".")[
|
|
|
+ data.Location.split(".").length - 1
|
|
|
+ ].toLocaleUpperCase()
|
|
|
+ ) != -1
|
|
|
+ ) {
|
|
|
+ _type = 3;
|
|
|
+ src =
|
|
|
+ "https://view.officeapps.live.com/op/view.aspx?src=" +
|
|
|
+ data.Location;
|
|
|
+ } else if (
|
|
|
+ videoA.indexOf(
|
|
|
+ data.Location.split(".")[
|
|
|
+ data.Location.split(".").length - 1
|
|
|
+ ].toLocaleUpperCase()
|
|
|
+ ) != -1
|
|
|
+ ) {
|
|
|
+ _type = 2;
|
|
|
+ src = _this.getVideo2(data.Location);
|
|
|
+ } else if (
|
|
|
+ imgA.indexOf(
|
|
|
+ data.Location.split(".")[
|
|
|
+ data.Location.split(".").length - 1
|
|
|
+ ].toLocaleLowerCase()
|
|
|
+ ) != -1
|
|
|
+ ) {
|
|
|
+ _type = 13;
|
|
|
+ }else if (
|
|
|
+ data.Location.split(".")[
|
|
|
+ data.Location.split(".").length - 1
|
|
|
+ ].toLocaleUpperCase() == "PDF"
|
|
|
+ ) {
|
|
|
+ _type = 9;
|
|
|
+ } else {
|
|
|
+ _type = 12;
|
|
|
+ }
|
|
|
+ _this.sourcesData.push({
|
|
|
+ name: file.name,
|
|
|
+ url: data.Location,
|
|
|
+ uid: file.uid,
|
|
|
+ type: _type,
|
|
|
+ src: src,
|
|
|
+ });
|
|
|
+ } if (type == 2 || type == 3) {
|
|
|
var src = "";
|
|
|
if (
|
|
|
data.Location.split(".")[
|
|
@@ -6283,6 +6531,10 @@ export default {
|
|
|
this.dialogVisibleSource = true;
|
|
|
},
|
|
|
setChapterIndex(itemTool, index) {
|
|
|
+ if(itemTool.toolData[index].type == 12){
|
|
|
+ this.downloadFile2(itemTool.toolData[index])
|
|
|
+ return;
|
|
|
+ }
|
|
|
itemTool.sourceIndex = index;
|
|
|
this.setVHeight();
|
|
|
this.$forceUpdate();
|
|
@@ -6296,11 +6548,32 @@ export default {
|
|
|
for (var z = 0; z < tool.length; z++) {
|
|
|
let _tool = tool[z];
|
|
|
if (_tool.tool == 51) {
|
|
|
- var a = document.getElementsByClassName("box_course" + j + z)[0]
|
|
|
- .offsetHeight;
|
|
|
- document.getElementsByClassName(
|
|
|
- "vedioList" + j + 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" + j + z
|
|
|
+ )[0].style.height = 650 + "px";
|
|
|
+ document.getElementsByClassName(
|
|
|
+ "vedioList" + j + z
|
|
|
+ )[0].style.width = "100%";
|
|
|
+ }else{
|
|
|
+ _tool.isNoFile = false;
|
|
|
+ var a = document.getElementsByClassName("box_course" + j + z)[0] ? document.getElementsByClassName("box_course" + j + z)[0]
|
|
|
+ .offsetHeight : 650;
|
|
|
+ document.getElementsByClassName(
|
|
|
+ "vedioList" + j + z
|
|
|
+ )[0].style.height = a + "px";
|
|
|
+ document.getElementsByClassName(
|
|
|
+ "vedioList" + j + z
|
|
|
+ )[0].style.width = "calc(100% - 83%)";
|
|
|
+ }
|
|
|
+ this.$forceUpdate();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -6312,6 +6585,13 @@ export default {
|
|
|
this.$message.error("请上传资源");
|
|
|
return;
|
|
|
}
|
|
|
+ let ic = 0
|
|
|
+ for(let i = 0; i < this.sourcesData.length; i++){
|
|
|
+ if(this.sourcesData[i].type != 12){
|
|
|
+ ic = i
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.editSourceType == 1) {
|
|
|
this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
this.taskCount
|
|
@@ -6322,7 +6602,7 @@ export default {
|
|
|
toolEdit: false,
|
|
|
toolId: this.guid(),
|
|
|
toolData: JSON.parse(JSON.stringify(this.sourcesData)),
|
|
|
- sourceIndex: 0,
|
|
|
+ sourceIndex: ic,
|
|
|
});
|
|
|
} else {
|
|
|
this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
@@ -6332,7 +6612,7 @@ export default {
|
|
|
);
|
|
|
this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
this.taskCount
|
|
|
- ].toolArray[this.toolIndex].sourceIndex = 0;
|
|
|
+ ].toolArray[this.toolIndex].sourceIndex = ic;
|
|
|
}
|
|
|
this.setPeople(this.unitIndex, this.taskCount, this.userid);
|
|
|
this.editSourceType = 1;
|
|
@@ -6719,6 +6999,7 @@ export default {
|
|
|
var a = this.sourcesData[ic - 1];
|
|
|
this.sourcesData[ic - 1] = this.sourcesData[ic];
|
|
|
this.sourcesData[ic] = a;
|
|
|
+ this.$forceUpdate();
|
|
|
},
|
|
|
downCd2(e, ic) {
|
|
|
e.stopPropagation();
|
|
@@ -6728,6 +7009,7 @@ export default {
|
|
|
var a = this.sourcesData[ic + 1];
|
|
|
this.sourcesData[ic + 1] = this.sourcesData[ic];
|
|
|
this.sourcesData[ic] = a;
|
|
|
+ this.$forceUpdate();
|
|
|
},
|
|
|
addWork() {
|
|
|
let cPan = 1;
|
|
@@ -9356,6 +9638,21 @@ export default {
|
|
|
padding: 20px 20px;
|
|
|
}
|
|
|
|
|
|
+.source_diy>>>.el-dialog {
|
|
|
+ height: 100% !important;
|
|
|
+ margin: 0 auto !important;
|
|
|
+}
|
|
|
+
|
|
|
+.source_diy>>>.el-dialog__body {
|
|
|
+ height: calc(100% - 185px);
|
|
|
+ overflow: auto;
|
|
|
+ background: #e6eaf0;
|
|
|
+}
|
|
|
+
|
|
|
+.source_diy>>>.el-dialog__footer {
|
|
|
+ background: #e6eaf0 !important;
|
|
|
+}
|
|
|
+
|
|
|
.left {
|
|
|
border-right: 1px solid rgb(60, 94, 143);
|
|
|
display: flex;
|