Selaa lähdekoodia

1. 个人题库新增查看
2. 题库顺序调整

dusenyao 1 vuosi sitten
vanhempi
commit
40fd184af4

+ 4 - 4
src/views/home/common.vue

@@ -63,14 +63,14 @@ export default {
       page_capacity: this.pageSize,
       menuList: [
         {
-          name: '公共题库',
-          path: '/home',
-        },
-        {
           name: '个人题库',
           path: '/personal_question',
         },
         {
+          name: '公共题库',
+          path: '/home',
+        },
+        {
           name: '协作题库',
           path: '/collaborate_question',
         },

+ 12 - 0
src/views/home/personal_question/index.vue

@@ -25,6 +25,7 @@
 
         <el-table-column prop="operation" label="操作" fixed="right" width="300">
           <template slot-scope="{ row }">
+            <span class="link" @click="showExercise(row.id)">查看</span>
             <span class="link" @click="$router.push({ path: '/exercise', query: { id: row.id } })">编辑</span>
             <span class="link" @click="share(row.id)">分享</span>
             <span class="link" @click="copyExerciseToPublicStore(row.id)">公开</span>
@@ -121,6 +122,17 @@ export default {
         this.exercise_list = exercise_list;
       });
     },
+    showExercise(exercise_id) {
+      this.$router.push({
+        path: '/answer',
+        query: {
+          exercise_id,
+          type: 'show',
+          question_index: 0,
+          back_url: encodeURIComponent(window.location.href),
+        },
+      });
+    },
     deleteExercise(exercise_id) {
       this.$confirm('是否删除当前练习题', '提示', {
         confirmButtonText: '确定',

+ 1 - 1
src/views/login/index.vue

@@ -88,7 +88,7 @@ export default {
         this.$store
           .dispatch('user/login', _form)
           .then(() => {
-            this.$router.push({ path: '/' });
+            this.$router.push({ path: '/personal_question' });
           })
           .catch(() => {
             this.updateVerificationCode();