Просмотр исходного кода

Merge remote-tracking branch 'origin/seec' into seec

yhd12345 4 лет назад
Родитель
Сommit
a18af45a73

+ 2 - 1
src/api/analysis/const.js

@@ -2,7 +2,8 @@
 export const REQUEST_BASE_URL_PROD = "https://smart-server.seec.seecoder.cn/";
 // 开发url (mock的地址
 // export const REQUEST_BASE_URL_DEV = "http://localhost:8080/api";
-export const REQUEST_BASE_URL_DEV = "/api";
+// export const REQUEST_BASE_URL_DEV = "/api";
+export const REQUEST_BASE_URL_DEV = "https://smart-server.seec.seecoder.cn/";
 export const ROLE = {
   STUDENT: "STUDENT", //学生身份
   TEACHER: "TEACHER", //教师身份

+ 13 - 6
src/api/course/course.js

@@ -86,14 +86,20 @@ function uploadCourseImage(name, image) {
   });
 }
 
-function uploadCarouselChart(input){
-  return axios.post(`${prefix}/uploadCarouseChart`,input);
+function uploadCarouselChart(input) {
+  return axios.post(`${prefix}/uploadCarouseChart`, input);
 }
 
-function queryCarouselChart(){
-  return axios.get(`${prefix}/queryCarouselChart`,{
-    params:{
+function queryCarouselChart() {
+  return axios.get(`${prefix}/queryCarouselChart`, {
+    params: {}
+  });
+}
 
+function findCourseByName(data) {
+  return axios.get(`${prefix}/findCourseByName`, {
+    params: {
+      name: data,
     }
   });
 }
@@ -115,7 +121,8 @@ const courseAPIs = {
   getCourseByEvalId,
   uploadCourseImage,
   uploadCarouselChart,
-  queryCarouselChart
+  queryCarouselChart,
+  findCourseByName,
 };
 
 export default courseAPIs;

+ 0 - 29
src/api/courseWare.js

@@ -25,32 +25,6 @@ function getCourseWareById(id) {
     return axios.get(`${prefix}/getById`, {params: {id}});
 }
 
-function downloadCourseWare(id) {
-    return axios.get(`${prefix}/download`, {params: {id}}, {responseType: "blob"}
-        //{headers: {Authorization: localStorage.getItem("token") }}
-    );
-}
-
-// const host = process.env.NODE_ENV === "development" ? "http://localhost:8080" : "";
-// const slideUrl = host + "/api/slide";
-// const useSlideServer = postfix => postfix ? slideUrl + postfix : slideUrl;
-
-// // 获取课件的文件链接
-// function getSlideUrl (slideId) {
-//     // return axios
-//     //     .get(useSlideServer("/" + slideId + "/url"))
-//     //     .then(res => res.data);
-//     return axios.get(`${prefix}/getSlideUrl`, {params: {slideId}});
-// }
-//
-// // 获取某个具体课件的信息
-// function getSlideInfo (slideId) {
-//     // return axios
-//     //     .get(useSlideServer("/" + slideId))
-//     //     .then(res => res.data);
-//     return axios.get(`${prefix}/getSlideInfo`, {params: {slideId}});
-// }
-
 function checkCourseWareNameUnique(courseId, name) {
     return axios.get(`${prefix}/checkName`, {params: {courseId, name}});
 }
@@ -70,10 +44,7 @@ const courseWareAPIs = {
     getCourseWaresByCourseId,
     getCourseWareById,
     uploadCourseWareFile,
-    downloadCourseWare,
     checkCourseWareNameUnique,
-    // getSlideUrl,
-    // getSlideInfo,
     changeCourseWareName
 };
 

+ 5 - 0
src/api/project.js

@@ -59,6 +59,10 @@ function forkProject(projectId, name = null) {
   });
 }
 
+function findAllPublicProjectsGroupByCourse() {
+  return axios.get(`${prefix}/findAllPublicGroupByCourse`);
+}
+
 const projectAPIs = {
   findAllProjects,
   findCourseProjects,
@@ -69,6 +73,7 @@ const projectAPIs = {
   createProject,
   updateCourseProjectState,
   forkProject,
+  findAllPublicProjectsGroupByCourse,
 };
 
 export default projectAPIs;

+ 102 - 42
src/components/Analysis/AnalysisGroupCard.vue

@@ -6,10 +6,10 @@
                 <span>小组信息</span>
             </template>
             <el-descriptions :column="2">
-                <el-descriptions-item label="小组总得分">{{
+                <el-descriptions-item label="小组总得分:">{{
                     totalScore
                     }}</el-descriptions-item>
-                <el-descriptions-item label="额外得分bonus">{{
+                <el-descriptions-item label="额外得分bonus:">{{
                     bonus
                     }}</el-descriptions-item>
             </el-descriptions>
@@ -47,13 +47,36 @@
                 </el-descriptions>
             </el-card>
         </el-card>
+        <!--        图表-->
+        <el-card class="box-card" style="margin-top: 20px">
+            <el-row :gutter="20">
+                <el-col :span="6">
+                    <p class="table_font">commit贡献占比</p>
+                    <div id="main1" class="pie"
+                    /></el-col>
+                <el-col :span="6">
+                    <p class="table_font">流水线部署贡献占比</p>
+                    <div id="main2" class="pie"
+                    />
+                </el-col>
+                <el-col :span="6">
+                    <p class="table_font">缺陷贡献占比</p>
+                    <div id="main3" class="pie"
+                    /></el-col>
+                <el-col :span="6">
+                    <p class="table_font">需求树贡献占比</p>
+                    <div id="main4" class="pie"
+                    />
+                </el-col>
+            </el-row>
+        </el-card>
 <!--        commit信息-->
         <el-card class="box-card" style="margin-top: 20px">
             <template v-slot:header class="clearfix">
                 <span>commit信息</span>
             </template>
             <el-descriptions :column="1">
-                <el-descriptions-item label="commit得分">{{
+                <el-descriptions-item label="commit得分:">{{
                     commitScore
                     }}</el-descriptions-item>
             </el-descriptions>
@@ -62,16 +85,16 @@
                     <span>commit统计信息</span>
                 </template>
                 <el-descriptions :column="2">
-                    <el-descriptions-item label="commit总次数">{{
+                    <el-descriptions-item label="commit总次数:">{{
                         commitMessage.commit_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="有效commit次数">{{
+                    <el-descriptions-item label="有效commit次数:">{{
                         commitMessage.valid_commit_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="bugList_commit次数">{{
+                    <el-descriptions-item label="bugList_commit次数:">{{
                         commitMessage.buglist_commit
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="feature_commit次数">{{
+                    <el-descriptions-item label="feature_commit次数:">{{
                         commitMessage.feature_commit
                         }}</el-descriptions-item>
                 </el-descriptions>
@@ -95,7 +118,7 @@
                 <span>缺陷信息</span>
             </template>
             <el-descriptions :column="1">
-                <el-descriptions-item label="缺陷得分">{{
+                <el-descriptions-item label="缺陷得分:">{{
                     bugScore
                     }}</el-descriptions-item>
             </el-descriptions>
@@ -104,13 +127,13 @@
                     <span>缺陷统计信息</span>
                 </template>
                 <el-descriptions :column="2">
-                    <el-descriptions-item label="缺陷数目">{{
+                    <el-descriptions-item label="缺陷数目:">{{
                         bugList.bug_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="高优先级缺陷数目">{{
+                    <el-descriptions-item label="高优先级缺陷数目:">{{
                         bugList.high_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="已经修复的缺陷数目">{{
+                    <el-descriptions-item label="已经修复的缺陷数目:">{{
                         bugList.finished_times
                         }}</el-descriptions-item>
                 </el-descriptions>
@@ -122,7 +145,7 @@
                 <span>需求树信息</span>
             </template>
             <el-descriptions :column="1">
-                <el-descriptions-item label="需求得分">{{
+                <el-descriptions-item label="需求得分:">{{
                     nodeScore
                     }}</el-descriptions-item>
             </el-descriptions>
@@ -131,13 +154,13 @@
                     <span>需求统计信息</span>
                 </template>
                 <el-descriptions :column="2">
-                    <el-descriptions-item label="需求节点数目">{{
+                    <el-descriptions-item label="需求节点数目:">{{
                         treeNode.treeNode_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="高优先级需求数目">{{
+                    <el-descriptions-item label="高优先级需求数目:">{{
                         treeNode.high_treeNode_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="已经完成的需求数目">{{
+                    <el-descriptions-item label="已经完成的需求数目:">{{
                         treeNode.finished_treeNode_times
                         }}</el-descriptions-item>
                 </el-descriptions>
@@ -149,7 +172,7 @@
                 <span>流水线部署信息</span>
             </template>
             <el-descriptions :column="1">
-                <el-descriptions-item label="部署得分">{{
+                <el-descriptions-item label="部署得分:">{{
                     pipelineScore
                     }}</el-descriptions-item>
             </el-descriptions>
@@ -158,41 +181,19 @@
                     <span>部署统计信息</span>
                 </template>
                 <el-descriptions :column="2">
-                    <el-descriptions-item label="流水线部署次数">{{
+                    <el-descriptions-item label="流水线部署次数:">{{
                         arrange.pipeline_deploy
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="流水线部署成功次数">{{
+                    <el-descriptions-item label="流水线部署成功次数:">{{
                         arrange.pipeline_pass
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="流水线部署失败次数">{{
+                    <el-descriptions-item label="流水线部署失败次数:">{{
                         arrange.pipline_failure
                         }}</el-descriptions-item>
                 </el-descriptions>
             </el-card>
         </el-card>
-<!--        图表-->
-        <el-card class="box-card" style="margin-top: 20px">
-            <el-row :gutter="20">
-                <el-col :span="6">
-                    <p class="table_font">commit贡献占比</p>
-                    <div id="main1" class="pie"
-                    /></el-col>
-                <el-col :span="6">
-                    <p class="table_font">流水线部署贡献占比</p>
-                    <div id="main2" class="pie"
-                    />
-                </el-col>
-                <el-col :span="6">
-                    <p class="table_font">缺陷贡献占比</p>
-                    <div id="main3" class="pie"
-                    /></el-col>
-                <el-col :span="6">
-                    <p class="table_font">需求树贡献占比</p>
-                    <div id="main4" class="pie"
-                    />
-                </el-col>
-            </el-row>
-        </el-card>
+
     </div>
 </template>
 
@@ -531,5 +532,64 @@ export default {
 </script>
 
 <style scoped>
+    .score-box {
+        width: 20px;
+        height: 10px;
+        background-color: #98e7ff;
+    }
+    .nui-scroll {
+        margin-top: 5px;
+        width: 99%;
+        height: 300px;
+        overflow: auto;
+    }
+
+    .nui-scroll::-webkit-scrollbar {
+        width: 8px;
+        height: 8px;
+    }
+    /*正常情况下滑块的样式*/
+
+    .nui-scroll::-webkit-scrollbar-thumb {
+        background-color: rgba(0, 0, 0, .05);
+        border-radius: 10px;
+        -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .1);
+    }
+    /*鼠标悬浮在该类指向的控件上时滑块的样式*/
+
+    .nui-scroll:hover::-webkit-scrollbar-thumb {
+        background-color: rgba(0, 0, 0, .2);
+        border-radius: 10px;
+        -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .1);
+    }
+    /*鼠标悬浮在滑块上时滑块的样式*/
+
+    .nui-scroll::-webkit-scrollbar-thumb:hover {
+        background-color: rgba(0, 0, 0, .4);
+        -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .1);
+    }
+    /*正常时候的主干部分*/
+
+    .nui-scroll::-webkit-scrollbar-track {
+        border-radius: 10px;
+        -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
+        background-color: white;
+    }
+    /*鼠标悬浮在滚动条上的主干部分*/
+
+    .nui-scroll::-webkit-scrollbar-track:hover {
+        -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .4);
+        background-color: rgba(0, 0, 0, .01);
+    }
 
+    .box-innercard {
+        /*background-color: #1f00f5;*/
+    }
+    .pie {
+        width: 200px;
+        height: 150px;
+    }
+    /* .main{
+      display: flex;
+    } */
 </style>

+ 24 - 24
src/components/Analysis/AnalysisStudentCard.vue

@@ -6,10 +6,10 @@
                 <span>个人信息</span>
             </template>
             <el-descriptions :column="2">
-                <el-descriptions-item label="个人总得分">{{
+                <el-descriptions-item label="个人总得分:">{{
                     totalScore
                     }}</el-descriptions-item>
-                <el-descriptions-item label="额外得分bonus">{{
+                <el-descriptions-item label="额外得分bonus:">{{
                     bonus
                     }}</el-descriptions-item>
             </el-descriptions>
@@ -18,13 +18,13 @@
                     <span>基本信息</span>
                 </template>
                 <el-descriptions :column="2">
-                    <el-descriptions-item label="姓名">{{
+                    <el-descriptions-item label="姓名:">{{
                         user.name
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="用户id">{{
+                    <el-descriptions-item label="用户id:">{{
                         user.userId
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="电子邮箱">{{
+                    <el-descriptions-item label="电子邮箱:">{{
                         user.email
                         }}</el-descriptions-item>
                 </el-descriptions>
@@ -35,10 +35,10 @@
                 </template>
                 <el-descriptions :column="2" style="margin-top: 20px">
                     <div v-for="item in productList" v-bind:key="item">
-                        <el-descriptions-item label="项目id" :key="item.projectId">{{
+                        <el-descriptions-item label="项目id:" :key="item.projectId">{{
                             item.projectId
                             }}</el-descriptions-item>
-                        <el-descriptions-item label="项目名称" :key="item.projectName">{{
+                        <el-descriptions-item label="项目名称:" :key="item.projectName">{{
                             item.projectName
                             }}</el-descriptions-item>
                     </div>
@@ -51,7 +51,7 @@
                 <span>commit信息</span>
             </template>
             <el-descriptions :column="1">
-                <el-descriptions-item label="commit得分">{{
+                <el-descriptions-item label="commit得分:">{{
                     commitScore
                     }}</el-descriptions-item>
             </el-descriptions>
@@ -60,16 +60,16 @@
                     <span>commit统计信息</span>
                 </template>
                 <el-descriptions :column="2">
-                    <el-descriptions-item label="commit总次数">{{
+                    <el-descriptions-item label="commit总次数:">{{
                         commitMessage.commit_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="有效commit次数">{{
+                    <el-descriptions-item label="有效commit次数:">{{
                         commitMessage.valid_commit_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="bugList_commit次数">{{
+                    <el-descriptions-item label="bugList_commit次数:">{{
                         commitMessage.buglist_commit
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="feature_commit次数">{{
+                    <el-descriptions-item label="feature_commit次数:">{{
                         commitMessage.feature_commit
                         }}</el-descriptions-item>
                 </el-descriptions>
@@ -94,7 +94,7 @@
                 <span>缺陷信息</span>
             </template>
             <el-descriptions :column="1">
-                <el-descriptions-item label="缺陷得分">{{
+                <el-descriptions-item label="缺陷得分:">{{
                     bugScore
                     }}</el-descriptions-item>
             </el-descriptions>
@@ -103,13 +103,13 @@
                     <span>缺陷统计信息</span>
                 </template>
                 <el-descriptions :column="2">
-                    <el-descriptions-item label="缺陷数目">{{
+                    <el-descriptions-item label="缺陷数目:">{{
                         bugList.bug_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="高优先级缺陷数目">{{
+                    <el-descriptions-item label="高优先级缺陷数目:">{{
                         bugList.high_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="已经修复的缺陷数目">{{
+                    <el-descriptions-item label="已经修复的缺陷数目:">{{
                         bugList.finished_times
                         }}</el-descriptions-item>
                 </el-descriptions>
@@ -122,7 +122,7 @@
                 <span>需求树信息</span>
             </template>
             <el-descriptions :column="1">
-                <el-descriptions-item label="需求得分">{{
+                <el-descriptions-item label="需求得分:">{{
                     nodeScore
                     }}</el-descriptions-item>
             </el-descriptions>
@@ -131,13 +131,13 @@
                     <span>需求统计信息</span>
                 </template>
                 <el-descriptions :column="2">
-                    <el-descriptions-item label="需求节点数目">{{
+                    <el-descriptions-item label="需求节点数目:">{{
                         treeNode.treeNode_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="高优先级需求数目">{{
+                    <el-descriptions-item label="高优先级需求数目:">{{
                         treeNode.high_treeNode_times
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="已经完成的需求数目">{{
+                    <el-descriptions-item label="已经完成的需求数目:">{{
                         treeNode.finished_treeNode_times
                         }}</el-descriptions-item>
                 </el-descriptions>
@@ -150,7 +150,7 @@
                 <span>流水线部署信息</span>
             </template>
             <el-descriptions :column="1">
-                <el-descriptions-item label="部署得分">{{
+                <el-descriptions-item label="部署得分:">{{
                     pipelineScore
                     }}</el-descriptions-item>
             </el-descriptions>
@@ -159,13 +159,13 @@
                     <span>部署统计信息</span>
                 </template>
                 <el-descriptions :column="2">
-                    <el-descriptions-item label="流水线部署次数">{{
+                    <el-descriptions-item label="流水线部署次数:">{{
                         pipeline.pipeline_deploy
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="流水线部署成功次数">{{
+                    <el-descriptions-item label="流水线部署成功次数:">{{
                         pipeline.pipeline_pass
                         }}</el-descriptions-item>
-                    <el-descriptions-item label="流水线部署失败次数">{{
+                    <el-descriptions-item label="流水线部署失败次数:">{{
                         pipeline.pipline_failure
                         }}</el-descriptions-item>
                 </el-descriptions>

+ 3 - 3
src/components/GlobalHeader.vue

@@ -18,12 +18,12 @@
       <el-menu-item index="5">
         测试
       </el-menu-item>
-      <el-menu-item index="6">
-        个人中心
-      </el-menu-item>
       <el-menu-item v-if="isTeacher" index="7">
         管理
       </el-menu-item>
+      <el-menu-item index="6">
+        个人中心
+      </el-menu-item>
     </el-menu>
     <div id="global-header-icon">
       <el-tooltip content="前往通知页" placement="bottom" effect="light" :show-after="1000">

+ 6 - 1
src/components/ProjectCard.vue

@@ -34,6 +34,7 @@ export default {
   props: {
     projectVO: Object,
     type: String,
+    isPublic: undefined,
   },
   data() {
     return {
@@ -69,6 +70,9 @@ export default {
           duration: 1000,
         });
         await this.$router.push({name: "Auth", params: {login_to: "/portal"}});
+      } else if (this.isPublic) {
+        const courseId = (await this.$apis.findCourseByName(this.isPublic)).data.data.id;
+        await this.$router.push(`/course/${courseId}`);
       } else {
         if (this.projectVO.name) {
           window.open("https://devcloud.seec.seecoder.cn/project/" + this.projectVO.id + "/schedule?id_token=" + this.$store.state.user.token);
@@ -95,7 +99,7 @@ export default {
 
 .project:hover {
   cursor: pointer;
-  border: 1px solid #aaaaaa;
+  border: 1px solid #999999;
 }
 
 .projectId {
@@ -109,6 +113,7 @@ export default {
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
+  font-weight: bold;
 }
 
 .project-description {

+ 12 - 9
src/components/TestCard.vue

@@ -70,11 +70,18 @@ export default {
       return store.state.user.token;
     },
     isCreator() {
-      if (this.testVO.examId) {
-        return Number(this.testVO.course.teacherId) === Number(this.$store.state.user.id);
-      } else {
-        return this.testVO.creator.username === this.$store.state.user.username;
+      let result = null;
+      switch (this.type) {
+        case "eval":
+          result = Number(this.testVO.course.teacherId) === Number(this.$store.state.user.id);
+          break;
+        case "coder":
+          result = this.testVO.creator.username === this.$store.state.user.username;
+          break;
+        default:
+          break;
       }
+      return result;
     },
     isTeacher() {
       return this.$store.getters.isTeacher;
@@ -187,15 +194,11 @@ export default {
         return;
       }
 
-      console.log(this.testVO);
-
       if (this.isCreator) {
         if (this.type === "eval") {
-          this.$router.push(`/exam/${this.testVO.examId}`);
-          // window.open("https://eval.seec.seecoder.cn/teacher/exam/" + this.testVO.examId + "/details?id_token" + this.$store.state.user.token);
+          this.$router.push(`/evalExam/${this.testVO.examId}/teacher/details`);
         } else {
           this.$router.push(`/exam/${this.testVO.id}`); //跳转到考试详情页
-          // window.open("https://coder.seec.seecoder.cn/exam/" + this.testVO.id + "?id_token=" + this.$store.state.user.token);
         }
       } else if (this.isTeacher) {
         this.$message.error("无权访问其他教师创建的课程");

+ 100 - 94
src/views/CoursePage/tabs/CoursewareTab.vue

@@ -8,18 +8,17 @@
                   plain>新建</el-button>
       </el-col>
       <el-col :span="15">
-          <span style="font-size: smaller; position: absolute; bottom: 25%">(支持拓展名:.pdf .ppt .pptx .doc .docx .xls .jpg .jpeg .png,单次只可上传一个文件)</span>
+          <span style="font-size: smaller; position: absolute; bottom: 25%">(支持拓展名:.pdf .ppt .pptx .doc .docx .xls .jpg .jpeg .png .exe .zip,仅支持单次上传一个文件)</span>
       </el-col>
     </el-row>
     <el-dialog v-model="uploadDialogVisible" :before-close="handleCancelUpload" :width="700">
-        <el-form ref="formRef" :model="form"  label-width="100px">
+        <el-form ref="formRef" :model="form" label-width="100px" style="margin-top: 10px">
           <el-form-item label="使用类型" required>
               <el-select v-model="form.useMethod" placeholder="类型">
-                  <el-option key="1" label="浏览" value="SCAN"></el-option>
-                  <el-option key="2" label="附件" value="ATTACHMENT"></el-option>
+                  <el-option key="1" label="浏览(支持拓展名:.pdf .ppt .pptx .doc .docx .xls .jpg .jpeg .png)" value="SCAN"></el-option>
+                  <el-option key="2" label="附件(支持拓展名:.exe .zip)" value="ATTACHMENT"></el-option>
               </el-select>
           </el-form-item>
-
           <el-form-item label="文件" required>
               <el-upload
                   :file-list="fileList"
@@ -29,11 +28,7 @@
                   :auto-upload="false"
                   :show-file-list="false"
               >
-                  <el-button
-                      plain
-                      type="primary"
-                      class="tabs-function-button"
-                        >上传文件</el-button>(仅支持上传单个文件)
+                  <el-button plain type="primary" class="tabs-function-button">上传文件</el-button>(仅支持上传单个文件)
               </el-upload>
               <el-tag
                       v-if="isNameUnique"
@@ -60,8 +55,6 @@
         </div>
     </el-dialog>
 
-
-
       <el-table :data="fileEntryList">
         <el-table-column
             type="index"
@@ -75,11 +68,10 @@
             <el-icon v-if="scope.row['courseWareVO'].useMethod === 'SCAN'" style="color: #337ecc" class="myicon"><Reading /></el-icon>
             <el-icon v-if="scope.row['courseWareVO'].useMethod === 'ATTACHMENT'" style="color: green" class="myicon"><Paperclip /></el-icon>
               {{scope.row['courseWareVO'].name}}
-              <el-link v-if="Number(scope.row['courseWareVO'].senderId) === Number(this.$store.state.user.id)"
-                       @click="handleChangeName(scope.row['courseWareVO'].id, scope.row['courseWareVO'].name)"
-                        :underline="false">
-                  <el-icon :size="20" style="color: #337ecc; margin-left: 5px"><Edit /></el-icon>
-              </el-link>
+              <el-button v-if="Number(scope.row['courseWareVO'].senderId) === Number(this.$store.state.user.id)"
+                         @click="handleChangeName(scope.row['courseWareVO'].id, scope.row['courseWareVO'].name)"
+                         type="text" icon="el-icon-edit-outline" style="color: #337ecc; font-size: 18px">
+              </el-button>
           </template>
       </el-table-column>
       <el-table-column
@@ -95,10 +87,8 @@
         label="上传时间"
         width="160"
         :sortable="true"
-        :sort-method="sortByDate2"
         >
           <template #default="scope">
-<!--            {{timestampToTime(scope.row["courseWareVO"].createdTime)}}-->
               {{timestampToTime(scope.row["courseWareVO"].createdTime)}}
           </template>
       </el-table-column>
@@ -107,29 +97,29 @@
         label="操作"
         width="200">
           <template #default="scope">
-              <a :href="scope.row['courseWareVO'].fileUrl" v-if="isPdfOrPicture(scope.row['courseWareVO'].name) === 'OTHER'">
-              <el-link v-if="scope.row['courseWareVO'].useMethod === 'SCAN'"
-                       size="mini" style="color: #409EFF" :underline="false">预览</el-link>
+            <a :href="scope.row['courseWareVO'].fileUrl" v-if="isPdfOrPicture(scope.row['courseWareVO'].name) === 'OTHER'">
+              <el-button v-if="scope.row['courseWareVO'].useMethod === 'SCAN'"
+                       style="color: #409EFF; margin-right: 10px" type="text">预览</el-button>
             </a>
-            <el-link v-if="scope.row['courseWareVO'].useMethod === 'SCAN' && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PDF'"
+            <el-button v-if="scope.row['courseWareVO'].useMethod === 'SCAN' && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PDF'"
                  @click="handlePreviewFile(scope.row['courseWareVO'].fileUrl)"
-                   size="mini" style="color: #409EFF" :underline="false">预览</el-link>
-            <el-link v-if="scope.row['courseWareVO'].useMethod === 'SCAN' && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PICTURE'"
+                       style="color: #409EFF" type="text">预览</el-button>
+            <el-button v-if="scope.row['courseWareVO'].useMethod === 'SCAN' && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PICTURE'"
                  @click="handlePreviewPicture(scope.row['courseWareVO'])"
-                 size="mini" style="color: #409EFF" :underline="false">预览</el-link>
+                       style="color: #409EFF; margin-right: 10px" type="text">预览</el-button>
             <a :href="scope.row['courseWareVO'].fileUrl" v-if="isPdfOrPicture(scope.row['courseWareVO'].name) === 'OTHER'">
-              <el-link v-if="scope.row['courseWareVO'].useMethod === 'SCAN'"
-                         size="mini" style="color: #67C23A; margin-left: 10px" :underline="false">下载</el-link>
+              <el-button style="color: #67C23A" type="text">下载</el-button>
             </a>
-            <el-link v-if="scope.row['courseWareVO'].useMethod === 'SCAN' && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PDF'"
+            <el-button v-if="isPdfOrPicture(scope.row['courseWareVO'].name) === 'PDF'"
                      @click="handlePreviewFile(scope.row['courseWareVO'].fileUrl)"
-                     size="mini" style="color: #67C23A; margin-left: 10px" :underline="false">下载</el-link>
+                    style="color: #67C23A" type="text">下载</el-button>
             <a :href="scope.row['courseWareVO'].fileUrl"
-               v-if="scope.row['courseWareVO'].useMethod === 'SCAN' && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PICTURE'">
-              <el-link size="mini" style="color: #67C23A; margin-left: 10px" :underline="false">下载</el-link>
+               v-if="isPdfOrPicture(scope.row['courseWareVO'].name) === 'PICTURE'">
+              <el-button style="color: #67C23A" type="text">下载</el-button>
             </a>
-            <el-link v-if="Number(scope.row['courseWareVO'].senderId) === Number(this.$store.state.user.id)"
-                       size="mini" style="color: #F56C6C; margin-left: 10px" :underline="false" @click="handleRemoveCourseWare(scope.row['courseWareVO'].id)">删除</el-link>
+            <el-button v-if="Number(scope.row['courseWareVO'].senderId) === Number(this.$store.state.user.id)"
+                       style="color: #F56C6C; margin-left: 10px" type="text"
+                       @click="handleRemoveCourseWare(scope.row['courseWareVO'].id)">删除</el-button>
           </template>
       </el-table-column>
     </el-table>
@@ -214,25 +204,6 @@ export default {
       this.init();
   },
   methods: {
-      sortByDate(obj1, obj2) {
-          console.log(obj1, obj2);
-          let val1 = obj1.deadline;
-          let val2 = obj2.deadline;
-          console.log(val1, val2);
-          console.log(val1 - val2);
-          return val1 - val2;
-      },
-
-      sortByDate2(obj1, obj2) {
-          console.log(obj1.courseWareVO, obj2.courseWareVO);
-          let val1 = obj1.courseWareVO.createdTime;
-          let val2 = obj2.courseWareVO.createdTime;
-          console.log(val1, val2);
-          console.log(val2 > val1 ? 1 : -1);
-          return val2 > val1 ? 1 : -1;
-      },
-
-
       async init() {
           this.fileEntryList = (await this.$apis.getCourseWaresByCourseId(this.courseId)).data.data;
           console.log(this.fileEntryList);
@@ -250,7 +221,12 @@ export default {
       },
 
       handleCancelChangeName() {
-          ElMessageBox.confirm("确定取消修改课件名称?")
+          ElMessageBox.confirm("是否退出修改课件名称?推出后将不保存已填写信息。", "提示", {
+              confirmButtonText: "确认退出",
+              cancelButtonText: "我再想想",
+              type: "warning",
+              center: true,
+          })
               .then(() => {
                   this.newName = null;
                   this.nameAppend = null;
@@ -259,7 +235,19 @@ export default {
       },
 
       handleConfirmChangeName() {
-          ElMessageBox.confirm("确定修改课件名称?")
+          if (this.newName === null  && this.nameAppend !== null) {
+              this.$message({
+                  message: "课件名称不可为空,请重新修改课件名称",
+                  type: "error"
+              });
+              return;
+          }
+          ElMessageBox.confirm("是否确定修改课件名称?", "提示", {
+              confirmButtonText: "确认修改",
+              cancelButtonText: "我再想想",
+              type: "warning",
+              center: true,
+          })
               .then(async () => {
                   const isNameUnique = (await this.$apis.checkCourseWareNameUnique(this.courseId, this.newName + this.nameAppend)).data.data;
                   if (!isNameUnique) {
@@ -286,13 +274,23 @@ export default {
       async handleUploadFile(file, fileList) {
           const fileType = file.name.substring(file.name.lastIndexOf(".") + 1);
           console.log(this.form.useMethod + " + " + file.name.substring(file.name.lastIndexOf(".") + 1));
-          if (!(fileType === "pdf" || fileType === "ppt" || fileType === "pptx" || fileType === "xls"
-                || fileType === "doc" || fileType === "docx" || fileType === "png" || fileType === "jpeg" || fileType === "jpg")) {
-              this.$message({
-                  message: "该文件类型不属于支持的课件类型",
-                  type: "error"
-              });
-              return;
+          if (this.form.useMethod === "SCAN") {
+              if (!(fileType === "pdf" || fileType === "ppt" || fileType === "pptx" || fileType === "xls"
+                  || fileType === "doc" || fileType === "docx" || fileType === "png" || fileType === "jpeg" || fileType === "jpg")) {
+                  this.$message({
+                      message: "该文件类型不属于支持的可浏览课件类型",
+                      type: "error"
+                  });
+                  return;
+              }
+          } else {
+              if (!(fileType === "exe" || fileType === "zip")) {
+                  this.$message({
+                      message: "该文件类型不属于支持的附件类型",
+                      type: "error"
+                  });
+                  return;
+              }
           }
           if (this.fileNum === 1) {
               this.$message({
@@ -316,6 +314,20 @@ export default {
       },
 
       async handleConfirmUpload() {
+        if (this.file === null) {
+            this.$message({
+              message: "尚未上传课件",
+              type: "error"
+            });
+            return;
+        }
+        if (this.newName === null && this.nameAppend !== null) {
+            this.$message({
+                message: "课件名称不可为空,请重新修改课件名称",
+                type: "error"
+            });
+            return;
+        }
         if (this.newName !== null) {
           const isNameUnique = (await this.$apis.checkCourseWareNameUnique(this.courseId, this.newName + this.nameAppend)).data.data;
           if (!isNameUnique) {
@@ -327,36 +339,30 @@ export default {
           }
         }
 
-        if (this.file === null) {
-            this.$message({
-                message: "尚未上传课件",
-                type: "error"
-            });
-        } else {
-            const fileUrl = (await this.$apis.uploadCourseWareFile(this.courseId + "/" + (this.newName == null ? this.file.name : (this.newName + this.nameAppend)), this.fileList[0].raw)).data.data;
-            this.$message({
-                message: "上传课件成功",
-                type: "success"
-            });
-            this.$apis.createCourseWare({
-                name: this.newName === null ? this.file.name : (this.newName + this.nameAppend),
-                size: this.file.size,
-                senderId: this.$store.state.user.id,
-                courseId: this.courseId,
-                createdTime: new Date(),
-                useTime: "BEFORE_CLASS",
-                useMethod: this.form.useMethod,
-                fileUrl: fileUrl,
-            }).then(async () => {
-                this.fileEntryList = (await this.$apis.getCourseWaresByCourseId(this.courseId)).data.data;
-            });
-            this.uploadDialogVisible = false;
-            this.isChangeNameWhenUpload = false;
-            this.isNameUnique = false;
-            this.fileNum = 0;
-            this.newName = null;
-            this.nameAppend = null;
-        }
+        const fileUrl = (await this.$apis.uploadCourseWareFile(this.courseId + "/" + (this.newName == null ? this.file.name : (this.newName + this.nameAppend)), this.file.raw)).data.data;
+        this.$apis.createCourseWare({
+            name: this.newName === null ? this.file.name : (this.newName + this.nameAppend),
+            size: this.file.size,
+            senderId: this.$store.state.user.id,
+            courseId: this.courseId,
+            createdTime: new Date(),
+            useTime: "BEFORE_CLASS",
+            useMethod: this.form.useMethod,
+            fileUrl: fileUrl,
+        }).then(async () => {
+            this.fileEntryList = (await this.$apis.getCourseWaresByCourseId(this.courseId)).data.data;
+        });
+        this.$message({
+          message: "上传课件成功",
+          type: "success"
+        });
+        this.uploadDialogVisible = false;
+        this.isChangeNameWhenUpload = false;
+        this.isNameUnique = false;
+        this.fileNum = 0;
+        this.newName = null;
+        this.nameAppend = null;
+        this.file = null;
       },
 
       handleCancelUpload(done) {
@@ -383,8 +389,8 @@ export default {
       },
 
       handleCloseFileTag() {
-        ElMessageBox.confirm("是否确认取消选择该课件?", "提示", {
-            confirmButtonText: "确认取消",
+        ElMessageBox.confirm("是否取消上传该课件?", "提示", {
+            confirmButtonText: "确定",
             cancelButtonText: "我再想想",
             type: "warning",
             center: true,

+ 32 - 33
src/views/CoursePage/tabs/TaskTab.vue

@@ -499,42 +499,42 @@ export default {
     toTask(task) {
       const _this = this;
       const type = task["examId"] ? "eval" : "coder";
-      let evalUrl;
-      let evalExamUrl;
-      let coderUrl;
-      let url;
-      if (_this.isStudent) {
-        evalUrl = "https://eval.seec.seecoder.cn/student/home/";
-        evalExamUrl = "https://eval.seec.seecoder.cn/exam/";
-        coderUrl = "https://coder.seec.seecoder.cn/exam/";
-        switch (this.state(task)) {
-          case "NOT_STARTED":
-            url = type === "eval" ? evalUrl : coderUrl;
-            break;
-          case "CLOSED":
-            url = type === "eval" ? evalUrl : coderUrl;
-            break;
-          case "FINISHED":
-            url = type === "eval" ? evalUrl : coderUrl;
-            break;
-          case "RUNNING":
-            if (task["isJoined"] || task["joined"]) {
-              url = type === "eval" ? evalExamUrl + task["examId"] + "/before-exam" : coderUrl + task.id;
-            } else {
-              url = type === "eval" ? evalUrl : coderUrl;
-            }
-            break;
-        }
-      } else {
-        evalUrl = "https://eval.seec.seecoder.cn/teacher/exam/";
-        coderUrl = "https://coder.seec.seecoder.cn/exam/";
-        url = type === "eval" ? evalUrl + task["examId"] + "/details" : coderUrl + task.id;
-      }
+      // let evalUrl;
+      // let evalExamUrl;
+      // let coderUrl;
+      // let url;
+      // if (_this.isStudent) {
+      //   evalUrl = "https://eval.seec.seecoder.cn/student/home/";
+      //   evalExamUrl = "https://eval.seec.seecoder.cn/exam/";
+      //   coderUrl = "https://coder.seec.seecoder.cn/exam/";
+      //   switch (this.state(task)) {
+      //     case "NOT_STARTED":
+      //       url = type === "eval" ? evalUrl : coderUrl;
+      //       break;
+      //     case "CLOSED":
+      //       url = type === "eval" ? evalUrl : coderUrl;
+      //       break;
+      //     case "FINISHED":
+      //       url = type === "eval" ? evalUrl : coderUrl;
+      //       break;
+      //     case "RUNNING":
+      //       if (task["isJoined"] || task["joined"]) {
+      //         url = type === "eval" ? evalExamUrl + task["examId"] + "/before-exam" : coderUrl + task.id;
+      //       } else {
+      //         url = type === "eval" ? evalUrl : coderUrl;
+      //       }
+      //       break;
+      //   }
+      // } else {
+      //   evalUrl = "https://eval.seec.seecoder.cn/teacher/exam/";
+      //   coderUrl = "https://coder.seec.seecoder.cn/exam/";
+      //   url = type === "eval" ? evalUrl + task["examId"] + "/details" : coderUrl + task.id;
+      // }
       if (type === "coder") {
         _this.$router.push(`/exam/${task.id}`);
 
       } else { //只有eval直接跳转
-        if (_this.isTeacher()) {
+        if (_this.isTeacher) {
           _this.$router.push({
             name: "teacher-examDetails",
             params: {
@@ -549,7 +549,6 @@ export default {
             }
           });
         }
-        // window.open(url + "?id_token=" + this.$store.state.user.token);
       }
     },
     // 创建Coder考试的Dialog

+ 0 - 1
src/views/ExamPage/ExamDetail.vue

@@ -362,7 +362,6 @@ export default {
       this.$apis.getCoderExamByExamId(examId)
           .then(_res => {
             this.exam = _res.data.res;
-            console.log(this.exam);
             if (!this.isAdmin && this.exam.joined) {
               this.fetchResult();
             }

+ 1 - 1
src/views/HomePage/HomePage.vue

@@ -25,7 +25,7 @@
             <el-icon>
               <Files/>
             </el-icon>
-            <span style="padding-left: 20px">gitlab</span>
+            <span style="padding-left: 20px">Gitlab</span>
           </el-menu-item>
         </el-menu>
       </el-card>

+ 1 - 1
src/views/ManagePage/ManagePage.vue

@@ -30,7 +30,7 @@
         </el-menu>
       </el-card>
     </el-col>
-    <el-col :span="1"/>
+    <el-col :span="2"/>
     <el-col :span="18">
       <el-card id="all-test-card">
         <template #header>

+ 42 - 20
src/views/ProjectPage/ProjectPage.vue

@@ -1,6 +1,6 @@
 <template>
   <el-row id="project-page-body">
-    <el-col :span="3">
+    <el-col :span="4">
       <el-card style="position: fixed;">
         <el-menu default-active="1" @select="handleSelect">
           <el-menu-item index="0">
@@ -26,14 +26,14 @@
             <el-icon>
               <Document/>
             </el-icon>
-            <span style="padding-left: 20px">个人项目分析</span>
+            <span style="padding-left: 20px">个人分析</span>
           </el-menu-item>
 
           <el-menu-item index="4">
             <el-icon>
               <Document/>
             </el-icon>
-            <span style="padding-left: 20px">小组项目分析</span>
+            <span style="padding-left: 20px">小组分析</span>
           </el-menu-item>
 
         </el-menu>
@@ -49,12 +49,26 @@
           </span>
         </template>
         <div v-if="this.activeIndex === '1'">
+          <div v-for="(item, key) in courseProjectList" :key="key">
+            <div v-if="item.length !== 0">
+              <div>
+                <el-divider style="margin: 10px 0 20px 0" content-position="left">{{ key }}</el-divider>
+              </div>
+              <div class="project-page-main">
+                <ProjectCard v-for="project in item"
+                             :is-public="key"
+                             :key="project.id"
+                             :projectVO="project"
+                             type="courseProject"/>
+              </div>
+            </div>
+          </div>
         </div>
 
         <div v-if="this.activeIndex === '2' && isStudent">
           <el-tabs v-model="activeProjectPaneName" style="width: 100%">
             <el-tab-pane label="课程下项目" name="courseProject">
-              <div v-for="(item, key) in courseProjectList" :key="key">
+              <div v-for="(item, key) in myCourseProjects" :key="key">
                 <div v-if="item.length !== 0">
                   <div>
                     <el-divider style="margin: 10px 0 20px 0" content-position="left">{{ key }}</el-divider>
@@ -67,7 +81,7 @@
             </el-tab-pane>
             <el-tab-pane label="非课程项目" name="commonProject">
               <div class="project-page-main">
-                <ProjectCard v-for="(item,key) in commonProjectList" :key="key" :projectVO="item" type="commonProject"></ProjectCard>
+                <ProjectCard v-for="(item,key) in myNonCourseProjects" :key="key" :projectVO="item" type="commonProject"></ProjectCard>
               </div>
             </el-tab-pane>
           </el-tabs>
@@ -86,12 +100,24 @@
                 @click="$router.push('/login')">登录</span>
         </div>
 
-        <div v-if="this.activeIndex === '3'">
-            <AnalysisStudentCard :num="1757"/>
+          <div v-if="this.activeIndex === '3' && !isLogin">
+              请先
+              <span style="cursor: pointer;color: #409eff"
+                    @click="$router.push('/login')">登录</span>
+          </div>
+
+          <div v-if="this.activeIndex === '4' && !isLogin">
+              请先
+              <span style="cursor: pointer;color: #409eff"
+                    @click="$router.push('/login')">登录</span>
+          </div>
+
+        <div v-if="this.activeIndex === '3' && isStudent">
+            <AnalysisStudentCard :num="userId"/>
         </div>
 
-        <div v-if="this.activeIndex === '4'">
-          <AnalysisGroupCard :num="1626"/>
+        <div v-if="this.activeIndex === '4' && isStudent">
+          <AnalysisGroupCard :num="userId"/>
         </div>
 
       </el-card>
@@ -111,9 +137,9 @@ export default {
   data() {
     return {
       activeIndex: "1",
-      courseProjectList: [],
-      commonProjectList: [],
-      ProjectList_my: [],
+      courseProjectList: null,
+      myNonCourseProjects: null,
+      myCourseProjects: null,
       activeProjectPaneName: "courseProject",
       activeProjectPaneName_my: "courseProject_my",
       userId:1575,//传递给分析系统
@@ -144,19 +170,15 @@ export default {
   },
   mounted() {
     this.$apis.findCourseProjects().then(res =>{
-        this.courseProjectList = res.data.data;
-        console.log(this.courseProjectList);
+        this.myCourseProjects = res.data.data;
         });
 
     this.$apis.findNonCourseProjects().then(res =>{
-      this.commonProjectList = res.data.data;
-      console.log(this.commonProjectList);
+      this.myNonCourseProjects = res.data.data;
     });
 
-    this.$apis.findProjectById(this.$store.state.user.id).then(res =>{
-      this.ProjectList_my = res.data.data;
-      this.userId = this.$store.state.user.id;
-      console.log(this.ProjectList_my);
+    this.$apis.findAllPublicProjectsGroupByCourse().then(res =>{
+      this.courseProjectList = res.data.data;
     });
 
   },