lsc 2 년 전
부모
커밋
910faebe3f
3개의 변경된 파일76개의 추가작업 그리고 30개의 파일을 삭제
  1. BIN
      src/assets/icon/old/work.png
  2. BIN
      src/assets/icon/thirdToolList/work.png
  3. 76 30
      src/components/pages/student/addCourse.vue

BIN
src/assets/icon/old/work.png


BIN
src/assets/icon/thirdToolList/work.png


+ 76 - 30
src/components/pages/student/addCourse.vue

@@ -653,7 +653,7 @@
                                         justify-content: flex-start;
                                         align-items: center;
                                       ">
-                                            <div class="lineTitle">资源上传</div>
+                                            <div class="lineTitle">资源</div>
                                             <div class="line"></div>
                                         </div>
                                         <div>
@@ -772,14 +772,14 @@
                                         </div>
                                         <div class="add_info_box">
                                             <button class="info_btn" @click="addImg($event)">
-                                                添加教学视频
+                                                添加视频
                                                 <input type="file" accept="video/mp4, video/quicktime, video/x-msvideo"
                                                     style="display: none" capture="camera" v-if="inputShow" @change="
                                                         beforeUpload2($event, unitIndex, 2, itemTaskIndex)
                                                     " />
                                             </button>
                                             <button class="info_btn" @click="addImg($event)">
-                                                添加教学附件
+                                                添加附件
                                                 <input type="file"
                                                     accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
                                                     style="display: none" v-if="inputShow" @change="
@@ -850,7 +850,7 @@
                                                             表格
                                                         </span>
                                                         <span v-if="itemTool.tool == 51">
-                                                            学习资源
+                                                            资源
                                                         </span>
                                                         <span v-if="itemTool.tool == 52">
                                                             文档
@@ -859,7 +859,7 @@
                                                             文件上传
                                                         </span>
                                                         <span v-if="itemTool.tool == 54">
-                                                            拍照上传
+                                                            拍照
                                                         </span>
                                                         <span v-if="itemTool.tool == 55">
                                                             压缩文件
@@ -927,7 +927,7 @@
                                                     </div>
                                                     <div class="tool" v-if="itemTool.tool == 53"
                                                         style="position:relative">
-                                                        <div class="whiteBIcon" @click="addImg($event)">
+                                                        <div class="whiteBIcon" :id="itemTaskIndex+'-'+toolIndex" @click="addImg($event)">
                                                             <img src="../../../assets/icon/fourthToolList/file.png"
                                                                 alt />
                                                             <div style="margin: 5px 0">文件上传</div>
@@ -944,10 +944,10 @@
                                                     </div>
                                                     <div class="tool" v-if="itemTool.tool == 54"
                                                         style="position:relative">
-                                                        <div class="whiteBIcon" @click="addImg($event)">
+                                                        <div class="whiteBIcon" :id="itemTaskIndex+'-'+toolIndex" @click="addImg($event)">
                                                             <img src="../../../assets/icon/fourthToolList/photo.png"
                                                                 alt />
-                                                            <div style="margin: 5px 0">拍照上传</div>
+                                                            <div style="margin: 5px 0">拍照</div>
                                                             <input type="file"
                                                                 accept="video/mp4, video/quicktime, video/x-msvideo,image/*"
                                                                 capture="camera" style="display: none"
@@ -961,7 +961,7 @@
                                                     </div>
                                                     <div class="tool" v-if="itemTool.tool == 55"
                                                         style="position:relative">
-                                                        <div class="whiteBIcon" @click="addImg($event)">
+                                                        <div class="whiteBIcon" :id="itemTaskIndex+'-'+toolIndex" @click="addImg($event)">
                                                             <img src="../../../assets/icon/fourthToolList/zip.png"
                                                                 alt />
                                                             <div style="margin: 5px 0">压缩文件</div>
@@ -1913,12 +1913,6 @@
                                         <div style="margin: 5px 0">问答工具</div>
                                     </div>
                                 </div> -->
-                                <div class="tool">
-                                    <div class="whiteBIcon" @click="addToolFun(51)">
-                                        <img src="../../../assets/icon/fourthToolList/upload.png" alt />
-                                        <div style="margin: 5px 0">资源上传</div>
-                                    </div>
-                                </div>
                                 <div class="tool">
                                     <div class="whiteBIcon" @click="addToolFun(52)">
                                         <img src="../../../assets/icon/fourthToolList/text.png" alt />
@@ -1926,15 +1920,21 @@
                                     </div>
                                 </div>
                                 <div class="tool">
+                                    <div class="whiteBIcon" @click="addToolFun(51)">
+                                        <img src="../../../assets/icon/fourthToolList/upload.png" alt />
+                                        <div style="margin: 5px 0">资源库</div>
+                                    </div>
+                                </div>
+                                <!-- <div class="tool">
                                     <div class="whiteBIcon" @click="addToolFun(53)">
                                         <img src="../../../assets/icon/fourthToolList/file.png" alt />
                                         <div style="margin: 5px 0">文件上传</div>
                                     </div>
-                                </div>
+                                </div> -->
                                 <div class="tool">
                                     <div class="whiteBIcon" @click="addToolFun(54)">
                                         <img src="../../../assets/icon/fourthToolList/photo.png" alt />
-                                        <div style="margin: 5px 0">拍照上传</div>
+                                        <div style="margin: 5px 0">拍照</div>
                                     </div>
                                 </div>
                                 <div class="tool">
@@ -2066,14 +2066,14 @@
                                 </div>
                                 <div class="add_info_box">
                                     <button class="info_btn" @click="addImg($event)">
-                                        添加教学视频
+                                        添加视频
                                         <input type="file" accept="video/mp4, video/quicktime, video/x-msvideo"
                                             style="display: none" capture="camera" v-if="inputShow" @change="
                                                 beforeUpload3($event, 2)
                                             " />
                                     </button>
                                     <button class="info_btn" @click="addImg($event)">
-                                        添加教学附件
+                                        添加附件
                                         <input type="file"
                                             accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
                                             style="display: none" v-if="inputShow" @change="
@@ -3259,7 +3259,7 @@ export default {
             this.isSysPic = false;
         },
         addImg(e) {
-            var el = e.currentTarget;
+            var el = e.currentTarget || e;
             el.getElementsByTagName("input")[0].click();
             e.target.value = "";
         },
@@ -4066,6 +4066,19 @@ export default {
                 });
                 this.$forceUpdate();
                 this.dialogVisibleTool = false;
+                if(tool == 1 || tool == 3 || tool == 6){
+                    setTimeout(() => {
+                        this.openToolFun(tool, this.taskCount, this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
+                        this.taskCount
+                        ].toolArray.length-1)
+                    },500)
+                }else if(tool == 53 || tool == 54 || tool == 55){
+                    setTimeout(() => {
+                        this.addImg(document.getElementById(this.taskCount.toString() + '-' + (this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
+                        this.taskCount
+                        ].toolArray.length-1)));
+                    },500)
+                }
             }
         },
         addToolFunD(itemTaskIndex) {
@@ -4132,7 +4145,17 @@ export default {
             if (tool == 48) {
                 this.taskCount = taskCount
                 this.toolIndex = i
-                this.tableJson.text = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].table ? JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].table)) : ''
+                const array = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].toolPhoto
+                let txt = ""
+                for(var l = 0;l<array.length;l++){
+                    let _uid = array[l].userid
+                    if(_uid == this.userid){
+                        txt = JSON.parse(JSON.stringify(array[l].content))
+                        break;
+                    }
+                }
+                this.tableJson.text = txt ? JSON.parse(txt) : (this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].table ? JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].table)) : '')
+                // this.tableJson.text = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].table ? JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].table)) : ''
                 this.dialogVisibleTable = true;
             } else if (tool == 15) {
                 this.taskCount = taskCount
@@ -4142,7 +4165,16 @@ export default {
             } else if (tool == 52) {
                 this.taskCount = taskCount
                 this.toolIndex = i
-                this.tableJson.text = JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].text))
+                const array = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].toolPhoto
+                let txt = ""
+                for(var l = 0;l<array.length;l++){
+                    let _uid = array[l].userid
+                    if(_uid == this.userid){
+                        txt = JSON.parse(JSON.stringify(array[l].content))
+                        break;
+                    }
+                }
+                this.tableJson.text = txt ? JSON.parse(txt) : (JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].text)))
                 this.dialogVisibleText3 = true;
             } else {
                 window.parent.postMessage({
@@ -5634,10 +5666,10 @@ export default {
             // }
         },
         addText() {
-            // if (this.tableJson.text == "" || this.tableJson.text == "<p></p>") {
-            //     this.$message.error("请填写信息!");
-            //     return;
-            // }
+            if (this.tableJson.text == "" || this.tableJson.text == "<p></p>") {
+                this.$message.error("请填写信息!");
+                return;
+            }
 
             this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
                 this.taskCount
@@ -5652,6 +5684,13 @@ export default {
             this.$forceUpdate();
             this.dialogVisibleTool = false;
             this.dialogVisibleText = false;
+            setTimeout(() => {
+            //     this.openToolFun(52, this.taskCount, this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
+            //     this.taskCount
+            // ].toolArray.length-1)
+                this.toolIndex = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount].toolArray.length-1
+                this.addTextJson()
+            }, 500);
             // if (
             //   this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount]
             //     .toolChoose[this.toolIndex].tool != 15
@@ -5660,10 +5699,10 @@ export default {
             // }
         },
         addTable() {
-            // if (this.tableJson.text == "" || this.tableJson.text == "<p></p>") {
-            //     this.$message.error("请填写信息!");
-            //     return;
-            // }
+            if (this.tableJson.text == "" || this.tableJson.text == "<p></p>") {
+                this.$message.error("请填写信息!");
+                return;
+            }
 
             this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
                 this.taskCount
@@ -5678,6 +5717,13 @@ export default {
             this.$forceUpdate();
             this.dialogVisibleTool = false;
             this.dialogVisibleTable1 = false;
+            setTimeout(() => {
+            //     this.openToolFun(48, this.taskCount, this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
+            //     this.taskCount
+            // ].toolArray.length-1)
+                this.toolIndex = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount].toolArray.length-1
+                this.addTableJson()
+            },500)
             // if (
             //   this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount]
             //     .toolChoose[this.toolIndex].tool != 15