index.vue 1.99 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<!--
 * @Author: 纪泽龙 jizelong@qq.com
 * @Date: 2022-09-20 11:19:55
 * @LastEditors: 纪泽龙 jizelong@qq.com
 * @LastEditTime: 2022-09-28 13:24:36
 * @FilePath: /danger-manage-web/src/views/myLessons/idnex.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="myLessons-wrapper flex">
    <div class="left">
      <Left @examination="examination" />
    </div>
    <div class="right">
      <Right :list="list" />
    </div>
    <AnswerLesson
      v-if="answerOpen"
      :courseId="courseId"
      :userCourseId="userCourseId"
21
      :courseName = "courseName"
耿迪迪's avatar
耿迪迪 committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
      :visible.sync="answerOpen"
    />
  </div>
</template>

<script>
import { getUserLessons } from "@/api/educationPlanExam/lessonsProgram";

import Left from "./components/Left";
import Right from "./components/Right";
import AnswerLesson from "./components/AnswerLesson";
export default {
  name: "myLessons",
  components: {
    Left,
    Right,
    AnswerLesson,
  },
  data() {
    return {
      answerOpen: false,
      courseId: "",
      userCourseId: "",
45
      courseName:"",
耿迪迪's avatar
耿迪迪 committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
      list: [],
    };
  },
  created() {
    this.getUserLessons();
  },
  methods: {
    getUserLessons() {
      getUserLessons().then((res) => {
        console.log(res.rows);
        this.list = res.rows.filter(item=>item.state>0);
      });
    },
    examination(e) {
      this.courseId = e.courseId;
      this.userCourseId = e.userCourseId;
62
      this.courseName = e.courseName;
耿迪迪's avatar
耿迪迪 committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
      // this.answerOpen=true;
    },
  },
};
</script>
<style lang="scss" scoped>
.myLessons-wrapper {
  width: 100%;
  height: calc(100vh - 50px);

  padding: 38px 18px 42px;
  box-sizing: border-box;
  > div {
  }
  .left {
    width: 72%;
    height: 100%;
    max-height: 940px;
    margin-right: 25px;
    border: 1px solid#BBBBBB;
    border-radius: 5px;
  }
  .right {
    flex: 1;
    width: 100%;
    height: 100%;
  }
}
</style>