Browse Source

修改工具及作业

zengyicheng 3 năm trước cách đây
mục cha
commit
14b4195195
2 tập tin đã thay đổi với 301 bổ sung60 xóa
  1. 1 0
      src/components/pages/classRoom.vue
  2. 300 60
      src/components/pages/liveRoom.vue

+ 1 - 0
src/components/pages/classRoom.vue

@@ -114,6 +114,7 @@ export default {
       course: [
         {
           cover: [],
+          courseId:"9a4e8dbe-132e-438e-97db-b07eb01fa04c",
           title: "湖心亭看雪可可乐博模拟展示课件",
           time: new Date().getTime(),
         },

+ 300 - 60
src/components/pages/liveRoom.vue

@@ -15,17 +15,26 @@
         <div class="logoLive">
           <img src="../../assets/icon/logo.png" alt />
         </div>
-        <div style="color: #fff; line-height: 45px; padding-left: 15px">湖心亭看雪可可乐博模拟展示课件</div>
+        <div style="color: #fff; line-height: 45px; padding-left: 15px">
+          湖心亭看雪可可乐博模拟展示课件
+        </div>
       </div>
     </div>
     <div class="isNoOther">
-      <div class="imgMiddle" :class="type !== 0 || steps > 0 ? 'imghalf' : 'imgMiddle'">
+      <div
+        class="imgMiddle"
+        :class="type !== 0 || steps > 0 ? 'imghalf' : 'imgMiddle'"
+      >
         <!-- <img src="../../assets/icon/kc1.png" alt /> -->
         <!-- <iframe
           style="width: 100%; height: 100%; border: none"
           src="https://view.officeapps.live.com/op/view.aspx?src=https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/0701%E5%AE%9E%E6%97%B6%E8%AF%BE%E5%A0%82%E6%A8%A1%E6%8B%9F%E6%BC%94%E7%A4%BA%E8%AF%BE%E4%BB%B61656644341323.pptx"
         ></iframe>-->
-        <pdf :pdfUrl="pdfUrl" style="width: 100%; height: 100%;" :getPage="getPage"></pdf>
+        <pdf
+          :pdfUrl="pdfUrl"
+          style="width: 100%; height: 100%"
+          :getPage="getPage"
+        ></pdf>
       </div>
       <div
         v-if="type == 1 || type == 2"
@@ -38,8 +47,14 @@
           padding: 0px 0 50px;
         "
       >
-        <div style="background: #fff; height: 92%; width: 96%; margin: 10px auto">
-          <div style="color: #bfbfbf; padding: 15px 0 20px 25px; font-size: 20px">答题查看</div>
+        <div
+          style="background: #fff; height: 92%; width: 96%; margin: 10px auto"
+        >
+          <div
+            style="color: #bfbfbf; padding: 15px 0 20px 25px; font-size: 20px"
+          >
+            答题查看
+          </div>
 
           <div class="answerBox" v-if="type == 1">
             <div class="answerTimuBox" v-for="item in 1" :key="item">
@@ -52,7 +67,9 @@
                 <span>C</span>
                 <span>D</span>
               </div>
-              <el-button style="margin: 0 auto" @click="showMember(item)">开始答题</el-button>
+              <el-button style="margin: 0 auto" @click="showMember(item)"
+                >开始答题</el-button
+              >
             </div>
           </div>
           <div class="answerBox" v-else>
@@ -61,7 +78,9 @@
                 :class="{ pAnswer: item.is == 2 }"
                 v-for="(item, index) in studentArray"
                 :key="index"
-              >{{ item.name }}</div>
+              >
+                {{ item.name }}
+              </div>
             </div>
             <div class="memberBox" v-else>
               <div
@@ -69,10 +88,19 @@
                 v-for="(item, index) in studentArray2"
                 :key="index"
                 @click="whoAnswer(item, index)"
-              >{{ item.name }}</div>
+              >
+                {{ item.name }}
+              </div>
+            </div>
+            <div
+              style="color: #948bdc; padding-top: 15px"
+              v-if="answerType == 1"
+            >
+              正在答题......
+            </div>
+            <div class="viewSta" @click="lookData" v-if="answerType == 1">
+              查看数据统计
             </div>
-            <div style="color: #948bdc; padding-top: 15px" v-if="answerType == 1">正在答题......</div>
-            <div class="viewSta" @click="lookData" v-if="answerType == 1">查看数据统计</div>
           </div>
         </div>
       </div>
@@ -95,7 +123,7 @@
             position: relative;
           "
         >
-          <div class="close" @click="(steps = 0), (type = 0)">
+          <div class="close" @click="(steps = 0), (type = 0),answerType = 0">
             <img src="../../assets/icon/close.png" alt />
           </div>
           <div style="color: #bfbfbf; padding: 15px 0 20px 25px">数据统计</div>
@@ -127,7 +155,7 @@
           position: relative;
           margin: 10px 15px;
         "
-        v-if="steps == 1"
+        v-if="toolsList.length > 0"
       >
         <!-- <div
           style="
@@ -140,22 +168,145 @@
         >
           选择工具
         </div>-->
-        <div v-if="toolCount == 0" style="height: 90%">
+
+        <div
+          v-if="toolsList[0].tools.length == 1"
+          style="height: 100%; width: 100%"
+        >
+          <div
+            v-if="toolsList[0].tools[0] == 9"
+            style="height: 90%; width: 100%"
+          >
+            选择题
+          </div>
+          <div
+            v-if="toolsList[0].tools[0] == 10"
+            style="height: 90%; width: 100%"
+          >
+            倒计时
+          </div>
+          <div
+            v-if="toolsList[0].tools[0] == 11"
+            style="height: 90%; width: 100%"
+          >
+            问答题
+          </div>
+          <div
+            v-if="toolsList[0].tools[0] == 12"
+            style="height: 90%; width: 100%"
+          >
+            选人回答
+          </div>
+          <div
+            v-if="toolsList[0].tools[0] == 13"
+            style="height: 90%; width: 100%"
+          >
+            分小组
+          </div>
+          <div
+            v-if="toolsList[0].tools[0] == 14"
+            style="height: 90%; width: 100%"
+          >
+            作业评价
+          </div>
+        </div>
+        <div v-else style="height: 100%; width: 100%">
+          <div
+            v-if="toolsList[0].tools[howTools] == 1"
+            style="height: 90%; width: 100%"
+          >
+            <iframe
+              style="width: 100%; height: 100%; border: none"
+              src="https://iwb.cocorobo.cn/"
+            ></iframe>
+          </div>
+          <div
+            v-if="toolsList[0].tools[howTools] == 2"
+            style="height: 90%; width: 100%"
+          >
+            <iframe
+              style="width: 100%; height: 100%; border: none"
+              src="https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/note"
+            ></iframe>
+          </div>
+          <div
+            v-if="toolsList[0].tools[howTools] == 3"
+            style="height: 90%; width: 100%"
+          >
+            <iframe
+              style="width: 100%; height: 100%; border: none"
+              src="https://cloud.cocorobo.cn/kityminder-editor/dist/index.html"
+            ></iframe>
+          </div>
+          <div
+            v-if="toolsList[0].tools[howTools] == 4"
+            style="height: 90%; width: 100%"
+          >
+            <iframe
+              style="width: 100%; height: 100%; border: none"
+              src="https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/ask"
+            ></iframe>
+          </div>
+          <div
+            v-if="toolsList[0].tools[howTools] == 6"
+            style="height: 90%; width: 100%"
+          >
+            <iframe
+              style="width: 100%; height: 100%; border: none"
+              src="https://cloud.cocorobo.cn/Office/Word/WordEditArea.htm"
+            ></iframe>
+          </div>
+          <div
+            v-if="toolsList[0].tools[howTools] == 7"
+            style="height: 90%; width: 100%"
+          >
+            <iframe
+              style="width: 100%; height: 100%; border: none"
+              src="https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/Grid"
+            ></iframe>
+          </div>
+          <div
+            v-if="toolsList[0].tools[howTools] == 8"
+            style="height: 90%; width: 100%"
+          >
+            <iframe
+              style="width: 100%; height: 100%; border: none"
+              src="https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/library"
+            ></iframe>
+          </div>
+          <div
+            v-if="toolsList[0].tools[howTools] == 10"
+            style="height: 90%; width: 100%"
+          >
+            <div>倒计时</div>
+          </div>
+          <div
+            v-if="toolsList[0].tools[howTools] == 13"
+            style="height: 90%; width: 100%"
+          >
+            <div>分小组</div>
+          </div>
+        </div>
+        <div class="nextStepOne" @click="nextTool">下一步</div>
+        <!-- <div v-if="toolCount == 0" style="height: 90%">
           <iframe
             style="width: 100%; height: 100%; border: none"
             src="https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/Grid"
           ></iframe>
         </div>
         <div v-if="toolCount == 1" style="height: 90%">
-          <iframe style="width: 100%; height: 100%; border: none" src="https://iwb.cocorobo.cn/"></iframe>
+          <iframe
+            style="width: 100%; height: 100%; border: none"
+            src="https://iwb.cocorobo.cn/"
+          ></iframe>
         </div>
         <div v-if="toolCount == 2" style="height: 90%">
           <iframe
             style="width: 100%; height: 100%; border: none"
             src="https://cloud.cocorobo.cn/kityminder-editor/dist/index.html"
           ></iframe>
-        </div>
-        <div class="nextStepOne" @click="nextTool">下一步</div>
+        </div> -->
+        <!-- <div class="nextStepOne" @click="nextTool">下一步</div> -->
       </div>
 
       <div
@@ -179,33 +330,35 @@
             height: 25px;
             line-height: 25px;
           "
-        >查看作业</div>
+        >
+          查看作业
+        </div>
         <div class="workBox">
-          <div class="works" v-for="w in 3" :key="w">
+          <div class="works" v-for="(w, wIndex) in worksList" :key="wIndex">
             <div class="workImg">
-              <img :src="mr" alt />
+              <img :src="w.upload.upImg ? w.upload.upImg[0].url : mr" alt />
             </div>
             <div class="workDetail">
               <div class="workLeft">
                 <div class="workTx">
                   <img src="../../assets/avatar.png" alt />
                 </div>
-                <div class="workName">约翰强尼</div>
+                <div class="workName">{{ w.sName }}</div>
               </div>
-              <div class="workRight">07-04 18:21</div>
+              <div class="workRight">{{ w.time }}</div>
             </div>
           </div>
         </div>
-        <div class="returnButton" @click=" (steps = 0), (type = 0)">返回</div>
+        <div class="returnButton" @click="(steps = 0), (type = 0)">返回</div>
       </div>
     </div>
 
     <div class="blackBottomB">
       <div style="display: flex">
-        <div class="blackButton" @click="answerWork">开始答题</div>
-        <div class="blackButton" @click="(steps = 1), (type = 0)">查看工具</div>
-        <div class="blackButton" @click="checkStudentAnswer">选择学生回答</div>
-        <div class="blackButton" @click=" (steps = 2), (type = 0)">查看作业</div>
+        <div class="blackButton" @click="answerWork" v-if="pageBlock == 3">开始答题</div>
+        <!-- <div class="blackButton" @click="(steps = 1), (type = 0)">查看工具</div> -->
+        <div class="blackButton" @click="checkStudentAnswer" v-if="pageBlock == 8">选择学生回答</div>
+        <div class="blackButton" @click="(steps = 2), (type = 0)" v-if="pageBlock == 11 || pageBlock == 12 ">查看作业</div>
       </div>
       <!-- <div
         class="blackButton"
@@ -223,9 +376,9 @@
       :before-close="handleClose"
       class="dialog_diy"
     >
-      <div
-        style="text-align: center; padding: 20px 0 50px 0; font-size: 18px"
-      >是否让“{{ answerStudent }}”同学进行单独答题?</div>
+      <div style="text-align: center; padding: 20px 0 50px 0; font-size: 18px">
+        是否让“{{ answerStudent }}”同学进行单独答题?
+      </div>
       <div
         style="
           width: 200px;
@@ -239,7 +392,9 @@
           cursor: pointer;
         "
         @click="dialogVisible = false"
-      >确定</div>
+      >
+        确定
+      </div>
     </el-dialog>
     <el-dialog
       :visible.sync="dialogVisible1"
@@ -248,7 +403,9 @@
       :before-close="handleClose"
       class="dialog_diy"
     >
-      <div style="text-align: center; padding: 20px 0 50px 0; font-size: 18px">正在开发中!</div>
+      <div style="text-align: center; padding: 20px 0 50px 0; font-size: 18px">
+        正在开发中!
+      </div>
       <div
         style="
           width: 200px;
@@ -262,7 +419,9 @@
           cursor: pointer;
         "
         @click="dialogVisible1 = false"
-      >确定</div>
+      >
+        确定
+      </div>
     </el-dialog>
     <el-dialog
       :visible.sync="dialogVisible2"
@@ -271,7 +430,9 @@
       :before-close="handleClose"
       class="dialog_diy"
     >
-      <div style="text-align: center; padding: 20px 0 50px 0; font-size: 18px">课程结束后才有报告!</div>
+      <div style="text-align: center; padding: 20px 0 50px 0; font-size: 18px">
+        课程结束后才有报告!
+      </div>
       <div
         style="
           width: 200px;
@@ -285,7 +446,9 @@
           cursor: pointer;
         "
         @click="dialogVisible2 = false"
-      >确定</div>
+      >
+        确定
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -304,6 +467,7 @@ export default {
       isLoading: false,
       formLabelWidth: "100px",
       userid: this.$route.query.userid,
+      cid: this.$route.query.cid,
       oid: this.$route.query.oid,
       mr: require("../../assets/icon/kc1.png"),
       timu: [],
@@ -312,6 +476,7 @@ export default {
       // c: false,
       type: 0,
       steps: 0,
+      pageBlock:0,
       answerType: 1,
       dialogVisible: false,
       dialogVisible1: false,
@@ -379,18 +544,23 @@ export default {
       tools: [
         "",
         "",
-        { tools: [""] }, //选择题
-        { tools: [""] }, //倒计时
-        { tools: [""] }, //问答题
-        { tools: [""] }, //问答题
-        { tools: [""] }, //思维导图/电子白板
-        { tools: [""] }, //选人回答
-        { tools: [""] }, //倒计时、分小组
-        { tools: [""] }, //思维导图/电子白板/思维网格
-        { tools: [""] }, //查看作业
-        { tools: [""] }, //查看作业
+        { tools: [9] }, //选择题
+        { tools: [10] }, //倒计时
+        { tools: [11] }, //问答题
+        { tools: [11] }, //问答题
+        { tools: [3, 1] }, //思维导图/电子白板
+        { tools: [12] }, //选人回答
+        { tools: [10, 13] }, //倒计时、分小组
+        { tools: [3, 1, 7] }, //思维导图/电子白板/思维网格
+        { tools: [14] }, //查看作业
+        { tools: [14] }, //查看作业
         "", //查看作业
+        //1、电子白板 2、便签 3、思维导图 4、问卷调查 5、量规评分 6、协同文档 7、思维网格 8、素材库 9、选择题 10、倒计时 11、问答题 12、选人回答 13、分小组 14、老师对提交作业进行评价
       ],
+      howTools: 0,
+      worksDetail: [],
+      worksList: [],
+      toolsList: [],
     };
   },
   methods: {
@@ -420,13 +590,14 @@ export default {
     },
     //uuid生成
     guid() {
-      return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (
-        c
-      ) {
-        var r = (Math.random() * 16) | 0,
-          v = c == "x" ? r : (r & 0x3) | 0x8;
-        return v.toString(16);
-      });
+      return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
+        /[xy]/g,
+        function (c) {
+          var r = (Math.random() * 16) | 0,
+            v = c == "x" ? r : (r & 0x3) | 0x8;
+          return v.toString(16);
+        }
+      );
     },
     time() {
       if (!this.now) {
@@ -465,13 +636,23 @@ export default {
       }
     },
     nextTool() {
-      if (this.toolCount < 2) {
-        this.toolCount++;
+      if (this.toolsList[0].tools.length > 1) {
+        if (this.howTools < this.toolsList[0].tools.length - 1) {
+          this.howTools++;
+        } else if (this.howTools == this.toolsList[0].tools.length - 1) {
+          this.toolsList = [];
+        }
       } else {
-        this.steps = 0;
-        this.type = 0;
-        this.toolCount = 0;
+        this.toolsList = [];
       }
+
+      // if (this.toolCount < 2) {
+      //   this.toolCount++;
+      // } else {
+      //   this.steps = 0;
+      //   this.type = 0;
+      //   this.toolCount = 0;
+      // }
     },
     answerWork() {
       this.type = 1;
@@ -535,6 +716,18 @@ export default {
     lookData() {
       this.type = 3;
     },
+    howPage(page) {
+      this.howTools = 0;
+      this.type = 0;
+      this.steps = 0;
+      this.answerType = 0;
+      if (this.toolsList.length > 0) {
+        this.toolsList = [];
+        this.toolsList.push({ tools: this.tools[page - 1].tools });
+      } else {
+        this.toolsList.push({ tools: this.tools[page - 1].tools });
+      }
+    },
     getPage(page) {
       console.log(page);
       let params = [
@@ -545,14 +738,59 @@ export default {
       this.ajax
         .post(this.$store.state.api + "updatePptPage", params)
         .then((res) => {
-          
+          this.pageBlock = page;
+          if (page == 3) {
+            this.howPage(page);
+          } else if (page == 4) {
+            this.howPage(page);
+          } else if (page == 5) {
+            this.howPage(page);
+          } else if (page == 6) {
+            this.howPage(page);
+          } else if (page == 7) {
+            this.howPage(page);
+          } else if (page == 8) {
+            this.howPage(page);
+          } else if (page == 9) {
+            this.howPage(page);
+          } else if (page == 10) {
+            this.howPage(page);
+          } else if (page == 11) {
+            this.howPage(page);
+          } else if (page == 12) {
+            this.howPage(page);
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    selectSWork() {
+      let params = {
+        uid: "",
+        cid: this.cid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectSWork", params)
+        .then((res) => {
+          this.worksDetail = res.data[0];
+          for (var i = 0; i < this.worksDetail.length; i++) {
+            this.worksList.push({
+              upload: JSON.parse(this.worksDetail[i].upload)[0],
+              sName: this.worksDetail[i].username,
+              time: this.worksDetail[i].time,
+            });
+          }
         })
         .catch((err) => {
+          this.$message.error("查询失败");
           console.error(err);
         });
     },
   },
-  created() {},
+  created() {
+    this.selectSWork();
+  },
 };
 </script>
 
@@ -794,9 +1032,11 @@ export default {
   border: 1px solid #ececec;
   height: 160px;
   margin: 0 10px 10px 0;
+  /* cursor: pointer; */
 }
 .workImg {
-  width: 100%;
+  width: 214px;
+  height: 117px;
 }
 .workDetail {
   display: flex;
@@ -804,7 +1044,7 @@ export default {
   flex-wrap: nowrap;
   align-items: center;
   justify-content: space-between;
-  padding-top: 3px;
+  padding-top: 8px;
 }
 .workLeft {
   display: flex;