Procházet zdrojové kódy

增加了临时的question显示页面

181250114@smail.nju.edu.cn před 4 roky
rodič
revize
a0b56f3517
5 změnil soubory, kde provedl 15625 přidání a 112 odebrání
  1. 15439 1
      package-lock.json
  2. 10 0
      src/router/index.js
  3. 40 40
      src/views/QuestionList.vue
  4. 59 0
      src/views/Questionboard.vue
  5. 77 71
      src/views/StudentPage.vue

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 15439 - 1
package-lock.json


+ 10 - 0
src/router/index.js

@@ -16,6 +16,8 @@ const Dashboard = () => import("@/views/Dashboard");
 const DevcloudGroup = () => import("@/views/DevGroupPage");
 const DevcloudUser = () => import("@/views/DevStudentPage");
 
+const Questionboard = () => import("@/views/Questionboard");
+
 const Home = () => import("@/views/Home");
 
 Vue.use(VueRouter);
@@ -80,6 +82,14 @@ const routes = [
     meta: { requiresAuth: [ROLE.TEACHER,ROLE.ADMIN] }
   },
 
+  //问题列表
+  {
+    path: '/questionboard/:id',
+    component: Questionboard,
+    name:"questionboard",
+    meta: { requiresAuth: [ROLE.STUDENT,ROLE.ADMIN] }
+  },
+
 // -----------------------未找到页面-----------------------------
   {
     path: '*',

+ 40 - 40
src/views/QuestionList.vue

@@ -24,46 +24,46 @@
     data() {
       return {
         tableData: [
-          {
-            "questionId": 4360,
-            "knowledgeType": "需求分类",
-            "score": 0,
-            "maxScore":20,
-            "proportion": 0,
-            "time": "2022-04-29 14:00:00"
-          },
-          {
-            "questionId": 3900 ,
-            "knowledgeType": "变更管理",
-            "score": 10,
-            "maxScore":20,
-            "proportion": 0.5,
-            "time": "2022-04-29 14:00:00"
-          },
-          {
-            "questionId": 7776,
-            "knowledgeType": "需求分类",
-            "score": 20,
-            "maxScore":20,
-            "proportion": 1,
-            "time": "2022-04-30 17:00:00"
-          },
-          {
-            "questionId": 6356,
-            "knowledgeType": "软件需求基础",
-            "score": 5,
-            "maxScore":20,
-            "proportion": 0.25,
-            "time": "2022-04-30 17:00:00"
-          },
-          {
-            "questionId": 445,
-            "knowledgeType": "需求工具",
-            "score": 20,
-            "maxScore":20,
-            "proportion": 1,
-            "time": "2022-04-30 17:00:00"
-          },
+          // {
+          //   "questionId": 4360,
+          //   "knowledgeType": "需求分类",
+          //   "score": 0,
+          //   "maxScore":20,
+          //   "proportion": 0,
+          //   "time": "2022-04-29 14:00:00"
+          // },
+          // {
+          //   "questionId": 3900 ,
+          //   "knowledgeType": "变更管理",
+          //   "score": 10,
+          //   "maxScore":20,
+          //   "proportion": 0.5,
+          //   "time": "2022-04-29 14:00:00"
+          // },
+          // {
+          //   "questionId": 7776,
+          //   "knowledgeType": "需求分类",
+          //   "score": 20,
+          //   "maxScore":20,
+          //   "proportion": 1,
+          //   "time": "2022-04-30 17:00:00"
+          // },
+          // {
+          //   "questionId": 6356,
+          //   "knowledgeType": "软件需求基础",
+          //   "score": 5,
+          //   "maxScore":20,
+          //   "proportion": 0.25,
+          //   "time": "2022-04-30 17:00:00"
+          // },
+          // {
+          //   "questionId": 445,
+          //   "knowledgeType": "需求工具",
+          //   "score": 20,
+          //   "maxScore":20,
+          //   "proportion": 1,
+          //   "time": "2022-04-30 17:00:00"
+          // },
         ],
       };
     },

+ 59 - 0
src/views/Questionboard.vue

@@ -0,0 +1,59 @@
+<template>
+    <div>
+        <el-button class="title-inner" @click="$router.push('/studentPage/' + $route.params.id)"
+        >返回分析页面</el-button
+        >
+        <el-card>
+            <template  v-for="item in questionList" >
+                {{item}},
+            </template>
+        </el-card>
+    </div>
+</template>
+
+<script>
+    import { getRecommendById } from "@/network/eval/index.js"
+    export default {
+        data() {
+            return {
+                questionList: [],
+            }
+        },
+        async mounted(){
+            await this.getData();
+        },
+        methods: {
+            async getData(){
+                try{
+                    let res = await getRecommendById({
+                        params: {
+                            user_id: this.$route.params.id,
+                        },
+                    });
+                    if(res.success){
+                        this.questionList = res.content;
+                    }
+                }catch (e) {
+                    this.$message.error(e.message);
+                }
+            }
+        }
+    }
+</script>
+
+<style scoped>
+    .title {
+        padding: 16px;
+        margin-bottom: 10px;
+    }
+    .title-inner {
+        width: 220px;
+        background-color: #e8eaf5 !important;
+        border-color: #e8eaf5 !important;
+        border-radius: 8px !important;
+        height: 40px;
+        text-align: center;
+        font-size: 21px;
+        font-weight: bold;
+    }
+</style>

+ 77 - 71
src/views/StudentPage.vue

@@ -18,9 +18,10 @@
             content="点击进行相关题目推荐"
             placement="right"
           >
-            <a href="#" @click="recommend(scope.row.name)" class="recommend"
-            >{{ scope.row.name }}⭐ ️</a
-          >
+<!--            <a href="#" @click="recommend(scope.row.name)" class="recommend"-->
+<!--            >{{ scope.row.name }}⭐ ️</a>-->
+            <a href="#" @click="$router.push('/questionboard/' + userId)" class="recommend"
+            >{{ scope.row.name }}⭐ ️</a>
           </el-tooltip>
         </template>
       </el-table-column>
@@ -69,75 +70,77 @@
     },
     data() {
       return {
-        recommendUrl: "",
-        tableData: [
-          {
-            name: "软件需求",
-            score: 55,
-            skills: [10, 2, 6, 4, 5, 4],
-            disposition: [
-              { name: "细心", score: 55 },
-              { name: "责任心", score: 55 },
-              { name: "耐心",score: 35},
-            ],
-            children: [
+          recommendUrl: "",
+          userId : 1,
+          treeScore: 55.0,
+          tableData: [
               {
-                name: "需求验证",
-                score: 25,
-                skills: [5, 1, 2, 1, 2, 3],
-                disposition: [
-                  { name: "细心", score: 20 },
-                  { name: "责任心", score: 20 },
-                  { name: "耐心",score: 10},
-                ],
-                children: [
-                  {
-                    name: "原型法",
-                    score: 20,
-                    skills: [5, 1, 2, 1, 2, 3],
-                    disposition: [
-                      { name: "细心", score: 20 },
-                      { name: "责任心", score: 20 },
-                      { name: "耐心",score: 10},
-                    ],
-                  },
-                ],
-              },
-              {
-                name: "需求分析",
-                score: 20,
-                skills: [3, 2, 3, 4, 5, 3],
-                disposition: [
-                  { name: "细心", score: 15 },
-                  { name: "责任心", score: 25 },
-                  { name: "耐心", score: 10 },
-                ],
-                children: [
-                  {
-                    name: "需求分类",
-                    score: 25,
-                    skills: [3, 2, 3, 4, 5, 3],
-                    disposition: [
-                      { name: "细心", score: 15 },
-                      { name: "责任心", score: 25 },
-                      { name: "耐心", score: 10 },
-                    ],
-                  },
-                ],
+                  name: "软件需求",
+                  score: 55,
+                  skills: [10, 2, 6, 4, 5, 4],
+                  disposition: [
+                      { name: "细心", score: 55 },
+                      { name: "责任心", score: 55 },
+                      { name: "耐心",score: 35},
+                  ],
+                  children: [
+                      {
+                          name: "需求验证",
+                          score: 25,
+                          skills: [5, 1, 2, 1, 2, 3],
+                          disposition: [
+                              { name: "细心", score: 20 },
+                              { name: "责任心", score: 20 },
+                              { name: "耐心",score: 10},
+                          ],
+                          children: [
+                              {
+                                  name: "原型法",
+                                  score: 20,
+                                  skills: [5, 1, 2, 1, 2, 3],
+                                  disposition: [
+                                      { name: "细心", score: 20 },
+                                      { name: "责任心", score: 20 },
+                                      { name: "耐心",score: 10},
+                                  ],
+                              },
+                          ],
+                      },
+                      {
+                          name: "需求分析",
+                          score: 20,
+                          skills: [3, 2, 3, 4, 5, 3],
+                          disposition: [
+                              { name: "细心", score: 15 },
+                              { name: "责任心", score: 25 },
+                              { name: "耐心", score: 10 },
+                          ],
+                          children: [
+                              {
+                                  name: "需求分类",
+                                  score: 25,
+                                  skills: [3, 2, 3, 4, 5, 3],
+                                  disposition: [
+                                      { name: "细心", score: 15 },
+                                      { name: "责任心", score: 25 },
+                                      { name: "耐心", score: 10 },
+                                  ],
+                              },
+                          ],
+                      },
+                      {
+                          name: "软件需求基础",
+                          score: 22,
+                          skills: [4, 3, 2, 5, 5, 4],
+                          disposition: [
+                              { name: "细心", score: 20 },
+                              { name: "责任心", score: 15 },
+                              { name: "耐心", score: 20 },
+                          ],
+                      },
+                  ],
               },
-              {
-                name: "软件需求基础",
-                score: 22,
-                skills: [4, 3, 2, 5, 5, 4],
-                disposition: [
-                  { name: "细心", score: 20 },
-                  { name: "责任心", score: 15 },
-                  { name: "耐心", score: 20 },
-                ],
-              },
-            ],
-          },
-        ],
+          ],
 
         // tableData: [
         //   {
@@ -398,8 +401,11 @@
             }
           });
           this.recommendUrl = "smart-server.seec.seecoder.cn/recommend/getRecommendById/?user_id=" + this.$route.params.id;
+          console.log(this.recommendUrl);
+          console.log(this.res);
           if(res.success){
-            this.tableData = res.content;
+            // this.tableData = res.content.tableData;
+              this.userId = res.content.userId
           }
           console.log("here");
           console.log(this.tableData);

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů