Parcourir la source

[新增]题目样式

soleil il y a 7 ans
Parent
commit
892812a1d3

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

@@ -65,6 +65,7 @@ $top-section-height: 4.25rem;
 
 .router-section {
   padding: 24px;
+  flex: 1;
   flex-grow: 1;
   max-width: 1000px;
 }

+ 38 - 30
src/views/teacher/Question/index.vue

@@ -55,7 +55,7 @@
         >
           <template slot-scope="props">
             <b-table-column field="id" label="ID" width="40" numeric sortable>
-              {{ props.row.id }}
+              <!--{{ props.row.id }}-->1
             </b-table-column>
 
             <b-table-column field="user.first_name" label="题目名称">
@@ -66,7 +66,12 @@
               {{ props.row.description }}
             </b-table-column>
 
-            <b-table-column field="date" label="题目难度" sortable centered>
+            <b-table-column
+              field="difficulty"
+              label="题目难度"
+              sortable
+              centered
+            >
               <span class="tag is-success"> {{ props.row.difficulty }} </span>
             </b-table-column>
 
@@ -79,7 +84,7 @@
               {{ props.row.expectTime }}
             </b-table-column>
             <b-table-column label="题目标签">
-              {{ props.row.assignmentType }}
+              {{ props.row.assignmentType.value }}
             </b-table-column>
           </template>
 
@@ -109,33 +114,34 @@
 <script>
 import { mapState } from "vuex";
 import { getStudentCourseReviewList } from "@/api/review";
+import { getTeacherQuestions } from "@/api/question";
 
-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: "文档作业"
-  }
-];
+// 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: {},
@@ -152,13 +158,14 @@ export default {
         { id: 1, title: "文档作业题目" },
         { id: 2, title: "代码作业题目" }
       ],
-      data
+      data: []
     };
   },
   mounted() {
     getStudentCourseReviewList(this.courses.id).then(
       value => (this.review = value.data)
     );
+    getTeacherQuestions().then(value => (this.data = value.data));
   }
 };
 </script>
@@ -174,6 +181,7 @@ export default {
 }
 .question-list {
   margin-top: 30px;
+  font-size: 0.9rem;
 }
 .form-group {
   display: flex;