lsc 2 سال پیش
والد
کامیت
b633b2968e
2فایلهای تغییر یافته به همراه105 افزوده شده و 40 حذف شده
  1. 74 20
      src/components/courseDetail.vue
  2. 31 20
      src/components/studyStudent.vue

+ 74 - 20
src/components/courseDetail.vue

@@ -6,17 +6,17 @@
           <div v-if="tType != 4" class="return" @click.stop="
             goTo(
               '/index?userid=' +
-                userid +
-                '&oid=' +
-                oid +
-                '&org='+
-                    org +
-                '&cid=' +
-                classId +
-                '&tType=' +
-                tType +
-                '&screenType=' +
-                screenType
+              userid +
+              '&oid=' +
+              oid +
+              '&org=' +
+              org +
+              '&cid=' +
+              classId +
+              '&tType=' +
+              tType +
+              '&screenType=' +
+              screenType
             )
           ">
             返回
@@ -24,9 +24,9 @@
           </div>
           <div class="box_course">
             <div class="wheel">
-              <img style="object-fit: contain" :src="
+              <img style="object-fit: cover" :src="
                 this.courseDetail.cover != null &&
-                this.courseDetail.cover != ''
+                  this.courseDetail.cover != ''
                   ? JSON.parse(this.courseDetail.cover).length > 0
                     ? JSON.parse(this.courseDetail.cover)[0].url
                     : mr
@@ -49,7 +49,7 @@
               <div class="cType" style="font-size: 18px; color: #6c6c6c">
                 <div style="min-width:150px">
                   创建者:<span style="color: #000">{{
-                  courseDetail.username
+                      courseDetail.username
                   }}</span>
                 </div>
                 <div class="Tname" v-if="Tname.length > 0">
@@ -57,12 +57,19 @@
                   }}</span>
                 </div>
               </div>
-              <div class="people">
-                <div class="man">
-                  <img src="../assets/people.png" alt />
+              <div class="cType" style="font-size: 18px; color: #6c6c6c">
+                <div style="display:flex; align-items: center;">
+                  <div>参与人数:</div>
+                  <div class="man">
+                    <img src="../assets/people.png" alt />
+                  </div>
+                  <div class="person" style=" color: #000">
+                    {{ courseDetail.vcount != null ? courseDetail.vcount : 0 }}人
+                  </div>
                 </div>
-                <div class="person">
-                  {{ courseDetail.vcount != null ? courseDetail.vcount : 0 }}人
+                <div class="Tname" v-if="courseDetail.classname">
+                  授课班级:<span style="margin: 0 5px; color: #000">{{ courseDetail.classname
+                  }}</span>
                 </div>
               </div>
 
@@ -83,6 +90,8 @@
               <div :title="item.dyName">{{ item.dyName }}</div>
               <div>{{ item.chapterInfo[0].taskJson.length }}个任务</div>
             </div>
+            <div v-if="tType == 1 || tType == 4">
+            </div>
           </div>
         </div>
 
@@ -138,6 +147,7 @@ export default {
       userinfo: [],
       mr: require("../assets/icon/wheel.png"),
       rw: 0,
+      chaptersJson: {},
     };
   },
   methods: {
@@ -281,6 +291,50 @@ export default {
           for (var z = 0; z < this.chapInfo.length; z++) {
             this.rw += this.chapInfo[z].chapterInfo[0].taskJson.length;
           }
+
+
+          // let _chapters = JSON.parse(a[0].chapters)
+          // let _works = res.data[3];
+
+          // let _chaptersJson = {
+          //   chapterState: _chapters,
+          //   state: {
+          //     stage: _chapters.length,
+          //     finish: 0,
+          //     learing: 0,
+          //   },
+          //   date: _works[0].time,
+          //   tool: [],
+          //   chapter: []
+          // }
+          // for (var i = 0; i < _chapters.length; i++) {
+          //   _chaptersJson.chapterState[i].isFinsh = false;
+          //   _chaptersJson.tool[i] = []
+          //   _chaptersJson.chapter[i] = []
+          //   for (var j = 0; j < _works.length; j++) {
+          //     if (i == _works[j].stage) {
+          //       _chaptersJson.chapterState[i].isFinsh = true;
+          //       _chaptersJson.state.finish++
+          //       break;
+          //     }
+          //   }
+          //   let el = _chapters[i].chapterInfo[0].taskJson;
+          //   for (var z = 0; z < el.length; z++) {
+          //     _chaptersJson.tool[i][z] = []
+          //     _chaptersJson.chapter[i][z] = []
+          //     let tools = el[z].toolChoose
+          //     for (var k = 0; k < tools.length; k++) {
+          //       // if (_chaptersJson.chapter[i][z].indexOf(tools[k].tool[0]) == -1) {
+          //       //   _chaptersJson.tool[i][z].push(tools[k].tool[0])
+          //       // }
+          //       _chaptersJson.chapter[i][z][k] = { tool: tools[k].tool[0] }
+          //       _chaptersJson.tool[i][z][k] = { tool: tools[k].tool[0] }
+          //     }
+          //   }
+          // }
+          // _chaptersJson.state.learing = _chaptersJson.state.stage - _chaptersJson.state.finish
+          // this.chaptersJson = _chaptersJson
+          // debugger
         })
         .catch((err) => {
           loading.close();
@@ -390,7 +444,7 @@ export default {
 
 .person {
   margin-left: 10px;
-  line-height: 18px;
+  /* line-height: 18px; */
 }
 
 .now_study {

+ 31 - 20
src/components/studyStudent.vue

@@ -2669,7 +2669,7 @@
         <el-button type="primary" @click="addStudentAsk" v-show="noteName == ''">确 定</el-button>
       </span>
     </el-dialog>
-    <el-dialog :title="noteName != '' ? noteName : '查看问卷'" :visible.sync="dialogVisibleChoice" :append-to-body="true"
+    <el-dialog :title="noteName != '' ? noteName : '查看选择题'" :visible.sync="dialogVisibleChoice" :append-to-body="true"
       width="1000px" :before-close="handleClose" class="dialog_diy dialog_diy3">
       <div>
         <!-- <div class="a_add_title" style="
@@ -4745,7 +4745,6 @@ export default {
           var d = res.data[1];
           var e = res.data[2];
           var f = res.data[3];
-
           for (var i = 0; i < a.length; i++) {
             this.worksStudent[i] = [];
             this.groupStudent[i] = [];
@@ -4777,6 +4776,7 @@ export default {
               var data = b[j];
               if (i == b[j].tool) {
                 if (data.type == 2 && a[i].tool[0] == 4) {
+                  // if(JSON.parse(data.content)[0].anwer){
                   var checkL = JSON.parse(data.content)[0].anwer.split(",");
                   for (var z = 0; z < checkL.length; z++) {
                     if (!this.checkJson[i][z]) {
@@ -4814,6 +4814,7 @@ export default {
                       : (this.checkJson[i][z].checkCount[
                         parseInt(checkL[z])
                       ] = 1);
+                    // }
                   }
                 } else if (data.type == 8 && a[i].tool[0] == 45) {
                   var checkL = JSON.parse(data.content)[0].anwer;
@@ -4865,18 +4866,20 @@ export default {
                       ) {
                         this.checkJson[i][z].rightPerson.push(data.name);
                       }
-                      this.checkJson[i][z].checkPerson[parseInt(checkL[z])]
-                        ? this.checkJson[i][z].checkPerson[
-                          parseInt(checkL[z])
-                        ].push(data.name)
-                        : (this.checkJson[i][z].checkPerson[
-                          parseInt(checkL[z])
-                        ] = [data.name]);
-                      this.checkJson[i][z].checkCount[parseInt(checkL[z])]
-                        ? this.checkJson[i][z].checkCount[parseInt(checkL[z])]++
-                        : (this.checkJson[i][z].checkCount[
-                          parseInt(checkL[z])
-                        ] = 1);
+                      if (parseInt(checkL[z]) || parseInt(checkL[z]) == 0) {
+                        this.checkJson[i][z].checkPerson[parseInt(checkL[z])]
+                          ? this.checkJson[i][z].checkPerson[
+                            parseInt(checkL[z])
+                          ].push(data.name)
+                          : (this.checkJson[i][z].checkPerson[
+                            parseInt(checkL[z])
+                          ] = [data.name]);
+                        this.checkJson[i][z].checkCount[parseInt(checkL[z])]
+                          ? this.checkJson[i][z].checkCount[parseInt(checkL[z])]++
+                          : (this.checkJson[i][z].checkCount[
+                            parseInt(checkL[z])
+                          ] = 1);
+                      }
                     }
                   }
                 } else if (data.type == 9 && a[i].tool[0] == 47) {
@@ -6516,7 +6519,11 @@ export default {
         });
     },
     addStudentAsk() {
-      for (var i = 0; i < this.radio.length; i++) {
+      if (!this.radio.length) {
+        this.$message.error("请选择选项");
+        return;
+      }
+      for (var i = 0; i < this.askJson.askCount; i++) {
         if (this.radio[i] !== 0 && !this.radio[i]) {
           this.$message.error("请选择选项");
           return;
@@ -6553,7 +6560,11 @@ export default {
         });
     },
     addStudentTest() {
-      for (var i = 0; i < this.radio.length; i++) {
+      if (!this.radio.length) {
+        this.$message.error("请选择选项");
+        return;
+      }
+      for (var i = 0; i < this.testJson.testCount; i++) {
         if (
           (this.radio[i] instanceof Array && !this.radio[i].length) ||
           (this.radio[i] !== 0 && !this.radio[i])
@@ -7431,10 +7442,10 @@ export default {
         this.captureScreen(_function, true);
         console.log('已点击允许,开启成功');
       }).catch(err => {
-          // 	console.log('浏览器不支持,请更换浏览器')
-          // } else {
-          this.captureScreen(_function, false);
-          console.log('请检查是否存在麦克风')
+        // 	console.log('浏览器不支持,请更换浏览器')
+        // } else {
+        this.captureScreen(_function, false);
+        console.log('请检查是否存在麦克风')
       })
     },
     /**