소스 검색

[修改]题目模块细节

soleil 7 년 전
부모
커밋
aa9998b573
4개의 변경된 파일23개의 추가작업 그리고 13개의 파일을 삭제
  1. 0 3
      src/layouts/LoginLayout.vue
  2. 13 6
      src/views/teacher/Question/index.vue
  3. 8 2
      src/views/teacher/Question/questionDetail.vue
  4. 2 2
      vue.config.js

+ 0 - 3
src/layouts/LoginLayout.vue

@@ -11,9 +11,6 @@
         </div>
       </div>
     </section>
-    <!--<footer class="footer is-transparent" style="background: #f4f7fb">-->
-    <!--<div class="content has-text-centered">@nju software</div>-->
-    <!--</footer>-->
   </section>
 </template>
 

+ 13 - 6
src/views/teacher/Question/index.vue

@@ -16,7 +16,7 @@
         <div class="form-group">
           <!--下拉框-->
           <b-field>
-            <b-select placeholder="选择题目类型">
+            <b-select placeholder="选择题目类型" v-model="selectedType">
               <option
                 v-for="(option, index) in questionType"
                 :value="option"
@@ -87,7 +87,7 @@
                 sortable
                 centered
               >
-                {{ props.row.expect_time }}分钟
+                {{ props.row.expectTime }}分钟
               </b-table-column>
             </template>
 
@@ -161,9 +161,15 @@ export default {
       data: [],
       keyWord: "",
       errorMessage: "服务器错误,请稍后再试",
-      loadingQuestionList: true
+      loadingQuestionList: true,
+      selectedType: ""
     };
   },
+  watch: {
+    selectedType(val) {
+      console.log(val);
+    }
+  },
   mounted() {
     //获取全部题目分类
     this.getQuestionType();
@@ -177,7 +183,8 @@ export default {
     getQuestionType() {
       getTeacherQuestionType()
         .then(value => {
-          this.questionType = value.data;
+          // this.questionType = value.data;
+          this.questionType = value.res;
         })
         .catch(e => {
           this.$toast.open({
@@ -190,8 +197,8 @@ export default {
     getQuestions() {
       getQuestionsByAssignType({ type: "DOCUMENT", page: 0, limit: 10 })
         .then(value => {
-          // this.data = value.res.content;
-          this.data = value.data;
+          this.data = value.data.content;
+          // this.data = value.data;
         })
         .catch(e => {
           this.$toast.open({

+ 8 - 2
src/views/teacher/Question/questionDetail.vue

@@ -12,10 +12,10 @@
       </template>
       <template slot="content">
         <b-tag class="tag" type="is-link" rounded>{{
-          questionInfo.assignmentType ? questionInfo.assignmentType.value : ""
+          questionInfo.assignmentType || ""
         }}</b-tag>
         <b-tag class="tag" type="is-link" rounded>{{
-          questionInfo.type ? questionInfo.type.value : ""
+          questionInfo.questionType || ""
         }}</b-tag>
       </template>
     </page-header>
@@ -50,6 +50,12 @@
                 <a>{{ item.filename }}</a>
               </div>
             </div>
+            <div
+              class="empty"
+              v-if="!(questionInfo.file && questionInfo.file.length > 0)"
+            >
+              当前题目暂无文件信息
+            </div>
           </div>
         </div>
       </div>

+ 2 - 2
vue.config.js

@@ -2,8 +2,8 @@ module.exports = {
   devServer: {
     proxy: {
       "^/api": {
-        target: "http://localhost:4000/",
-        // target: "http://10.1.1.198:8080/",
+        // target: "http://localhost:4000/",
+        target: "http://10.1.1.198:8080/",
         ws: true,
         changeOrigin: true
       }