Browse Source

教师端

zengyicheng 2 years ago
parent
commit
3b98386fab

+ 1 - 0
src/App.vue

@@ -68,6 +68,7 @@ export default {
         "/library",
         "/classRoom",
         "/liveRoom",
+		"/addPPt",
         // "/course/addCourse",
         // "/ask",
         // "/ask/askList",

BIN
src/assets/icon/upImg.png


BIN
src/assets/icon/upPpt.png


+ 491 - 0
src/components/pages/addPPt.vue

@@ -0,0 +1,491 @@
+<template>
+  <div class="pb_content" style="background: #e6eaf0; margin: 0">
+    <div class="bread">
+      <el-breadcrumb
+        separator-class="el-icon-arrow-right"
+        style="margin-top: 15px"
+      >
+        <el-breadcrumb-item
+          :to="{ path: '/classRoom?userid=' + userid + '&oid=' + oid }"
+          >课堂备课</el-breadcrumb-item
+        >
+        <el-breadcrumb-item>创建课堂</el-breadcrumb-item>
+      </el-breadcrumb>
+    </div>
+    <div class="pb_content_body" style="height: 100%">
+      <div class="pptBody">
+        <div class="pptLeft">
+          <div>课堂备课</div>
+        </div>
+        <div class="pptRight">
+          <div v-if="steps == 0">
+            <div style="background: #fff">
+              <div class="pptName">课堂名称</div>
+              <div class="pptInput">
+                <span style="color: red; margin-right: 10px">*</span>
+                <el-input
+                  type="text"
+                  placeholder="请输入名称"
+                  v-model="upPPT[0].pName"
+                  maxlength="50"
+                  show-word-limit
+                >
+                </el-input>
+              </div>
+            </div>
+            <div style="background: #fff; margin-top: 10px">
+              <div class="pptName">上传课堂封面</div>
+              <div class="pptInput" @click="addImg($event)">
+                <span style="color: red; margin-right: 10px">*</span>
+                <div class="uploadImg" v-if="upPPT[0].pImg.length == 0">
+                  <div class="upImg">
+                    <img src="../../assets/icon/upImg.png" alt="" />
+                  </div>
+                  <div style="color: #bfc3c7">支持jpg/png格式</div>
+                  <input
+                    type="file"
+                    accept="image/png,image/jpg"
+                    style="display: none"
+                    @change="beforeUpload1($event, 1)"
+                  />
+                </div>
+                <div v-else>
+                  <div class="isUpImg">
+                    <img :src="upPPT[0].pImg[0].url" alt="" />
+                  </div>
+                  <div
+                    style="
+                      width: 300px;
+                      white-space: nowrap;
+                      overflow: hidden;
+                      text-overflow: ellipsis;
+                      margin: 10px 0;
+                      text-align: center;
+                    "
+                  >
+                    {{ upPPT[0].pImg[0].name }}
+                  </div>
+                </div>
+              </div>
+            </div>
+            <div style="background: #fff; margin-top: 10px">
+              <div class="pptName">上传备课PPT</div>
+              <div class="pptInput" @click="addImg($event)">
+                <span style="color: red; margin-right: 10px">*</span>
+                <div
+                  class="uploadImg"
+                  style="width: 320px; height: 200px"
+                  v-if="upPPT[0].pPPt.length == 0"
+                >
+                  <div class="upImg">
+                    <img src="../../assets/icon/upPpt.png" alt="" />
+                  </div>
+                  <div style="color: #bfc3c7">上传文件</div>
+                  <input
+                    type="file"
+                    accept="application/.ppt, .pptx"
+                    style="display: none"
+                    @change="beforeUpload1($event, 2)"
+                  />
+                </div>
+                <div v-else>
+                  <div class="isUpImg"><img :src="mr" alt="" /></div>
+                  <div
+                    style="
+                      width: 300px;
+                      white-space: nowrap;
+                      overflow: hidden;
+                      text-overflow: ellipsis;
+                      margin: 10px 0;
+                      text-align: center;
+                    "
+                  >
+                    {{ upPPT[0].pPPt[0].name }}
+                  </div>
+                </div>
+              </div>
+            </div>
+            <div class="rightButton" @click="steps = 1">下一步</div>
+          </div>
+          <div v-if="steps == 1">
+            <div style="background: #fff; margin-top: 10px">
+              <div class="pptName">上传备课PPT</div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div v-if="proVisible" class="mask">
+      <div class="progressBox">
+        <div class="lbox">
+          <img src="../../assets/loading.gif" />上传中,请稍后
+        </div>
+        <el-progress
+          :text-inside="true"
+          :stroke-width="20"
+          :percentage="progress"
+          style="width: 80%"
+        ></el-progress>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      dataVisible: false,
+      isLoading: false,
+      formLabelWidth: "100px",
+      userid: this.$route.query.userid,
+      oid: this.$route.query.oid,
+      total: 0,
+      tableData: [],
+      upPPT: [
+        {
+          pName: "",
+          pImg: [],
+          pPPt: [],
+        },
+      ],
+      now: "",
+      mr: require("../../assets/icon/pptImg.png"),
+      noneBtnImg: false,
+      proVisible: false,
+      progress: 0,
+      steps: 0,
+    };
+  },
+  methods: {
+    change(val) {
+      console.log(val);
+    },
+    goTo(path) {
+      this.$router.push(path);
+    },
+    tableRowClassName({ row, rowIndex }) {
+      if ((rowIndex + 1) % 2 === 0) {
+        return "even_row";
+      } else {
+        return "";
+      }
+    },
+    jump(cid) {
+      window.parent.postMessage({ cid: cid, type: "1" }, "*");
+    },
+    init() {},
+    handleClose(done) {
+      done();
+    },
+    handleRemove(file, fileList) {
+      console.log(file, fileList);
+    },
+    onExceed() {
+      this.$message.error("课程海报仅支持上传一张,请删除后再进行上传");
+    },
+    //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);
+        }
+      );
+    },
+    time() {
+      if (!this.now) {
+        this.now = new Date().getTime();
+        return true;
+      } else {
+        let time = new Date().getTime();
+        if (time - this.now > 3000) {
+          this.now = time;
+          return true;
+        } else {
+          return false;
+        }
+      }
+    },
+    addImg(e) {
+      var el = e.currentTarget;
+      el.getElementsByTagName("input")[0].click();
+    },
+    imgChange(file, fileList, type) {
+      if (type == 1) {
+        var _tmp = this.upPPT[0].pImg;
+      } else if (type == 2) {
+        var _tmp = this.upPPT[0].pPPt;
+      }
+      this.noneBtnImg = _tmp.length >= 1;
+    },
+    beforeUpload1(event, type) {
+      var file = event.target.files[0];
+      var credentials = {
+        accessKeyId: "AKIATLPEDU37QV5CHLMH",
+        secretAccessKey: "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",
+      }; //秘钥形式的登录上传
+      window.AWS.config.update(credentials);
+      window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+      var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+      var _this = this;
+      _this.progress = 0;
+      _this.proVisible = true;
+
+      if (file) {
+        var params = {
+          Key:
+            file.name.split(".")[0] +
+            new Date().getTime() +
+            "." +
+            file.name.split(".")[1],
+          ContentType: file.type,
+          Body: file,
+          "Access-Control-Allow-Credentials": "*",
+          ACL: "public-read",
+        }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+        var options = {
+          partSize: 2048 * 1024 * 1024,
+          queueSize: 2,
+          leavePartsOnError: true,
+        };
+        bucket
+          .upload(params, options)
+          .on("httpUploadProgress", function (evt) {
+            //这里可以写进度条
+            // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+            _this.progress = parseInt((evt.loaded * 80) / evt.total);
+          })
+          .send(function (err, data) {
+            _this.progress = 100;
+            setTimeout(() => {
+              _this.proVisible = false;
+            }, 1000);
+            if (err) {
+              var a = _this.$refs.upload1.uploadFiles;
+              a.splice(a.length - 1, a.length);
+              _this.$message.error("上传失败");
+            } else {
+              if (type == 1) {
+                _this.upPPT[0].pImg.push({
+                  name: file.name,
+                  url: data.Location,
+                  uid: file.uid,
+                });
+                _this.imgChange(null, null, type);
+              } else {
+                _this.upPPT[0].pPPt.push({
+                  name: file.name,
+                  url: data.Location,
+                  uid: file.uid,
+                });
+                _this.imgChange(null, null, type);
+              }
+
+              console.log(data.Location);
+            }
+          });
+      }
+    },
+    checkData() {
+      this.dataVisible = true;
+    },
+  },
+  created() {},
+};
+</script>
+
+<style scoped>
+.upImg > img,
+.isUpImg > img {
+  width: 100%;
+  height: 100%;
+}
+.xls_button {
+  font-size: 14px;
+  cursor: pointer;
+  text-decoration: underline;
+  color: rgb(34, 104, 188);
+}
+.student_search {
+  display: flex;
+  align-items: center;
+  width: calc(100% / 3);
+}
+.student_search span {
+  margin: 0 10px 0 0;
+  width: 65px;
+}
+.el_cards >>> .el-card__body {
+  height: 100%;
+}
+.student_input >>> .el-input__inner {
+  height: 40px;
+  width: 190px;
+  font-size: 13px;
+  padding: 0 10px;
+}
+.dialog_diy >>> .el-dialog__header {
+  padding: 9px 20px 10px;
+  background: #32455b !important;
+}
+.dialog_diy >>> .el-dialog__title {
+  color: #fff;
+  font-size: 15px;
+}
+.dialog_diy >>> .el-dialog__headerbtn {
+  top: 14px;
+}
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
+  color: #fff;
+}
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
+  color: #fff;
+}
+.dialog_diy >>> .el-dialog__body,
+.dialog_diy >>> .el-dialog__footer {
+  background: #f3f3f3;
+}
+.bread {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  justify-content: flex-end;
+  align-items: center;
+}
+.pptBody {
+  display: flex;
+  width: 100%;
+  height: 100%;
+  flex-direction: row;
+  align-items: flex-start;
+  flex-wrap: nowrap;
+  align-content: flex-start;
+}
+.pptLeft {
+  background: #fff;
+  width: 20%;
+  height: 55px;
+  border-radius: 5px;
+  line-height: 55px;
+  display: flex;
+  align-items: center;
+}
+.pptLeft > div {
+  border-left: 5px solid #418ae4;
+  height: 35px;
+  line-height: 35px;
+  padding-left: 20px;
+}
+.pptRight {
+  width: 80%;
+  margin-left: 25px;
+  background: #e6e9f0;
+  position: relative;
+  min-height: 100%;
+}
+.pptName {
+  height: 40px;
+  padding: 15px 0 0 20px;
+  border-bottom: 1px solid #f9f9f9;
+}
+.pptInput {
+  display: flex;
+  margin-top: 15px;
+  padding: 10px 0 20px 25px;
+  flex-direction: row;
+  align-items: center;
+}
+.pptInput >>> .el-input {
+  width: 80%;
+}
+
+.pptInput >>> .el-input__inner,
+.pptInput >>> .el-input__count-inner {
+  background: #f4f4f4 !important;
+}
+.uploadImg {
+  background: #f2f2f2;
+  width: 300px;
+  height: 150px;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-items: center;
+  justify-content: center;
+  cursor: pointer;
+}
+.upImg {
+  width: 60px;
+}
+.mask {
+  background-color: rgba(0, 0, 0, 0);
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 20000;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.progressBox {
+  width: 500px;
+  height: 180px;
+  background: #fff;
+  border-radius: 10px;
+  box-shadow: 0 0 6px 1px #bfbfbf;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+}
+.progressBox .lbox {
+  height: 100px;
+  font-size: 19px;
+  display: flex;
+  align-items: center;
+}
+
+.progressBox .lbox img {
+  width: 40px;
+  margin-right: 20px;
+}
+
+.progressBox >>> .el-progress-bar__outer {
+  background-color: #d1dfff !important;
+}
+.progressBox .lbox {
+  height: 100px;
+  font-size: 19px;
+  display: flex;
+  align-items: center;
+}
+
+.progressBox .lbox img {
+  width: 40px;
+  margin-right: 20px;
+}
+.isUpImg {
+  width: 300px;
+  height: 150px;
+}
+.rightButton {
+  background: #30adff;
+  width: 160px;
+  height: 40px;
+  text-align: center;
+  line-height: 40px;
+  color: #fff;
+  border-radius: 5px;
+  font-size: 12px;
+  position: absolute;
+  right: 0;
+  bottom: 17%;
+  cursor: pointer;
+}
+</style>

+ 3 - 2
src/components/pages/classRoom.vue

@@ -3,10 +3,11 @@
     <div class="pb_head top">
       <span>课堂备课</span>
       <div class="student_button">
-        <!-- <el-button
+        <el-button
           type="primary"
           class="bgColor"
-        >添加备课ppt</el-button> -->
+          @click="goTo('/addPPt?userid=' + userid + '&oid=' + oid)"
+        >添加备课ppt</el-button>
       </div>
     </div>
     <div class="pb_content_body" style="height: 100%">

+ 157 - 33
src/components/pages/liveRoom.vue

@@ -101,7 +101,14 @@
       </div>
       <div
         v-if="type == 3"
-        style="background: #d0d6e4height:92%;; min-width: 40%;max-width: 40%;overflow:auto;padding: 0px 0 50px;"
+        style="
+          background: #d0d6e4;
+          height: 92%;
+          min-width: 40%;
+          max-width: 40%;
+          overflow: auto;
+          padding: 0px 0 50px;
+        "
       >
         <div
           style="
@@ -145,7 +152,7 @@
         "
         v-if="steps == 1"
       >
-        <div
+        <!-- <div
           style="
             border-bottom: 3px solid rgb(44, 131, 238);
             width: 70px;
@@ -155,45 +162,90 @@
           "
         >
           选择工具
+        </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 class="toolList">
-          <div class="tools">
-            <div>
-              <img
-                src="../../assets/icon/mindNetwork.png"
-                alt
-                @click="addTool(7)"
-              />
-            </div>
-            <div>思维网格</div>
-          </div>
-          <div class="tools">
-            <div>
-              <img
-                src="../../assets/icon/whiteBoard.png"
-                alt
-                @click="addTool(1)"
-              />
-            </div>
-            <div>电子白板</div>
-          </div>
-          <div class="tools">
-            <div>
-              <img src="../../assets/icon/secondToolList/mindMapping.png" alt @click="addTool(3)" />
+        <div v-if="toolCount == 1" style="height: 90%">
+          <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="answerBox"
+        style="
+          width: 62.5%;
+          overflow: auto;
+          background: rgb(255, 255, 255);
+          height: 91.5%;
+          position: relative;
+          margin: 10px 15px;
+        "
+        v-if="workSteps == 1"
+      >
+        <div
+          style="
+            color: #b7b7b7;
+            border-left: 5px solid #a5b6e2;
+            padding-left: 7px;
+            height: 25px;
+            line-height: 25px;
+          "
+        >
+          查看作业
+        </div>
+        <div class="workBox">
+          <div class="works" v-for="w in 3" :key="w">
+            <div class="workImg"><img :src="mr" alt="" /></div>
+            <div class="workDetail">
+              <div class="workLeft">
+                <div class="workTx">
+                  <img src="../../assets/avatar.png" alt="" />
+                </div>
+                <div class="workName">约翰强尼</div>
+              </div>
+              <div class="workRight">07-04 18:21</div>
             </div>
-            <div>思维导图</div>
           </div>
         </div>
-        <!-- <div class="nextStepOne" @click="answerWork">下一步</div> -->
+        <div
+          class="returnButton"
+          @click="(workSteps = 0), (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="(steps = 1), (type = 0), (workSteps = 0)"
+        >
+          查看工具
+        </div>
         <div class="blackButton" @click="checkStudentAnswer">选择学生回答</div>
-        <!-- <div class="blackButton" @click="dialogVisible1 = true">查看作业</div> -->
+        <div
+          class="blackButton"
+          @click="(workSteps = 1), (steps = 0), (type = 0)"
+        >
+          查看作业
+        </div>
       </div>
       <!-- <div
         class="blackButton"
@@ -311,6 +363,8 @@ export default {
       dialogVisible: false,
       dialogVisible1: false,
       dialogVisible2: false,
+      toolCount: 0,
+      workSteps: 0,
       answerBox: "",
       answer: [
         { name: "A.1568" },
@@ -444,8 +498,18 @@ export default {
         window.parent.postMessage({ tools: "7" }, "*");
       }
     },
+    nextTool() {
+      if (this.toolCount < 2) {
+        this.toolCount++;
+      } else {
+        this.steps = 0;
+        this.type = 0;
+        this.toolCount = 0;
+      }
+    },
     answerWork() {
       this.type = 1;
+      this.workSteps = 0;
       this.answerType = 1;
       this.steps = 0;
     },
@@ -455,6 +519,7 @@ export default {
       }
       this.steps = 0;
       this.type = 2;
+      this.workSteps = 0;
       this.answerType = 2;
     },
     showMember(i) {
@@ -616,7 +681,7 @@ export default {
   align-items: center;
 }
 .memberBox > div {
-  background: rgb(240, 185, 204);
+  background: rgb(79 213 163);
   width: 120px;
   color: #fff;
   height: 40px;
@@ -628,7 +693,7 @@ export default {
 }
 
 .memberBox .pAnswer {
-  background: rgb(227, 117, 154);
+  background: rgb(55 197 144);
 }
 
 .viewSta {
@@ -670,7 +735,9 @@ export default {
 .tools > div:nth-child(1) {
   width: 60px;
 }
-.tools > div:nth-child(1) > img {
+.tools > div:nth-child(1) > img,
+.workImg > img,
+.workTx > img {
   width: 100%;
   height: 100%;
 }
@@ -735,4 +802,61 @@ export default {
   width: 20px;
   cursor: pointer;
 }
+.workBox {
+  margin-top: 20px;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  width: 100%;
+}
+.works {
+  width: 31%;
+  border: 1px solid #ececec;
+  height: 160px;
+  margin: 0 10px 10px 0;
+}
+.workImg {
+  width: 100%;
+}
+.workDetail {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  justify-content: space-between;
+  padding-top: 3px;
+}
+.workLeft {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  margin-left: 5px;
+}
+.workTx {
+  width: 25px;
+}
+.workName {
+  font-size: 14px;
+  padding-left: 5px;
+}
+.workRight {
+  font-size: 14px;
+  color: #ccc;
+  padding-right: 10px;
+}
+.returnButton {
+  position: absolute;
+  bottom: 20px;
+  width: 230px;
+  background: #616161;
+  left: 35%;
+  color: #ababab;
+  text-align: center;
+  border-radius: 5px;
+  height: 30px;
+  font-size: 14px;
+  line-height: 30px;
+  cursor: pointer;
+}
 </style>

+ 9 - 0
src/components/tools/leftBar.vue

@@ -104,6 +104,15 @@
             </div>
             <span slot="title">实时课堂</span>
           </el-menu-item>
+          <el-menu-item index="/addPPt">
+            <div class="img" v-if="path == '/addPPt'">
+              <img src="../../assets/icon/new-active.svg" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/notice.png" alt="" />
+            </div>
+            <span slot="title">添加备课</span>
+          </el-menu-item>
           <!-- <el-menu-item index="/ask">
             <div class="img" v-if="path == '/ask'">
               <img

+ 9 - 0
src/router/index.js

@@ -19,6 +19,7 @@ import Grid from '@/components/pages/Grid'
 import demo from '@/components/pages/demo'
 import classRoom from '@/components/pages/classRoom'
 import liveRoom from '@/components/pages/liveRoom'
+import addPPt from '@/components/pages/addPPt'
 
 Vue.use(Router).use(ElementUI)
 
@@ -165,6 +166,14 @@ export default new Router({
             meta: {
                 requireAuth: '' // 不需要鉴权
             }
+        },
+        {
+            path: '/addPPt',
+            name: 'addPPt',
+            component: addPPt,
+            meta: {
+                requireAuth: '' // 不需要鉴权
+            }
         }
     ]
 })