lsc hace 2 años
padre
commit
cc9bfc872a

+ 11 - 0
package-lock.json

@@ -21,6 +21,7 @@
         "lamejs": "^1.2.1",
         "pdfjs-dist": "^2.5.207",
         "pdfvuer": "^1.7.5",
+        "recordrtc": "^5.6.2",
         "vue": "^2.5.2",
         "vue-cookies": "^1.7.4",
         "vue-jsmind": "^1.5.0",
@@ -19585,6 +19586,11 @@
         "node": ">= 0.10"
       }
     },
+    "node_modules/recordrtc": {
+      "version": "5.6.2",
+      "resolved": "https://registry.npmmirror.com/recordrtc/-/recordrtc-5.6.2.tgz",
+      "integrity": "sha512-1QNKKNtl7+KcwD1lyOgP3ZlbiJ1d0HtXnypUy7yq49xEERxk31PHvE9RCciDrulPCY7WJ+oz0R9hpNxgsIurGQ=="
+    },
     "node_modules/redent": {
       "version": "1.0.0",
       "resolved": "https://registry.nlark.com/redent/download/redent-1.0.0.tgz",
@@ -40141,6 +40147,11 @@
         "resolve": "^1.1.6"
       }
     },
+    "recordrtc": {
+      "version": "5.6.2",
+      "resolved": "https://registry.npmmirror.com/recordrtc/-/recordrtc-5.6.2.tgz",
+      "integrity": "sha512-1QNKKNtl7+KcwD1lyOgP3ZlbiJ1d0HtXnypUy7yq49xEERxk31PHvE9RCciDrulPCY7WJ+oz0R9hpNxgsIurGQ=="
+    },
     "redent": {
       "version": "1.0.0",
       "resolved": "https://registry.nlark.com/redent/download/redent-1.0.0.tgz",

+ 1 - 0
package.json

@@ -25,6 +25,7 @@
     "lamejs": "^1.2.1",
     "pdfjs-dist": "^2.5.207",
     "pdfvuer": "^1.7.5",
+    "recordrtc": "^5.6.2",
     "vue": "^2.5.2",
     "vue-cookies": "^1.7.4",
     "vue-jsmind": "^1.5.0",

BIN
src/assets/teacherWork.png


BIN
src/assets/uploadImg2.png


+ 131 - 56
src/components/cameraDemo.vue

@@ -1,64 +1,139 @@
 <template>
-    <div id="vueapp">
-        <div>
-            <button @click="btnRecordClicked" v-if="!recording">录制</button>
-            <button @click="btnPauseClicked" v-if="!paused && recording">暂停</button>
-            <button @click="btnResumeClicked" v-if="paused && recording">继续</button>
-            <button @click="btnStopClicked" :disabled="!recording">停止</button>
-            <button :disabled="!currentWebmData" @click="btnPlayClicked">播放</button>
-        </div>
-        <video controls ref="player"></video>
-    </div>
+<div>
+    <el-button type="primary" @click="startRecording" v-if="!videoStart">开始录制</el-button>
+    <el-button type="primary" @click="stopRecording" v-else>停止录制</el-button>
+    
+</div>
 </template>
 
 <script>
-export default {
-    data() {
-        return {
-            currentWebmData: 0,
-            recording: false,
-            paused: false
-        }
-    },
-    mounted() {
-        this._initApp();
-    },
-
-    methods: {
-        async _initApp() {
-            // this._stream=await navigator.mediaDevices.getUserMedia({audio:true,video:false});
-            this._stream = await navigator.mediaDevices.getDisplayMedia();
-            this._recorder = new MediaRecorder(this._stream, { mimeType: "video/webm;codecs=h264" });
-            this._recorder.ondataavailable = this.recorder_dataAvailableHandler.bind(this);
-        },
-        recorder_dataAvailableHandler(e) {
-            console.log(e);
-            this.currentWebmData = e.data;
-        },
-        btnRecordClicked() {
-            this.recording = true;
-            this.paused = false;
-            this._recorder.start();
-        },
-        btnPauseClicked() {
-            this.paused = true;
-            this._recorder.pause();
-        },
-        btnResumeClicked() {
-            this.paused = false;
-            this._recorder.resume();
-        },
-        btnStopClicked() {
-            this.recording = false;
-            this._recorder.stop();
-        },
-        btnPlayClicked() {
-            this.$refs.player.src = URL.createObjectURL(this.currentWebmData);
-        }
-    }
-}
+	import RecordRTC from 'recordrtc';
+	export default {
+		data() {
+			return {
+				videoStart: false,
+				recorder: null,
+			}
+		},
+		props:{
+			fileName:{
+				type:String,
+				default:new Date().getTime()
+			}
+		},
+		onLoad() {
+			
+		},
+		methods:{
+			
+			/**
+			 * 开始录制
+			 */
+			startRecording(callback){
+				this.captureScreen((screenStream)=>{
+					this.addStreamStopListener(screenStream,()=>{
+						console.log("流停止监听");
+						this.$emit("streamStop",{})
+						// this.stopRecording();
+					});
+					var options = {
+					    type: 'video',
+					    mimeType: 'video/webm',
+					    disableLogs: false,
+					    getNativeBlob: false, // enable it for longer recordings
+						ignoreMutedMedia:false
+					};
+					// this.video.srcObject = screenStream;
+					this.recorder = RecordRTC(screenStream, options);
+					this.recorder.startRecording();
+					this.recorder.screen = screenStream;
+					this.videoStart = true;
+					// callback(true);
+				});
+			},
+			/**
+			 * 停止录制
+			 */
+			stopRecording(callback){
+				this.recorder.stopRecording(()=>{
+					// this.video.src = this.video.srcObject = null;
+					// this.video.src = URL.createObjectURL(this.recorder.getBlob());
+					const url = URL.createObjectURL(this.recorder.getBlob());
+					const a = document.createElement("a");
+					let videoFile = new File([this.recorder.getBlob()], this.fileName+".mp4", {
+						type: 'video/mp4'  
+					})
+					let downloadUrl = URL.createObjectURL(videoFile);
+					document.body.appendChild(a);
+					a.style.display = "none";
+					a.href = url;
+					a.download = this.fileName + ".mp4";
+					a.click();
+					this.recorder.screen.stop();
+					this.recorder.destroy();
+					this.recorder = null;
+					this.videoStart = false;
+					// callback(false);
+				});
+			},
+			//初始化
+			captureScreen(callback) {
+				if (navigator.getDisplayMedia) {
+					//录制结束,文件下载
+				    navigator.getDisplayMedia({
+				        video: true
+				    }).then(screenStream => {
+						navigator.mediaDevices.getUserMedia({audio:true}).then((mic)=>{
+						    screenStream.addTrack(mic.getTracks()[0]);
+							callback(screenStream);
+						});
+				    }).catch(function(error) {
+						console.log('error',error);
+				    });
+				} else if (navigator.mediaDevices.getDisplayMedia) {
+				    navigator.mediaDevices.getDisplayMedia({
+				        video: true
+				    }).then(screenStream => {
+						navigator.mediaDevices.getUserMedia({audio:true}).then((mic)=>{
+						    screenStream.addTrack(mic.getTracks()[0]);
+							callback(screenStream);
+						});
+				    }).catch(function(error) {
+						console.log('error',error);
+				    });
+				} else {
+				    var error = 'getDisplayMedia API are not supported in this browser.';
+				   console.log('error',error);
+				    alert(error);
+				}
+			},
+			
+			//流监听
+			addStreamStopListener(stream, callback) {
+			    stream.addEventListener('ended', function () {
+			        callback();
+			        callback = function () { };
+			    }, false);
+			    stream.addEventListener('inactive', function () {
+			        callback();
+			        callback = function () { };
+			    }, false);
+			    stream.getTracks().forEach(function (track) {
+			        track.addEventListener('ended', function () {
+			            callback();
+			            callback = function () { };
+			        }, false);
+			        track.addEventListener('inactive', function () {
+			            callback();
+			            callback = function () { };
+			        }, false);
+			    });
+			},
+			
+		}
+	}
 </script>
 
 <style>
+</style>
 
-</style>

+ 14 - 15
src/components/components/vpdf.vue

@@ -4,19 +4,9 @@
     <div class="loading" v-show="loading">
       <span>pdf可能会加载时间有点长,请耐心等待...</span>
     </div>
-    <div id="contentArea" class="show">
-      <pdf
-        :scale.sync="scale"
-        :resize="true"
-        ref="wrapper"
-        class="p-pdf"
-        :src="pdfData"
-        v-for="i in numPages"
-        :key="i"
-        :id="i"
-        :page="i"
-        style="width: 100%"
-      >
+    <div id="contentArea" class="show" v-if="!loading">
+      <pdf :scale.sync="scale" :resize="true" ref="wrapper" class="p-pdf" :src="pdfData" v-for="i in numPages" :key="i"
+        :id="i" :page="i" style="width: 100%">
         <!-- <template slot="loading"> loading content here... </template> -->
       </pdf>
     </div>
@@ -73,7 +63,7 @@ export default {
     this.loading = true;
     this.getPdf();
   },
-  beforeDestroy() {},
+  beforeDestroy() { },
   watch: {
     pdfUrl: function (s) {
       // this.loading = this.$loading.service({
@@ -133,6 +123,7 @@ export default {
   font-size: 20px;
   color: #007fff;
 }
+
 .pdf {
   height: 100%;
   width: 100%;
@@ -141,6 +132,7 @@ export default {
   overflow-x: hidden;
   overflow-y: auto;
 }
+
 .pdf .show {
   margin: auto;
   width: 100%;
@@ -151,6 +143,7 @@ export default {
 .pdf .show .p-pdf {
   overflow: hidden;
 }
+
 .pdf .show .p-pdf .line {
   position: absolute;
   width: 50px;
@@ -165,15 +158,17 @@ export default {
   color: #fff;
 }
 
-.pdf .show .p-pdf span + span {
+.pdf .show .p-pdf span+span {
   margin-top: 10px;
 }
+
 .pdfbox {
   /* border: 3px solid #000; */
   /* box-sizing: border-box; */
   /* border-radius: 4px; */
   /* overflow: hidden; */
 }
+
 .pdf .pdf_footer {
   position: sticky;
   bottom: 0;
@@ -188,12 +183,14 @@ export default {
   justify-content: center;
   flex-direction: column;
 }
+
 .pdf .pdf_footer .info {
   display: flex;
   flex-wrap: wrap;
   width: 100%;
   justify-content: center;
 }
+
 .pdf .p-pdf .viewerContainer {
   width: 100%;
 }
@@ -208,10 +205,12 @@ export default {
   justify-content: center;
   width: 100%;
 }
+
 .pdf .pdf_footer .operate div {
   text-align: center;
   font-size: 15px;
 }
+
 .pdf .pdf_footer .operate .btn {
   cursor: pointer;
   margin: 5px 10px;

+ 232 - 79
src/components/studyStudent.vue

@@ -1040,41 +1040,43 @@
                         <div class="workImg" v-if="w.type == 0">
                           <img :src="w.works" @click="commentOther(w, toolIndex, wIndex)" alt />
                           <div class="answerScore" v-if="w.score" @click.stop="openScore(w)"
-                            :class="{ rightW: w.userid == userid }">
+                            :class="{ rightW: w.userid == userid || w.ateacher == userid }">
                             {{ JSON.parse(w.score).wScore }}分
                           </div>
                           <div class="answerScore" @click.stop="openScore(w)" v-else-if="courseDetail.userid == userid"
-                            :class="{ rightW: w.userid == userid }">
+                            :class="{ rightW: w.userid == userid || w.ateacher == userid }">
                             评分
                           </div>
-                          <img class="deleteImg" src="../assets/deleteworks.png" v-if="w.userid == userid"
-                            @click.stop="deleteWorks(w.wid)" alt />
+                          <img class="deleteImg" src="../assets/deleteworks.png"
+                            v-if="w.userid == userid || w.ateacher == userid" @click.stop="deleteWorks(w.wid)" alt />
                         </div>
                         <div class="workImg" v-if="w.type == 1">
-                          <img :src="word" @click="openFile(w.works)" alt />
+                          <img :src="word" @click="commentOther(w, toolIndex, wIndex)" alt />
+                          <!-- @click="openFile(w.works)" -->
                           <div class="answerScore" v-if="w.score" @click.stop="openScore(w)"
-                            :class="{ rightW: w.userid == userid }">
+                            :class="{ rightW: w.userid == userid || w.ateacher == userid }">
                             {{ JSON.parse(w.score).wScore }}分
                           </div>
                           <div class="answerScore" @click.stop="openScore(w)" v-else-if="courseDetail.userid == userid"
-                            :class="{ rightW: w.userid == userid }">
+                            :class="{ rightW: w.userid == userid || w.ateacher == userid }">
                             评分
                           </div>
-                          <img class="deleteImg" src="../assets/deleteworks.png" v-if="w.userid == userid"
-                            @click.stop="deleteWorks(w.wid)" alt />
+                          <img class="deleteImg" src="../assets/deleteworks.png"
+                            v-if="w.userid == userid || w.ateacher == userid" @click.stop="deleteWorks(w.wid)" alt />
                         </div>
                         <div class="workImg" v-if="w.type == 3">
-                          <img style="cursor: pointer" :src="video" @click="openVideo(w.works)" alt />
+                          <img style="cursor: pointer" :src="video" @click="commentOther(w, toolIndex, wIndex)" alt />
+                          <!--  @click="openVideo(w.works)" -->
                           <div class="answerScore" v-if="w.score" @click.stop="openScore(w)"
-                            :class="{ rightW: w.userid == userid }">
+                            :class="{ rightW: w.userid == userid || w.ateacher == userid }">
                             {{ JSON.parse(w.score).wScore }}分
                           </div>
                           <div class="answerScore" @click.stop="openScore(w)" v-else-if="courseDetail.userid == userid"
-                            :class="{ rightW: w.userid == userid }">
+                            :class="{ rightW: w.userid == userid || w.ateacher == userid }">
                             评分
                           </div>
-                          <img class="deleteImg" src="../assets/deleteworks.png" v-if="w.userid == userid"
-                            @click.stop="deleteWorks(w.wid)" alt />
+                          <img class="deleteImg" src="../assets/deleteworks.png"
+                            v-if="w.userid == userid || w.ateacher == userid" @click.stop="deleteWorks(w.wid)" alt />
                         </div>
 
                         <div class="comment" style="min-width: 200px">
@@ -1102,7 +1104,8 @@
                     </div>
                     <div style="font-size: 18px">未提交</div>
                     <div class="noWorksS">
-                      <div v-for="(s, sIndex) in noWorksS[toolIndex]" :key="sIndex" class="noWorksName">
+                      <div v-for="(s, sIndex) in noWorksS[toolIndex]" :key="sIndex" class="noWorksName"
+                        @click="teacherWorkSubmit(16, toolIndex, taskCount, s)">
                         {{ s.student }}
                       </div>
                     </div>
@@ -2562,15 +2565,18 @@
           {{ JSON.parse(commentDetail.works)[0].answer }}
         </div>
         <div class="worksAnswer" v-if="commentDetail.works && commentDetail.type == 1">
+          <img src="../assets/teacherWork.png" v-if="commentDetail.ateacher" class="w_teachert" />
           <pdf v-if="showPDF" :pdfUrl="pptImgUrl" style="width: 100%; height: 520px; overflow: auto"
             :class="{ fullStyle: full }"></pdf>
           <iframe v-else :src="pptImgUrl" frameborder="0" width="100%" height="600"
             :class="{ fullStyle: full }"></iframe>
         </div>
         <div class="worksAnswer" v-if="commentDetail.works && commentDetail.type == 0">
+          <img src="../assets/teacherWork.png" v-if="commentDetail.ateacher" class="w_teachert" style="right:105px" />
           <img :src="commentDetail.works" alt="" @click="previewImg(commentDetail.works)" />
         </div>
         <div class="worksAnswer" v-if="commentDetail.works && commentDetail.type == 3">
+          <img src="../assets/teacherWork.png" v-if="commentDetail.ateacher" class="w_teachert" />
           <video-player class="video-player vjs-custom-skin" :playsinline="true" :options="videoDetail"
             @play="onPlayerPlay($event)" style="width: 90%; height: 100%; margin: 0 0 0 30px"></video-player>
         </div>
@@ -2985,6 +2991,41 @@
         <el-button type="primary" @click="dialogVisibleSentence1 = false">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog title="教师提交作业" :visible.sync="dialogVisibleWorks" :append-to-body="true" width="500px"
+      :before-close="handleClose" class="dialog_change">
+      <div class="marginT">
+        <div class="w_name">学生姓名:<span>{{ sStudent.student }}</span></div>
+        <div>上传文件</div>
+        <div class="chapter_add" @click="addImg($event)" v-if="studyJuri[0].cover.length == 0">
+          <div class="up_photo">
+            <img src="../assets/uploadImg2.png" alt />
+          </div>
+          <input type="file"
+            accept="video/mp4, video/quicktime, video/x-msvideo,application/pdf, application/.ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, image/*"
+            capture="camera" style="display: none" @change="beforeUpload1($event, 1)" />
+        </div>
+        <div class="chapter_add" style="
+                display: flex;
+                width: 100%;
+                flex-direction: row;
+                flex-wrap: wrap;
+                justify-content: flex-start;
+                padding: 15px 0;
+              " v-if="studyJuri[0].cover.length > 0">
+          <div class="upCover">
+            <img :src="studyJuri[0].cover[0].url" alt v-if="fileType == 0" />
+            <img :src="word" alt v-else-if="fileType == 1" />
+            <img :src="video" alt v-else />
+            <span class="picName">{{ studyJuri[0].cover[0].name }}</span>
+
+            <div class="deleteWord" @click="clean(1)">
+              <img src="../assets/icon/deleteWorks.png" alt />
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="upload_send" @click="addCourseWorksTeacher(taskCount)">提交</div>
+    </el-dialog>
     <ImgDraw :drawShow="drawShow" @closeDraw="closeDraw" @addImgDraw="addImgDraw" :bg="bg"></ImgDraw>
   </div>
 </template>
@@ -3035,6 +3076,8 @@ export default {
       dialogVisibleScore: false,
       dialogVisibleSentence: false,
       dialogVisibleSentence1: false,
+      dialogVisibleWorks: false,
+      sStudent: {},
       bzText: "",
       commentDetail: [],
       selectAnswer: [],
@@ -3445,6 +3488,45 @@ export default {
           });
       }
     },
+    addCourseWorksTeacher(i) {
+      var typesql;
+      if (this.fileType === 0) {
+        typesql = 1;
+      } else if (this.fileType === 1) {
+        typesql = 4;
+      } else {
+        typesql = 5;
+      }
+
+      let params = [
+        {
+          uid: this.sStudent.userid,
+          cid: this.id,
+          stage: this.courseType,
+          task: i,
+          tool: this.toolindex,
+          content: this.studyJuri[0].cover[0].url,
+          type: typesql,
+          ateacher: this.userid
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addCourseWorksTeacher", params)
+        .then((res) => {
+          this.$message({
+            message: "提交成功",
+            type: "success",
+          });
+          this.studyJuri[0].cover = [];
+          this.dialogVisibleWorks = false;
+          this.getCourseDetail();
+        })
+        .catch((err) => {
+          this.$message.error("提交失败");
+          console.error(err);
+        });
+
+    },
     selectWorksStudent() {
       let params = {
         oid: this.oid,
@@ -3464,12 +3546,12 @@ export default {
               studentK = studentK.join(",");
               for (var j = 0; j < a.length; j++) {
                 if (studentK.indexOf(a[j].userid) == -1) {
-                  this.noWorksS[i].push({ student: a[j].name });
+                  this.noWorksS[i].push({ student: a[j].name, userid: a[j].userid });
                 }
               }
             } else {
               for (var k = 0; k < a.length; k++) {
-                this.noWorksS[i].push({ student: a[k].name });
+                this.noWorksS[i].push({ student: a[k].name, userid: a[k].userid });
               }
             }
           }
@@ -3574,7 +3656,7 @@ export default {
                       b[j].content
                         .split(".")
                       [b[j].content.split(".").length - 1].toLocaleUpperCase()
-                    ) != -1
+                    ) != -1 && a[i].tool[0] == 16
                   ) {
                     this.workStudent[i].push({
                       works: b[j].content,
@@ -3591,7 +3673,7 @@ export default {
                       b[j].content
                         .split(".")
                       [b[j].content.split(".").length - 1].toLocaleUpperCase()
-                    ) != -1
+                    ) != -1 && a[i].tool[0] == 16
                   ) {
                     this.workStudent[i].push({
                       userid: b[j].userid,
@@ -3625,7 +3707,18 @@ export default {
                       type: 5,
                       time: b[j].time,
                     });
-                  } else {
+                  } else if (b[j].type == 1 && a[i].tool[0] == b[j].atool){
+                    this.workStudent[i].push({
+                      works: b[j].content,
+                      sName: b[j].name,
+                      score: b[j].score,
+                      img: b[j].img,
+                      type: 0,
+                      time: b[j].time,
+                      userid: b[j].userid,
+                      wid: b[j].id,
+                    });
+                  } else if (b[j].type == 1 && !parseInt(b[j].atool)){
                     this.workStudent[i].push({
                       works: b[j].content,
                       sName: b[j].name,
@@ -4164,10 +4257,11 @@ export default {
                       b[j].content
                         .split(".")
                       [b[j].content.split(".").length - 1].toLocaleUpperCase()
-                    ) != -1
+                    ) != -1 && a[i].tool[0] == 16
                   ) {
                     this.worksStudent[i].push({
                       userid: b[j].userid,
+                      ateacher: b[j].ateacher,
                       wid: b[j].id,
                       works: b[j].content,
                       sName: b[j].name,
@@ -4185,10 +4279,11 @@ export default {
                       b[j].content
                         .split(".")
                       [b[j].content.split(".").length - 1].toLocaleUpperCase()
-                    ) != -1
+                    ) != -1 && a[i].tool[0] == 16
                   ) {
                     this.worksStudent[i].push({
                       userid: b[j].userid,
+                      ateacher: b[j].ateacher,
                       wid: b[j].id,
                       works: b[j].content,
                       sName: b[j].name,
@@ -4204,6 +4299,7 @@ export default {
                   } else if (b[j].type == 6) {
                     this.worksStudent[i].push({
                       userid: b[j].userid,
+                      ateacher: b[j].ateacher,
                       wid: b[j].id,
                       works: b[j].content,
                       sName: b[j].name,
@@ -4219,6 +4315,7 @@ export default {
                   } else if (b[j].type == 7) {
                     this.worksStudent[i].push({
                       userid: b[j].userid,
+                      ateacher: b[j].ateacher,
                       wid: b[j].id,
                       works: b[j].content,
                       sName: b[j].name,
@@ -4231,9 +4328,26 @@ export default {
                       isLikes: isLikes,
                       commentJson: commentJson,
                     });
-                  } else {
+                  } else if (b[j].type == 1 && a[i].tool[0] == b[j].atool){
                     this.worksStudent[i].push({
                       userid: b[j].userid,
+                      ateacher: b[j].ateacher,
+                      wid: b[j].id,
+                      works: b[j].content,
+                      sName: b[j].name,
+                      type: 0,
+                      time: b[j].time,
+                      score: b[j].score,
+                      img: b[j].img,
+                      likesCount: likesCount,
+                      commentCount: commentCount,
+                      isLikes: isLikes,
+                      commentJson: commentJson,
+                    }); 
+                  }else if (b[j].type == 1 && !parseInt(b[j].atool)){
+                    this.worksStudent[i].push({
+                      userid: b[j].userid,
+                      ateacher: b[j].ateacher,
                       wid: b[j].id,
                       works: b[j].content,
                       sName: b[j].name,
@@ -4250,6 +4364,7 @@ export default {
                 } else if (b[j].type == 3 && a[i].tool[0] == 15) {
                   this.worksStudent[i].push({
                     userid: b[j].userid,
+                    ateacher: b[j].ateacher,
                     wid: b[j].id,
                     works: b[j].content,
                     sName: b[j].name,
@@ -4266,6 +4381,7 @@ export default {
                   //问卷
                   this.worksStudent[i].push({
                     userid: b[j].userid,
+                    ateacher: b[j].ateacher,
                     wid: b[j].id,
                     works: b[j].content,
                     sName: b[j].name,
@@ -4282,6 +4398,7 @@ export default {
                   //选择题
                   this.worksStudent[i].push({
                     userid: b[j].userid,
+                    ateacher: b[j].ateacher,
                     wid: b[j].id,
                     works: b[j].content,
                     sName: b[j].name,
@@ -4298,6 +4415,7 @@ export default {
                   //选择题
                   this.worksStudent[i].push({
                     userid: b[j].userid,
+                    ateacher: b[j].ateacher,
                     wid: b[j].id,
                     works: b[j].content,
                     sName: b[j].name,
@@ -4465,29 +4583,29 @@ export default {
         "SVG",
         "APNG",
       ];
-      if (
-        b.indexOf(
-          file.name
-            .split(".")
-          [file.name.split(".").length - 1].toLocaleUpperCase()
-        ) != -1
-      ) {
-        if (file.size / 1024 / 1024 > 10) {
-          this.$message.error("上传文件大于10兆,请重新选择文件!");
-          return;
-        }
-      } else if (
-        excelA.indexOf(
-          file.name
-            .split(".")
-          [file.name.split(".").length - 1].toLocaleUpperCase()
-        ) != "-1"
-      ) {
-        if (file.size / 1024 / 1024 > 5) {
-          this.$message.error("添加成上传文件大于5兆,请重新选择文件!");
-          return;
-        }
-      }
+      // if (
+      //   b.indexOf(
+      //     file.name
+      //       .split(".")
+      //     [file.name.split(".").length - 1].toLocaleUpperCase()
+      //   ) != -1
+      // ) {
+      //   if (file.size / 1024 / 1024 > 10) {
+      //     this.$message.error("上传文件大于10兆,请重新选择文件!");
+      //     return;
+      //   }
+      // } else if (
+      //   excelA.indexOf(
+      //     file.name
+      //       .split(".")
+      //     [file.name.split(".").length - 1].toLocaleUpperCase()
+      //   ) != "-1"
+      // ) {
+      //   if (file.size / 1024 / 1024 > 5) {
+      //     this.$message.error("添加成上传文件大于5兆,请重新选择文件!");
+      //     return;
+      //   }
+      // }
 
       if (
         photoA.indexOf(
@@ -4542,45 +4660,45 @@ export default {
               _this.$message.error("上传失败");
             } else {
               // _this.$message.success('上传成功')
+              var b = ["PDF", "DOC", "DOCX", "PPT", "PPTX", "XLSX", "XLS"];
+              var c = [
+                "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 (type == 1) {
                 _this.studyJuri[0].cover.push({
                   name: file.name,
                   url: data.Location,
                   uid: file.uid,
                 });
-                var b = ["PDF", "DOC", "DOCX", "PPT", "PPTX", "XLSX", "XLS"];
-                var c = [
-                  "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 (
                   c.indexOf(
                     _this.studyJuri[0].cover[0].url
@@ -6230,6 +6348,23 @@ export default {
         this.dialogVisibleSentence = true;
       }
     },
+    teacherWorkSubmit(t, i, index, s) {
+      this.sStudent = s
+      this.toolindex = i;
+      if (this.tType !== "1" && this.tType !== "4") {
+        return
+      }
+      if (t == 16) {
+        // if (this.workCount > 0) {
+        //   this.updateCount(this.workCount, t);
+        // } else {
+        //   this.workCount++;
+        //   a = this.workCount;
+        //   this.toolsCount(a, t);
+        // }
+        this.dialogVisibleWorks = true;
+      }
+    },
     setRightAnswer(s, i, j) {
       for (var q = 0; q < this.sentenceList[i].chooseSenList.length; q++) {
         if (
@@ -8404,6 +8539,7 @@ export default {
   color: #4078dd;
   margin: 10px 0;
   font-size: 16px;
+  position: relative;
 }
 
 .worksAnswer>img {
@@ -9365,4 +9501,21 @@ ol {
   margin: 10px auto;
   word-break: break-word;
 }
+
+.w_name {
+  margin-bottom: 10px;
+}
+
+.w_name span {
+  font-size: 16px;
+}
+
+.w_teachert {
+  width: 50px !important;
+  position: absolute;
+  height: auto !important;
+  z-index: 10;
+  right: 25px;
+  top: -25px;
+}
 </style>

+ 33 - 18
src/components/tools/wangEnduit.vue

@@ -1,10 +1,10 @@
-<template lang="html">  
-  <div class="editor"  >  
-    <div ref="toolbar" class="toolbar">  
-    </div>  
-    <div ref="editor" class="text">  
-    </div>  
-  </div>  
+<template lang="html">
+  <div class="editor">
+    <div ref="toolbar" class="toolbar">
+    </div>
+    <div ref="editor" class="text">
+    </div>
+  </div>
 </template>  
   
 <script>
@@ -64,25 +64,25 @@ export default {
         "head", //标题
         "bold", //加粗
         "fontSize", //字体大小
-        "fontName", //字体
-        "italic", //斜体
-        "underline", //下划线
-        "strikeThrough", //删除线
+        // "fontName", //字体
+        // "italic", //斜体
+        // "underline", //下划线
+        // "strikeThrough", //删除线
         "indent", //缩进
-        "lineHeight", //行高
+        // "lineHeight", //行高
         // "foreColor",
         // "backColor",
         // "link",
         "list",
-        "todo",
+        // "todo",
         "justify",
-        "quote",
+        // "quote",
         // "emoticon",
         "image",
         // "video",
-        // "table",//表格
+        "table",
         // "code",
-        // "splitLine",//分割线
+        // "splitLine",
         "undo",
         "redo",
       ];
@@ -115,7 +115,7 @@ export default {
                 file.name.split(".")[0] +
                 new Date().getTime() +
                 "." +
-                file.name.split(".")[file.name.split(".").length-1],
+                file.name.split(".")[file.name.split(".").length - 1],
               ContentType: file.type,
               Body: file,
               "Access-Control-Allow-Credentials": "*",
@@ -133,7 +133,7 @@ export default {
                 // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
               })
               .send(function (err, data) {
-                 loading.close();
+                loading.close();
                 if (err) {
                   that.$message.error("上传失败");
                 } else {
@@ -144,6 +144,19 @@ export default {
           }
         }
       };
+      //配置 自定义处理粘贴的文本内容
+      this.editor.config.pasteTextHandle = function (content) {
+        if (content == '' && !content) return ''
+        var str = content
+        str = str.replace(/<xml>[\s\S]*?<\/xml>/ig, '')
+        str = str.replace(/<style>[\s\S]*?<\/style>/ig, '')
+        str = str.replace(/<\/?[^>]*>/g, '')
+        str = str.replace(/[ | ]*\n/g, '\n')
+        str = str.replace(/&nbsp;/ig, '')
+        // console.log('****', content)
+        // console.log('****', str)
+        return str
+      }; 
       this.editor.config.onchange = (html) => {
         this.info_ = html; // 绑定当前逐渐地值
         this.$emit("change", this.info_); // 将内容同步到父组件中
@@ -162,9 +175,11 @@ export default {
   position: relative;
   z-index: 0;
 }
+
 .toolbar {
   border: 1px solid #ccc;
 }
+
 .text {
   border: 1px solid #ccc;
   height: 230px;

+ 7 - 0
src/router/index.js

@@ -18,6 +18,7 @@ import study from '@/components/study'
 import liveRoom from '@/components/liveRoom'
 import liveProjectDetail from '@/components/liveProjectDetail'
 import audioDemo from '@/components/audioDemo'
+import cameraDemo from '@/components/cameraDemo'
 import studyStudent from '@/components/studyStudent'
 import studyStudentGM from '@/components/GM/studyStudentGM'
 import pdf from '@/components/pdf'
@@ -125,6 +126,12 @@ export default new Router({
             component: audioDemo,
             requireAuth: ''
         },
+        {
+            path: '/cameraDemo',
+            name: 'cameraDemo',
+            component: cameraDemo,
+            requireAuth: ''
+        },
         {
             path: '/studyStudent',
             name: 'studyStudent',