瀏覽代碼

[新增]题目页结构

soleil 7 年之前
父節點
當前提交
ecb89dd587

+ 1 - 1
src/App.vue

@@ -4,6 +4,6 @@
 
 <style lang="scss">
 #app {
-  background: #f4f7fb;
+  background: #fafbfd;
 }
 </style>

+ 1 - 4
src/components/Card/index.vue

@@ -25,7 +25,6 @@ export default {
 
 <style lang="scss" scoped>
 @import "../../assets/scss/app";
-
 .custom-card {
   width: 100%;
   height: 100%;
@@ -34,7 +33,6 @@ export default {
   box-shadow: 0 2px 24px 0 rgba(0, 0, 0, 0.04);
   color: #152935;
 }
-
 .hoverable {
   cursor: pointer;
   position: relative;
@@ -51,12 +49,11 @@ export default {
   top: -5px;
   left: -5px;
   padding: 5px;
-  box-shadow: 0 0 0 4px #8897a2;
+  box-shadow: 0 0 0 4px rgba(130, 177, 237, 0.5);
   transition: transform 0.2s, opacity 0.2s;
   transform: scaleY(0.9) scaleX(0.95);
   opacity: 0;
 }
-
 .hoverable:hover:after {
   transform: scale(1);
   opacity: 1;

+ 1 - 10
src/layouts/courseLayouts/LayoutStructure.vue

@@ -4,7 +4,6 @@
       <div class="menu-section">
         <div class="menu-sticky">
           <div class="header-logo">MOOC</div>
-          <div class="subtitle">当前课程</div>
           <div class="course-detail">
             {{ course.name }}
             <b-loading
@@ -107,20 +106,12 @@ $top-section-height: 4.25rem;
       color: #ffffff;
       font-weight: bold;
       background: rgba(255, 255, 255, 0.24);
-      border: 1px solid #ffffff;
+      border: 1px solid rgba(255, 255, 255, 0.5);
       border-radius: 3px;
       box-shadow: 0 1px 2px rgba(201, 216, 234, 0.5);
       margin-bottom: 1em;
       min-height: 54px;
     }
-
-    .subtitle {
-      color: #ffffff;
-      font-size: 1rem;
-      font-weight: bold;
-      padding-bottom: 5px;
-      border-bottom: 1px solid #ffffff;
-    }
     .link {
       color: #ffffff;
       font-weight: bold;

+ 1 - 1
src/layouts/courseLayouts/TeacherMenu.vue

@@ -58,7 +58,7 @@ export default {
   color: #ffffff;
   font-size: 1rem;
   padding-bottom: 5px;
-  border-bottom: 1px solid;
+  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
   font-weight: bold;
 }
 .menu-list {

+ 4 - 0
src/router/routes.js

@@ -49,6 +49,10 @@ export default [
         name: TEACHER_COURSE,
         path: "dashboard",
         component: () => import("@/views/teacher/Dashboard")
+      },
+      {
+        path: "question",
+        component: () => import("@/views/teacher/Question")
       }
     ]
   },

+ 1 - 8
src/views/teacher/Dashboard/index.vue

@@ -1,10 +1,3 @@
 <template>
-  <div class="contentContainer"></div>
+  <div></div>
 </template>
-<style lang="scss" scoped>
-.contentContainer {
-  margin-top: 4rem;
-  flex: 1;
-  width: 100%;
-}
-</style>

+ 2 - 0
src/views/teacher/Home/index.vue

@@ -59,6 +59,8 @@ export default {
   position: absolute;
   bottom: -40px;
   left: 20px;
+  transition-property: all;
+  transition-duration: 0.2s;
 
   &:hover {
     height: 90px;

+ 182 - 0
src/views/teacher/Question/index.vue

@@ -0,0 +1,182 @@
+<template>
+  <div>
+    <nav class="breadcrumb" aria-label="breadcrumbs">
+      <ul>
+        <li><router-link :to="{ name: 'HOME' }">所有课程</router-link></li>
+        <li>
+          <router-link :to="`/student-course/${course.id}/dashboard`">{{
+            course.name
+          }}</router-link>
+        </li>
+        <li class="is-active">
+          <router-link :to="`/student-course/${course.id}/review`"
+            >查看题目</router-link
+          >
+        </li>
+      </ul>
+    </nav>
+    <!-- container面板-->
+    <div class="data-table">
+      <!--下拉框&搜索框-->
+      <div class="form-group">
+        <!--下拉框-->
+        <b-field>
+          <b-select placeholder="选择题目类型">
+            <option
+              v-for="option in questionType"
+              :value="option.title"
+              :key="option.id"
+            >
+              {{ option.title }}
+            </option>
+          </b-select>
+        </b-field>
+        <!--搜索框-->
+        <b-field>
+          <b-input
+            placeholder="输入关键字查找题目"
+            type="search"
+            icon="magnify"
+          >
+          </b-input>
+        </b-field>
+      </div>
+      <!--题目table-->
+      <div class="question-list">
+        <b-table
+          :data="data"
+          paginated
+          per-page="5"
+          detailed
+          detail-key="id"
+          @details-open="
+            (row, index) => $toast.open(`Expanded ${row.user.first_name}`)
+          "
+        >
+          <template slot-scope="props">
+            <b-table-column field="id" label="ID" width="40" numeric sortable>
+              {{ props.row.id }}
+            </b-table-column>
+
+            <b-table-column field="user.first_name" label="题目名称">
+              {{ props.row.name }}
+            </b-table-column>
+
+            <b-table-column field="user.last_name" label="题目描述">
+              {{ props.row.description }}
+            </b-table-column>
+
+            <b-table-column field="date" label="题目难度" sortable centered>
+              <span class="tag is-success"> {{ props.row.difficulty }} </span>
+            </b-table-column>
+
+            <b-table-column
+              label="平均时长"
+              field="expectTime"
+              sortable
+              centered
+            >
+              {{ props.row.expectTime }}
+            </b-table-column>
+            <b-table-column label="题目标签">
+              {{ props.row.assignmentType }}
+            </b-table-column>
+          </template>
+
+          <template slot="detail" slot-scope="props">
+            <article class="media">
+              <!--<figure class="media-left">-->
+              <!--<p class="image is-64x64">-->
+              <!--<img src="/static/img/placeholder-128x128.png">-->
+              <!--</p>-->
+              <!--</figure>-->
+              <div class="media-content">
+                <div class="content">
+                  <p>
+                    <strong>{{ props.row.name }}</strong>
+                    <small>@{{ props.row.expectTime }}分钟</small> <br />
+                    {{ props.row.description }}
+                  </p>
+                </div>
+              </div>
+            </article>
+          </template>
+        </b-table>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { mapState } from "vuex";
+import { getStudentCourseReviewList } from "@/api/review";
+
+const data = [
+  {
+    id: 1,
+    name: "第一题",
+    description: "这题xxxxxxxx",
+    difficulty: "easy",
+    expectTime: 20,
+    assignmentType: "文档作业"
+  },
+  {
+    id: 2,
+    name: "第一题",
+    description: "这题xxxxxxxx",
+    difficulty: "easy",
+    expectTime: 25,
+    assignmentType: "文档作业"
+  },
+  {
+    id: 3,
+    name: "第一题",
+    description: "这题xxxxxxxx",
+    difficulty: "easy",
+    expectTime: 35,
+    assignmentType: "文档作业"
+  }
+];
+
+export default {
+  components: {},
+  computed: {
+    ...mapState({
+      course: state => state.course.currentCourse
+    })
+  },
+  data() {
+    return {
+      courses: [],
+      review: [],
+      questionType: [
+        { id: 1, title: "文档作业题目" },
+        { id: 2, title: "代码作业题目" }
+      ],
+      data
+    };
+  },
+  mounted() {
+    getStudentCourseReviewList(this.courses.id).then(
+      value => (this.review = value.data)
+    );
+  }
+};
+</script>
+<style lang="scss" scoped>
+.breadcrumb a {
+  /*color: #7957d5;*/
+  font-weight: bold;
+}
+.data-table {
+  width: 100%;
+  padding: 30px;
+  background-color: #ffffff;
+}
+.question-list {
+  margin-top: 30px;
+}
+.form-group {
+  display: flex;
+  justify-content: space-between;
+}
+</style>