Browse Source

Merge branch 'seec' of http://gogs.seec.seecoder.cn/LiuQin/SEEC-Portal-Front into seec

yhd12345 3 years ago
parent
commit
5c30bf5349

File diff suppressed because it is too large
+ 1 - 19088
package-lock.json


+ 2 - 1
package.json

@@ -30,7 +30,8 @@
     "vue-router": "^4.0.12",
     "vue3-pdfjs": "^0.1.6",
     "vuex": "^4.0.2",
-    "worker-loader": "^3.0.8"
+    "worker-loader": "^3.0.8",
+    "yarn": "^1.22.19"
   },
   "devDependencies": {
     "@babel/core": "^7.20.2",

+ 7 - 7
src/api/coder.js

@@ -9,7 +9,7 @@ function getStudentCoderExams({page, limit}) {
   });
 }
 
-function getStudentCoderExamsGroupByCourse() {
+function getStudentCoderExamsGroupByCourse(){
   return axios.get(`${prefix}/exam/student/groupByCourse`);
 }
 
@@ -24,7 +24,7 @@ function getRecommendCoderExams() {
   return axios.get(`${prefix}/exam/recommend`);
 }
 
-function getRecommendCoderExamsGroupByCourse() {
+function getRecommendCoderExamsGroupByCourse(){
   return axios.get(`${prefix}/exam/recommend/groupByCourse`);
 }
 
@@ -36,11 +36,11 @@ function getStudentCoderExamsByCourseId(courseId) {
   return axios.get(`${prefix}/exam/student/course`, {params: {courseId,}});
 }
 
-function getTeacherCoderExamsGroupByCourse() {
+function getTeacherCoderExamsGroupByCourse(){
   return axios.get(`${prefix}/exam/teacher/groupByCourse`);
 }
 
-function retrievePageProblem(page, limit, typeStr, name) {
+function retrievePageProblem(page, limit, typeStr, name){
   return axios.get(`${prefix}/problem`, {
     params: {
       page,
@@ -51,7 +51,7 @@ function retrievePageProblem(page, limit, typeStr, name) {
   });
 }
 
-function createCoderExam(data) {
+function createCoderExam(data){
   return axios.post(`${prefix}/exam/create`, data);
 }
 
@@ -119,7 +119,7 @@ function changeExamIsShownForStu(examId, status) {
   return axios.post(`${prefix}/exam/${examId}/console?showConsole=${status}`);
 }
 
-function stopRecord(recordId) {
+function stopRecordById(recordId) {
   return axios.put(`${prefix}/record/stop`, null, {
     params: {
       recordId,
@@ -156,7 +156,7 @@ const coderAPIs = {
   getRecordByRecordId,
   getExamIsShownForStu,
   changeExamIsShownForStu,
-  stopRecord,
+  stopRecordById,
 };
 
 export default coderAPIs;

+ 9 - 1
src/api/group.js

@@ -41,7 +41,14 @@ function findGroupRule(courseId){
     });
 }
 
-
+function deleteGroup(userId,courseId){
+    return axios.get(`${prefix}/delete`,{
+        params:{
+            "userId":userId,
+            "courseId":courseId,
+        }
+    });
+}
 
 const groupAPIs={
     createGroupRule,
@@ -51,6 +58,7 @@ const groupAPIs={
     findGroup,
     findAllGroupsByCourse,
     findGroupRule,
+    deleteGroup
 };
 
 export default groupAPIs;

+ 5 - 10
src/router/index.js

@@ -135,6 +135,11 @@ const routes = [
     path: "/courseWare/:courseWareId/details",
     name: "courseWareDetails",
     component: ()=>import("../views/CourseWarePage/CourseWarePage")
+  },
+  {
+    path: "/root",
+    name: "Root",
+    component: ()=>import("../views/RootPage/index.vue")
   }
 ];
 
@@ -146,16 +151,6 @@ const router = createRouter({
 const unauthorizedRoutes = ["Portal", "Auth", "Course", "Test","Project", "CompletePhone"];
 
 router.beforeEach((to, from, next) => {
-  let token = localStorage.getItem("token");
-  console.log(token);
-
-    // else if (token && to.name === "courseWareDetails") {
-    //   console.log(localStorage);
-    //   if (localStorage.s === "true") {
-    //     console.log(3);
-    //     next();
-    //   }
-    // }
     if (unauthorizedRoutes.indexOf(to.name) !== -1) {
       next();
     }

+ 5 - 3
src/views/AuthPage/components/AuthCard.vue

@@ -334,14 +334,12 @@ export default {
               this.$apis.loginAPI(params)
                 .then((res) => {
                   if (res.data.code === 0) {
-                    console.log(res);
                     if (this.rememberMe) {
                       localStorage.phone = this.cardForm.phone;
                       localStorage.password = this.cardForm.password;
                       localStorage.rememberMe = this.rememberMe;
                       this.st="true";//修改登录状态为true
                       localStorage.setItem("s",this.st);
-                      console.log(localStorage);
                     } else {
                       localStorage.removeItem("rememberMe");
                       localStorage.removeItem("phone");
@@ -362,7 +360,11 @@ export default {
                         if (this.$route.params.login_to) {
                           this.$router.push(String(this.$route.params.login_to));
                         } else {
-                          this.$router.push("/portal");
+                          if(res.data.data.user.role === "ADMIN"){
+                            this.$router.push("/root");
+                          }else{
+                            this.$router.push("/portal");
+                          }
                         }
                       } else {
                         let p = new Promise(function (resolve, reject) {

+ 56 - 54
src/views/CoderPage/ExamDetail.vue

@@ -5,11 +5,13 @@
         <page-header>
           <template #actions>
             <el-button
-                @click="fetchExamDetail"
-                :loading="loading.refresh"
-                v-if="isStudentGroup && exam.joined"
+              @click="fetchExamDetail"
+              :loading="loading.refresh"
+              v-if="isStudentGroup && exam.joined"
             >
-              <el-icon><RefreshRight /></el-icon>
+              <el-icon>
+                <RefreshRight/>
+              </el-icon>
             </el-button>
             <el-button
               v-if="isStudentGroup && !exam.joined"
@@ -20,11 +22,11 @@
               参加考试
             </el-button>
             <el-button
-                v-if="(isStudentGroup || isTeacherGroup) && !exam.joined"
-                type="primary"
-                :loading="loading.create"
-                @click="createExamPaper"
-                :disabled="statusTagContent!=='进行中'"
+              v-if="(isStudentGroup || isTeacherGroup) && !exam.joined"
+              type="primary"
+              :loading="loading.create"
+              @click="createExamPaper"
+              :disabled="statusTagContent!=='进行中'"
             >
               生成自测试卷
             </el-button>
@@ -153,9 +155,9 @@
 
       <!--      题目列表-->
       <el-card
-          v-if="exam.joined || isTeacherGroup"
-          class="son-card"
-          style="background: none; box-shadow:none;border: none; margin-top: 15px;margin-bottom: 30px"
+        v-if="exam.joined || isTeacherGroup"
+        class="son-card"
+        style="background: none; box-shadow:none;border: none; margin-top: 15px;margin-bottom: 30px"
       >
         <template #header>
           <span style="color:black;font-size: 24px;font-family: 'Inter',sans-serif">题目列表</span>
@@ -175,7 +177,7 @@
             </template>
             <div style="margin-left: 40px">{{ problem.description }}</div>
             <div style="margin-left: 30px;margin-top: 10px">
-<!--              原来逻辑:只有老师和管理员可以查看题目预览-->
+              <!--              原来逻辑:只有老师和管理员可以查看题目预览-->
               <a
                 v-if="isTeacherGroup || isAdmin"
                 style="color: #409EFF;cursor: pointer;"
@@ -189,15 +191,16 @@
 
       <!--      提交记录-->
       <el-card
-          v-if="exam.joined || isTeacherGroup"
-          class="son-card"
-          style="background: none; box-shadow:none;border: none;margin-bottom: 30px"
+        v-if="exam.joined || isTeacherGroup"
+        class="son-card"
+        style="background: none; box-shadow:none;border: none;margin-bottom: 30px"
       >
         <template #header>
           <span style="color:black;font-size: 24px;font-family: 'Inter',sans-serif">提交记录</span>
         </template>
 
-        <el-table v-if="exam.joined || isTeacherGroup" :data="result.commits" style="background: none; box-shadow:none;border: none">
+        <el-table v-if="exam.joined || isTeacherGroup" :data="result.commits"
+                  style="background: none; box-shadow:none;border: none">
           <el-table-column prop="id" label="#" width="200"/>
           <el-table-column label="提交时间">
             <template #default="scope">
@@ -213,25 +216,9 @@
             </template>
           </el-table-column>
           <el-table-column prop="score" label="成绩" width="150"/>
-          <el-table-column label="操作" width="150">
+          <el-table-column label="操作" type="expand" width="50">
             <template #default="scope">
-              <el-button
-                type="text"
-                @click="
-                    $router.push(
-                    {
-                      path: `/exam/${$route.params.examId}/commit/${scope.row.id}`
-                    })
-                "
-              >
-                详情
-              </el-button>
-              <el-divider direction="vertical"/>
-              <el-button type="text"
-                         @click="stopRecord(scope.row.id)"
-                         class="commit-stop-button">
-                停止
-              </el-button>
+              <CommitBoard :commit-id="scope.row.id" :exam-id="Number($route.params.examId)"></CommitBoard>
             </template>
           </el-table-column>
         </el-table>
@@ -305,8 +292,13 @@
             <el-table-column label="操作" width="200">
               <template #default="scope">
                 <el-button type="text" @click="jumpToCodemirror(scope.row.owner)">源码</el-button>
-                |
-                <el-button type="text" @click="jumpToResultDetail(scope.row.id)">详情</el-button>
+                <!--                |-->
+                <!--                <el-button type="text" @click="jumpToResultDetail(scope.row.id)">详情</el-button>-->
+              </template>
+            </el-table-column>
+            <el-table-column type="expand">
+              <template #default="scope">
+                <ResultDetail :resultId="scope.row.id" :exam-id="$route.params.examId"></ResultDetail>
               </template>
             </el-table-column>
           </el-table>
@@ -362,7 +354,7 @@
       <template #footer class="dialog-footer">
         <el-button @click="dialog.update = false">取消</el-button>
         <el-button
-         type="primary"
+          type="primary"
           :loading="loading.update"
           :disabled="range.length !== 2"
           @click="updateExam"
@@ -379,7 +371,8 @@
           {{ isConsoleOutputShownForStu ? "" : "不" }}允许学生查看控制台输出
         </el-descriptions-item>
         <el-descriptions-item label="控制台权限变更:">
-          {{ isConsoleOutputShownForStu ? "" : "不" }}允许学生查看控制台输出 -> {{ isConsoleOutputShownForStu ? "不" : "" }}允许学生查看控制台输出
+          {{ isConsoleOutputShownForStu ? "" : "不" }}允许学生查看控制台输出 ->
+          {{ isConsoleOutputShownForStu ? "不" : "" }}允许学生查看控制台输出
         </el-descriptions-item>
       </el-descriptions>
       <template #footer class="dialog-footer">
@@ -420,6 +413,8 @@ import {
 } from "@/utils/coder-utils";
 import {mapGetters} from "vuex";
 import PageHeader from "../../components/PageHeader.vue";
+import CommitBoard from "@/views/CoderPage/ResultPage/CommitPage/components/CommitBoard.vue";
+import ResultDetail from "@/views/CoderPage/ResultPage/ResultDetail";
 import Echarts from "@/views/CoderPage/ResultPage/Echarts.vue";
 import {ElMessage} from "element-plus";
 import Clipboard from "clipboard";
@@ -429,7 +424,9 @@ export default {
   name: "ExamDetail",
   components: {
     PageHeader,
-    Echarts
+    Echarts,
+    CommitBoard,
+    ResultDetail
   },
   props: {},
   data() {
@@ -737,13 +734,13 @@ export default {
     createExamPaper() { // 生成自测试卷(老师选择考试,否则不能正常自测)
       this.loading.create = true;
       this.$apis.joinCoderExam(this.exam.id)
-          .then(_res => {
-            this.$message.success({
-              message: "生成自测试卷成功!",
-              center: true
-            });
-            this.fetchExamDetail();
-          }).catch(_err => {
+        .then(_res => {
+          this.$message.success({
+            message: "生成自测试卷成功!",
+            center: true
+          });
+          this.fetchExamDetail();
+        }).catch(_err => {
         this.$message.error({
           message: "生成自测试卷出错!",
           center: true
@@ -773,9 +770,9 @@ export default {
       this.$router.push(`${this.$route.path}/result/${resultId}`);
     },
     // stop coder record
-    async stopRecord(recordId){
-       const res = (await this.$apis.stopRecord(recordId)).data;
-       console.log(res);
+    async stopRecord(recordId) {
+      const res = (await this.$apis.stopRecord(recordId)).data;
+      console.log(res);
     }
   }
 };
@@ -804,7 +801,7 @@ export default {
   padding-bottom: 0;
 }
 
-::v-deep .exam-description .el-descriptions__body{
+::v-deep .exam-description .el-descriptions__body {
   font-size: 16px;
   background-color: #F8F9FB; //样式穿透,覆盖原本的样式
 }
@@ -833,11 +830,16 @@ export default {
 //  border-bottom: 1px solid #afaaaa;
 //}
 
-.commit-stop-button{
+.commit-stop-button {
   color: var(--el-color-danger)
 }
 
-.commit-stop-button:hover{
-  opacity: 75%;
+.commit-stop-button:hover {
+  color: rgba(245, 108, 108, 0.75);
+}
+
+:deep(.el-table__expanded-cell[class*=cell]){
+  padding: 0;
+  box-shadow: inset 0px 0px 5px 0px var(--el-color-info);
 }
 </style>

+ 15 - 4
src/views/CoderPage/ResultPage/CommitPage/CommitDetail.vue

@@ -9,7 +9,7 @@
           <span style="font-size: 36px;font-family: 'Inter',sans-serif">提交详情</span>
         </page-header>
       </template>
-      <CommitBoard :commit-id="commitId"></CommitBoard>
+      <CommitBoard :commit-id="commitId" :exam-id="examId"></CommitBoard>
     </el-card>
   </div>
 </template>
@@ -20,15 +20,26 @@ import PageHeader from "@/components/PageHeader.vue";
 export default {
   name: "CommitDetail",
   components: {PageHeader, CommitBoard},
+  props:{
+    commitId:{
+      type: Number,
+      required: true
+    },
+    examId: {
+      type:Number,
+      required: true
+    }
+  },
   data() {
     return {
 
     };
   },
   computed: {
-    commitId() {
-      const {commitId} = this.$route.params;
-      return commitId;
+    // eslint-disable-next-line vue/no-dupe-keys
+    examId(){
+      const {examId} = this.$route.params;
+      return examId;
     }
   },
   mounted() {

+ 13 - 8
src/views/CoderPage/ResultPage/CommitPage/RecordPage/RecordDetail.vue

@@ -22,9 +22,9 @@
               查看控制台输出
             </el-button>
           </template>
-          <el-button @click="getBack" style="border: none;background: none;">
-            <el-icon :size="22"><Back /></el-icon>
-          </el-button>
+<!--          <el-button @click="getBack" style="border: none;background: none;">-->
+<!--            <el-icon :size="22"><Back /></el-icon>-->
+<!--          </el-button>-->
           <span style="font-size: 36px;font-family: 'Inter',sans-serif">运行详情</span>
         </page-header>
       </template>
@@ -95,7 +95,14 @@ export default {
   name: "RecordDetail",
   components: {PageHeader},
   props: {
-
+    examId:{
+      type: Number,
+      required: true
+    },
+    recordId:{
+      type: Number,
+      required: true
+    }
   },
   data() {
     return {
@@ -123,8 +130,7 @@ export default {
   },
   methods: {
     fetchData() {
-      const {recordId} = this.$route.params;
-      this.$apis.getRecordByRecordId(recordId)
+      this.$apis.getRecordByRecordId(this.recordId)
           .then(_res => {
             this.record = _res.data.res;
           }).catch(_err => {
@@ -132,8 +138,7 @@ export default {
       });
     },
     checkConsole() {
-      const {examId} = this.$route.params;
-      this.$apis.getExamIsShownForStu(examId)
+      this.$apis.getExamIsShownForStu(this.examId)
           .then(_res => {
             this.isConsoleOutputShownForStu = _res.data?.res;
           }).catch(_err => {

+ 76 - 53
src/views/CoderPage/ResultPage/CommitPage/components/CommitBoard.vue

@@ -1,29 +1,29 @@
 <template>
-  <el-descriptions class="commit-description">
-    <el-descriptions-item
-        label-class-name="label-bold"
-        label="编号:">{{ commit.id }}</el-descriptions-item>
-    <el-descriptions-item
-        :width="600"
-        label-class-name="label-bold"
-        label="提交时间:">{{ formatTimestamp(commit.createdAt) }}</el-descriptions-item>
-    <el-descriptions-item
-        :width="200"
-        label-class-name="label-bold"
-        label="分数:">{{ commit.score }}</el-descriptions-item>
-    <el-descriptions-item
-        label-class-name="label-bold"
-        label="Git Commit ID:" :span="2">{{ commit.hash }}</el-descriptions-item>
-  </el-descriptions>
+  <!--  <el-descriptions class="commit-description">-->
+  <!--    <el-descriptions-item-->
+  <!--        label-class-name="label-bold"-->
+  <!--        label="编号:">{{ commit.id }}</el-descriptions-item>-->
+  <!--    <el-descriptions-item-->
+  <!--        :width="600"-->
+  <!--        label-class-name="label-bold"-->
+  <!--        label="提交时间:">{{ formatTimestamp(commit.createdAt) }}</el-descriptions-item>-->
+  <!--    <el-descriptions-item-->
+  <!--        :width="200"-->
+  <!--        label-class-name="label-bold"-->
+  <!--        label="分数:">{{ commit.score }}</el-descriptions-item>-->
+  <!--    <el-descriptions-item-->
+  <!--        label-class-name="label-bold"-->
+  <!--        label="Git Commit ID:" :span="2">{{ commit.hash }}</el-descriptions-item>-->
+  <!--  </el-descriptions>-->
 
   <el-card
-      class="son-card"
-      style="background: none; box-shadow:none;border: none;">
-    <template #header>
-      <page-header>
-        <span style="font-size: 24px;font-family: 'Inter',sans-serif">提交列表</span>
-      </page-header>
-    </template>
+    class="son-card" border
+    style="background:none ; box-shadow: none; border: none">
+    <!--    <template #header>-->
+    <!--      <page-header>-->
+    <!--        <span style="font-size: 24px;font-family: 'Inter',sans-serif;margin-left: 10px">提交列表</span>-->
+    <!--      </page-header>-->
+    <!--    </template>-->
     <el-table :data="commit.records">
       <el-table-column label="题目">
         <template #default="scope">
@@ -33,24 +33,23 @@
       <el-table-column label="状态" width="380">
         <template #default="scope">
         <span
-            :style="{color: buildStatusToColor(buildStatusToTagType(scope.row.status))}">
+          :style="{color: buildStatusToColor(buildStatusToTagType(scope.row.status))}">
           {{ buildStatusToTagContent(scope.row.status) }}
         </span>
         </template>
       </el-table-column>
-      <el-table-column prop="score" label="分数" width="220" />
+      <el-table-column prop="score" label="分数" width="220"/>
       <el-table-column label="操作" width="160">
         <template #default="scope">
           <el-button
-              type="text"
-              @click="$router.push(`${$route.path}/record/${scope.row.id}`)"
-          >详情</el-button>
-          <el-button
-              v-if="stopRecordButton(scope.row.status)"
-              type="danger"
-              size="mini"
-              @click="dialog.stop = scope.$index"
-          >
+            type="text"
+            @click="this.openRecordDetail(scope.row.id)"
+          >详情
+          </el-button>
+          <el-divider direction="vertical"/>
+          <el-button type="text" class="stop-record-button"
+                     :disabled="scope.row.status!==`RUNNING`"
+                     @click="handleStopRecordButtonClick(scope.row.id)">
             停止
           </el-button>
         </template>
@@ -58,19 +57,27 @@
     </el-table>
   </el-card>
 
+  <el-dialog width="80%" v-model="recordDetailVisible" title="运行详情">
+    <RecordDetail :exam-id="this.examId" :record-id="this.selectedRecordId"></RecordDetail>
+  </el-dialog>
+
 </template>
 
 <script>
 import {formatTimestamp, buildStatusToTagType, buildStatusToTagContent} from "@/utils/coder-utils";
-import PageHeader from "@/views/ProblemPage/components/PageHeader.vue";
+import RecordDetail from "@/views/CoderPage/ResultPage/CommitPage/RecordPage/RecordDetail";
 
 export default {
   name: "CommitBoard",
-  components: {PageHeader},
+  components: {RecordDetail},
   props: {
     commitId: {
       type: Number,
       required: true
+    },
+    examId: {
+      type: Number,
+      required: true
     }
   },
   data() {
@@ -79,7 +86,9 @@ export default {
       dialog: {
         stop: -1
       },
-      loading: false
+      loading: false,
+      recordDetailVisible: false,
+      selectedRecordId: 0
     };
   },
   mounted() {
@@ -88,19 +97,26 @@ export default {
   methods: {
     fetchData() {
       this.$apis.getCommitByCommitId(this.commitId)
-          .then(_res => {
-            this.commit = _res.data.res;
-            console.log(this.commit);
-          }).catch(_err => {
+        .then(_res => {
+          this.commit = _res.data.res;
+        }).catch(_err => {
         console.log(_err);
 
       });
     },
+    openRecordDetail(id) {
+      console.log("jumpToRecordDetail!");
+      this.selectedRecordId = id;
+      console.log("examId", this.examId);
+      console.log("recordId", this.selectedRecordId);
+      this.recordDetailVisible = true;
+      // this.$router.push(`${this.$route.path}/commit/${this.commitId}/record/${id}`);
+    },
     formatTimestamp,
     buildStatusToTagType,
     buildStatusToTagContent,
     buildStatusToColor(status) {
-      switch(status) {
+      switch (status) {
         case "success":
           return this.$color.ElEMENT_COLOR.successColor;
         case "warning":
@@ -113,23 +129,22 @@ export default {
           return "black";
       }
     },
-    stopRecordButton(status) {
-      if (this.commit.createdAt !== undefined) {
-        return (
-            status === "RUNNING" &&
-            (Date.parse(new Date().toString()) / 1000 - this.commit.createdAt) /
-            60 >
-            7
-        );
+    // 点击"停止"按钮,停止当前提交的运行;
+    async handleStopRecordButtonClick(recordId) {
+      const response = await this.$apis.stopRecordById(recordId);
+      if (response.data.res) {
+        this.$message.success(`记录${recordId}被用户手动停止`);
+        setTimeout(() => this.fetchData(), 0);
+      } else {
+        this.$message.error(response.data);
       }
-      return false;
-    }
+    },
   }
 };
 </script>
 
 <style lang="scss" scoped>
-:deep .el-descriptions__body{
+:deep .el-descriptions__body {
   font-size: 16px;
   background-color: #F8F9FB; //样式穿透,覆盖原本的样式
 }
@@ -143,4 +158,12 @@ export default {
   border-bottom: none !important;
   padding-bottom: 0 !important;
 }
+
+.stop-record-button {
+  color: var(--el-color-danger);
+}
+
+.stop-record-button:hover {
+  color: rgba(245, 108, 108, 75%);
+}
 </style>

+ 28 - 6
src/views/CoderPage/ResultPage/ResultDetail.vue

@@ -27,7 +27,7 @@
             <el-button
                 type="primary"
                 size="mini"
-                @click="$router.push(`${$route.path}/commit/${scope.row.id}`)"
+                @click="openCommitDetail(scope.row.id)"
             >详情</el-button
             >
           </template>
@@ -35,20 +35,38 @@
       </el-table>
     </el-card>
   </div>
+
+  <el-dialog width="80%" v-model="commitDetailVisible" title="运行详情">
+    <CommitDetail :commit-id="this.commitId" :exam-id="this.examId"></CommitDetail>
+  </el-dialog>
+
 </template>
 
 <script>
 import {ElMessage} from "element-plus";
 import PageHeader from "@/components/PageHeader.vue";
+import CommitDetail from "@/views/CoderPage/ResultPage/CommitPage/CommitDetail";
 import {formatTimestamp} from "@/utils/coder-utils";
 
 export default {
   name: "ResultDetail",
-  components: {PageHeader},
+  components: {PageHeader,CommitDetail},
+  props: {
+    resultId: {
+      type: Number,
+      required: true
+    },
+    examId: {
+      type: Number,
+      required: true
+    },
+  },
   data(){
     return {
       result: {},
       user: {},
+      commitDetailVisible:false,
+      commitId:0
     };
   },
   mounted() {
@@ -57,8 +75,8 @@ export default {
   methods: {
     formatTimestamp,
     fetchData() {
-      const {resultId} = this.$route.params;
-      this.$apis.getResultByResultId(resultId)
+      console.log("resultId",this.resultId);
+      this.$apis.getResultByResultId(this.resultId)
           .then(_res => {
             this.result = _res.data.res ?? {};
             this.user = this.result.owner;
@@ -68,6 +86,10 @@ export default {
     },
     getBack() {
       this.$router.go(-1);
+    },
+    openCommitDetail(id){
+      this.commitId = id;
+      this.commitDetailVisible=true;
     }
   }
 };
@@ -75,7 +97,7 @@ export default {
 
 <style lang="scss" scoped>
 .result-container {
-  margin: 40px 10vw 80px 10vw;
-  min-height: calc(100vh - 100px);
+  margin: 10px 0 10px 0;
+  //min-height: calc(100vh - 400px);
 }
 </style>

+ 1 - 1
src/views/CourseDetailPage/tabs/CoursewareTab.vue

@@ -72,7 +72,7 @@
       <el-table :data="fileEntryList" style="width: 100%">
         <el-table-column
             type="index"
-            width="30"
+            width="50"
         >
         </el-table-column>
         <el-table-column

+ 33 - 9
src/views/CourseDetailPage/tabs/GroupTab.vue

@@ -12,17 +12,24 @@
                    plain type="primary" @click="createGroupDialog=true">
           创建队伍
         </el-button>
-        <el-button v-else class="tabs-function-button"
-                   plain type="primary" @click="addMemberDialog=true">
-          邀请成员
-        </el-button>
+          <div v-else>
+              <el-button class="tabs-function-button"
+                         plain type="primary" @click="addMemberDialog=true">
+                  邀请成员
+              </el-button>
+              <el-button class="tabs-function-button"
+                         plain type="primary" @click="deleteGroup=true">
+                  解散团队
+              </el-button>
+          </div>
+
       </div>
     </div>
     <el-table v-if="isRuleExisted" :data="groupTableData" style="width: 100%">
       <el-table-column label="组名">
         <template #default="scope">
         <span
-            :style="groupData && scope.row['groupVO'].id===groupData['groupVO'].id ? 'color: #67C23A':''">
+            :style="groupData && scope.row['groupVO'].id===groupData['groupVO'].id ? 'color: var(--el-color-primary)':''">
           {{ scope.row["groupVO"].name }}
         </span>
         </template>
@@ -33,7 +40,7 @@
             <div v-for="item of scope.row.members"
                  :key="'member'+item.id"
                  style="margin-right: 10px"
-                 :style="groupData && scope.row['groupVO'].id===groupData['groupVO'].id ? 'color: #67C23A':''">
+                 :style="groupData && scope.row['groupVO'].id===groupData['groupVO'].id ? 'color: var(--el-color-primary)':''">
               {{ item.username }}
             </div>
           </div>
@@ -81,10 +88,15 @@
     </div>
   </el-dialog>
 
+    <el-dialog v-model="deleteGroup">
+        <div style="margin: 10px;position: relative;left: 280px">确定要解散团队吗?</div>
+        <el-button type="primary" style="margin: 10px;position: relative;left: 220px" @click="deleteUserGroup">确认</el-button>
+        <el-button style="margin: 10px;position: relative;left: 300px" @click="beforeDeleteGroup">取消</el-button>
+    </el-dialog>
 </template>
 
 <script>
-import {ElMessage, ElMessageBox} from "element-plus";
+import {ElMessage} from "element-plus";
 
 export default {
   name: "GroupTab",
@@ -100,7 +112,7 @@ export default {
     return {
       groupTableData: [],
       groupData: null,
-
+      deleteGroup:false,
       isRuleExisted: false,
       ruleFormDialog: false,
       maxNameLen:10,
@@ -161,6 +173,7 @@ export default {
   methods: {
     async init() {
       const _this = this;
+      _this.groupTableData = []; // init前置空
       const ruleRes = (await _this.$apis.findGroupRule(_this.courseId)).data;
       _this.isRuleExisted = !ruleRes.code;
       if (_this.isRuleExisted) {
@@ -205,6 +218,17 @@ export default {
       });
     },
 
+    beforeDeleteGroup(){
+        this.deleteGroup=false;
+    },
+
+    deleteUserGroup(){
+       this.$apis.deleteGroup(this.$store.state.user.id,this.courseId).then(res=>{
+           console.log(res);
+           this.$router.go(0);
+       });
+       this.beforeDeleteGroup();
+    } ,
     beforeGroupFormClose() {
       this.createGroupDialog = false;
       this.$refs.createGroupFormRef.resetFields();
@@ -269,7 +293,7 @@ export default {
               });
         }
       });
-
+    this.addMemberDialog=false;
     },
 
   },

+ 3 - 3
src/views/CourseWarePage/pdf/Pdf.vue

@@ -28,8 +28,8 @@
             this._context = this._canvas.getContext("2d");
 
             // Default size
-            this._canvas.height = 450;
-            this._canvas.width = 700;
+            this._canvas.height = 500;
+            this._canvas.width = 800;
 
             if (this.src) {
                 this.load(this.src);
@@ -67,7 +67,7 @@
             },
             showPage() {
                 this._pdf && this._pdf.getPage(this.currentPage || 1).then(page => {
-                    const scale = 2.5;
+                    const scale = 1;
                     const viewport = page.getViewport({scale: scale});
 
                     this._canvas.height = viewport.height;

+ 1 - 1
src/views/ProblemPage/ProblemDetail.vue

@@ -129,7 +129,7 @@
       </span>
       </template>
     </el-dialog>
-    <el-dialog v-model="dialog.update" title="更新题目文件">
+    <el-dialog destroy-on-close v-model="dialog.update" title="更新题目文件">
       <el-form label-width="40px">
         <el-form-item label="路径" prop="name">
           <div>{{ selectedFile }}</div>

+ 13 - 0
src/views/RootPage/index.vue

@@ -0,0 +1,13 @@
+<template>
+  <div>root</div>
+</template>
+
+<script>
+export default {
+  name: "RootPage"
+};
+</script>
+
+<style scoped>
+
+</style>

+ 5 - 0
yarn.lock

@@ -10625,6 +10625,11 @@ yargs@^16.0.0:
     y18n "^5.0.5"
     yargs-parser "^20.2.2"
 
+yarn@^1.22.19:
+  version "1.22.19"
+  resolved "https://registry.npmmirror.com/yarn/-/yarn-1.22.19.tgz#4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
+  integrity sha512-/0V5q0WbslqnwP91tirOvldvYISzaqhClxzyUKXYxs07yUILIs5jx/k6CFe8bvKSkds5w+eiOqta39Wk3WxdcQ==
+
 yocto-queue@^0.1.0:
   version "0.1.0"
   resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz"

Some files were not shown because too many files changed in this diff