Browse Source

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table

lsc 2 years ago
parent
commit
eb95dfbaf6

+ 2 - 0
src/App.vue

@@ -65,6 +65,8 @@
 					"/worksDetail",
 					"/course/courseDetail",
 					"/library",
+					"/classRoom",
+					"/liveRoom",
 					// "/course/addCourse",
 					// "/ask",
 					// "/ask/askList",

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

@@ -0,0 +1,536 @@
+<template>
+  <div class="pb_content" style="height: auto">
+    <div class="pb_head top">
+      <span>课堂备课</span>
+      <div class="student_button">
+        <el-button
+          type="primary"
+          class="bgColor"
+          @click="goTo('/course/addCourse?userid=' + userid + '&oid=' + oid)"
+        >添加备课ppt</el-button>
+      </div>
+    </div>
+    <div class="pb_content_body" style="height: 100%">
+      <div class="student_head">
+        <div class="student_right">
+          <div class="head_left">
+            <el-input v-model="courseName" class="student_input" placeholder="请输入课程名称"></el-input>
+            <el-button class="course_button" @click="searchCourse">查询</el-button>
+          </div>
+        </div>
+      </div>
+      <div class="student_table">
+        <div class="course_box">
+          <div class="out_box" v-for="(item, index) in course" :key="index">
+            <div class="tup">
+              <img
+                :src="
+									item.cover != null && item.cover != ''
+										? JSON.parse(item.cover).length > 0
+											? JSON.parse(item.cover)[0].url
+											: mr
+										: mr
+								"
+                alt
+              />
+            </div>
+            <div class="bottom_box">
+              <div>{{ item.title }}</div>
+              <div class="kc_t" v-if="groupA == '1'">创建老师:{{ item.uname }}</div>
+              <div class="kc_time">{{ item.time }}</div>
+            </div>
+            <div class="three_bottom">
+              <div @click="jump(item.courseId)">查看课程</div>
+              <div
+                v-if="groupA == '0'"
+                @click="
+									goTo(
+										'/course/addCourse?cid=' +
+											item.courseId +
+											'&userid=' +
+											userid +
+											'&oid=' +
+											oid
+									)
+								"
+              >修改</div>
+              <div
+                @click="
+									goTo(
+										'/works?cid=' +
+											item.courseId +
+											'&userid=' +
+											userid +
+											'&oid=' +
+											oid
+									)
+								"
+              >报告</div>
+              <div @click="deleteCourse(item.courseId)">删除</div>
+            </div>
+          </div>
+          <div class="course_empty" v-if="course.length == 0">暂无数据</div>
+        </div>
+      </div>
+    </div>
+    <div class="student_page">
+      <el-pagination
+        background
+        layout="prev, pager, next"
+        :page-size="10"
+        :total="total"
+        v-if="page && course.length"
+        style="padding-bottom: 20px"
+        @current-change="handleCurrentChange"
+      ></el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import "../../common/aws-sdk-2.235.1.min";
+import EditorBar from "../../components/tools/wangEnduit";
+import CourseProblem from "./components/courseProblem";
+export default {
+  components: { EditorBar,CourseProblem },
+  data() {
+    return {
+      isLoading: false,
+      formLabelWidth: "100px",
+      userid: this.$route.query.userid,
+      oid: this.$route.query.oid,
+      page: 1,
+      total: 0,
+      tableData: [
+
+      ],
+      now: "",
+      groupA: "0",
+      course: [
+          {cover:[],title:"认识种子的起源在线课程.ppt",time:new Date().getTime()},
+          {cover:[],title:"人工智能创意应用.ppt",time:new Date().getTime()},
+      ],
+      courseName: "",
+      mr: require("../../assets/icon/kc1.png"),
+    };
+  },
+  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" }, "*");
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.page = val;
+    },
+    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;
+        }
+      }
+    },
+    searchCourse() {
+      this.page = 1;
+    },
+    // deleteCourse(cid) {
+    //   const loading = this.openLoading(
+    //     document.querySelector(".student_table")
+    //   );
+    //   this.isLoading = true;
+    //   let params = {
+    //     cid: cid,
+    //   };
+    //   this.ajax
+    //     .get(this.$store.state.api + "deleteCourse", params)
+    //     .then((res) => {
+    //       loading.close();
+    //       this.isLoading = false;
+    //       this.$message.success("删除成功");
+    //     })
+    //     .catch((err) => {
+    //       console.error(err);
+    //     });
+    // },
+    
+    search() {
+      this.page = 1;
+    },
+  },
+  created() {
+    this.page = 1;
+  },
+};
+</script>
+
+<style scoped>
+.dialog_diy >>> .el-dialog__header {
+  background: #3d67bc !important;
+  padding: 15px 20px;
+}
+.dialog_diy >>> .el-dialog__title {
+  color: #fff;
+}
+.dialog_diy >>> .el-dialog__headerbtn {
+  top: 19px;
+}
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
+  color: #fff;
+}
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
+  color: #fff;
+}
+.student_head >>> .el-button--primary {
+  background-color: #2268bc;
+}
+
+.xls_button {
+  font-size: 14px;
+  cursor: pointer;
+  text-decoration: underline;
+  color: rgb(34, 104, 188);
+}
+.student_head {
+  display: flex;
+  justify-content: flex-end;
+  align-items: baseline;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  margin-top: 25px;
+}
+
+.top {
+  display: flex;
+  justify-content: space-between;
+}
+
+.bgColor {
+  background: #466b99;
+}
+
+.student_search {
+  display: flex;
+  align-items: center;
+  width: calc(100% / 3);
+}
+.student_search span {
+  margin: 0 10px 0 0;
+  width: 65px;
+}
+.student_button {
+  display: flex;
+  overflow: hidden;
+  height: 40px;
+}
+.upload-demo {
+  display: flex;
+  flex-direction: column;
+  align-items: end;
+  /* position: relative; */
+  width: 100px;
+  overflow: hidden;
+}
+.student_table {
+  margin: 10px 0;
+  height: 100%;
+  overflow: auto;
+}
+
+.student_empty {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.el-table >>> .even_row {
+  background-color: #f1f1f1;
+}
+
+.time {
+  font-size: 13px;
+  color: #999;
+}
+
+.course_button {
+  padding: 10px 20px;
+}
+.course_button_box {
+  display: flex;
+  margin-top: 5px;
+  justify-content: space-between;
+}
+.course_rate {
+  margin-top: 5px;
+}
+.course_view {
+  display: flex;
+  align-items: center;
+  margin: 5px 0 0 0;
+}
+.course_view i {
+  background-image: url("../../assets/liulan.png");
+  width: 25px;
+  height: 25px;
+  background-size: 100% 100%;
+  /* margin-top: 1px; */
+  line-height: 25px;
+  vertical-align: text-top;
+  background-repeat: no-repeat;
+}
+.image {
+  width: 100%;
+  height: 150px;
+  display: block;
+}
+.course_box {
+  display: flex;
+  flex-wrap: wrap;
+  height: 100%;
+  min-height: 530px;
+}
+.student_page {
+  width: 95%;
+  margin: 0 auto;
+}
+.course_create_box {
+  font-size: 18px;
+}
+.course_name {
+  margin-top: 10px;
+}
+.course_name span {
+  margin-bottom: 10px;
+  display: block;
+}
+.homework_box {
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+}
+.course_homework {
+  width: 130px;
+  display: flex;
+  justify-content: center;
+  flex-direction: column;
+  align-items: center;
+  margin: 0 10px 10px 0;
+}
+.course_type {
+  margin-top: 10px;
+  display: flex;
+}
+.course_type1 span {
+  margin-bottom: 10px;
+  display: block;
+}
+.course_type2 {
+  margin-left: 20px;
+}
+.course_type2 span {
+  margin-bottom: 10px;
+  display: block;
+}
+.course_empty {
+  color: rgb(110, 110, 110);
+  width: 100%;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.el_cards >>> .el-card__body {
+  height: 100%;
+}
+.courseBtnBox {
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  height: calc(100% - 170px);
+  padding: 10px;
+}
+
+.wordUpload {
+  display: flex;
+}
+
+.wordUpload > .buttonUp {
+  margin-right: 5px;
+}
+
+.out_box {
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  width: 250px;
+  background: #fff;
+  margin-left: 25px;
+  border: 1px solid #ccc;
+  height: fit-content;
+  box-sizing: border-box;
+  border-radius: 0px 0px 5px 5px;
+  overflow: hidden;
+  margin-bottom: 15px;
+}
+
+.bottom_box {
+  display: flex;
+  padding: 10px 0 10px 10px;
+  flex-direction: column;
+  box-sizing: border-box;
+}
+.bottom_box > div:nth-child(1) {
+  width: 230px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.tup {
+  width: 100%;
+  height: 141.06px;
+  margin: 0 auto;
+}
+
+.tup > img {
+  width: 100%;
+  height: 100%;
+}
+
+.kc_time {
+  margin-top: 8px;
+  font-size: 14px;
+  color: #999;
+}
+.kc_t {
+  margin-top: 5px;
+}
+
+.three_bottom {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+  height: 40px;
+  align-items: center;
+  background: #f5f4f4;
+  font-size: 14px;
+}
+.three_bottom > div {
+  cursor: pointer;
+}
+
+.three_bottom > div:hover {
+  color: #79a2ff;
+}
+.head_left {
+  display: flex;
+}
+.student_input >>> .el-input__inner {
+  height: 40px;
+  width: 190px;
+  font-size: 13px;
+  padding: 0 10px;
+}
+.course_button {
+  color: #fff;
+  background: #2268bc;
+  width: 75px;
+  height: 40px;
+  padding: 0 !important;
+  font-size: 12px;
+  line-height: 40px;
+}
+.all_choose {
+  margin: 15px 0 10px;
+  height: 20%;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  width: calc(100% / 3);
+}
+.all_choose > span {
+  width: 50px;
+  display: block;
+}
+.choose {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  align-content: space-between;
+  height: 100%;
+  justify-content: flex-start;
+  width: 60%;
+  min-width: 868px;
+  align-items: center;
+}
+.choose > div:nth-child(2) {
+  margin-left: 1%;
+  width: 32.33333%;
+}
+.choose > div:nth-child(4) {
+  margin-right: 1%;
+  width: 32.33333%;
+}
+.choose > div:nth-child(5) {
+  margin-left: 1%;
+}
+.choose > div:nth-child(4) > span {
+  width: 74px !important;
+  min-width: 74px;
+}
+.choose > div:nth-child(4) >>> .el-select {
+  width: 217.5px;
+  min-width: 215.06px;
+}
+.clear {
+  width: 70px;
+  height: 35px;
+  background: #2268bc;
+  color: #fff;
+  text-align: center;
+  border-radius: 5px;
+  line-height: 35px;
+  cursor: pointer;
+  margin-left: 20px;
+}
+
+
+</style>

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

@@ -63,7 +63,7 @@
               <div class="kc_time">{{ item.time }}</div>
             </div>
             <div class="three_bottom">
-              <div @click="jump(item.courseId)">开始教学</div>
+              <div @click="jump(item.courseId)">查看内容</div>
               <div
                 v-if="groupA == '0'"
                 @click="
@@ -88,8 +88,7 @@
 											oid
 									)
 								"
-              >作业</div>
-              <div @click="checkProblem(item)">提问</div>
+              >报告</div>
               <div @click="deleteCourse(item.courseId)">删除</div>
             </div>
           </div>

+ 216 - 0
src/components/pages/liveRoom.vue

@@ -0,0 +1,216 @@
+<template>
+  <div
+    style="
+      background: rgb(230, 234, 240);
+      width: 100%;
+      margin: 0;
+      position: relate;
+    "
+  >
+    <!-- <div class="pb_content_body" style="height: 100%">
+    </div> -->
+    <div class="blackBottom">
+      <div style="color: #fff; line-height: 45px; padding-left: 15px">
+        人工智能风车实践课程
+      </div>
+    </div>
+    <div class="isNoOther">
+      <div class="imgMiddle">
+        <img src="../../assets/icon/kc1.png" alt="" />
+      </div>
+      <div v-if="a == true" style="background: #d0d6e4">
+        <div style="background: #fff">
+          <div>答题查看</div>
+        </div>
+      </div>
+    </div>
+
+    <div class="blackBottomB">
+      <div class="blackButton" @click="answerWork">开始答题</div>
+      <div class="blackButton">查看工具</div>
+      <div class="blackButton">选择学生回答</div>
+    </div>
+  </div>
+</template>
+
+<script>
+import "../../common/aws-sdk-2.235.1.min";
+import EditorBar from "../../components/tools/wangEnduit";
+import CourseProblem from "./components/courseProblem";
+export default {
+  components: { EditorBar, CourseProblem },
+  data() {
+    return {
+      isLoading: false,
+      formLabelWidth: "100px",
+      userid: this.$route.query.userid,
+      oid: this.$route.query.oid,
+      mr: require("../../assets/icon/kc1.png"),
+      timu: [],
+      a: false,
+    };
+  },
+  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" }, "*");
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.page = val;
+    },
+    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;
+        }
+      }
+    },
+    searchCourse() {
+      this.page = 1;
+    },
+    // deleteCourse(cid) {
+    //   const loading = this.openLoading(
+    //     document.querySelector(".student_table")
+    //   );
+    //   this.isLoading = true;
+    //   let params = {
+    //     cid: cid,
+    //   };
+    //   this.ajax
+    //     .get(this.$store.state.api + "deleteCourse", params)
+    //     .then((res) => {
+    //       loading.close();
+    //       this.isLoading = false;
+    //       this.$message.success("删除成功");
+    //     })
+    //     .catch((err) => {
+    //       console.error(err);
+    //     });
+    // },
+    answerWork() {
+      this.a = true;
+    },
+    search() {
+      this.page = 1;
+    },
+  },
+  created() {
+    this.page = 1;
+  },
+};
+</script>
+
+<style scoped>
+.dialog_diy >>> .el-dialog__header {
+  background: #3d67bc !important;
+  padding: 15px 20px;
+}
+.dialog_diy >>> .el-dialog__title {
+  color: #fff;
+}
+.dialog_diy >>> .el-dialog__headerbtn {
+  top: 19px;
+}
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
+  color: #fff;
+}
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
+  color: #fff;
+}
+
+.blackBottom {
+  background: rgb(0, 0, 0);
+  height: 45px;
+  width: 100%;
+}
+
+.imgMiddle {
+  width: 100%;
+  height: 100%;
+  max-height: 920px;
+}
+
+.imgMiddle > img {
+  width: 100%;
+  height: 100%;
+  max-height: 920px;
+}
+
+.blackBottomB {
+  position: absolute;
+  bottom: 0px;
+  left: 0px;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  align-content: center;
+  justify-content: flex-start;
+  align-items: center;
+  background: rgb(0, 0, 0);
+  height: 45px;
+  width: 100%;
+}
+
+.blackBottomB > div:nth-child(1) {
+  margin-left: 10px !important;
+}
+
+.blackButton {
+  color: #fff;
+  background: rgb(179, 62, 117);
+  width: 100px;
+  height: 30px;
+  line-height: 30px;
+  text-align: center;
+  margin: 0 5px;
+  border-radius: 5px;
+  font-size: 15px;
+  cursor: pointer;
+}
+
+.isNoOther {
+  width: 100%;
+  height: 100%;
+}
+</style>

+ 12 - 2
src/components/pages/student.vue

@@ -26,7 +26,7 @@
         <div class="head_right">
           <el-button @click="addStudent">添加学生</el-button>
           <el-upload
-            class="upload-demo"
+            class="upload-demo newCss"
             :http-request="handleChange"
             :on-remove="handleRemove"
             action="#"
@@ -34,7 +34,7 @@
             accept=".xlsx"
           >
             <el-button size="primary" type="primary">批量添加</el-button>
-            <div slot="tip" class="el-upload__tip">
+            <div slot="tip" class="el-upload__tip" style="margin-left:10px;">
               只能上传jpg/png文件,且不超过500kb
             </div>
           </el-upload>
@@ -1007,6 +1007,9 @@ export default {
 }
 .head_right {
   display: flex;
+      flex-direction: row;
+    flex-wrap: nowrap;
+    align-items: baseline;
 }
 .student_input >>> .el-input__inner {
   height: 30px;
@@ -1146,4 +1149,11 @@ export default {
   width: 100%;
   height: 100%;
 }
+
+.newCss{
+  display: flex;
+    flex-direction: row;
+    flex-wrap: nowrap;
+    align-items: baseline;
+}
 </style>

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

@@ -86,6 +86,24 @@
             </div>
             <span slot="title">素材库</span>
           </el-menu-item>
+          <el-menu-item index="/classRoom">
+            <div class="img" v-if="path == '/classRoom'">
+              <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="/liveRoom">
+            <div class="img" v-if="path == '/liveRoom'">
+              <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

+ 18 - 0
src/router/index.js

@@ -17,6 +17,8 @@ import library from '@/components/pages/library'
 import note from '@/components/pages/note'
 import Grid from '@/components/pages/Grid'
 import demo from '@/components/pages/demo'
+import classRoom from '@/components/pages/classRoom'
+import liveRoom from '@/components/pages/liveRoom'
 
 Vue.use(Router).use(ElementUI)
 
@@ -147,6 +149,22 @@ export default new Router({
             meta: {
                 requireAuth: '' // 不需要鉴权
             }
+        },
+        {
+            path: '/classRoom',
+            name: 'classRoom',
+            component: classRoom,
+            meta: {
+                requireAuth: '' // 不需要鉴权
+            }
+        },
+        {
+            path: '/liveRoom',
+            name: 'liveRoom',
+            component: liveRoom,
+            meta: {
+                requireAuth: '' // 不需要鉴权
+            }
         }
     ]
 })