Browse Source

提交最新代码

TheLittlePrince 6 years ago
parent
commit
5309336df7

+ 4 - 1
src/api/index.js

@@ -54,6 +54,8 @@ const errorDetail = urlFn('/api/kmt/correctSys/errorDetail')
 const logout = urlFn('/api/kmt/login/logout')
 // 质检前校验作业状态
 const CheckHomeworkStatus = urlFn('/api/kmt/correctSys/checkHomeworkStatus')
+// 管理员查看科目报表数据
+const FindSubjectCharts = urlFn('/api/kmt/correctSys/findSubjectCharts')
 export {
     GET_TOKEN,
     GET_UUIONID_TOKEN,
@@ -80,5 +82,6 @@ export {
     errorWarning,
     errorDetail,
     logout,
-    CheckHomeworkStatus
+    CheckHomeworkStatus,
+    FindSubjectCharts
 }

+ 199 - 0
src/components/HomeworkTotalList.vue

@@ -0,0 +1,199 @@
+<template>
+  <div>
+    <div :id="myChart" class="myChartDiv" style=" width: 80%; height: 600px;"></div>
+    <!-- <div id="myChart" class="myChart" style="width:960px;height:500px;margin:0 auto;"></div> -->
+  </div>
+</template>
+<script>
+import { mapGetters, mapActions } from "vuex";
+//引入uuid文件
+import uuidv1 from "uuid/v1";
+
+// 引入基本模板
+let echarts = require("echarts/lib/echarts");
+// 引入柱状图组件
+require("echarts/lib/chart/bar");
+// 引入提示框和title组件
+require("echarts/lib/component/tooltip");
+require("echarts/lib/component/title");
+export default {
+  name: "hello",
+  props: {
+    chartData: {
+      type: Object,
+      default: () => {}
+    }
+    // 接收父组件传递过来的信息
+  },
+  created() {
+    this.myChart = uuidv1(); //获取随机id
+  },
+  data() {
+    return {
+      chartDataINfo: [],
+      total: "",
+      subject: "",
+      myChart: "",
+      dataAxis: [
+        "0h",
+        "1h",
+        "2h",
+        "3h",
+        "4h",
+        "5h",
+        "6h",
+        "7h",
+        "8h",
+        "9h",
+        "10h",
+        "11h",
+        "12h",
+        "13h",
+        "14h",
+        "15h",
+        "16h",
+        "17h",
+        "18h",
+        "19h",
+        "20h",
+        "21h",
+        "22h",
+        "23h",
+        "24h"
+      ],
+      yMax: 500,
+      dataShadow: [],
+      msg: "Welcome to Your Vue.js App"
+    };
+  },
+  mounted() {
+    const vm = this;
+    vm.$nextTick(() => {
+      vm.drawLine();
+    });
+  },
+  watch: {
+    chartData: {
+      handler: function(val, oldVal) {
+        this.chartDataINfo = val.series;
+        this.subject = val.subject;
+        this.total = val.total;
+        this.drawLine();
+      },
+      deep: true
+    }
+  },
+  methods: {
+    dataSet() {
+      const dataShadow = [];
+      for (var i = 0; i < this.data.length; i++) {
+        dataShadow.push(this.yMax);
+        this.dataShadow = dataShadow;
+      }
+    },
+    drawLine() {
+      // 基于准备好的dom,初始化echarts实例
+      let myChart = echarts.init(document.getElementById(this.myChart), null, {
+        renderer: "svg"
+      });
+      // 绘制图表
+      myChart.setOption({
+        title: {
+          text: this.subject,
+          subtext: "作业总张数:" + this.total + "张",
+          left: "center"
+        },
+        tooltip: {
+          trigger: "axis",
+          //在这里设置
+          formatter: "{b0}时{a0}{c0}张",
+          extraCssText: "width:100px;height:40px;"
+        },
+        xAxis: {
+            type : 'category',
+          data: this.dataAxis,
+          axisLabel: {
+            inside: true,
+            textStyle: {
+              color: "#fff"
+            }
+          },
+          axisTick: {
+            show: true
+          },
+          axisLine: {
+            show: false
+          },
+          z: 10
+        },
+        yAxis: {
+          axisLine: {
+            show: false
+          },
+          axisTick: {
+            show: false
+          },
+          axisLabel: {
+            textStyle: {
+              color: "#999"
+            }
+          }
+        },
+        dataZoom: [
+          {
+            type: "inside"
+          }
+        ],
+        series: [
+          {
+            type: "bar",
+            itemStyle: {
+              normal: { color: "rgba(0,0,0,0.05)" }
+            },
+            barGap: "-100%",
+            barCategoryGap: "40%",
+            data: this.dataShadow,
+            animation: true
+          },
+          {
+            type: "bar",
+            itemStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                  { offset: 0, color: "#FF3377" },
+                  { offset: 0.5, color: "#188df0" },
+                  { offset: 1, color: "#00B9FF" }
+                ])
+              },
+              emphasis: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                  { offset: 0, color: "#2378f7" },
+                  { offset: 0.7, color: "#2378f7" },
+                  { offset: 1, color: "#83bff6" }
+                ])
+              }
+            },
+            data: this.chartDataINfo 
+          }
+        ]
+      });
+      window.onresize = function() {
+        myChart.resize();
+      };
+    }
+  },
+  computed: {
+    ...mapGetters(["FindSubjectCharts"])
+  }
+};
+</script>
+
+<style scoped>
+.myChartDiv {
+  width: 70%;
+  height: 500px;
+  margin: 0 auto;
+  text-align: center;
+  color:brown;
+}
+</style>

+ 224 - 203
src/components/SuperComponent.vue

@@ -1,34 +1,49 @@
 <template>
-  <el-col :span="24" class="">
-      <div class="logo-header">
-       <img class="logoImg" src="../assets/img/log.png"/>
-      </div>
+  <el-col :span="24" class>
+    <div class="logo-header">
+      <img class="logoImg" src="../assets/img/log.png" />
+    </div>
     <!--v-show="roles.indexOf(item.id) >= 0"-->
-      <el-col :span="3"   v-for="(item, index) of menuData" :key="item.id"
-      @click.native="secondNavClick(item,index)" style="text-align: center">
-          <span class="lineStyle" :class="{superactive:index == checkindex,menu_item:true}">{{item.name}}</span>
-          <!-- <div class="box" v-if="index==1||index==3">
+    <el-col
+      :span="3"
+      v-for="(item, index) of menuData"
+      :key="item.id"
+      @click.native="secondNavClick(item,index)"
+      style="text-align: center"
+    >
+      <span
+        class="lineStyle"
+        :class="{superactive:index == checkindex,menu_item:true}"
+      >{{item.name}}</span>
+      <!-- <div class="box" v-if="index==1||index==3">
             <span class="box-text">{{index==1?2+'项任务':3+'份作业'}}</span>
-          </div> -->
-      </el-col>
+      </div>-->
+    </el-col>
 
-      <el-col :span="4" class="aside-right">
-      <div class="login">   
-        <img  class="userstyle"  :src="BASE_URL + avatar" alt="">
+    <el-col :span="4" class="aside-right">
+      <div class="login">
+        <img class="userstyle" :src="BASE_URL + avatar" alt />
         <!-- <img class="userstyle" src="../assets/img/user.jpg"> -->
         <span>{{name}}</span>
         <i class="el-icon-caret-bottom"></i>
       </div>
       <div class="out">
-        <img src="../assets/img/out.png" alt class="out-img">
+        <img src="../assets/img/out.png" alt class="out-img" />
         <span @click="LoginoutBtn">退出</span>
       </div>
     </el-col>
-       <div class='showModel' @click="allShowModel()" v-if="hiddenModel"></div>
-    <div class='model' v-if="hiddenModel">
-      <div class='model-text'>
+    <div class="showModel" @click="allShowModel()" v-if="hiddenModel"></div>
+    <div class="model" v-if="hiddenModel">
+      <div class="model-text">
         <div class="model-text-items">
-          <div><img src="../assets/img/del@2x.png" alt="" @click="allShowModel()" class="model-text-items-close"></div>
+          <div>
+            <img
+              src="../assets/img/del@2x.png"
+              alt
+              @click="allShowModel()"
+              class="model-text-items-close"
+            />
+          </div>
           <div>{{name}}老师您确定退出吗?</div>
         </div>
         <div class="model-btn">
@@ -41,8 +56,8 @@
 </template>
 
 <script>
-import {mapGetters} from 'vuex'
-import { IMG_BASE_URL } from '@/ImgConfig'
+import { mapGetters } from "vuex";
+import { IMG_BASE_URL } from "@/ImgConfig";
 export default {
   name: "navMenu",
   // props: {
@@ -50,31 +65,37 @@ export default {
   // },
   data() {
     return {
-         hiddenModel:false,
-        accessToken:localStorage.getItem("accessToken"), //token
-        BASE_URL:IMG_BASE_URL,
-      menuData: [ {
-    id: "1",
-    name: "校区管理员",
-    href: "SuperAdmin",
-  },
-  {
-    id: "2",
-    name: " 批改老师注册审核",
-    href: "CheckTeacherAudit",
-  },
-  {
-    id: "3",
-    name: "批改老师薪酬表",
-    href: "CheckTeacherPay",
-  },
-          {
-            id: "4",
-            name: "作业回收站",
-            href: "HomeworkRecycle",
-          },
- ],
-      checkindex:0
+      hiddenModel: false,
+      accessToken: localStorage.getItem("accessToken"), //token
+      BASE_URL: IMG_BASE_URL,
+      menuData: [
+        {
+          id: "1",
+          name: "校区管理员",
+          href: "SuperAdmin"
+        },
+        {
+          id: "2",
+          name: " 批改老师注册审核",
+          href: "CheckTeacherAudit"
+        },
+        {
+          id: "3",
+          name: "批改老师薪酬表",
+          href: "CheckTeacherPay"
+        },
+        {
+          id: "4",
+          name: "待分配作业",
+          href: "HomeworkRecycle"
+        },
+           {
+          id: "5",
+          name: "作业统计",
+          href: "HomeworkTotally"
+        }
+      ],
+      checkindex: 0
     };
   },
   watch: {
@@ -88,36 +109,37 @@ export default {
     // initNav() {
     //   this.menuData = JSON.parse(JSON.stringify(this.navsData));
     // },
-      LoginoutBtn(){
-       this.hiddenModel = true;
+    LoginoutBtn() {
+      this.hiddenModel = true;
     },
-    allShowModel(){
+    allShowModel() {
       this.hiddenModel = false;
-       this.$message("已取消操作!");
+      this.$message("已取消操作!");
     },
-    ApplyOperate(){
-        this.$store.dispatch("LogOut", {
-             accessToken: this.accessToken
+    ApplyOperate() {
+      this.$store.dispatch("LogOut", {
+        accessToken: this.accessToken
       });
     },
     secondNavClick(val, index) {
-
-      sessionStorage.setItem('tabIndex',index);
-      this.checkindex = sessionStorage.getItem('tabIndex');
-      console.log(sessionStorage.getItem('tabIndex'))
-      if (sessionStorage.getItem('tabIndex') == 0){
-        this.$router.push("/super/" + 'SuperAdmin');
-      } else if (sessionStorage.getItem('tabIndex') == 1){
-        this.$router.push("/super/" + 'CheckTeacherAudit');
-      } else if (sessionStorage.getItem('tabIndex') == 2){
-        this.$router.push("/super/" + 'CheckTeacherPay');
-      } else if (sessionStorage.getItem('tabIndex') == 3){
-        this.$router.push("/super/" + 'HomeworkRecycle');
+      sessionStorage.setItem("tabIndex", index);
+      this.checkindex = sessionStorage.getItem("tabIndex");
+      console.log(sessionStorage.getItem("tabIndex"));
+      if (sessionStorage.getItem("tabIndex") == 0) {
+        this.$router.push("/super/" + "SuperAdmin");
+      } else if (sessionStorage.getItem("tabIndex") == 1) {
+        this.$router.push("/super/" + "CheckTeacherAudit");
+      } else if (sessionStorage.getItem("tabIndex") == 2) {
+        this.$router.push("/super/" + "CheckTeacherPay");
+      } else if (sessionStorage.getItem("tabIndex") == 3) {
+        this.$router.push("/super/" + "HomeworkRecycle");
+      } else if (sessionStorage.getItem("tabIndex") == 4) {
+        this.$router.push("/super/" + "HomeworkTotally");
       }
       // this.$router.push("/super/" + val.href);
       // this.checkindex = index;
     },
-     //  账号管理、退出登录
+    //  账号管理、退出登录
     Loginout() {
       this.$confirm("您确定退出吗?", "提示", {
         confirmButtonText: "确定",
@@ -126,8 +148,8 @@ export default {
       })
         .then(() => {
           this.$store.dispatch("LogOut", {
-             accessToken: this.accessToken
-      });
+            accessToken: this.accessToken
+          });
         })
         .catch(() => {
           // console.log(err)
@@ -136,185 +158,184 @@ export default {
     }
   },
   computed: {
-      ...mapGetters(['name', 'avatar','roles'])
-    },
+    ...mapGetters(["name", "avatar", "roles"])
+  },
   mounted() {
-    this.checkindex = sessionStorage.getItem('tabIndex');
+    this.checkindex = sessionStorage.getItem("tabIndex");
     // this.initNav();
   }
 };
 </script>
 <style scoped>
 /*.mainHeader{*/
-  /*height: 110px;*/
-  /*line-height:110px;*/
+/*height: 110px;*/
+/*line-height:110px;*/
 /*}*/
 .menu_item {
   cursor: pointer;
-  color:#999999;
+  color: #999999;
   font-size: 9px;
   font-family: serif;
-  box-sizing:border-box;
+  box-sizing: border-box;
   height: 80%;
-  text-align:center;
-  padding-bottom:19px ;
+  text-align: center;
+  padding-bottom: 19px;
   /*display: inline-block;*/
 }
 .menu_item:hover {
-  color:#52CC60 ;
-  border-bottom:2px solid #52cc60;
+  color: #52cc60;
+  border-bottom: 2px solid #52cc60;
 }
 .superactive {
-  color:#52CC60 !important;
-  border-bottom:2px solid #52cc60;
+  color: #52cc60 !important;
+  border-bottom: 2px solid #52cc60;
 }
-.menu_item+.menu_item {
+.menu_item + .menu_item {
   border-left: 1px solid #ffffff;
 }
-.logo-header{
+.logo-header {
   display: inline-block;
   float: left;
   margin-left: 8.3%;
 }
-.logoImg{
-  width:136px;
-  height:52px;
+.logoImg {
+  width: 136px;
+  height: 52px;
 }
-.sishuLogo{
-  margin-left:125px;
+.sishuLogo {
+  margin-left: 125px;
 }
-.userstyle{
-  width:50px;
-  height:50px;
+.userstyle {
+  width: 50px;
+  height: 50px;
   border-radius: 25px;
 }
-  .lineStyle{
-    color: #999999;
-    font-size: 18px;
-    text-align: center;
-  }
-.login{
+.lineStyle {
+  color: #999999;
+  font-size: 18px;
+  text-align: center;
+}
+.login {
   color: #333333;
   font-size: 14px;
   display: inline-block;
 }
-.out{
+.out {
   margin-left: 2%;
   font-size: 14px;
   color: #666666;
   display: inline-block;
   cursor: pointer;
 }
-.out-img{
+.out-img {
   width: 16px;
   height: 18px;
 }
-  .aside-right{
-    float: right;
-    margin-right: 0%;
-  }
-  .box-items{
-    position: relative;
-  }
-  .box-text{
-    color: #FFFFFF;
-    font-size: 14px;
-    position: absolute;
-    top:-37px;
-    left: 0;
-    height:34px;
-    min-width: 75px;
-    display: inline-block;
-  }
-.box{
-    position: relative;
-    top:0px;
-    left:0px;
-    min-width:75px;
-    height:34px;
-    background: #FF6767;
-   -moz-border-radius: 12px;
-   -webkit-border-radius: 12px;
-   border-radius: 17px;
-   display: inline-block;
+.aside-right {
+  float: right;
+  margin-right: 0%;
+}
+.box-items {
+  position: relative;
+}
+.box-text {
+  color: #ffffff;
+  font-size: 14px;
+  position: absolute;
+  top: -37px;
+  left: 0;
+  height: 34px;
+  min-width: 75px;
+  display: inline-block;
+}
+.box {
+  position: relative;
+  top: 0px;
+  left: 0px;
+  min-width: 75px;
+  height: 34px;
+  background: #ff6767;
+  -moz-border-radius: 12px;
+  -webkit-border-radius: 12px;
+  border-radius: 17px;
+  display: inline-block;
+}
+.box:before {
+  position: absolute;
+  content: "";
+  width: 0;
+  height: 0;
+  right: 100%;
+  top: 25px;
+  left: -5px;
+  border-top: 5px solid transparent;
+  border-right: 18px solid #ff6767;
+  border-bottom: 5px solid transparent;
+  transform: rotate(-45deg);
+}
+.showModel {
+  width: 100%;
+  height: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background: #000000;
+  opacity: 0.2;
+  overflow: hidden;
+  z-index: 1000;
+  color: #fff;
+}
+.model {
+  z-index: 1001;
+  width: 40%;
+  height: auto;
+  position: fixed;
+  top: 30%;
+  left: 30%;
+  margin: auto;
+  background: #fff;
+  border-radius: 10px;
+  text-align: center;
 }
-.box:before{
-             position: absolute;
-             content: "";
-             width: 0;
-             height: 0;
-             right: 100%;
-             top: 25px;
-             left: -5px;
-             border-top: 5px solid transparent;
-             border-right: 18px solid #FF6767;
-             border-bottom: 5px solid transparent;
-             transform: rotate(-45deg);
-            }
-            .showModel{
-    width: 100%;
-    height: 100%;
-    position: fixed;
-    top: 0;
-    left: 0;
-    background: #000000;
-    opacity: 0.2;
-    overflow: hidden;
-    z-index: 1000;
-    color: #fff;
-
-  }
-  .model{
-    z-index: 1001;
-    width:40%;
-    height:auto;
-    position: fixed;
-    top: 30%;
-    left: 30%;
-    margin:auto;
-    background: #fff;
-    border-radius:10px;
-    text-align: center;
-  }
 
-  .model-text{
-    background:rgba(255,255,255,1);
-    border-radius:10px;
-  }
+.model-text {
+  background: rgba(255, 255, 255, 1);
+  border-radius: 10px;
+}
 
-  .model-btn{
-    display: flex;
-    justify-content: space-around;
-    margin-bottom: 44px;
-    cursor: pointer;
-  }
-  .model-btn-items{
-    width:154px;
-    height:50px;
-    line-height: 50px;
-    text-align: center;
-    font-size: 18px;
-    border-radius:4px;
-  }
-  .main-gay{
-    background:rgba(246,247,251,1);
-    color: #7E7E7E;
-  }
-  .model-grdeen{
-    background-color: #52CC60;
-    color: #fff;
-  }
-  .model-text-items-close{
-    position: absolute;
-    top: 10px;
-    right: -5px;
-  }
-  .model-text-items{
-    position: relative;
-    color: #000000;
-    font-size: 24px;
-    text-align: center;
-    padding: 40px 0 50px 0;
-    margin: 0 33px;
-  }
+.model-btn {
+  display: flex;
+  justify-content: space-around;
+  margin-bottom: 44px;
+  cursor: pointer;
+}
+.model-btn-items {
+  width: 154px;
+  height: 50px;
+  line-height: 50px;
+  text-align: center;
+  font-size: 18px;
+  border-radius: 4px;
+}
+.main-gay {
+  background: rgba(246, 247, 251, 1);
+  color: #7e7e7e;
+}
+.model-grdeen {
+  background-color: #52cc60;
+  color: #fff;
+}
+.model-text-items-close {
+  position: absolute;
+  top: 10px;
+  right: -5px;
+}
+.model-text-items {
+  position: relative;
+  color: #000000;
+  font-size: 24px;
+  text-align: center;
+  padding: 40px 0 50px 0;
+  margin: 0 33px;
+}
 </style>

+ 3 - 0
src/main.js

@@ -16,6 +16,7 @@ import store from './store'
 import jQuery from "jquery";
 import postcss from "postcss-pxtorem";
 import "./assets/js/jquery-ui.min.js";
+import echarts from 'echarts'
 import * as filters from "./filters";
 // import 'element-ui/lib/theme-chalk/index.css'
 import "./assets/css/element-#00C1DE/index.css";
@@ -30,6 +31,8 @@ import '@/permission' // permission control
 Vue.config.productionTip = false;
 // axios.defaults.withCredentials = true
 Vue.prototype.$zrender = zrender;
+Vue.prototype.$echarts = echarts 
+
 Vue.use(Viewer);
 Viewer.setDefaults({
   Options: { "inline": true, "button": true, "navbar": true, "title": true, "toolbar": true, "tooltip": true, "movable": true, "zoomable": true, "rotatable": true, "scalable": true, "transition": true, "fullscreen": false, "keyboard": true, "url": "data-source" }

File diff suppressed because it is too large
+ 449 - 385
src/pages/home/SchoolManager.vue


+ 207 - 0
src/pages/super/HomeworkTotally.vue

@@ -0,0 +1,207 @@
+<!-- 活动解析 -->
+<template>
+  <div>
+    <!-- table 表格 -->
+    <el-row :gutter="20" class="main-items">
+      <el-col :span="20" class="main" :offset="2">
+        <el-row>
+          <el-col :span="20" class :offset="2">
+            <h5 class="tiplog">作业统计表</h5>
+          </el-col>
+          <el-col :span="16" class :offset="4">
+            <div class="block">
+              <span class="demonstration">选择时间</span>
+              <el-date-picker
+                @change="FindSubjectChartsInfo"
+                v-model="Timevalue"
+                type="daterange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+                value-format="yyyy-MM-dd"
+                align="right"
+              ></el-date-picker>
+            </div>
+          </el-col>
+        </el-row>
+        <el-row>
+          <!-- {{FindSubjectCharts}} -->
+          <el-col class="chartdiv">
+            <HomeworkTotalList :chartData="chartData1"></HomeworkTotalList>
+          </el-col>
+          <el-col class="chartdiv">
+            <HomeworkTotalList :chartData="chartData2"></HomeworkTotalList>
+          </el-col>
+          <el-col class="chartdiv">
+            <HomeworkTotalList :chartData="chartData3"></HomeworkTotalList>
+          </el-col>
+        </el-row>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+<script>
+import { mapGetters, mapActions } from "vuex";
+import HomeworkTotalList from "@/components/HomeworkTotalList";
+import { IMG_BASE_URL } from "@/ImgConfig";
+export default {
+  components: {
+    HomeworkTotalList
+  },
+  name: "actvResolveLabel",
+  props: {},
+  data() {
+    return {
+      chartData1: {},
+      chartData2: {},
+      chartData3: {},
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: "最近一周",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", [start, end]);
+            }
+          },
+          {
+            text: "最近一个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit("pick", [start, end]);
+            }
+          },
+          {
+            text: "最近三个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit("pick", [start, end]);
+            }
+          }
+        ]
+      },
+      Timevalue: "",
+      startTime: "",
+      endTime: ""
+
+      //   Timevalue: ""
+    };
+  },
+   created() {
+    this.getNowFormatDate(); //获取随机id
+  },
+  methods: {
+    // 数据列表
+    async FindSubjectChartsInfo() {
+      let arr = this.Timevalue;
+      if (this.Timevalue.length > 0) {
+        for (let i = 0; i < arr.length; i++) {
+          this.startTime = arr[0];
+          this.endTime = arr[1];
+        }
+      }
+      this.$store.dispatch("FindSubjectChartsLists", {
+        startTime: this.startTime,
+        endTime: this.endTime
+      });
+      console.log(this.startTime);
+      console.log(this.endTime);
+    },
+   //获取当前时间,格式YYYY-MM-DD
+   getNowFormatDate() {
+    var date = new Date();
+    var seperator1 = "-";
+    var year = date.getFullYear();
+    var month = date.getMonth() + 1;
+    var strDate = date.getDate();
+    if (month >= 1 && month <= 9) {
+        month = "0" + month;
+    }
+    if (strDate >= 0 && strDate <= 9) {
+        strDate = "0" + strDate;
+    }
+    var currentdate = year + seperator1 + month + seperator1 + strDate;
+    this.startTime = currentdate
+    this.endTime = currentdate
+    console.log(this.startTime)
+     console.log(this.endTime)
+      console.log(currentdate)
+}
+
+  },
+  watch: {
+    FindSubjectCharts: {
+      handler: function(val, oldVal) {
+        this.chartData1 = val;
+      },
+      deep: true
+    },
+    FindSubjectmathCharts: {
+      handler: function(val, oldVal) {
+        this.chartData2 = val;
+      },
+      deep: true
+    },
+    FindSubjectEngCharts: {
+      handler: function(val, oldVal) {
+        this.chartData3 = val;
+      },
+      deep: true
+    }
+  },
+  mounted() {
+    this.FindSubjectChartsInfo();
+  },
+  computed: {
+    ...mapGetters([
+      "FindSubjectCharts",
+      "FindSubjectmathCharts",
+      "FindSubjectEngCharts"
+    ])
+  }
+};
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped>
+.main {
+  background-color: #fff;
+  margin-top: 16px;
+  padding: 0 !important;
+  border: 1px solid #e1e1e1;
+  min-height: 980px;
+}
+
+el-table {
+  color: #999999;
+  font-size: 18px;
+}
+.tiplog {
+  font-size: 30px;
+  text-align: center;
+  margin-top: 100px;
+  font-weight: 700;
+}
+.el-date-editor--daterange.el-input,
+.el-date-editor--daterange.el-input__inner,
+.el-date-editor--timerange.el-input,
+.el-date-editor--timerange.el-input__inner {
+  width: 35%;
+  height: 30%;
+  font-size: 12px;
+  border-radius: 15px;
+  text-align: center;
+}
+.chartdiv {
+  margin: 100px 0;
+}
+.block {
+  margin-top: 40px;
+}
+</style>

+ 19 - 13
src/pages/super/SchoolManager.vue

@@ -15,18 +15,17 @@
       <!--数据监控-->
       <el-col :span="17" class="main" v-if="modelindex == 0">
         <el-row :gutter="20" class="main-header">
-          <el-col :span="3" :offset="1">
-            <div class="main-header-item">在线:{{monitorTeacherList.onlineCount}}人</div>
-          </el-col>
-          <el-col :span="3">
-            <div class="main-header-item">离线:{{monitorTeacherList.offlineCount}}人</div>
-          </el-col>
-          <el-col :span="7">
-            <div class="main-header-item">
-              <span>分配未批改作业:{{monitorTeacherList.unCorrectCount}}份</span>
-              <span @click="allocation()" class="main-header-link">去分配</span>
-            </div>
-          </el-col>
+           <el-col :span="14" :offset="0">
+              <div class="main-header-item displayBox">在线:{{monitorTeacherList.onlineCount}}人</div>
+              <div class="main-header-item displayBox">离线:{{monitorTeacherList.offlineCount}}人</div>
+              <div class="main-header-item displayBox">
+                <span>平均响应时间:{{monitorTeacherList.unCorrectCount}}/份</span>
+              </div>
+              <div class="main-header-item displayBox">
+                <span>分配未批改作业:{{monitorTeacherList.unCorrectCount}}份</span>
+                <span @click="allocation()" class="main-header-link">去分配</span>
+              </div>
+            </el-col>
           <el-col :span="10">
                <div class="selectBox">
               <div class="Ageclass" @click="choiceclass()" @mouseover="selectStyle()" @mouseout="outStyle()">
@@ -685,7 +684,8 @@
           <div class="model-items-other model-active">上次登录时间 : {{GetTeacherDetail.lastOnlineTime}}</div>
           <div class="model-items-other">批改正确率 : {{GetTeacherDetail.accuracyRate}}</div>
           <div class="model-items-other model-active">被报错总次数 : {{GetTeacherDetail.wrongCount}}</div>
-          <div class="model-items-other">满意度 : {{GetTeacherDetail.satisfactionDegree}}</div>
+           <div class="model-items-other">纠正次数 : {{GetTeacherDetail.satisfactionDegree}}</div>
+          <div class="model-items-other model-active">家长满意度 : {{GetTeacherDetail.satisfactionDegree}}</div>
           <div style="display:inline-block">
              <div class="UpTeacherID" style="width:80px"   @click="isShow(GetTeacherDetail,8)">
                   <span class="el-icon-user-solid">重新分配组</span>
@@ -2445,6 +2445,12 @@ position: relative;
 height: 40px;
 top:15px;
 }
+.displayBox{
+  display:inline-block;
+  float:left;
+  text-align:left!important;
+  margin-left:40px;
+}
 .miinorSeachIcon{
   position:absolute;
   font-size: 20px;

+ 7 - 0
src/router/index.js

@@ -18,6 +18,7 @@ import SuperSchoolManager from "@/pages/Super/SchoolManager";
 import CheckTeacherPay from "@/pages/Super/CheckTeacherPay";
 import SuperAdmin from "@/pages/Super/SuperAdmin";
 import HomeworkRecycle from "@/pages/Super/HomeworkRecycle";
+import HomeworkTotally from "@/pages/Super/HomeworkTotally";
 // 在线批改老师
 import Onlineteacher from "@/pages/OnlineTeacher/onlineteacher";
 import Redirect_uri from "@/pages/aikmt/Redirect_uri"; //微信登陆路由重定向页面
@@ -87,6 +88,12 @@ export const constantRouterMap =
            component: HomeworkRecycle,
            meta: { title: '作业回收站', roles: ['3'] }
          },
+         {
+          path: "HomeworkTotally",
+          name: "HomeworkTotally",
+          component: HomeworkTotally,
+          meta: { title: '作业统计', roles: ['3'] }
+        },
        ]
      },
     //  校区管理员角色路由

+ 3 - 0
src/store/getters.js

@@ -34,5 +34,8 @@ const getters = {
   GetTeacherstatues :state => state.user.GetTeacherstatues,
   ApporingTeacherstatues :state => state.user.ApporingTeacherstatues,
   currtHomeworkStatus :state => state.user.currtHomeworkStatus,
+  FindSubjectCharts :state => state.user.FindSubjectCharts,
+  FindSubjectmathCharts :state => state.user.FindSubjectmathCharts,
+  FindSubjectEngCharts :state => state.user.FindSubjectEngCharts,
 }
 export default getters

+ 33 - 5
src/store/modules/user.js

@@ -4,7 +4,7 @@ import { GET_UUIONID_TOKEN,GET_TOKEN,GetInfo,InfoWatch,InfoWatchDay,
   GetStudentDetail,GetManagerDetail,Downgrade,SuperManagerList,
   SuperApplyTeacherList,ApplyOperate,GetTeacherSalaryList,DealCorrectTeacher,
   GetAllotManagerList,AllotTeacherToManager,HomeworkRecoveryList,errorWarning,errorDetail,logout,
-  CheckHomeworkStatus
+  CheckHomeworkStatus,FindSubjectCharts
   } from '@/api'
   import { APPOR_BASE_URL } from '@/ImgConfig'
 import { getToken, setToken, removeToken } from '@/utils/auth'
@@ -41,7 +41,10 @@ const user = {
     InfoTeacherstatues:"",
     GetTeacherstatues:"",
     ApporingTeacherstatues:"",
-    currtHomeworkStatus:""
+    currtHomeworkStatus:"",
+    FindSubjectCharts:[],
+    FindSubjectmathCharts:[],
+    FindSubjectEngCharts:[]
   },
 
   mutations: {
@@ -140,6 +143,15 @@ const user = {
     SET_CURRT_HOMEWORK_STATUS:(state,currtHomeworkStatus) => {
       state.currtHomeworkStatus = currtHomeworkStatus
     },
+    FIND_SUBJECT_CHARTS:(state,FindSubjectCharts) => {
+      state.FindSubjectCharts = FindSubjectCharts
+    },
+    FIND_SUBJECTMATH_CHARTS:(state,FindSubjectmathCharts) => {
+      state.FindSubjectmathCharts = FindSubjectmathCharts
+    },
+    FIND_SUBJECTENG_CHARTS:(state,FindSubjectEngCharts) => {
+      state.FindSubjectEngCharts = FindSubjectEngCharts
+    },
   },
 
   actions: {
@@ -155,7 +167,6 @@ const user = {
             commit('SET_TOKEN', data);
             localStorage.setItem("accessToken",data.accessToken)
                    dispatch('GetInfo').then(res => { // 拉取用户信息
-                    // debugger
                         const roles = res.data.role
                         const isBanned = res.data.isBanned
                         const userId = res.data.userId
@@ -163,7 +174,8 @@ const user = {
                         if (isBanned == 0) {
                           if (roles == 0) {
                             localStorage.removeItem("accessToken");
-                            Message.error('无用户角色')
+                            window.open(APPOR_BASE_URL + '?unionid=' + unionid);
+                            Message.error('无用户角色,请先注册')
                           }
                           if (roles == 1) {
                             Message.success('在线批改老师角色登录成功')
@@ -217,8 +229,9 @@ const user = {
                         localStorage.setItem("userId",userId)
                         if (isBanned == 0) {
                           if (roles == 0) {
-                            Message.error('无用户角色')
+                            Message.error('无用户角色,请先注册')
                             localStorage.removeItem("accessToken");
+                            window.open(APPOR_BASE_URL + '?unionid=' + unionid);
                           }
                           if (roles == 1) {
                             Message.success('在线批改老师角色登录成功')
@@ -393,6 +406,21 @@ const user = {
               })
             })
           },
+            // 管理员查看科目报表数据
+      FindSubjectChartsLists({ commit, state }, data) {
+      return new Promise((resolve, reject) => {
+        axios.post(FindSubjectCharts, data).then((response = {}) => {
+          const data = response.data.chartList || {}
+          if (response.code === "999"){
+            commit('FIND_SUBJECT_CHARTS', data[0]);
+            commit('FIND_SUBJECTMATH_CHARTS', data[1]);
+            commit('FIND_SUBJECTENG_CHARTS', data[2]);
+          }
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
         // 未批改作业列表
         UnallotHomeworkList({ commit, state }, data) {
           return new Promise((resolve, reject) => {