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

对接getAllUsers,getStudentAnalysis

lmc 4 лет назад
Родитель
Сommit
af2b2c799a

+ 1 - 1
package.json

@@ -12,7 +12,7 @@
     "axios": "^0.19.2",
     "core-js": "^3.6.4",
     "echarts": "^4.9.0",
-    "element-ui": "^2.14.1",
+    "element-ui": "^2.15.7",
     "mint-ui": "^2.2.13",
     "moment": "^2.29.1",
     "vue": "^2.6.11",

+ 2 - 2
src/common/const.js

@@ -1,8 +1,8 @@
 // 部署url
 export const REQUEST_BASE_URL_PROD = "http://ismzl.com/";
 // 开发url (mock的地址
-export const REQUEST_BASE_URL_DEV = "http://127.0.0.1:12306/";
-// export const REQUEST_BASE_URL_DEV = "/api";
+// export const REQUEST_BASE_URL_DEV = "http://localhost:8080/api";
+export const REQUEST_BASE_URL_DEV = "/api";
 export const ROLE = {
   STUDENT: "STUDENT", //学生身份
   TEACHER: "TEACHER", //教师身份

+ 166 - 146
src/components/content/Layout.vue

@@ -1,157 +1,177 @@
 <template>
-    <el-container style="height: 100%; border: 1px solid #eee; background-color: #f8f9fb">
-        <el-aside width="250px" style="background-color: #545c64">
-            <header class="title">
-                <div class="title-inner">SEEC-SMART</div>
-            </header>
-            <el-menu
-                    :default-active="this.$route.path"
-                    class="el-menu-vertical-demo"
-                    background-color="#fff"
-                    text-color="#000000DE"
-                    @open="handleOpen"
-                    @close="handleClose"
-                    active-text-color="#409EFF"
-                    router>
-				<el-menu-item index="/studentPage" v-if="permit([ROLE.STUDENT, ROLE.ADMIN])">
-				    <i class="el-icon-s-data"></i>
-				    <span slot="title">Eval学生能力树</span>
-				</el-menu-item>
-				<el-menu-item index="/questionList" v-if="permit([ROLE.STUDENT, ROLE.ADMIN])">
-				    <i class="el-icon-s-order"></i>
-				    <span slot="title">Eval学生做题列表</span>
-				</el-menu-item>
-<!--                <el-menu-item index="/teacherPage" v-if="permit([ROLE.TEACHER, ROLE.ADMIN])">-->
-<!--                    <i class="el-icon-receiving"></i>-->
-<!--                    <span slot="title">Teacher-page</span>-->
-<!--                </el-menu-item>-->
-                <el-menu-item @click="toDev" v-if="permit([ROLE.TEACHER, ROLE.ADMIN])">
-                    <i class="el-icon-s-data"></i>
-                    <span slot="title">Devcloud信息分析</span>
-                </el-menu-item>
-<!--                <el-menu-item index="/devGroupPage" v-if="permit([ROLE.TEACHER, ROLE.ADMIN])">-->
-<!--                    <i class="el-icon-s-data"></i>-->
-<!--                    <span slot="title">Devcloud小组视角信息分析</span>-->
-<!--                </el-menu-item>-->
-            </el-menu>
-            <div class="logout-fix">
-                <div class="logout-name">{{getUsername()}}</div>
-                <div class="logout" @click="logout()">退出登录</div>
-            </div>
-        </el-aside>
+  <el-container
+    style="height: 100%; border: 1px solid #eee; background-color: #f8f9fb"
+  >
+    <el-aside width="250px" style="background-color: #545c64">
+      <header class="title">
+        <el-button class="title-inner" @click="$router.push('/dashboard')"
+          >返回首页</el-button
+        >
+      </header>
+      <el-menu
+        :default-active="this.$route.name"
+        class="el-menu-vertical-demo"
+        background-color="#fff"
+        text-color="#000000DE"
+        @open="handleOpen"
+        @close="handleClose"
+        active-text-color="#409EFF"
+      >
+        <el-menu-item
+          index="studentPage"
+          @click="$router.push('/studentPage/' + $route.params.id)"
+          
+        >
+          <i class="el-icon-s-data"></i>
+          <span slot="title">Eval能力树</span>
+        </el-menu-item>
+        <el-menu-item
+          index="questionList"
+          @click="$router.push('/questionList/' + $route.params.id)"
+   
+        >
+          <i class="el-icon-s-order"></i>
+          <span slot="title">Eval做题列表</span>
+        </el-menu-item>
+        <el-menu-item
+          index="devcloudGroup"
+          @click="$router.push('/devcloud/group/' + $route.params.id)"
+         
+        >
+          <i class="el-icon-s-home"></i>
+          <span slot="title">Devcloud小组信息</span>
+        </el-menu-item>
+        <el-menu-item
+          index="devcloudUser"
+          @click="$router.push('/devcloud/user/' + $route.params.id)"
 
-        <el-main>
-            <slot></slot>
-        </el-main>
-    </el-container>
+        >
+          <i class="el-icon-s-custom"></i>
+          <span slot="title">Devcloud个人信息</span>
+        </el-menu-item>
+        <!--                <el-menu-item index="/devGroupPage" v-if="permit([ROLE.TEACHER, ROLE.ADMIN])">-->
+        <!--                    <i class="el-icon-s-data"></i>-->
+        <!--                    <span slot="title">Devcloud小组视角信息分析</span>-->
+        <!--                </el-menu-item>-->
+      </el-menu>
+      <div class="logout-fix">
+        <div class="logout-name">{{ getUsername() }}</div>
+        <div class="logout" @click="logout()">退出</div>
+      </div>
+    </el-aside>
+
+    <el-main>
+      <slot></slot>
+    </el-main>
+  </el-container>
 </template>
 
 <script>
-    import { ROLE } from "../../common/const"
+import { ROLE } from "../../common/const";
 
-    export default {
-        name: "Layout",
-        data() {
-            return {
-                ROLE: ROLE
-            }
-        },
-        mounted() {
-        },
-        methods: {
-            toDev(){
-                window.location.replace("http://localhost:8081/#/student/201250076");
-            },
+export default {
+  name: "Layout",
+  data() {
+    return {
+      ROLE: ROLE,
+    };
+  },
+  mounted() {},
+  methods: {
+    toDev() {
+      window.location.replace("http://localhost:8081/#/student/201250076");
+    },
 
-            handleOpen(key, keyPath) {
-                console.log(key, keyPath);
-            },
-            handleClose(key, keyPath) {
-                console.log(key, keyPath);
-            },
-            logout() {
-                sessionStorage.removeItem("username"); // username
-                sessionStorage.removeItem("role"); // role
-                sessionStorage.removeItem("token"); // token
-                // this.$router.push('/');
-                location.href = '/';
-            },
-            getUsername() {
-                return sessionStorage.getItem("username");
-            },
-            permit(arr) {
-                return arr.some(role => role === sessionStorage.getItem("role"));
-            }
-        },
-    }
+    handleOpen(key, keyPath) {
+      console.log(key, keyPath);
+    },
+    handleClose(key, keyPath) {
+      console.log(key, keyPath);
+    },
+    logout() {
+      sessionStorage.removeItem("username"); // username
+      sessionStorage.removeItem("role"); // role
+      sessionStorage.removeItem("token"); // token
+      // this.$router.push('/');
+      location.href = "/";
+    },
+    getUsername() {
+      return sessionStorage.getItem("username");
+    },
+    permit(arr) {
+      return arr.some((role) => role === sessionStorage.getItem("role"));
+    },
+  },
+};
 </script>
 
 <style>
-    .title {
-        padding: 16px;
-        margin-bottom: 10px;
-    }
-    .title-inner {
-            background-color: #98e7ff !important;
-            border-color: #9fa8da!important;
-            border-radius: 8px!important;
-            line-height: 40px;
-            height: 40px;
-            text-align: center;
-            font-size: 21px;
-            font-weight: bold;
-    }
-    .el-aside {
-        background-color: #fff !important;
-        margin-right: 10px;
-    }
-    .el-menu {
-        border-right: solid 1px #fff;
-    }
-    .el-menu-item {
-        width: 92%;
-        margin: 0 auto;
-        padding: 0 10px!important;
-        height: 40px;
-        line-height: 40px;
-        font-size: 13px;
-    }
-    .el-menu-item > i {
-        margin-right: 30px!important;
-    }
-    .el-menu-item:focus, .el-menu-item:hover {
-        outline: 0;
-        background-color: #f6f6f6!important;
-    }
-    .el-menu-item.is-active {
-        color: #7e57c2;
-        background-color: #e0f3f8 !important;
-    }
-    .logout-fix {
-        position: fixed;
-        left: 30px;
-        bottom: 30px;
-    }
-    .logout-fix .logout-name {
-        min-width: 60px;
-        background-color: #409eff !important;
-        border-color: #7e57c2 !important;
-        color: #fff;
-        border-radius: 16px;
-        font-size: 14px;
-        height: 32px;
-        text-align: center;
-        padding: 0 10px;
-        margin-left: -10px;
-        line-height: 32px;
-        margin-bottom: 14px;
-    }
-    .logout-fix  .logout {
-        color: #00000099;
-        font-size: 14px;
-        cursor: pointer;
-    }
-    .logout-fix  .logout:hover {
-        color: #000000;
-    }
+.title {
+  padding: 16px;
+  margin-bottom: 10px;
+}
+.title-inner {
+  width: 220px;
+  background-color: #98e7ff !important;
+  border-color: #9fa8da !important;
+  border-radius: 8px !important;
+  height: 40px;
+  text-align: center;
+  font-size: 21px;
+  font-weight: bold;
+}
+.el-aside {
+  background-color: #fff !important;
+  margin-right: 10px;
+}
+.el-menu {
+  border-right: solid 1px #fff;
+}
+.el-menu-item {
+  width: 92%;
+  margin: 0 auto;
+  padding: 0 10px !important;
+  height: 40px;
+  line-height: 40px;
+  font-size: 13px;
+}
+.el-menu-item > i {
+  margin-right: 30px !important;
+}
+.el-menu-item:focus,
+.el-menu-item:hover {
+  outline: 0;
+  background-color: #f6f6f6 !important;
+}
+.el-menu-item.is-active {
+  color: #7e57c2;
+  background-color: #e0f3f8 !important;
+}
+.logout-fix {
+  position: fixed;
+  left: 30px;
+  bottom: 30px;
+}
+.logout-fix .logout-name {
+  min-width: 60px;
+  background-color: #409eff !important;
+  border-color: #7e57c2 !important;
+  color: #fff;
+  border-radius: 16px;
+  font-size: 14px;
+  height: 32px;
+  text-align: center;
+  padding: 0 10px;
+  margin-left: -10px;
+  line-height: 32px;
+  margin-bottom: 14px;
+}
+.logout-fix .logout {
+  color: #00000099;
+  font-size: 14px;
+  cursor: pointer;
+}
+.logout-fix .logout:hover {
+  color: #000000;
+}
 </style>

+ 3 - 0
src/network/dashboard/index.js

@@ -0,0 +1,3 @@
+import request from "@/network/request";
+
+export const  getAllUsers = config => request._get("/display/getAllUsers", config);

+ 3 - 0
src/network/devcloud/index.js

@@ -0,0 +1,3 @@
+import request from "@/network/request";
+
+export const  getStudentAnalysis = config => request._get("/devcloud/getStudentAnalysis", config);

+ 72 - 44
src/router/index.js

@@ -11,6 +11,11 @@ const TeacherPage = () => import("@/views/TeacherPage");
 const DevStudentPage = () => import("@/views/DevStudentPage");
 const DevGroupPage = () => import("@/views/DevGroupPage");
 
+
+const Dashboard = () => import("@/views/Dashboard");
+const DevcloudGroup = () => import("@/views/DevGroupPage");
+const DevcloudUser = () => import("@/views/DevStudentPage");
+
 const Home = () => import("@/views/Home");
 
 Vue.use(VueRouter);
@@ -24,14 +29,37 @@ const routes = [
     path: '/error',
     component: Error
   },
+  //学生整体信息
+  {
+    path: '/dashboard',
+    name:"dashboard",
+    component: Dashboard,
+    meta: { requiresAuth: [ROLE.STUDENT,ROLE.ADMIN] }
+  },
+    //devcloud小组信息
+    {
+      path: '/devcloud/group/:id',
+      name:"devcloudGroup",
+      component: DevcloudGroup,
+      meta: { requiresAuth: [ROLE.STUDENT,ROLE.ADMIN] }
+    },
+    //devcloud学生信息
+    {
+      path: '/devcloud/user/:id',
+      component: DevcloudUser,
+      name:"devcloudUser",
+      meta: { requiresAuth: [ROLE.STUDENT,ROLE.ADMIN] }
+    },
   {
-    path: '/studentPage',
+    path: '/studentPage/:id',
     component: StudentPage,
+    name:"studentPage",
     meta: { requiresAuth: [ROLE.STUDENT,ROLE.ADMIN] }
   },
   {
-    path: '/questionList',
+    path: '/questionList/:id',
     component: QuestionList,
+    name:"questionList",
     meta: { requiresAuth: [ROLE.STUDENT,ROLE.ADMIN] }
   },
   {
@@ -65,48 +93,48 @@ const router = new VueRouter({
   routes
 });
 
-router.beforeEach(async (to,from,next) => {
-  console.log(to.path, " ", from.path);
-  let { id_token: token } = to.query;
-  token = "123";
-  if (token) {
-    sessionStorage.setItem("token", token); // get token from the query param "id_token"
-    // TODO : get user info from backend
-    let res = null;
-    await auth({
-      params: {
-        token: token
-      }
-    }).then(_res => res = _res);
-    console.log(res);
-    if(res?.data?.user_info) {
-      sessionStorage.setItem("role", res.data.user_info.role);
-      sessionStorage.setItem("username", res.data.user_info.name);
-    } else {
-      this.$message({
-        "message": "查无此人!", 
-        "type": "error"
-      });
-      next("/error");
-    }
-  }
-  if(sessionStorage.getItem("token") == null) { // no token , redirect to portal
-    let portal = "http://p.seecoder.cn";
-    location.href = `${portal}/api/interaction?client_id=seec-mooc&redirect_uri=${encodeURIComponent(
-      location.origin + '/'
-    )}&scope=openid`;
-  }
+// router.beforeEach(async (to,from,next) => {
+//   console.log(to.path, " ", from.path);
+//   let { id_token: token } = to.query;
+//   token = "123";
+//   if (token) {
+//     sessionStorage.setItem("token", token); // get token from the query param "id_token"
+//     // TODO : get user info from backend
+//     let res = null;
+//     await auth({
+//       params: {
+//         token: token
+//       }
+//     }).then(_res => res = _res);
+//     console.log(res);
+//     if(res?.data?.user_info) {
+//       sessionStorage.setItem("role", res.data.user_info.role);
+//       sessionStorage.setItem("username", res.data.user_info.name);
+//     } else {
+//       this.$message({
+//         "message": "查无此人!", 
+//         "type": "error"
+//       });
+//       next("/error");
+//     }
+//   }
+//   if(sessionStorage.getItem("token") == null) { // no token , redirect to portal
+//     let portal = "http://p.seecoder.cn";
+//     location.href = `${portal}/api/interaction?client_id=seec-mooc&redirect_uri=${encodeURIComponent(
+//       location.origin + '/'
+//     )}&scope=openid`;
+//   }
   
-  if(to.meta.requiresAuth) {
-    if(to.meta.requiresAuth.some(role => role.toString() === sessionStorage.getItem("role"))) { //有权限
-      next();
-    } else {
-      next("/error"); //无权限
-    }
-  }
-  else { //页面没有权限限制,直接访问
-    next();
-  }
-});
+//   if(to.meta.requiresAuth) {
+//     if(to.meta.requiresAuth.some(role => role.toString() === sessionStorage.getItem("role"))) { //有权限
+//       next();
+//     } else {
+//       next("/error"); //无权限
+//     }
+//   }
+//   else { //页面没有权限限制,直接访问
+//     next();
+//   }
+// });
 
 export default router;

+ 83 - 0
src/views/Dashboard.vue

@@ -0,0 +1,83 @@
+<template>
+  <div>
+    <div class="title">SEEC-SMART</div>
+    <div class="main">
+      <div class="cardMain" v-for="item in pageList" :key="item.userId">
+        <el-card class="box-card">
+          <div slot="header" class="clearfix">
+            <span>{{ item.userId }}</span>
+            <el-button
+              style="float: right; padding: 3px 0"
+              type="text"
+              @click="$router.push('/studentPage/' + item.userId)"
+              >进入分析页面</el-button
+            >
+          </div>
+          <el-descriptions :column="1">
+            <el-descriptions-item label="姓名">{{
+              item.name
+            }}</el-descriptions-item>
+            <el-descriptions-item label="手机号">{{
+              item.phone
+            }}</el-descriptions-item>
+            <el-descriptions-item label="邮件">{{
+              item.email
+            }}</el-descriptions-item>
+          </el-descriptions>
+        </el-card>
+      </div>
+    </div>
+    <el-pagination style="text-align:center;" background layout="prev, pager, next" :current-page="page" :total="studentList.length" :page-size="8" @current-change="pageChange"> </el-pagination>
+  </div>
+</template>
+
+<script>
+import { getAllUsers } from "@/network/dashboard/index.js";
+export default {
+  data() {
+    return {
+      page:1,
+      studentList: [],
+      pageList:[]
+    };
+  },
+  created() {
+    this.getAllUsers();
+  },
+  methods: {
+    pageChange(currentPage){
+        this.page = currentPage;
+         this.pageList = this.studentList.slice((this.page-1) * 8, this.page * 8)
+    },
+    async getAllUsers() {
+      let res = await getAllUsers();
+      if (res.success) {
+        this.studentList = res.content;
+          this.pageList = this.studentList.slice((this.page-1) * 8, this.page * 8)
+      }
+    },
+  },
+};
+</script>
+
+<style scoped>
+.cardMain:nth-child(4n) {
+  margin-right: 0;
+}
+.cardMain {
+  margin-bottom: 30px;
+  flex: 0 0 22%;
+  margin-right: calc(15% / 4);
+}
+.main {
+  display: flex;
+  flex-wrap: wrap;
+  margin-top: 20px;
+  padding: 50px;
+}
+.title {
+  font-size: 40px;
+  text-align: center;
+  margin-top: 30px;
+}
+</style>

+ 310 - 386
src/views/DevGroupPage.vue

@@ -1,405 +1,329 @@
 <template>
-    <Layout >
-        <Title title="Devcloud小组数据分析"></Title>
-        <a-row style="margin-top: 5px;">
-            <a-button type="link" @click="clickBackHome">
-                <a-icon type="caret-left" theme="filled"/>
-                返回首页
-            </a-button>
-        </a-row>
-        <a-col :span="12">
-            <!--      小组信息-->
-            <div style="padding: 5px">
-                <a-card title="小组信息" v-model="group_message" class="outer_border_color" :bordered="false">
-                    <a-row>
-                        <a-col :span="12" style="font-size: 15px">
-                            组号:{{group_message[0].group}}
-                        </a-col>
-                    </a-row>
-                    <a-card title="项目信息:" class="inner_border_color">
-                        <a-row v-for="projectItem in group_message[0].projects" :key="projectItem" style="margin-top: 5px" >
-                            <a-col :span="12">
-                                项目id:{{projectItem.projectId}}
-                            </a-col>
-                            <a-col>
-                                项目名称:{{projectItem.projectName}}
-                            </a-col>
-                        </a-row>
-                    </a-card>
-                    <a-card title="小组成员:" class="inner_border_color">
-                        <a-row v-for="memberItem in group_message[0].members" :key="memberItem" style="margin-top: 5px">
-                            <a-col :span="8">
-                                用户id:{{memberItem.userId}}
-                            </a-col>
-                            <a-col :span="8">
-                                学号:
-                                <a-button type="link" @click="clickStudent(memberItem.studentId)">
-                                    {{memberItem.studentId}}
-                                </a-button>
-                            </a-col>
-                            <a-col>
-                                姓名:{{memberItem.name}}
-                            </a-col>
-                        </a-row>
-                    </a-card>
-                </a-card>
-            </div>
-            <!--      commit信息-->
-            <div style="padding: 5px">
-                <a-card title="commit信息" v-model="group_message" class="outer_border_color" :bordered="false">
-                    <a-row>
-                        <a-col :span="12">
-                            commit总次数:{{group_message[0].commit["commit-times"]}}
-                        </a-col>
-                        <a-col>
-                            有效commit次数:{{group_message[0].commit["valid-commit-times"]}}
-                        </a-col>
-                    </a-row>
-                    <a-row>
-                        <a-col :span="12">
-                            bugList_commit次数:{{group_message[0].commit["buglist-commit"]}}
-                        </a-col>
-                        <a-col>
-                            feature_commit次数:{{group_message[0].commit["feature-commit"]}}
-                        </a-col>
-                    </a-row>
-                    <a-card title="commit具体信息:" class="inner_border_color">
-                        <a-row v-for="commitItem in group_message[0].commit['commit-msg-overview']" :key="commitItem" style="margin-top: 2px" >
-                            <a-col :span="1"/>
-                            <a-col :span="12">
-                                - {{commitItem}}
-                            </a-col>
-                        </a-row>
-                    </a-card>
-                </a-card>
-            </div>
-        </a-col>
+  <Layout>
+    <Title title="Devcloud小组数据分析"></Title>
+    <div class="main">
+      <!-- 小组信息 -->
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+          <span>小组信息</span>
+        </div>
+        <el-card class="box-innercard">
+          <div slot="header" class="clearfix">
+            <span>项目信息</span>
+          </div>
+          <el-descriptions :column="2">
+            <template v-for="item in productList">
+              <el-descriptions-item label="项目id" :key="item.id">{{
+                item.id
+              }}</el-descriptions-item>
+              <el-descriptions-item label="项目名称" :key="item.name">{{
+                item.name
+              }}</el-descriptions-item>
+            </template>
+          </el-descriptions>
+        </el-card>
+        <el-card class="box-innercard" style="margin-top: 20px">
+          <div slot="header" class="clearfix">
+            <span>小组成员</span>
+          </div>
+          <el-descriptions :column="3">
+            <template v-for="item in userList">
+              <el-descriptions-item label="用户id" :key="item.id">{{
+                item.id
+              }}</el-descriptions-item>
+              <el-descriptions-item label="学号" :key="item.number">{{
+                item.number
+              }}</el-descriptions-item>
+              <el-descriptions-item label="姓名" :key="item.name">{{
+                item.name
+              }}</el-descriptions-item>
+            </template>
+          </el-descriptions>
+        </el-card>
+      </el-card>
+      <!-- 提交信息 -->
+      <el-card class="box-card" style="margin-top: 20px">
+        <div slot="header" class="clearfix">
+          <span>commit信息</span>
+        </div>
+        <el-descriptions :column="2">
+          <el-descriptions-item label="commit总次数">{{
+            commitMessage.commitTotal
+          }}</el-descriptions-item>
+          <el-descriptions-item label="有效commit次数">{{
+            commitMessage.commit
+          }}</el-descriptions-item>
+          <el-descriptions-item label="bugList_commit次数">{{
+            commitMessage.bugList_commit
+          }}</el-descriptions-item>
+          <el-descriptions-item label="feature_commit次数">{{
+            commitMessage.feature_commit
+          }}</el-descriptions-item>
+        </el-descriptions>
 
-        <a-col :span="12">
-            <!--      测试信息-->
-            <div style="padding: 5px">
-                <a-card title="测试信息" v-model="group_message" class="outer_border_color" :bordered="false">
-                    <a-card title="接口测试" class="inner_border_color" :bordered="false">
-                        <a-row>
-                            <a-col :span="12">
-                                接口测试总数:{{group_message[0].test["interface-test"]["interface-test-times"]}}
-                            </a-col>
-                            <a-col>
-                                接口测试执行次数:{{group_message[0].test["interface-test"]["interface-test-concurrency-count"]}}
-                            </a-col>
-                        </a-row>
-                        <a-row style="margin-top: 5px">
-                            <a-col :span="12">
-                                接口测试失败次数:{{group_message[0].test["interface-test"]["interface-test-concurrency-failure"]}}
-                            </a-col>
-                            <a-col>
-                                接口测试通过次数:{{group_message[0].test["interface-test"]["interface-test-concurrency-pass"]}}
-                            </a-col>
-                        </a-row>
-                    </a-card>
-                </a-card>
-            </div>
-            <!--      流水线信息-->
-            <div style="padding: 5px">
-                <a-card title="流水线部署信息" v-model="group_message" class="outer_border_color" :bordered="false">
-                    <a-row>
-                        流水线部署次数:{{group_message[0].pipeline["pipeline-deploy"]}}
-                    </a-row>
-                    <a-row>
-                        <a-col :span="12">
-                            部署成功次数:{{group_message[0].pipeline["pipeline-pass"]}}
-                        </a-col>
-                        <a-col>
-                            部署失败次数:{{group_message[0].pipeline["pipeline-failure"]}}
-                        </a-col>
-                    </a-row>
-                </a-card>
-            </div>
-
-            <div style="padding: 5px">
-                <a-row class="outer_border_color">
-                    <a-row>
-                        <a-col :span="7">
-                            <p class="table_font">commit贡献占比</p>
-                            <div id="main1" class="pie"/>
-                        </a-col>
-                        <a-col :span="1"/>
-                        <a-col :span="7">
-                            <p class="table_font">接口测试贡献占比</p>
-                            <div id="main2" class="pie"/>
-                        </a-col>
-                        <a-col :span="1"/>
-                        <a-col :span="7">
-                            <a-col>
-                                <p class="table_font">流水线部署贡献占比</p>
-                                <div id="main3" class="pie"/>
-                            </a-col>
-                        </a-col>
-                    </a-row>
-                </a-row>
-            </div>
-        </a-col>
-    </Layout>
+        <el-card class="box-innercard">
+          <div slot="header" class="clearfix">
+            <span>commit具体信息</span>
+          </div>
+          <el-descriptions :column="1" :colon="false">
+            <template v-for="item in commitMessage.commitDetail">
+              <el-descriptions-item :key="item">{{
+                item
+              }}</el-descriptions-item>
+            </template>
+          </el-descriptions>
+        </el-card>
+      </el-card>
+      <!-- 测试信息 -->
+      <el-card class="box-card" style="margin-top: 20px">
+        <div slot="header" class="clearfix">
+          <span>测试信息</span>
+        </div>
+        <el-card class="box-innercard">
+          <div slot="header" class="clearfix">
+            <span>接口测试</span>
+          </div>
+          <el-descriptions :column="2">
+            <el-descriptions-item label="接口测试总数">{{
+              test.total
+            }}</el-descriptions-item>
+            <el-descriptions-item label="接口测试执行次数">{{
+              test.execute
+            }}</el-descriptions-item>
+            <el-descriptions-item label="接口测试失败次数">{{
+              test.fail
+            }}</el-descriptions-item>
+            <el-descriptions-item label="接口测试通过次数">{{
+              test.pass
+            }}</el-descriptions-item>
+          </el-descriptions>
+        </el-card>
+      </el-card>
+      <!-- 部署信息 -->
+      <el-card class="box-card" style="margin-top: 20px">
+        <div slot="header" class="clearfix">
+          <span>流水线部署信息</span>
+        </div>
+        <el-descriptions :column="2">
+          <el-descriptions-item label="流水线部署次数">{{
+            arrange.total
+          }}</el-descriptions-item>
+          <el-descriptions-item label="流水线部署成功次数">{{
+            arrange.pass
+          }}</el-descriptions-item>
+          <el-descriptions-item label="流水线部署失败次数">{{
+            arrange.fail
+          }}</el-descriptions-item>
+        </el-descriptions>
+      </el-card>
+      <!-- 图表 -->
+      <el-card class="box-card" style="margin-top: 20px">
+        <el-row :gutter="20">
+          <el-col :span="8">
+            <p class="table_font">commit贡献占比</p>
+            <div id="main1" class="pie"
+          /></el-col>
+          <el-col :span="8">
+            <p class="table_font">接口测试贡献占比</p>
+            <div id="main2" class="pie"
+          /></el-col>
+          <el-col :span="8">
+            <p class="table_font">流水线部署贡献占比</p>
+            <div id="main3" class="pie"
+          /></el-col>
+        </el-row>
+      </el-card>
+    </div>
+  </Layout>
 </template>
 
 <script>
-    import {mapGetters, mapMutations} from "vuex"
-    import * as echarts from 'echarts';
-    import Layout from "@/components/content/Layout";
-    import Title from "@/components/content/Title";
-    export default {
-        name: "Group",
-        components: {
-            Layout,
-            Title
+import * as echarts from "echarts";
+import Layout from "@/components/content/Layout";
+import Title from "@/components/content/Title";
+export default {
+  components: {
+    Layout,
+    Title,
+  },
+  data() {
+    return {
+      commitContribution: [
+        { name: "zqq", times: 0, proportion: 0 },
+        { name: "ty", times: 2, proportion: 0.4 },
+        { name: "kcy", times: 1, proportion: 0.2 },
+        { name: "pyy", times: 2, proportion: 0.4 },
+      ],
+      interfaceContribution: [
+        { name: "zqq", times: 4, proportion: 0.8 },
+        { name: "ty", times: 0, proportion: 0 },
+        { name: "kcy", times: 0, proportion: 0 },
+        { name: "pyy", times: 1, proportion: 0.2 },
+      ],
+      pipelineContribution: [
+        { name: "zqq", times: 1, proportion: 0.1 },
+        { name: "ty", times: 1, proportion: 0.1 },
+        { name: "kcy", times: 2, proportion: 0.2 },
+        { name: "pyy", times: 6, proportion: 0.6 },
+      ],
+      commitPie: [],
+      testPie: [],
+      deployPie: [],
+      arrange: {
+        total: 10,
+        pass: 20,
+        fail: 20,
+      },
+      test: {
+        total: 20,
+        execute: 200,
+        pass: 10,
+        fail: 20,
+      },
+      commitMessage: {
+        commitTotal: 5,
+        commit: 3,
+        bugList_commit: 4,
+        feature_commit: 3,
+        commitDetail: [
+          "- fix: 修改错误",
+          "- feat: 增加评论区功能",
+          "- feat: 增加头像上传",
+          "- fix: 修复登录页面的错误",
+        ],
+      },
+      userList: [
+        { id: 11, name: "测试", number: "2222" },
+        { id: 12, name: "测试2", number: "2222" },
+        { id: 13, name: "测试3", number: "2222" },
+      ],
+      productList: [
+        { id: 1, name: "fun_frontEnd" },
+        { id: 2, name: "fun_backEnd" },
+      ],
+    };
+  },
+  mounted() {
+    this.getAnalysis();
+    this.getCommitPie();
+    this.getTestPie();
+    this.getDeployPie();
+  },
+  methods: {
+    getAnalysis() {
+      for (let i = 0; i < this.commitContribution.length; i++) {
+        this.commitPie.push({
+          value: this.commitContribution[i].times,
+          name: this.commitContribution[i].name,
+        });
+      }
+      for (let i = 0; i < this.interfaceContribution.length; i++) {
+        this.testPie.push({
+          value: this.interfaceContribution[i].times,
+          name: this.interfaceContribution[i].name,
+        });
+      }
+      for (let i = 0; i < this.pipelineContribution.length; i++) {
+        this.deployPie.push({
+          value: this.pipelineContribution[i].times,
+          name: this.pipelineContribution[i].name,
+        });
+      }
+    },
+    getCommitPie() {
+      // 绘制图表
+      var myChart1 = echarts.init(document.getElementById("main1"));
+      // 指定图表的配置项和数据
+      var option = {
+        title: {
+          // text: 'commit占比信息',
         },
-        data() {
-            return {
-                testData: [                  //每个模块的名字和值
-                    { name: '未领取', value: 10 },
-                    { name: '处理中', value: 30},
-                    { name: '已完成', value: 50 }
-                ],
-                group_message:[
-                    {
-                        group: 10,
-                        projects: [
-                            {projectId:1, projectName:"fun_frontEnd",},
-                            {projectId:2, projectName:"fun_backEnd",},
-                        ],
-                        members: [
-                            {userId: 11,studentId: 201250076, name:"周棋秋"},
-                            {userId: 12,studentId: 201250075,name: "田野"},
-                            {userId: 13,studentId: 201250077,name: "金采源"},
-                            {userId: 14,studentId: 201250230,name: "李泽玉"},
-                        ],
-                        commit: {
-                            ["commit-times"]: 5,
-                            ["valid-commit-times"]: 5,
-                            ["buglist-commit"]: 2,
-                            ["feature-commit"]: 3,
-                            ["commit-msg-overview"]: [
-                                "fix: 修改错误",
-                                "feat: 增加评论区功能",
-                                "feat: 增加头像上传",
-                                "fix: 修复登录页面的错误",
-                                "feat: 增加优惠券功能",
-                            ],
-                            ["commit-contribution"]: [
-                                {name: "周棋秋", times: 0, proportion: 0},
-                                {name:"田野",times:2, proportion: 0.4},
-                                {name:"金采源",times:1, proportion: 0.2},
-                                {name:"李泽玉",times:2, proportion: 0.4},
-                            ]
-                        },
-                        test: {
-                            ["interface-test"]: {
-                                ["interface-test-times"]: 5,
-                                ["interface-test-concurrency-count"]: 100,
-                                ["interface-test-concurrency-failure"]: 20,
-                                ["interface-test-concurrency-pass"]: 80,
-                                ["interface-test-contribution"]: [
-                                    {name: "周棋秋", times: 4, proportion: 0.8},
-                                    {name:"田野",times:0, proportion: 0},
-                                    {name:"金采源",times:0, proportion: 0},
-                                    {name:"李泽玉",times:1, proportion: 0.2},
-                                ]
-                            },
-                        },
-                        pipeline: {
-                            ["pipeline-deploy"]:10,
-                            ["pipeline-pass"]:10,
-                            ["pipeline-failure"]:0,
-                            ["pipeline-contribution"]: [
-                                {name: "周棋秋", times: 1, proportion: 0.1},
-                                {name:"田野",times:1, proportion: 0.1},
-                                {name:"金采源",times:2, proportion: 0.2},
-                                {name:"李泽玉",times:6, proportion: 0.6},
-                            ]
-                        },
-                    }],
-                // group_message:[],
-                commitPie:[],
-                testPie:[],
-                deployPie:[],
-                current_student:-1,
-            };
+        grid: {
+          top: 90,
         },
-
-        async mounted () {
-            console.log('here');
-            // await this.set_group({
-            //   groupId: Number(this.$route.params.groupId),
-            // })
-            // await this.initData(this.groupId);
-            this.getAnalysis();
-            this.getCommitPie();
-            this.getTestPie();
-            this.getDeployPie();
+        tooltip: {
+          trigger: "item",
         },
+        series: [
+          {
+            name: "commit次数",
+            center: ["50%", "40%"],
+            type: "pie", // 设置图表类型为饼图
+            radius: "55%", // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
+            data: this.commitPie,
+          },
+        ],
+      };
+      // 使用刚指定的配置项和数据显示图表。
+      myChart1.setOption(option);
+    },
 
-        clickStudent(studentId){
-            console.log(studentId);
-            this.current_student = studentId;
-            this.$router.push({
-                name: 'student',
-                params: {
-                    studentId: this.current_student,
-                }
-            })
+    getTestPie() {
+      var myChart2 = echarts.init(document.getElementById("main2"));
+      // 指定图表的配置项和数据
+      var option = {
+        title: {
+          // text: 'commit占比信息',
         },
-
-        async initData(groupId){
-            // var res = await getGroupAPI(groupId);
-            // this.group_message = [];
-            // this.group_message.push({
-            //     group: res.data.group,
-            //     projects: res.data.projects,
-            //     members: res.data.members,
-            //     commit: res.data.commit,
-            //     test: res.data.test,
-            //     pipeline: res.data.pipeline,
-            // })
+        grid: {
+          top: 90,
         },
-
-        getAnalysis(){
-            for(let i=0;i<this.group_message[0].commit["commit-contribution"].length;i++){
-                this.commitPie.push({
-                    value: this.group_message[0].commit["commit-contribution"][i].times,
-                    name: this.group_message[0].commit["commit-contribution"][i].name,
-                })
-            }
-            for(let i=0;i<this.group_message[0].test["interface-test"]["interface-test-contribution"].length;i++){
-                this.testPie.push({
-                    value: this.group_message[0].test["interface-test"]["interface-test-contribution"][i].times,
-                    name: this.group_message[0].test["interface-test"]["interface-test-contribution"][i].name,
-                })
-            }
-            for(let i=0;i<this.group_message[0].pipeline["pipeline-contribution"].length;i++){
-                this.deployPie.push({
-                    value: this.group_message[0].pipeline["pipeline-contribution"][i].times,
-                    name: this.group_message[0].pipeline["pipeline-contribution"][i].name,
-                })
-            }
+        tooltip: {
+          trigger: "item",
         },
+        series: [
+          {
+            name: "测试次数",
+            center: ["50%", "40%"],
+            type: "pie", // 设置图表类型为饼图
+            radius: "55%", // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
+            data: this.testPie,
+          },
+        ],
+      };
+      // 使用刚指定的配置项和数据显示图表。
+      myChart2.setOption(option);
+    },
 
-        getCommitPie() {
-            // 绘制图表
-            var myChart1 = echarts.init(document.getElementById('main1'))
-            // 指定图表的配置项和数据
-            var option = {
-                title: {
-                    // text: 'commit占比信息',
-                },
-                grid: {
-                    top: 90
-                },
-                tooltip: {
-                    trigger: 'item'
-                },
-                series: [
-                    {
-                        name: 'commit次数',
-                        center: ['50%', '30%'],
-                        type: 'pie',    // 设置图表类型为饼图
-                        radius: '55%',  // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
-                        data: this.commitPie,
-                    }
-                ]
-            }
-            // 使用刚指定的配置项和数据显示图表。
-            myChart1.setOption(option)
+    getDeployPie() {
+      var myChart3 = echarts.init(document.getElementById("main3"));
+      // 指定图表的配置项和数据
+      var option = {
+        title: {
+          // text: 'commit占比信息',
         },
-
-        getTestPie(){
-            var myChart2 = echarts.init(document.getElementById('main2'))
-            // 指定图表的配置项和数据
-            var option = {
-                title: {
-                    // text: 'commit占比信息',
-                },
-                grid: {
-                    top: 90
-                },
-                tooltip: {
-                    trigger: 'item'
-                },
-                series: [
-                    {
-                        name: '测试次数',
-                        center: ['50%', '30%'],
-                        type: 'pie',    // 设置图表类型为饼图
-                        radius: '55%',  // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
-                        data: this.testPie,
-                    }
-                ]
-            }
-            // 使用刚指定的配置项和数据显示图表。
-            myChart2.setOption(option)
+        grid: {
+          top: 90,
         },
-
-        getDeployPie(){
-            console.log("start Deploy")
-            var myChart3 = echarts.init(document.getElementById('main3'))
-            // 指定图表的配置项和数据
-            var option = {
-                title: {
-                    // text: 'commit占比信息',
-                },
-                grid: {
-                    top: 90
-                },
-                tooltip: {
-                    trigger: 'item'
-                },
-                series: [
-                    {
-                        name: '部署次数',
-                        center: ['50%', '30%'],
-                        type: 'pie',    // 设置图表类型为饼图
-                        radius: '55%',  // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
-                        data: this.deployPie,
-                    }
-                ]
-            }
-            // 使用刚指定的配置项和数据显示图表。
-            myChart3.setOption(option)
-        }
-
-    };
+        tooltip: {
+          trigger: "item",
+        },
+        series: [
+          {
+            name: "部署次数",
+            center: ["50%", "40 %"],
+            type: "pie", // 设置图表类型为饼图
+            radius: "55%", // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
+            data: this.deployPie,
+          },
+        ],
+      };
+      // 使用刚指定的配置项和数据显示图表。
+      myChart3.setOption(option);
+    },
+  },
+};
 </script>
 
 <style scoped>
-    .el-carousel__item h2 {
-        color: #475669;
-        font-size: 14px;
-        opacity: 0.75;
-        margin: 0;
-    }
-
-    .outer_border_color {
-        min-width: 550px;
-        border-radius: 20px;
-        margin: 15px;
-        background-color: #f9f9f9;
-        border: 2px solid #d6d6d6;
-    }
-
-    .inner_border_color{
-        min-width: 150px;
-        border-radius: 10px;
-        margin-top: 10px;
-        background-color: #ffffff;
-    }
-
-    .table_font{
-        font-size: 15px;
-        margin: 20px;
-    }
-
-    .pie{
-        width: 200px;
-        height: 120px;
-    }
-
+.box-innercard {
+  /* background-color: #F0F2F5; */
+}
+.pie {
+  width: 200px;
+  height: 150px;
+}
+/* .main{
+  display: flex;
+} */
 </style>

+ 332 - 12
src/views/DevStudentPage.vue

@@ -1,21 +1,341 @@
 <template>
-    <Layout>
-        <Title title="Devcloud个人数据分析"></Title>
-        <a-row style="background-color: #7deeff">??????????</a-row>
-    </Layout>
+  <Layout>
+    <Title title="Devcloud个人数据分析"></Title>
+    <!-- 个人信息 -->
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>个人信息</span>
+      </div>
+      <el-descriptions :column="2">
+        <el-descriptions-item label="姓名">{{
+          user.name
+        }}</el-descriptions-item>
+        <el-descriptions-item label="学号">{{
+          user.userId
+        }}</el-descriptions-item>
+        <el-descriptions-item label="电子邮箱">{{
+          user.email
+        }}</el-descriptions-item>
+      </el-descriptions>
+      <el-card class="box-innercard">
+        <div slot="header" class="clearfix">
+          <span>项目信息</span>
+        </div>
+        <el-descriptions :column="2">
+          <template v-for="item in productList">
+            <el-descriptions-item label="项目id" :key="item.projectId">{{
+              item.projectId
+            }}</el-descriptions-item>
+            <el-descriptions-item label="项目名称" :key="item.projectName">{{
+              item.projectName
+            }}</el-descriptions-item>
+          </template>
+        </el-descriptions>
+      </el-card>
+    </el-card>
+    <!-- 提交信息 -->
+    <el-card class="box-card" style="margin-top: 20px">
+      <div slot="header" class="clearfix">
+        <span>commit信息</span>
+      </div>
+      <el-descriptions :column="2">
+        <el-descriptions-item label="commit总次数">{{
+          commitMessage.commit_times
+        }}</el-descriptions-item>
+        <el-descriptions-item label="有效commit次数">{{
+          commitMessage.valid_commit_times
+        }}</el-descriptions-item>
+        <el-descriptions-item label="bugList_commit次数">{{
+          commitMessage.buglist_commit
+        }}</el-descriptions-item>
+        <el-descriptions-item label="feature_commit次数">{{
+          commitMessage.feature_commit
+        }}</el-descriptions-item>
+      </el-descriptions>
+
+      <el-card class="box-innercard">
+        <div slot="header" class="clearfix">
+          <span>commit具体信息</span>
+        </div>
+        <el-descriptions :column="1" :colon="false">
+          <template v-for="item in commitMessage.commit_msg_overview">
+            <el-descriptions-item :key="item">{{ item }}</el-descriptions-item>
+          </template>
+        </el-descriptions>
+      </el-card>
+      <el-button type="text" @click="showModel1">commit组成信息</el-button>
+    </el-card>
+    <!-- 测试信息 -->
+    <el-card class="box-card" style="margin-top: 20px">
+      <div slot="header" class="clearfix">
+        <span>测试信息</span>
+      </div>
+      <el-card class="box-innercard">
+        <div slot="header" class="clearfix">
+          <span>接口测试</span>
+        </div>
+        <el-descriptions :column="2">
+          <el-descriptions-item label="接口测试总数">{{
+            test.test_times
+          }}</el-descriptions-item>
+          <el-descriptions-item label="接口测试执行次数">{{
+            test.test_concurrency_count
+          }}</el-descriptions-item>
+          <el-descriptions-item label="接口测试失败次数">{{
+            test.test_concurrency_failure
+          }}</el-descriptions-item>
+          <el-descriptions-item label="接口测试通过次数">{{
+            test.test_concurrency_success
+          }}</el-descriptions-item>
+        </el-descriptions>
+      </el-card>
+      <el-button type="text" @click="showModel2">接口测试通过率</el-button>
+    </el-card>
+    <!-- 部署信息 -->
+    <el-card class="box-card" style="margin-top: 20px">
+      <div slot="header" class="clearfix">
+        <span>流水线部署信息</span>
+      </div>
+      <el-descriptions :column="2">
+        <el-descriptions-item label="流水线部署次数">{{
+          pipeline.pipeline_deploy
+        }}</el-descriptions-item>
+        <el-descriptions-item label="流水线部署成功次数">{{
+          pipeline.pipeline_pass
+        }}</el-descriptions-item>
+        <el-descriptions-item label="流水线部署失败次数">{{
+          pipeline.pipline_failure
+        }}</el-descriptions-item>
+      </el-descriptions>
+      <el-button type="text" @click="showModel3">部署通过率</el-button>
+    </el-card>
+    <el-dialog :visible.sync="visible1">
+      <div
+        class="righttop"
+        ref="charts1"
+        :style="{
+          width: '100%',
+          height: '280px',
+          background: 'rgba(255,0,0,0)',
+        }"
+      ></div>
+    </el-dialog>
+    <el-dialog :visible.sync="visible2">
+      <div
+        class="righttop"
+        ref="charts2"
+        :style="{
+          width: '100%',
+          height: '280px',
+          background: 'rgba(255,0,0,0)',
+        }"
+      ></div>
+    </el-dialog>
+    <el-dialog :visible.sync="visible3">
+      <div
+        class="righttop"
+        ref="charts3"
+        :style="{
+          width: '100%',
+          height: '280px',
+          background: 'rgba(255,0,0,0)',
+        }"
+      ></div>
+    </el-dialog>
+  </Layout>
 </template>
 
 <script>
-    import Layout from "@/components/content/Layout";
-    import Title from "@/components/content/Title";
-    export default {
-        components: {
-            Layout,
-            Title
-        },
+import * as echarts from "echarts";
+import Layout from "@/components/content/Layout";
+import Title from "@/components/content/Title";
+import { getStudentAnalysis } from "@/network/devcloud/index.js";
+export default {
+  components: {
+    Layout,
+    Title,
+  },
+  data() {
+    return {
+      visible1: false,
+      commitAnalysis: [],
+      visible2: false,
+      testAnalysis: [],
+      visible3: false,
+      deployAnalysis: [],
+      pipeline: {
+      },
+      user: {
+      },
+      test: {
+      },
+      commitMessage: {
+        
+      },
+      productList: [
+      ],
     };
+  },
+  created() {
+    this.getData();
+  },
+  mounted() {
+    this.getAnaylysis();
+  },
+  methods: {
+    async getData() {
+      let res = await getStudentAnalysis({
+        params: {
+          user_id: this.$route.params.id,
+        },
+      });
+      if (res.success) {
+        this.user = res.content;
+        this.productList = res.content.projects
+        this.commitMessage = res.content.commit
+        this.test = res.content.test
+        this.pipeline = res.content.pipeline
+      }
+    },
+    getAnaylysis() {
+      //部署信息图表
+      this.deployAnalysis.push({
+        value: this.pipeline.pipeline_deploy,
+        name: "部署成功次数",
+      });
+      this.deployAnalysis.push({
+        value: this.pipeline.pipline_failure,
+        name: "部署失败次数",
+      });
+      //commit信息图表
+      this.commitAnalysis.push({
+        value: this.commitMessage.feature_commit,
+        name: "feature_commit次数",
+      });
+      this.commitAnalysis.push({
+        value: this.commitMessage.buglist_commit,
+        name: "buglist_commit次数",
+      });
+      //test信息图表
+      this.testAnalysis.push({
+        value: this.test.test_concurrency_failure,
+        name: "接口测试失败次数",
+      });
+      this.testAnalysis.push({
+        value: this.test.test_concurrency_success,
+        name: "接口测试通过次数",
+      });
+    },
+    initBarChart1() {
+      let newPromise = new Promise((resolve) => {
+        resolve();
+      });
+      newPromise.then(() => {
+        let myChart1 = echarts.init(this.$refs.charts1);
+        myChart1.setOption({
+          title: {
+            text: "commit占比信息",
+          },
+          grid: {
+            top: 90,
+          },
+          tooltip: {
+            trigger: "item",
+          },
+          series: [
+            {
+              name: "commit次数",
+              type: "pie", // 设置图表类型为饼图
+              radius: "55%", // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
+              data: this.commitAnalysis,
+            },
+          ],
+        });
+      });
+    },
+    initBarChart2() {
+      let newPromise = new Promise((resolve) => {
+        resolve();
+      });
+      newPromise.then(() => {
+        let myChart2 = echarts.init(this.$refs.charts2);
+        myChart2.setOption({
+          title: {
+            text: "接口测试通过率",
+          },
+          grid: {
+            top: 90,
+          },
+          tooltip: {
+            trigger: "item",
+          },
+          series: [
+            {
+              name: "测试次数",
+              type: "pie", // 设置图表类型为饼图
+              radius: "55%", // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
+              data: this.testAnalysis,
+            },
+          ],
+        });
+      });
+    },
+    initBarChart3() {
+      let newPromise = new Promise((resolve) => {
+        resolve();
+      });
+      newPromise.then(() => {
+        let myChart3 = echarts.init(this.$refs.charts3);
+        myChart3.setOption({
+          title: {
+            text: "部署通过率",
+          },
+          grid: {
+            top: 90,
+          },
+          tooltip: {
+            trigger: "item",
+          },
+          series: [
+            {
+              name: "部署次数",
+              type: "pie", // 设置图表类型为饼图
+              radius: "55%", // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
+              data: this.deployAnalysis,
+            },
+          ],
+        });
+      });
+    },
+    showModel1() {
+      this.visible1 = true;
+    },
+    showModel2() {
+      this.visible2 = true;
+    },
+    showModel3() {
+      this.visible3 = true;
+    },
+  },
+  watch: {
+    visible1: function (val) {
+      if (val) {
+        this.initBarChart1();
+      }
+    },
+    visible2: function (val) {
+      if (val) {
+        this.initBarChart2();
+      }
+    },
+    visible3: function (val) {
+      if (val) {
+        this.initBarChart3();
+      }
+    },
+  },
+};
 </script>
 
 <style scoped>
-
 </style>

+ 10 - 9
src/views/Home.vue

@@ -6,15 +6,16 @@
 import { ROLE } from "@/common/const";
   export default {
     beforeMount() {
-      if(sessionStorage.getItem("role") === ROLE.STUDENT || 
-      sessionStorage.getItem("role") === ROLE.ADMIN) {
-        this.$router.push("/studentPage");
-      } else if(sessionStorage.getItem("role") === ROLE.TEACHER) {
-        this.$router.push("/teacherPage");
-      } 
-      else {
-        this.$router.push("/error");
-      }
+      // if(sessionStorage.getItem("role") === ROLE.STUDENT || 
+      // sessionStorage.getItem("role") === ROLE.ADMIN) {
+        this.$router.push("/dashboard");
+      // } else if(sessionStorage.getItem("role") === ROLE.TEACHER) {
+      //   this.$router.push("/teacherPage");
+      // } 
+      // else {
+      //   this.$router.push("/error");
+      // }
+    // }
     }
   }
 </script>

+ 3 - 4
vue.config.js

@@ -2,15 +2,14 @@ module.exports = {
   configureWebpack: {
     devServer: {
       port: 8085,
+      https: true,
       open: true,
-      host:"localhost",
       proxy: {
         '/api': {
-          target: 'http://localhost:12306',
-          ws: true,
+          target: 'http://smart-server.seec.seecoder.cn',
           changeOrigin: true,
           pathRewrite:{
-            '^/api': '/'
+            '^/api': ''
           }
         }
       }