ソースを参照

fix InfoCard.vue with EL-popover

Damon 4 年 前
親
コミット
023f607d27

+ 1 - 3
src/api/course/course.js

@@ -1,5 +1,4 @@
 import {axios} from "@/requests/axios.config";
 import {axios} from "@/requests/axios.config";
-import mockAPIs from "@/api/mock";
 import courseSelectionAPIs from "@/api/course/courseSelection";
 import courseSelectionAPIs from "@/api/course/courseSelection";
 
 
 const prefix = "/course";
 const prefix = "/course";
@@ -9,8 +8,7 @@ function createCourse(data) {
 }
 }
 
 
 function getAllCourses() {
 function getAllCourses() {
-  // return axios.get(`${prefix}/all`);
-  return mockAPIs.getAllCourses();
+  return axios.get(`${prefix}/all`);
 }
 }
 
 
 function getExampleCourses() {
 function getExampleCourses() {

BIN
src/assets/homePage.png


BIN
src/assets/seec-logo--full.png


BIN
src/assets/seec-logo-full-temp.png


+ 14 - 20
src/components/CourseCard.vue

@@ -1,9 +1,6 @@
 <template>
 <template>
   <el-card class="course-card" shadow="hover" @click="toCourseInfo">
   <el-card class="course-card" shadow="hover" @click="toCourseInfo">
-    <div class="image">
-      <img :src="imageUrl" alt="">
-    </div>
-
+    <img :src="imageUrl" alt="" class="image" style="">
     <el-row>
     <el-row>
       <el-col :span="16" class="name">{{ courseVO.name }}</el-col>
       <el-col :span="16" class="name">{{ courseVO.name }}</el-col>
       <el-col :span="8" class="status">
       <el-col :span="8" class="status">
@@ -24,12 +21,12 @@
     <el-row class="description">
     <el-row class="description">
       {{ courseVO.description }}
       {{ courseVO.description }}
     </el-row>
     </el-row>
-<!--    <el-row class="button">-->
-<!--      <el-col :span="24">-->
-<!--        <el-button v-if="state==='FINISHED'" plain size="small" type="success">结果报告</el-button>-->
-<!--        <el-button v-else plain size="small" type="primary">查看详情</el-button>-->
-<!--      </el-col>-->
-<!--    </el-row>-->
+    <!--    <el-row class="button">-->
+    <!--      <el-col :span="24">-->
+    <!--        <el-button v-if="state==='FINISHED'" plain size="small" type="success">结果报告</el-button>-->
+    <!--        <el-button v-else plain size="small" type="primary">查看详情</el-button>-->
+    <!--      </el-col>-->
+    <!--    </el-row>-->
   </el-card>
   </el-card>
 </template>
 </template>
 
 
@@ -75,10 +72,10 @@ export default {
 <style scoped>
 <style scoped>
 .course-card {
 .course-card {
   margin-bottom: 10px;
   margin-bottom: 10px;
-  border-radius: 4px;
-  height: calc(100% - 10px);
+  border-radius: 8px;
   position: relative;
   position: relative;
   border: 1px solid #cccccc;
   border: 1px solid #cccccc;
+  padding-top: 100px;
 }
 }
 
 
 .course-card:hover {
 .course-card:hover {
@@ -86,15 +83,12 @@ export default {
 }
 }
 
 
 .image {
 .image {
-  height: 80px;
-  outline: solid 1px #eeeeee;
-  margin-bottom: 10px;
-  border-radius: 4px;
-}
-
-.image img {
-  height: 100%;
+  position: absolute;
+  height: 100px;
   width: 100%;
   width: 100%;
+  top: 0;
+  left: 0;
+  outline: solid 1px #eeeeee;
 }
 }
 
 
 .name {
 .name {

+ 1 - 1
src/components/GlobalFooter.vue

@@ -2,7 +2,7 @@
   <div id="global-footer-body">
   <div id="global-footer-body">
     <div id="global-footer-main">
     <div id="global-footer-main">
       <div id="global-footer-logo">
       <div id="global-footer-logo">
-        <img id="global-footer-logo-img" alt="err" src="@/assets/seec-logo-full-temp.png">
+        <img id="global-footer-logo-img" alt="err" src="@/assets/seec-logo--full.png">
         <div id="global-footer-logo-text">软件工程教育云平台 Software Engineering Education Cloud</div>
         <div id="global-footer-logo-text">软件工程教育云平台 Software Engineering Education Cloud</div>
       </div>
       </div>
       <div style="width: 10%"></div>
       <div style="width: 10%"></div>

+ 47 - 45
src/components/GlobalHeader.vue

@@ -2,7 +2,7 @@
   <div v-show="this.$route.path!=='/auth'" id="global-header-body">
   <div v-show="this.$route.path!=='/auth'" id="global-header-body">
     <el-backtop/>
     <el-backtop/>
     <div @click="toPortal">
     <div @click="toPortal">
-      <img id="global-header-logo" alt="err" src="@/assets/seec-logo-full-temp.png">
+      <img id="global-header-logo" alt="err" src="@/assets/seec-logo--full.png">
     </div>
     </div>
     <el-menu :default-active="activeMenu" class="el-menu-demo" mode="horizontal" @select="handleMenuSelect">
     <el-menu :default-active="activeMenu" class="el-menu-demo" mode="horizontal" @select="handleMenuSelect">
       <el-menu-item index="1">
       <el-menu-item index="1">
@@ -12,7 +12,7 @@
         任务
         任务
       </el-menu-item>
       </el-menu-item>
       <el-submenu index="3">
       <el-submenu index="3">
-        <template #title>{{quickAccessTitle}}</template>
+        <template #title>{{ quickAccessTitle }}</template>
         <el-menu-item index="3-1">全部课程</el-menu-item>
         <el-menu-item index="3-1">全部课程</el-menu-item>
         <el-menu-item index="3-2">全部测试</el-menu-item>
         <el-menu-item index="3-2">全部测试</el-menu-item>
       </el-submenu>
       </el-submenu>
@@ -35,24 +35,24 @@
         </svg>
         </svg>
       </div>
       </div>
       <div class="global-header-icon-content" @click="toHome">
       <div class="global-header-icon-content" @click="toHome">
-        <ElDropdown :hide-timeout="3000">
-          <div v-if="isLogin" id="info-circle">
-            <span>{{ name.substring(0, 1) }}</span>
-          </div>
-          <div v-else>
-            <svg height="32" viewBox="0 0 1025 1024" width="32" xmlns="http://www.w3.org/2000/svg">
-              <path
-                d="M511.999723 331.913794m-117.748854 0a117.748854 117.748854 0 1 0 235.497708 0 117.748854 117.748854 0 1 0-235.497708 0Z"
-                fill="#82BAD8"></path>
-              <path
-                d="M511.999723 0.000554A511.999723 511.999723 0 1 0 1025.10767 512.000277 512.276779 512.276779 0 0 0 511.999723 0.000554zM792.380524 779.636496a24.935051 24.935051 0 0 1-24.935052-24.935052 255.445749 255.445749 0 0 0-510.614442 0 24.935051 24.935051 0 0 1-49.870103 0 304.76174 304.76174 0 0 1 205.29859-288.138372 167.896013 167.896013 0 1 1 199.480412 0 304.76174 304.76174 0 0 1 205.575646 288.138372 24.935051 24.935051 0 0 1-24.935051 24.935052z"
-                fill="#82BAD8"></path>
-            </svg>
-          </div>
-          <template #dropdown>
-            <InfoCard/>
+        <ElPopover trigger="hover">
+          <template #reference>
+            <div v-if="isLogin" id="info-circle">
+              <span>{{ name.substring(0, 1) }}</span>
+            </div>
+            <div v-else>
+              <svg height="32" viewBox="0 0 1025 1024" width="32" xmlns="http://www.w3.org/2000/svg">
+                <path
+                  d="M511.999723 331.913794m-117.748854 0a117.748854 117.748854 0 1 0 235.497708 0 117.748854 117.748854 0 1 0-235.497708 0Z"
+                  fill="#82BAD8"></path>
+                <path
+                  d="M511.999723 0.000554A511.999723 511.999723 0 1 0 1025.10767 512.000277 512.276779 512.276779 0 0 0 511.999723 0.000554zM792.380524 779.636496a24.935051 24.935051 0 0 1-24.935052-24.935052 255.445749 255.445749 0 0 0-510.614442 0 24.935051 24.935051 0 0 1-49.870103 0 304.76174 304.76174 0 0 1 205.29859-288.138372 167.896013 167.896013 0 1 1 199.480412 0 304.76174 304.76174 0 0 1 205.575646 288.138372 24.935051 24.935051 0 0 1-24.935051 24.935052z"
+                  fill="#82BAD8"></path>
+              </svg>
+            </div>
           </template>
           </template>
-        </ElDropdown>
+          <InfoCard/>
+        </ElPopover>
       </div>
       </div>
     </div>
     </div>
   </div>
   </div>
@@ -66,8 +66,16 @@ export default {
   components: { InfoCard },
   components: { InfoCard },
   data() {
   data() {
     return {
     return {
-      activeMenu: "1",
       quickAccessTitle: "快速访问",
       quickAccessTitle: "快速访问",
+      menuIndex: [
+        ["1", "/portal"],
+        ["2", "/task"],
+        ["3-1", "/course"],
+        ["3-2", "/test"],
+        ["4", "/home"],
+        ["5", "/manage"],
+        ["6", "/problem"],
+      ]
     };
     };
   },
   },
   computed: {
   computed: {
@@ -80,9 +88,18 @@ export default {
     name() {
     name() {
       return this.$store.state.user.name;
       return this.$store.state.user.name;
     },
     },
-
+    activeMenu() {
+      let out = "1";
+      this.menuIndex.forEach(i => {
+        if (i[1] === this.$route.path) {
+          out = i[0];
+        }
+      });
+      return out;
+    },
   },
   },
 
 
+
   methods: {
   methods: {
     toPortal() {
     toPortal() {
       this.$router.push("/portal");
       this.$router.push("/portal");
@@ -94,32 +111,17 @@ export default {
       this.$router.push("/home");
       this.$router.push("/home");
     },
     },
     handleMenuSelect(key) {
     handleMenuSelect(key) {
-      switch (key) {
-        case "1":
-          this.$router.push("/portal");
-          break;
-        case "2":
-          this.$router.push("/task");
-          break;
-        case "3-1":
-          this.$router.push("/course");
-          break;
-        case "3-2":
-          this.$router.push("/test");
-          break;
-        case "4":
-          this.$router.push("/home");
-          break;
-        case "5":
-          this.$router.push("/manage");
-          break;
-        case "6":
-          this.$router.push("/problem");
-          break;
-      }
+      let target = "/portal";
+      this.menuIndex.forEach(i => {
+        if (i[0] === key) {
+          target = i[1];
+        }
+      });
+      this.$router.push(target);
+
       if (key === "3-1") {
       if (key === "3-1") {
         this.quickAccessTitle = "全部课程";
         this.quickAccessTitle = "全部课程";
-      } else if(key === "3-2") {
+      } else if (key === "3-2") {
         this.quickAccessTitle = "全部测试";
         this.quickAccessTitle = "全部测试";
       } else {
       } else {
         this.quickAccessTitle = "快速访问";
         this.quickAccessTitle = "快速访问";

+ 1 - 2
src/global/register-element.js

@@ -32,7 +32,7 @@ import {
   ElTag,
   ElTag,
   ElTimeline,
   ElTimeline,
   ElTimelineItem,
   ElTimelineItem,
-  ElBacktop, ElDropdown, ElMenu, ElMenuItem, ElSubmenu,
+  ElBacktop, ElMenu, ElMenuItem, ElSubmenu,
 } from "element-plus";
 } from "element-plus";
 
 
 // NOTE 使用到的组件列表,请确保 import 和 component 的一致性
 // NOTE 使用到的组件列表,请确保 import 和 component 的一致性
@@ -71,7 +71,6 @@ const components = [
   ElTimeline,
   ElTimeline,
   ElTimelineItem,
   ElTimelineItem,
   ElBacktop,
   ElBacktop,
-  ElDropdown,
   ElMenu,
   ElMenu,
   ElMenuItem,
   ElMenuItem,
   ElSubmenu,
   ElSubmenu,

+ 60 - 61
src/views/CoursePage/CoursePage.vue

@@ -1,105 +1,104 @@
 <template>
 <template>
-  <div id="course-page-body">
-    <div id="course-back-button" @click="toPortal">
-      <svg data-v-ba633cb8="" viewBox="0 0 1024 1024" width="24" xmlns="http://www.w3.org/2000/svg">
-        <path d="M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64z" fill="currentColor"></path>
-        <path d="m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312L237.248 512z" fill="currentColor"></path>
-      </svg>
-    </div>
-    <el-tabs v-model="activeTab">
-      <el-tab-pane class="course-page-main" label="全部课程" name="first">
-        <CourseCard v-for="course in courses_show" :key="course.id" :courseVO="course"/>
-      </el-tab-pane>
-      <el-tab-pane label="我的课程" name="second">
-        <div v-if="courses_my.length!==0" class="course-page-main">
-          <CourseCard v-for="course in courses_my" :key="course.id" :courseVO="course"/>
+  <el-row id="course-page-body">
+    <el-col :span="3">
+      <el-menu background-color="#f8f9fb" default-active="1" @select="handleSelect">
+        <el-menu-item index="0">
+          <el-icon>
+            <Back/>
+          </el-icon>
+          <span style="padding-left: 20px">返回首页</span>
+        </el-menu-item>
+        <el-menu-item index="1">
+          <el-icon>
+            <Document/>
+          </el-icon>
+          <span style="padding-left: 20px">全部课程</span>
+        </el-menu-item>
+        <el-menu-item index="2">
+          <el-icon>
+            <DocumentChecked/>
+          </el-icon>
+          <span style="padding-left: 20px">我的课程</span>
+        </el-menu-item>
+      </el-menu>
+    </el-col>
+    <el-col :span="1"/>
+    <el-col :span="18">
+      <el-card>
+        <template #header>
+          <span style="font-weight: bold; font-size: larger">
+            {{ activeName }}
+          </span>
+        </template>
+        <div v-if="this.activeIndex === '1'" class="course-page-main">
+          <CourseCard v-for="course in courses_all" :key="course.id" :courseVO="course"/>
         </div>
         </div>
-        <div v-else class="course-page-main" style="display: flex; flex-direction: column; justify-content: center;align-items: center;margin-top: 16vh">
-          <svg class="icon" height="128" viewBox="0 0 1024 1024" width="128" xmlns="http://www.w3.org/2000/svg">
-            <path
-              d="M909.016 820.828H841a30 30 0 0 1 0-60h38.016a20 20 0 0 0 20-20V145.185a20 20 0 0 0-20-20H352a20 20 0 0 0-20 20v28h370.016a50 50 0 0 1 50 50v223.36a29.989 29.989 0 1 1-59.507 5.283h-0.493V253.185a20
-                  20 0 0 0-20-20H145a20 20 0 0 0-20 20v625.643a20 20 0 0 0 20 20h337a30 30 0 0 1 0 60H115a50 50 0 0 1-50-50V223.185a50 50 0 0 1 50-50h157v-58a50 50 0 0 1 50-50h587.016a50 50 0 0 1 50 50v655.643a50 50 0 0 1-50 50z m-663.037-484H572.74a29.979 29.979 0 1 1 0
-                  59.957H245.979a29.979 29.979 0 1 1 0-59.957z m0 290.043h74.912a29.979 29.979 0 0 1 29.979 29.978 29.979 29.979 0 0 1-29.979
-                  29.979h-74.912A29.979 29.979 0 0 1 216 656.849a29.979 29.979 0 0 1 29.979-29.978zM216 511.807a29.979 29.979 0 0 1 29.979-29.979h140.935a29.979 29.979 0 0 1 29.979 29.979v0.042a29.979 29.979 0 0 1-29.979 29.979H245.979A29.979 29.979 0 0 1 216 511.849v-0.042z m163 177.521c0-107.419
-                   87.081-194.5 194.5-194.5S768 581.909 768 689.328a193.618 193.618 0 0 1-37.9 115.356l84.115 84.115a30 30 0 1 1-42.425 42.429l-84.3-84.3a193.6 193.6 0 0 1-113.99 36.9c-107.419 0-194.5-87.081-194.5-194.5z m194.5 134.5a134.5 134.5 0 1 0-134.5-134.5 134.5 134.5 0 0 0 134.5 134.5z"
-              fill="#bfbfbf"></path>
-          </svg>
-          <div>
-            暂无数据
-          </div>
+        <div v-else class="course-page-main">
+          <CourseCard v-for="course in courses_my" :key="course.id" :courseVO="course"/>
         </div>
         </div>
-      </el-tab-pane>
-    </el-tabs>
-  </div>
+      </el-card>
+    </el-col>
+  </el-row>
   <GlobalFooter/>
   <GlobalFooter/>
 </template>
 </template>
 
 
 <script>
 <script>
 import GlobalFooter from "@/components/GlobalFooter";
 import GlobalFooter from "@/components/GlobalFooter";
+import { Back, Document, DocumentChecked } from "@element-plus/icons-vue";
 import CourseCard from "@/components/CourseCard";
 import CourseCard from "@/components/CourseCard";
 
 
 export default {
 export default {
   name: "CoursePage",
   name: "CoursePage",
-  components: { CourseCard, GlobalFooter },
+  components: { Back, CourseCard, Document, DocumentChecked, GlobalFooter },
   data() {
   data() {
     return {
     return {
-      activeTab: "first",
+      activeIndex: "1",
       courses_all: [],
       courses_all: [],
       courses_my: [],
       courses_my: [],
     };
     };
   },
   },
   computed: {
   computed: {
-    courses_show() {
-      return this.courses_all;
-    }
+    activeName() {
+      if (this.activeIndex === "1") {
+        return "全部课程";
+      } else {
+        return "我的课程";
+      }
+    },
   },
   },
 
 
   mounted() {
   mounted() {
-    // await this.$apis.getAllCourses().then(res => {
-    //   this.courseList = res.data.data;
-    // });
-    this.courses_all = this.$apis.getAllCourses().data.data;
-    for (let i = 3 - this.courses_all.length % 3; i !== 0; i--) {
-      this.courses_all.push(this.courses_all[0]);
-    }
+    this.$apis.getAllCourses().then(res => {
+      this.courses_all = res.data.data;
+    });
     if (this.$store.state.user.token) {
     if (this.$store.state.user.token) {
-      this.courses_my = this.$apis.getStudentCourses(this.$store.state.user.id).then(res => {
+      this.courses_my = this.$apis.getStudentCourses({ studentId: this.$store.state.user.id }).then(res => {
         this.courses_my = res.data.data;
         this.courses_my = res.data.data;
       });
       });
     }
     }
   },
   },
 
 
   methods: {
   methods: {
-    toPortal() {
-      this.$router.push("/portal");
-    }
+    handleSelect(index) {
+      if (index === "0") {
+        this.$router.push("portal");
+      }
+      this.activeIndex = index;
+    },
   },
   },
 };
 };
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>
 #course-page-body {
 #course-page-body {
-  margin: 40px 180px 80px 180px;
+  margin: 40px 60px 80px 60px;
   min-height: calc(100vh - 340px);
   min-height: calc(100vh - 340px);
   position: relative;
   position: relative;
 }
 }
 
 
-#course-back-button {
-  position: absolute;
-  padding: 10px;
-  top: 0;
-  left: -70px;
-  font-size: 14px;
-}
-
-#course-back-button:hover {
-  cursor: pointer;
-  color: #409eff;
-}
-
 .course-page-main {
 .course-page-main {
   display: grid;
   display: grid;
   grid-template-columns: 1fr 1fr 1fr 1fr;
   grid-template-columns: 1fr 1fr 1fr 1fr;
-  grid-gap: 20px 20px;
+  grid-gap: 20px;
 }
 }
 </style>
 </style>

+ 13 - 4
src/views/HomePage/HomePage.vue

@@ -1,7 +1,13 @@
 <template>
 <template>
   <el-row id="home-page-body">
   <el-row id="home-page-body">
     <el-col :span="4">
     <el-col :span="4">
-      <el-menu default-active="1" background-color="#f8f9fb" @select="handleSelect">
+      <el-menu background-color="#f8f9fb" default-active="1" @select="handleSelect">
+        <el-menu-item index="0">
+          <el-icon>
+            <Back/>
+          </el-icon>
+          <span style="padding-left: 20px">返回首页</span>
+        </el-menu-item>
         <el-menu-item index="1">
         <el-menu-item index="1">
           <el-icon>
           <el-icon>
             <User/>
             <User/>
@@ -27,13 +33,13 @@
 
 
 <script>
 <script>
 import GlobalFooter from "@/components/GlobalFooter";
 import GlobalFooter from "@/components/GlobalFooter";
-import { Medal, User } from "@element-plus/icons-vue";
+import { Back, Medal, User } from "@element-plus/icons-vue";
 import InformationCard from "@/views/HomePage/components/InformationCard";
 import InformationCard from "@/views/HomePage/components/InformationCard";
 import CertificationCard from "@/views/HomePage/components/CertificationCard";
 import CertificationCard from "@/views/HomePage/components/CertificationCard";
 
 
 export default {
 export default {
   name: "HomePage",
   name: "HomePage",
-  components: { CertificationCard, InformationCard, Medal, User, GlobalFooter, },
+  components: { Back, CertificationCard, InformationCard, Medal, User, GlobalFooter, },
   data() {
   data() {
     return {
     return {
       activeIndex: "1",
       activeIndex: "1",
@@ -42,6 +48,9 @@ export default {
   methods: {
   methods: {
     handleSelect(index) {
     handleSelect(index) {
       this.activeIndex = index;
       this.activeIndex = index;
+      if (index === "0") {
+        this.$router.push("portal");
+      }
     },
     },
   }
   }
 };
 };
@@ -49,7 +58,7 @@ export default {
 
 
 <style scoped>
 <style scoped>
 #home-page-body {
 #home-page-body {
-  margin: 40px 180px 80px 180px;
+  margin: 40px 160px 80px 160px;
   min-height: calc(100vh - 160px);
   min-height: calc(100vh - 160px);
 }
 }
 </style>
 </style>

+ 34 - 41
src/views/PortalPage/components/InfoCard.vue

@@ -1,48 +1,48 @@
 <template>
 <template>
-  <el-card>
-    <div id="info-card-body">
-      <div>SEECODER</div>
-      <div v-if="isLogin" id="info-card-circle">
-        <span>{{ name.substring(0, 1) }}</span>
-      </div>
-      <div v-else>
-        <svg height="50" viewBox="0 0 1025 1024" width="50" xmlns="http://www.w3.org/2000/svg">
-          <path
-            d="M511.999723 331.913794m-117.748854 0a117.748854 117.748854 0 1 0 235.497708 0 117.748854 117.748854 0 1 0-235.497708 0Z"
-            fill="#82BAD8"></path>
-          <path
-            d="M511.999723 0.000554A511.999723 511.999723 0 1 0 1025.10767 512.000277 512.276779 512.276779 0 0 0 511.999723 0.000554zM792.380524 779.636496a24.935051 24.935051 0 0 1-24.935052-24.935052 255.445749 255.445749 0 0 0-510.614442 0 24.935051 24.935051 0 0 1-49.870103 0 304.76174 304.76174 0 0 1 205.29859-288.138372 167.896013 167.896013 0 1 1 199.480412 0 304.76174 304.76174 0 0 1 205.575646 288.138372 24.935051 24.935051 0 0 1-24.935051 24.935052z"
-            fill="#82BAD8"></path>
-        </svg>
-      </div>
-      <div v-if="isLogin" id="info-card-name-id">
-        <div>{{ name }}</div>
-        <div>{{ email }}</div>
-      </div>
-      <div v-if="isLogin" id="info-card-button-in" @click="logout">
-        <span>登出</span>
-      </div>
-      <div v-else id="info-card-button-not" @click="toAuth">
-        <span>登录/注册</span>
-      </div>
+  <!--  <el-card>-->
+  <div id="info-card-body">
+    <div>SEECODER</div>
+    <div v-if="isLogin" id="info-card-circle">
+      <span>{{ name.substring(0, 1) }}</span>
     </div>
     </div>
-  </el-card>
+    <div v-else>
+      <svg height="50" viewBox="0 0 1025 1024" width="50" xmlns="http://www.w3.org/2000/svg">
+        <path
+          d="M511.999723 331.913794m-117.748854 0a117.748854 117.748854 0 1 0 235.497708 0 117.748854 117.748854 0 1 0-235.497708 0Z"
+          fill="#82BAD8"></path>
+        <path
+          d="M511.999723 0.000554A511.999723 511.999723 0 1 0 1025.10767 512.000277 512.276779 512.276779 0 0 0 511.999723 0.000554zM792.380524 779.636496a24.935051 24.935051 0 0 1-24.935052-24.935052 255.445749 255.445749 0 0 0-510.614442 0 24.935051 24.935051 0 0 1-49.870103 0 304.76174 304.76174 0 0 1 205.29859-288.138372 167.896013 167.896013 0 1 1 199.480412 0 304.76174 304.76174 0 0 1 205.575646 288.138372 24.935051 24.935051 0 0 1-24.935051 24.935052z"
+          fill="#82BAD8"></path>
+      </svg>
+    </div>
+    <div v-if="isLogin" id="info-card-name-id">
+      <div>{{ name }}</div>
+      <div>{{ email }}</div>
+    </div>
+    <div v-if="isLogin" id="info-card-button-in" @click="logout">
+      <span>登出</span>
+    </div>
+    <div v-else id="info-card-button-not" @click="toAuth">
+      <span>登录/注册</span>
+    </div>
+  </div>
+  <!--  </el-card>-->
 </template>
 </template>
 
 
 <script>
 <script>
 export default {
 export default {
   name: "InfoCard",
   name: "InfoCard",
-  data() {
-    return {
-      name: "",
-      email: "",
-    };
-  },
 
 
   computed: {
   computed: {
     isLogin: function () {
     isLogin: function () {
       return this.$store.state.user.token !== undefined;
       return this.$store.state.user.token !== undefined;
     },
     },
+    name() {
+      return this.$store.state.user.name;
+    },
+    email() {
+      return this.$store.state.user.email;
+    }
   },
   },
 
 
   methods: {
   methods: {
@@ -58,19 +58,12 @@ export default {
       }, 0);
       }, 0);
     },
     },
   },
   },
-
-  beforeMount() {
-    if (this.isLogin) {
-      this.name = this.$store.state.user.name;
-      this.email = this.$store.state.user.email;
-    }
-  }
 };
 };
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>
 #info-card-body {
 #info-card-body {
-  height: 160px;
+  min-height: 180px;
   margin: 0 auto 0 auto;
   margin: 0 auto 0 auto;
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;

+ 1 - 2
src/views/TaskPage/TaskPage.vue

@@ -1,6 +1,5 @@
 <template>
 <template>
-  <p style="text-align: center; font-weight: bolder; font-size: xxx-large">任务页</p>
-  <img alt="err" src="@/assets/taskPage.png" style="width: 100%">
+  <div>s</div>
 </template>
 </template>
 
 
 <script>
 <script>

+ 69 - 41
src/views/TestPage/TestPage.vue

@@ -1,43 +1,81 @@
 <template>
 <template>
-  <div id="test-page-body">
-    <div id="test-back-button" @click="toPortal">
-      <svg data-v-ba633cb8="" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24">
-        <path d="M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64z" fill="currentColor"></path>
-        <path d="m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312L237.248 512z" fill="currentColor"></path>
-      </svg>
-    </div>
-    <el-tabs v-model="activeTab">
-      <el-tab-pane class="test-page-main" label="全部测试" name="first">
-        <EvalCard v-for="item in evalExamList" :key="item.id" :examVO="item"/>
-        <el-divider style="grid-column-start: 1; grid-column-end: 5"/>
-        <CoderCard v-for="item in coderExamList" :key="item.id" :coderVO="item"/>
-      </el-tab-pane>
-      <el-tab-pane class="test-page-main" label="我的测试" name="second">
-        <EvalCard v-for="item in evalExamList" :key="item.id" :examVO="item"/>
-        <el-divider style="grid-column-start: 1; grid-column-end: 5"/>
-        <CoderCard v-for="item in coderExamList" :key="item.id" :coderVO="item"/>
-      </el-tab-pane>
-    </el-tabs>
-  </div>
-  <GlobalFooter></GlobalFooter>
+  <el-row id="test-page-body">
+    <el-col :span="3">
+      <el-menu background-color="#f8f9fb" default-active="1" @select="handleSelect">
+        <el-menu-item index="0">
+          <el-icon>
+            <Back/>
+          </el-icon>
+          <span style="padding-left: 20px">返回首页</span>
+        </el-menu-item>
+        <el-menu-item index="1">
+          <el-icon>
+            <Document/>
+          </el-icon>
+          <span style="padding-left: 20px">全部测试</span>
+        </el-menu-item>
+        <el-menu-item index="2">
+          <el-icon>
+            <DocumentChecked/>
+          </el-icon>
+          <span style="padding-left: 20px">我的测试</span>
+        </el-menu-item>
+      </el-menu>
+    </el-col>
+    <el-col :span="1"/>
+    <el-col :span="18">
+      <el-card>
+        <template #header>
+          <span style="font-weight: bold; font-size: larger">
+            {{ activeName }}
+          </span>
+        </template>
+        <div v-if="this.activeIndex === '1'" class="test-page-main">
+          <EvalCard v-for="item in evalExamList" :key="item.id" :examVO="item"/>
+          <el-divider style="grid-column-start: 1; grid-column-end: 5"/>
+          <CoderCard v-for="item in coderExamList" :key="item.id" :coderVO="item"/>
+        </div>
+        <div v-else class="test-page-main">
+          <EvalCard v-for="item in evalExamList_my" :key="item.id" :examVO="item"/>
+          <el-divider style="grid-column-start: 1; grid-column-end: 5"/>
+          <CoderCard v-for="item in coderExamList_my" :key="item.id" :coderVO="item"/>
+        </div>
+      </el-card>
+    </el-col>
+  </el-row>
+  <GlobalFooter/>
 </template>
 </template>
 
 
+
 <script>
 <script>
 import EvalCard from "@/components/EvalCard";
 import EvalCard from "@/components/EvalCard";
 import CoderCard from "@/components/CoderCard";
 import CoderCard from "@/components/CoderCard";
 import GlobalFooter from "@/components/GlobalFooter";
 import GlobalFooter from "@/components/GlobalFooter";
+import { Back, Document, DocumentChecked } from "@element-plus/icons-vue";
 
 
 
 
 export default {
 export default {
   name: "TestPage",
   name: "TestPage",
-  components: { GlobalFooter, CoderCard, EvalCard, },
+  components: { Back, Document, DocumentChecked, GlobalFooter, CoderCard, EvalCard, },
   data() {
   data() {
     return {
     return {
-      activeTab: "first",
+      activeIndex: "1",
       evalExamList: [],
       evalExamList: [],
       coderExamList: [],
       coderExamList: [],
+      evalExamList_my: [],
+      coderExamList_my: [],
     };
     };
   },
   },
+  computed: {
+    activeName() {
+      if (this.activeIndex === "1") {
+        return "全部测试";
+      } else {
+        return "我的测试";
+      }
+    },
+  },
+
 
 
   mounted() {
   mounted() {
     // await this.$apis.getAllEvalExams().then(res => {
     // await this.$apis.getAllEvalExams().then(res => {
@@ -52,37 +90,27 @@ export default {
   },
   },
 
 
   methods: {
   methods: {
-    toPortal() {
-      this.$router.push("/portal");
-    }
+    handleSelect(index) {
+      if (index === "0") {
+        this.$router.push("portal");
+      }
+      this.activeIndex = index;
+    },
   },
   },
 };
 };
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>
 #test-page-body {
 #test-page-body {
-  margin: 40px 180px 80px 180px;
+  margin: 40px 60px 80px 60px;
   min-height: calc(100vh - 340px);
   min-height: calc(100vh - 340px);
   position: relative;
   position: relative;
 }
 }
 
 
-#test-back-button {
-  position: absolute;
-  padding: 10px;
-  top: 0;
-  left: -70px;
-  font-size: 14px;
-}
-
-#test-back-button:hover {
-  cursor: pointer;
-  color: #409eff;
-}
-
 .test-page-main {
 .test-page-main {
   display: grid;
   display: grid;
   grid-template-columns: 1fr 1fr 1fr 1fr;
   grid-template-columns: 1fr 1fr 1fr 1fr;
-  grid-gap: 20px 20px;
+  grid-gap: 20px;
 }
 }
 
 
 :deep(.el-divider) {
 :deep(.el-divider) {

ファイルの差分が大きいため隠しています
+ 475 - 44
yarn.lock


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません