name 6 rokov pred
rodič
commit
1b42ffd6a3

+ 4 - 1
src/api/index.js

@@ -2,8 +2,10 @@ import { BASE_URL } from '@/config'
 
 const urlFn = v => BASE_URL + v
 
-// 登录
+// 微信登录
 const GET_TOKEN = urlFn('/api/kmt/login/wxlogin/scanlogin')
+// Uniconid登录
+const GET_UUIONID_TOKEN = urlFn('/api/kmt/login/unionidlogin')
 // 获取用户信息
 const GetInfo = urlFn('/api/kmt/correctSys/getMyInfo')
 // 校区群管理员数据监控
@@ -38,6 +40,7 @@ const ApplyOperate = urlFn('/api/kmt/correctSys/applyOperate')
 const GetTeacherSalaryList = urlFn('/api/kmt/correctSys/getTeacherSalaryList')
 export {
     GET_TOKEN,
+    GET_UUIONID_TOKEN,
     GetInfo,
     InfoWatch,
     InfoWatchDay,

+ 19 - 5
src/axios/index.js

@@ -41,8 +41,8 @@ function checkCode (response) {
     }
     return response
 }
-// let accessToken = sessionStorage.getItem("accessToken")
-let accessToken = "jAf6LV0HJJiIvhgvIHCM2t10GW7lHt5VAUE13pmj2lLEWlzQyNqx9dbVG0aXpTvn"
+let accessToken = sessionStorage.getItem("accessToken")
+// let accessToken = "jAf6LV0HJJiIvhgvIHCM2t10GW7lHt5VAUE13pmj2lLEWlzQyNqx9dbVG0aXpTvn"
 
 // export default ({method = 'post', url = '', params = {}}) => {
 // 	return new Promise((resolve, reject) => {
@@ -56,6 +56,21 @@ let accessToken = "jAf6LV0HJJiIvhgvIHCM2t10GW7lHt5VAUE13pmj2lLEWlzQyNqx9dbVG0aXp
 // 	})
 // }
 export default {
+    Tokenpost (url, data) {
+        const params = data;
+        return axios({
+            method:'post',
+            // url,
+            url: `${url}?${qs.stringify(params)}`,
+            // timeout: TIME_OUT,
+            data,
+            // data: qs.stringify(data),
+            headers:{
+                'Content-Type': 'application/json',
+                // 'Content-Type':'application/x-www-form-urlencoded'
+            }
+        }).then(checkStatus).then(checkCode)
+    },
     post (url, data) {
         if (!accessToken){
             accessToken = sessionStorage.getItem("accessToken");
@@ -79,10 +94,9 @@ export default {
             method: 'get',
             url: `${url}?${qs.stringify(params)}`,
             timeout: TIME_OUT,
-            data: params,
             headers:{
-                'Content-Type':'text/plain'
-            }
+                'Content-Type':'text/plain',
+            },
         }).then(checkStatus).then(checkCode)
     },
 }

+ 107 - 79
src/components/MenuComponent.vue

@@ -1,33 +1,39 @@
 <template>
-  <el-col :span="24" class="">
-      <el-col :span="2" :offset="2">
-       <img class="logoImg" src="../assets/img/log.png"/>
-      </el-col>
+  <el-col :span="24" class>
+    <el-col :span="2" :offset="2">
+      <img class="logoImg" src="../assets/img/log.png">
+    </el-col>
 
-      <!-- v-show="roles.indexOf(item.id) >= 0" -->
-      <el-col :span="2"  v-for="(item, index) of menuData" :key="item.id"
-      @click.native="secondNavClick(item,index)" style="text-align: center">
-        <span class="lineStyle" :class="{active:index == checkindex,menu_item:true}">{{item.name}}</span>
+    <!-- v-show="roles.indexOf(item.id) >= 0" -->
+    <el-col
+      :span="2"
+      v-show="roles.indexOf(item.id) >= 0"
+      v-for="(item, index) of menuData"
+      :key="item.index"
+      @click.native="secondNavClick(item,index)"
+      style="text-align: center"
+    >
+      <span class="lineStyle" :class="{active:index == checkindex,menu_item:true}">{{item.name}}</span>
+    </el-col>
 
-      </el-col>
-
-      <el-col :span="3"  :offset="12">
-        <div class="login">
-          <img class="userstyle" src="../assets/img/user.jpg"/>
-          <span>李老师</span>
-          <i class="el-icon-caret-bottom"></i>
-        </div>
-        <div class="out">
-          <img src="../assets/img/out.png" alt="" class="out-img">
-          <span>退出</span>
-        </div>
-      </el-col>
-      <el-col :span="1"></el-col>
+    <el-col :span="4" :offset="2">
+      <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">
+        <span @click="Loginout">退出</span>
+      </div>
+    </el-col>
+    <el-col :span="1"></el-col>
   </el-col>
 </template>
 
 <script>
-import {mapGetters} from 'vuex'
+import { mapGetters } from "vuex";
 export default {
   name: "navMenu",
   // props: {
@@ -35,22 +41,25 @@ export default {
   // },
   data() {
     return {
-      menuData: [ {
-    id: "1",
-    name: "校区群管理员",
-    href: "SchoolManager",
-  },
-  {
-    id: "2",
-    name: " 在线批改老师",
-    href: "TeacherApporval",
-  },
-  {
-    id: "3",
-    name: "",
-    href: "TeacherPay",
-  },
- ],
+       BASE_URL: "https://xt.sharingschool.com/upload/",
+      menuData: [
+        {
+          id: "1",
+          name: "校区群管理员",
+          href: "SchoolManager"
+        },
+        {
+          id: "1",
+          name: " 在线批改老师",
+          href: "TeacherApporval"
+        },
+        {
+          id: "2",
+          name: "",
+          href: "TeacherPay"
+        }
+
+      ],
       checkindex: 0
     };
   },
@@ -68,11 +77,29 @@ export default {
     secondNavClick(val, index) {
       this.$router.push("/home/" + val.href);
       this.checkindex = index;
+    },
+    //  账号管理、退出登录
+    Loginout() {
+      this.$confirm("您确定退出吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          localStorage.removeItem("accessToken");
+          this.$store.dispatch("LogOut").then(() => {
+            location.reload(); // 为了重新实例化vue-router对象 避免bug
+          });
+        })
+        .catch(() => {
+          // console.log(err)
+          this.$message("已取消操作!");
+        });
     }
   },
   computed: {
-      ...mapGetters(['name', 'avatar','roles'])
-    },
+    ...mapGetters(["name", "avatar", "roles"])
+  },
   mounted() {
     // this.initNav();
   }
@@ -80,60 +107,61 @@ export default {
 </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;
 }
 .active {
-  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;
 }
-.logoImg{
-  width:136px;
-  height:52px;
+.logoImg {
+  width: 136px;
+  height: 52px;
 }
-.sishuLogo{
-  margin-left:125px;
+.sishuLogo {
+  margin-left: 125px;
 }
-.userstyle{
-  width:26px;
-  height:26px;
+.userstyle {
+  width: 26px;
+  height: 26px;
   border-radius: 15px;
 }
-  .lineStyle{
-    color: #999999;
-    font-size: 18px;
-  }
-  .login{
-    color: #333333;
-    font-size: 14px;
-    display: inline-block;
-  }
-  .out{
-    margin-left: 20px;
-    font-size: 14px;
-    color: #666666;
-  }
-  .out-img{
-    width: 16px;
-    height: 18px;
-    display: inline-block;
-  }
+.lineStyle {
+  color: #999999;
+  font-size: 18px;
+}
+.login {
+  color: #333333;
+  font-size: 14px;
+  display: inline-block;
+}
+.out {
+  margin-left: 20px;
+  font-size: 14px;
+  color: #666666;
+  display: inline-block;
+}
+.out-img {
+  width: 16px;
+  height: 18px;
+  display: inline-block;
+}
 </style>

+ 24 - 6
src/pages/Login.vue

@@ -6,7 +6,7 @@
     <div class="log-container">
       <img class="log-icon" src="../assets/img/log.png">
       <div class="log-text">欢迎登陆私塾家在线人员管理后台</div>
-      <div @click="WxLogin" class="log-qrcode">
+      <div @click="WxLoginCtl" class="log-qrcode">
         <div id="login_container"></div>
         <!-- <img class="log-qrcode-image" src="../assets/img/ssj_qrcode.png"> -->
         <div class="log-qrcode-text">请使用微信扫码登陆</div>
@@ -28,19 +28,37 @@ export default {
    watch:{
   },
   created() {
-    // debugger
+    // this.getTKByUnionid()
   },
   methods: {
-    WxLogin() {
+    WxLoginCtl() {
+      // console.log(this.$router)
+      // this.$router.push({ path: '/aikmt/Redirect_uri' });
+      // console.log(123, this.$router.push)
+      // window.location.src = '/aikmt/Redirect_uri'
+      // this.$router.push('/aikmt/Redirect_uri')
+      // this.history.push('/aikmt/Redirect_uri')
       // this.$util.messageMethod("success", "前去微信登陆扫码授权");
-       this.$router.push({path: '/aikmt/Redirect_uri', query: {code: "081nx4K50HDkED1WgLI50InQJ50nx4Kb",prince: "6666666666666"}});
-    }
+       this.$router.push({path: '/aikmt/Redirect_uri', query: {unionid: "oPHg8wbCbIuZwq6NKEdEUPh6DQFM",prince: "6666666666666"}});
+    },
+      async getTKByUnionid(){
+    //  if (window.location.href.indexOf('unionid') >= 0) {
+    //     // 如果url中包含code,则保存到store中
+    //     let unionid = window.location.href.split("?")[1];
+    //     unionid = unionid.substring(8, code.indexOf('&'));
+    //     let WxCode = unionid
+    //     this.WxCode = WxCode
+    //   }
+           this.$store.dispatch('UnionidLogin', {
+             unionid: "oPHg8wbCbIuZwq6NKEdEUPh6DQFM"
+        });
+	}
   },
   mounted() {
     var obj = new WxLogin({
       self_redirect: false,
       id: "login_container",
-      appid: "wx90d07ffb3ef03fc3",
+      appid: "wxd18ca9555a939281",
       scope: "snsapi_login",
       redirect_uri: encodeURI(
         "https://kmt.sharingschool.com/aijia/index.html#/aikmt/Redirect_uri"

+ 34 - 11
src/pages/aikmt/Redirect_uri.vue

@@ -10,12 +10,13 @@
         <img class="log-qrcode-image" src="../../assets/img/ssj_qrcode.png">
         <div class="log-qrcode-text">请使用微信扫码登陆</div>
       </div>
+      {{accessToken}}
     </div>
   </div>
 </template>
 
 <script>
-// import { mapActions } from "vuex";
+import { mapGetters } from "vuex";
 // import wx from 'weixin-js-sdk'
 // import $ from 'jquery'
 
@@ -23,24 +24,46 @@ export default {
   name: "login",
   data() {
     return {
+      WxCode:"",
+      accessToken: sessionStorage.getItem("accessToken")
     };
   },
   created() {
-    this.getTKByCode()
+    this.getTKByUnionid()
     // debugger
   },
+   computed: {
+    ...mapGetters([
+      "token"
+    ])
+  },
   methods: {
-	async getTKByCode(){
-     if (window.location.href.indexOf('code') >= 0) {
-        // 如果url中包含code,则保存到store中
-        let code = window.location.href.split("?")[1];
-        code = code.substring(5, code.indexOf('&'));
-        let WxCode = {code: code}
-      }
-           this.$store.dispatch('GET_TOKEN', {
-             code: "081nx4K50HDkED1WgLI50InQJ50nx4Kb"
+       async getTKByUnionid(){
+          if (window.location.href.indexOf('unionid') >= 0) {
+            //  debugger
+              // 如果url中包含code,则保存到store中
+              let unionid = window.location.href.split("?")[1];
+              unionid = unionid.substring(8, unionid.indexOf('&'));
+              let WxCode = unionid
+              this.WxCode = WxCode
+            }
+           this.$store.dispatch('UnionidLogin', {
+             unionid: this.WxCode
         });
+        // debugger
 	}
+	// async getTKByCode(){
+  //    if (window.location.href.indexOf('code') >= 0) {
+  //       // 如果url中包含code,则保存到store中
+  //       let code = window.location.href.split("?")[1];
+  //       code = code.substring(5, code.indexOf('&'));
+  //       let WxCode = code
+  //       this.WxCode = WxCode
+  //     }
+  //          this.$store.dispatch('GET_TOKEN', {
+  //            code: this.WxCode
+  //       });
+	// }
   },
   mounted() {}
 };

+ 424 - 0
src/pages/home/CheckTeacherAudit.vue

@@ -0,0 +1,424 @@
+<!-- 活动解析 -->
+<template>
+  <div>
+    <!-- table 表格 -->
+    <el-row :gutter="20" class="main-items" >
+
+      <!--数据监控-->
+      <el-col :span="20" class="main" :offset="2">
+
+        <el-table
+          :data="applyTeacherList.list"
+          highlight-current-row
+          size="medium"
+          border
+          stripe
+        >
+          <el-table-column
+            label="注册老师"
+            header-align="center"
+          >
+            <template scope="scope">
+              <img :src='BASE_URL+scope.row.imgUrl' alt="" class="table-img" v-if="scope.row.imgUrl">
+              <img src="../../assets/img/user.jpg" alt="" v-if="!scope.row.imgUrl" class="table-img">
+              <span class="scope-name">{{scope.row.name}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="school"
+            label="学校"
+            header-align="center"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="subject"
+            label="批改科目"
+            header-align="center"
+          ></el-table-column>
+          <el-table-column
+            prop="grade"
+            label="批改年级"
+            header-align="center">
+          </el-table-column>
+          <el-table-column
+            prop=""
+            label="可批改时间"
+            header-align="center"
+          >
+            <template scope="scope">
+              <el-button type="info" round>{{scope.row.period}}</el-button>
+            </template>
+          </el-table-column>
+
+          <el-table-column prop="status" label="" header-align="center" width="250">
+            <template scope="scope">
+              <el-button type="danger" @click="isShow(2,scope.row.teacherId,scope.row.name)">不通过</el-button>
+              <el-button type="primary" @click="isShow(1,scope.row.teacherId,scope.row.name)">通过</el-button>
+            </template>
+          </el-table-column>
+
+        </el-table>
+        <!-- 分页显示 -->
+        <div class="page-block">
+          <el-pagination
+            background
+            class="all_pagination"
+            @size-change="handleSizeChange"
+            @current-change="pageChange"
+            :page-sizes="[10, 20, 30, 40]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+          >
+          </el-pagination>
+        </div>
+      </el-col>
+
+
+    </el-row>
+
+    <!--是否通过-->
+    <div class='showModel' @click="allShowModel(1)" 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(1)" class="model-text-items-close"></div>
+          <div>是否要通过{{userName}}老师的注册申请?</div>
+        </div>
+        <div class="model-btn">
+          <div class="model-btn-items main-gay" @click="ApplyOperate()">是</div>
+          <div class="model-btn-items model-grdeen" @click="allShowModel(1)">否</div>
+        </div>
+      </div>
+    </div>
+    <!--是否驳回-->
+    <div class='showModel' @click="allShowModel(2)" v-if="isPigai"></div>
+    <div class='model' v-if="isPigai">
+      <div class='model-text'>
+        <div class="model-text-items">
+          <div><img src="../../assets/img/del@2x.png" alt="" @click="allShowModel(2)" class="model-text-items-close"></div>
+          <div>是否要驳回{{userName}}老师的注册申请?</div>
+        </div>
+        <div class="model-btn">
+          <div class="model-btn-items main-gay" @click="ApplyOperate()">是</div>
+          <div class="model-btn-items model-grdeen" @click="allShowModel(2)">否</div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  import { mapGetters, mapActions } from "vuex";
+  export default {
+    components: { },
+    name: "actvResolveLabel",
+    props: {},
+    data() {
+      return {
+        BASE_URL:'https://xt.sharingschool.com/upload/',
+        hiddenModel:false,
+        applicantId:'',
+        operate:'',
+        isPigai:false,
+        options: [
+          {
+            value: "0",
+            label: "一年级"
+          },
+          {
+            value: "1",
+            label: "二年级"
+          },
+          {
+            value: "2",
+            label: "三年级"
+          },
+          {
+            value: "3",
+            label: "四年级"
+          },
+          {
+            value: "4",
+            label: "五年级"
+          },
+          {
+            value: "5",
+            label: "六年级"
+          }
+        ],
+        grades: [
+          {
+            value: "0",
+            label: "语文"
+          },
+          {
+            value: "1",
+            label: "数学"
+          },
+          {
+            value: "2",
+            label: "英语"
+          }
+        ],
+        ItemList: [
+          {
+            text:'数据监控'
+          },
+          {
+            text:'当天'
+          },
+          {
+            text:'当月'
+          },
+        ],
+        filters: {
+          actvNm: "",
+          actvCrtUserId: "",
+          actvType: "",
+          actvSmallType: "",
+          // 排序
+          MaxtimeValue:'',
+          pageNo: 1,
+          pageSize: 10,
+          count: 0,
+          orderField: "",
+          orderAD: ""
+        }
+      };
+    },
+    watch: {},
+    computed: {
+      ...mapGetters(["getUser","applyTeacherList"])
+    },
+    methods: {
+      ...mapActions(["setUser"]),
+
+      isShow(str,res,ts){
+        let _this = this;
+        console.log(str)
+        _this.operate = str;
+        _this.applicantId = res;
+        _this.userName = ts
+        if (str == 1){
+          _this.hiddenModel = true;
+          _this.isPigai = false;
+        } else if (str == 2){
+          _this.isPigai = true;
+          _this.hiddenModel = false;
+        }
+
+      },
+      //关闭弹框
+      allShowModel(str) {
+        let _this = this;
+
+        if (str == 1){
+          _this.hiddenModel = false;
+        } else if (str == 2){
+          _this.isPigai = false;
+        }
+      },
+      //查看申请老师列表
+      async SuperApplyTeacherList() {
+        this.$store.dispatch("SuperApplyTeacherList", {
+          maxCreateTime: this.formatDate(),
+          pageNo: this.filters.pageNo,
+          pageSize: this.filters.pageSize
+        });
+        console.log(applyTeacherList)
+      },
+      //申请审批操作
+      async ApplyOperate() {
+        this.$store.dispatch("ApplyOperate", {
+          applicantId: this.applicantId,
+          operate: this.operate,
+        });
+        this.allShowModel(this.operate)
+      },
+      //时间封装
+      formatDate: function () {
+        let date = new Date();
+        let y = date.getFullYear();
+        let MM = date.getMonth() + 1;
+        MM = MM < 10 ? ('0' + MM) : MM;
+        let d = date.getDate();
+        d = d < 10 ? ('0' + d) : d;
+        let h = date.getHours();
+        h = h < 10 ? ('0' + h) : h;
+        let m = date.getMinutes();
+        m = m < 10 ? ('0' + m) : m;
+        let s = date.getSeconds();
+        s = s < 10 ? ('0' + s) : s;
+        return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
+      },
+      // 分页
+      pageChange(val) {
+        this.filters.pageNo = val;
+        this.SuperApplyTeacherList();
+      },
+      changeDateSlot(dateSlot) {
+        if (dateSlot) {
+          this.filters.startDate = dateSlot[0];
+          this.filters.endDate = dateSlot[1];
+        } else {
+          this.filters.startDate = null;
+          this.filters.endDate = null;
+        }
+      },
+      actvTypeChange(typeList) {
+        switch (typeList.length) {
+          case 1:
+            this.filters.actvType = typeList[0];
+            this.filters.actvSmallType = null;
+            break;
+          case 2:
+            this.filters.actvType = null;
+            this.filters.actvSmallType = typeList[1];
+            break;
+          default:
+            this.filters.actvType = null;
+            this.filters.actvSmallType = null;
+            break;
+        }
+      },
+      handleSizeChange(val) {
+        console.log(val)
+        this.filters.pageSize = val;
+        this.SuperApplyTeacherList();
+      },
+      // 排序
+      sortChange(sort) {
+        this.filters.orderField = sort.prop;
+        this.filters.orderAD = sort.order != null ? sort.order : "";
+        this.itemListReshow();
+      },
+      clearSearch() {
+        this.filters.actvNm = null;
+        this.filters.actvCrtUserId = null;
+        this.filters.actvType = null;
+        this.filters.actvSmallType = null;
+        this.filtersActvType = [];
+        this.createDateSlot = null;
+      },
+
+    },
+    mounted() {
+      this.SuperApplyTeacherList();
+
+      // for (let j in applyTeacherList) {
+      //   applyTeacherList[j] = (res => {
+      //     const d = []
+      //     console.log(res)
+      //     // for (let i in res) {
+      //     //   d.push({ gradeList: res[i].homeworkPictureUrl, isVague: res[i].isVague})
+      //     // }
+      //     return d
+      //   })(applyTeacherList)
+      // }
+    }
+  };
+</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;
+  }
+  .scope-name{
+    margin-left: 13px;
+  }
+  .main-items{
+    color: #393939;
+    text-align: center;
+    line-height: 80px;
+  }
+
+  .input-with-select .el-input-group__prepend {
+    background-color: #fff;
+  }
+
+  .table-img{
+    width:36px;
+    height:36px;
+    border-radius:6px;
+  }
+  .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-btn{
+    display: flex;
+    justify-content: space-around;
+    margin-bottom: 44px;
+  }
+  .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: 15px;
+  }
+  .model-text-items{
+    position: relative;
+    color: #000000;
+    font-size: 24px;
+    text-align: center;
+    padding: 40px 0 50px 0;
+  }
+  .page-block{
+    text-align: center;
+  }
+  /*.all_pagination{*/
+  /*text-align: center !important;*/
+  /*}*/
+</style>

+ 405 - 0
src/pages/home/CheckTeacherPay.vue

@@ -0,0 +1,405 @@
+<!-- 活动解析 -->
+<template>
+  <div>
+    <!-- table 表格 -->
+    <el-row :gutter="20" class="main-items" >
+
+      <!--数据监控-->
+      <el-col :span="20" class="main" :offset="2">
+        <el-row :gutter="20" class="main-header">
+          <el-col :span="3" :offset="1"><div class="main-header-item" >
+            <div class="block" >
+              <el-date-picker
+                v-model="selMonth"
+                type="month"
+                placeholder="选择月" @change="allclick()">
+              </el-date-picker>
+            </div>
+          </div></el-col>
+          <el-col :span="4" :offset="16">
+            <div class="main-header-item">
+              <i class="el-icon-printer"></i>
+              <span @click="excel()">导出表格</span>
+            </div>
+          </el-col>
+        </el-row>
+        <el-table
+          :data="getTeacherSalaryList.list"
+          highlight-current-row
+          size="medium"
+          border
+          stripe
+        >
+          <el-table-column
+            label="注册老师"
+            header-align="center"
+          >
+            <template scope="scope">
+              <img :src="BASE_URL+scope.row.imgUrl" alt="" class="table-img">
+              <span class="scope-name">{{scope.row.name}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="lowGradeCount"
+            label="1~2年级0.6元/份"
+            header-align="center"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="middleGradeCount"
+            label="3~4年级0.8元/份"
+            header-align="center"
+          ></el-table-column>
+          <el-table-column
+            prop="highGradeCount"
+            label="5~6年级1.2元/份"
+            header-align="center">
+          </el-table-column>
+          <el-table-column
+            prop="total"
+            label="总计"
+            header-align="center"
+            width="450"
+          >
+          </el-table-column>
+        </el-table>
+        <!-- 分页显示 -->
+        <div class="page-block">
+          <el-pagination
+            background
+            class="all_pagination"
+            @size-change="handleSizeChange"
+            @current-change="pageChange"
+            :page-sizes="[10, 20, 30, 40]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+          >
+          </el-pagination>
+        </div>
+      </el-col>
+
+    </el-row>
+
+
+    <!--弹框-->
+    <div class='showModel' @click="allShowModel(2)" v-if="isPigai"></div>
+    <div class='model' v-if="isPigai">
+      <div class='model-text'>
+        <div class="model-text-items">
+          <div><img src="../../assets/img/del@2x.png" alt="" @click="allShowModel(2)" class="model-text-items-close"></div>
+          <div>是否导出表格?</div>
+        </div>
+        <div class="model-btn">
+          <div class="model-btn-items main-gay">是</div>
+          <div class="model-btn-items model-grdeen">否</div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  import { mapGetters, mapActions } from "vuex";
+  export default {
+    components: { },
+    name: "actvResolveLabel",
+    props: {},
+    data() {
+      return {
+        BASE_URL:'https://xt.sharingschool.com/upload/',
+        selMonth:'',
+        hiddenModel:false,
+        isPigai:false,
+        ItemList: [
+          {
+            text:'数据监控'
+          },
+          {
+            text:'当天'
+          },
+          {
+            text:'当月'
+          },
+        ],
+        filters: {
+          actvNm: "",
+          actvCrtUserId: "",
+          actvType: "",
+          actvSmallType: "",
+          // 排序
+          MaxtimeValue:'',
+          oneMonth:'',
+          pageNo: 1,
+          pageSize: 10,
+          count: 0,
+          orderField: "",
+          orderAD: ""
+        }
+      };
+    },
+    watch: {},
+    computed: {
+      ...mapGetters(["getUser","getTeacherSalaryList"])
+    },
+    methods: {
+      ...mapActions(["setUser"]),
+      //表格导出
+      excel(){
+        try {
+          //var curTbl = document.getElementById(tableId);
+          //var lenRow = curTbl.rows.length;
+          var curTbl = $('.el-table')[0];
+          var lenRow = curTbl.rows.length;
+          //创建AX对象excel
+          var oXL = new ActiveXObject("Excel.Application");
+          //获取workbook对象
+          var oWB = oXL.Workbooks.Add();
+          var oSheet = oWB.ActiveSheet;
+
+          //取得表格行数
+          for (var i = 0; i < lenRow; i++) {
+            var lenCol = curTbl.rows(i).cells.length;
+            //取得每行的列数
+            for (var j = 0; j < lenCol; j++)
+            {
+              oSheet.Cells(i + 1, j + 1).value = curTbl.rows(i).cells(j).innerText;
+
+            }
+          }
+          oXL.Visible = true; //设置excel可见属性
+          //oXL.UserControl = true;
+          //oXL=null
+        } catch (e) {
+          if ((!+'\v1')) { //ie浏览器
+            alert("无法启动Excel,请确保电脑中已经安装了Excel!")
+          } else {
+            let arr = this.getTeacherSalaryList.list;
+            let str = '注册老师,1~2年级0.6元/份,3~4年级0.8元/份,5~6年级1.2元/份,总计/元';
+            for (let i = 0; i < arr.length; i++) {
+              str += "\n" + arr[i].name + ',' + arr[i].lowGradeCount + ',' + arr[i].middleGradeCount + ',' + arr[i].highGradeCount
+            }
+            var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str);
+            var downloadLink = document.createElement("a");
+            downloadLink.href = uri;
+            downloadLink.download = "export.csv";
+
+            document.body.appendChild(downloadLink);
+            downloadLink.click();
+            document.body.removeChild(downloadLink);
+          }
+        }
+      },
+      //弹框
+      isShow(str){
+        let _this = this;
+        console.log(str)
+        if (str == 1){
+          _this.hiddenModel = true;
+          _this.isPigai = false;
+        } else if (str == 2){
+          _this.isPigai = true;
+          _this.hiddenModel = false;
+        }
+
+      },
+      //关闭弹框
+      allShowModel(str) {
+        let _this = this;
+        if (str == 1){
+          _this.hiddenModel = false;
+        } else if (str == 2){
+          _this.isPigai = false;
+        }
+      },
+      //时间封装
+      formatDate: function () {
+        let date = new Date();
+        let y = date.getFullYear();
+        let MM = date.getMonth() + 1;
+        MM = MM < 10 ? ('0' + MM) : MM;
+        let d = date.getDate();
+        d = d < 10 ? ('0' + d) : d;
+        let h = date.getHours();
+        h = h < 10 ? ('0' + h) : h;
+        let m = date.getMinutes();
+        m = m < 10 ? ('0' + m) : m;
+        let s = date.getSeconds();
+        s = s < 10 ? ('0' + s) : s;
+        return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
+      },
+      // 老师薪酬列表
+      async GetTeacherSalaryList() {
+        this.$store.dispatch("GetTeacherSalaryList", {
+          pageNo: this.filters.pageNo,
+          pageSize: this.filters.pageSize,
+          oneMonth:this.filters.oneMonth,
+          maxCreateTime: this.formatDate()
+        });
+      },
+      //选择月
+      allclick(){
+        var year = this.selMonth.getFullYear();
+        var month = this.selMonth.getMonth() + 1;
+        month = (month < 10 ? "0" + month : month);
+        var mydate = (year.toString() + '-' + month.toString());
+        this.filters.oneMonth = mydate;
+        this.GetTeacherSalaryList()
+      },
+
+      // 分页
+      pageChange(val) {
+        this.filters.pageNo = val;
+        this.GetTeacherSalaryList();
+      },
+      changeDateSlot(dateSlot) {
+        if (dateSlot) {
+          this.filters.startDate = dateSlot[0];
+          this.filters.endDate = dateSlot[1];
+        } else {
+          this.filters.startDate = null;
+          this.filters.endDate = null;
+        }
+      },
+      actvTypeChange(typeList) {
+        switch (typeList.length) {
+          case 1:
+            this.filters.actvType = typeList[0];
+            this.filters.actvSmallType = null;
+            break;
+          case 2:
+            this.filters.actvType = null;
+            this.filters.actvSmallType = typeList[1];
+            break;
+          default:
+            this.filters.actvType = null;
+            this.filters.actvSmallType = null;
+            break;
+        }
+      },
+      handleSizeChange(val) {
+        this.filters.pageSize = val;
+        this.GetTeacherSalaryList();
+      },
+      // 排序
+      sortChange(sort) {
+        this.filters.orderField = sort.prop;
+        this.filters.orderAD = sort.order != null ? sort.order : "";
+        this.itemListReshow();
+      },
+      clearSearch() {
+        this.filters.actvNm = null;
+        this.filters.actvCrtUserId = null;
+        this.filters.actvType = null;
+        this.filters.actvSmallType = null;
+        this.filtersActvType = [];
+        this.createDateSlot = null;
+      },
+
+    },
+    mounted() {
+      this.GetTeacherSalaryList()
+    }
+  };
+</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;
+  }
+  .main-items{
+    color: #393939;
+    text-align: center;
+    line-height: 80px;
+  }
+  .main-header-item{
+    font-size: 16px;
+    color: #7E7E7E;
+  }
+
+  .input-with-select .el-input-group__prepend {
+    background-color: #fff;
+  }
+
+  .table-img{
+    width:36px;
+    height:36px;
+    border-radius:6px;
+  }
+  .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;
+  }
+  .scope-name{
+    margin-left: 13px;
+  }
+
+  .model-text{
+    background:rgba(255,255,255,1);
+    border-radius:10px;
+  }
+
+  .model-btn{
+    display: flex;
+    justify-content: space-around;
+    margin-bottom: 44px;
+  }
+  .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: 15px;
+  }
+  .model-text-items{
+    position: relative;
+    color: #000000;
+    font-size: 24px;
+    text-align: center;
+    padding: 40px 0 50px 0;
+  }
+</style>

+ 474 - 0
src/pages/home/SuperAdmin.vue

@@ -0,0 +1,474 @@
+<!-- 活动解析 -->
+<template>
+  <div>
+    <!-- table 表格 -->
+    <el-row :gutter="20" class="main-items" >
+
+      <!--数据监控-->
+      <el-col :span="20" class="main" :offset="2">
+        <el-row :gutter="20" class="main-header">
+          <el-col :span="3"><div class="main-header-item" >注册老师数:{{getManagerList.registerTeacherCount}}人</div></el-col>
+          <el-col :span="3"><div class="main-header-item">活跃老师数:{{getManagerList.activeTeacherCount}}人</div></el-col>
+          <el-col :span="4"><div class="main-header-item">注册用户数:{{getManagerList.registerUserCount}}人</div></el-col>
+          <el-col :span="4"><div class="main-header-item">活跃用户数:{{getManagerList.activeUserCount}}人</div></el-col>
+        </el-row>
+        <el-table
+          :data="getManagerList.list"
+          highlight-current-row
+          size="medium"
+          border
+          stripe
+        >
+          <el-table-column
+            label="小组管理员"
+            header-align="center"
+          >
+            <template scope="scope">
+              <img :src="BASE_URL +scope.row.imgUrl" alt="" class="table-img">
+              <span class="scope-name">{{scope.row.name}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="groupCount"
+            label="小组人数"
+            header-align="center"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="attendanceRate"
+            label="老师出勤率"
+            header-align="center"
+          ></el-table-column>
+          <el-table-column
+            prop="homeworkCount"
+            label="作业批改总份数"
+            header-align="center">
+          </el-table-column>
+          <el-table-column
+            prop="homeworkPicCount"
+            label="作业批改总张数"
+            header-align="center"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="avgTime"
+            label="批改平均用时"
+            header-align="center"></el-table-column>
+          <el-table-column
+            prop="avgMark"
+            label="家长平均评分"
+            header-align="center"></el-table-column>
+          <el-table-column
+            prop="status"
+            label="是否在线"
+            header-align="center"></el-table-column>
+          <el-table-column prop="status" label="" header-align="center" width="250">
+            <template scope="scope">
+              <el-button type="success" plain >小组详情</el-button>
+              <el-button type="success" @click="isShow(1,scope.row.managerId)">管理员详情</el-button>
+            </template>
+          </el-table-column>
+
+        </el-table>
+        <!-- 分页显示 -->
+        <div class="page-block">
+          <el-pagination
+            background
+            class="all_pagination"
+            @size-change="handleSizeChange"
+            @current-change="pageChange"
+            :page-sizes="[10, 20, 30, 40]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+          >
+          </el-pagination>
+        </div>
+      </el-col>
+
+    </el-row>
+
+    <!--可分配老师-->
+    <div class='showModel' @click="allShowModel(1)" v-if="hiddenModel"></div>
+    <div class='model' v-if="hiddenModel">
+      <div class='model-text'>
+        <div class="model-manager">
+          <div>校区管理员</div>
+          <div><img src="../../assets/img/del@2x.png" alt="" @click="allShowModel(1)"></div>
+        </div>
+        <div class="model-items">
+          <div class="model-items-first">
+            <div>
+              <img :src="BASE_URL+getManagerDetail.imgUrl" alt="" class="model-items-first-img">
+              <div class="model-items-first-left">
+                <div>{{getManagerDetail.name}}({{getManagerDetail.status}})</div>
+                <div class="model-items-first-left-down">{{getManagerDetail.school}}</div>
+              </div>
+            </div>
+            <div>
+              <el-button type="danger" plain round @click="isShow(2,getManagerDetail.name)"><i class="el-icon-bottom"></i><span>降级</span></el-button>
+            </div>
+          </div>
+          <div class="model-items-other model-active">批改科目 : {{getManagerDetail.subject}}</div>
+          <div class="model-items-other">批改年级 : <span v-for="(v, k) of arrGrade" :key=k class="scope-name">{{v}}</span></div>
+          <div class="model-items-other model-active">可批改时间:<el-button type="info" round v-for="(v, k) of arrPeriod" :key=k>{{v}}</el-button></div>
+          <div class="model-items-other">手机号 : {{getManagerDetail.phone}}</div>
+          <div class="model-items-other model-active-last">上次登录时间 : {{getManagerDetail.lastOnlineTime}}</div>
+        </div>
+
+      </div>
+    </div>
+    <!--所有未批改作业-->
+    <div class='showModel' @click="allShowModel(2)" v-if="isPigai"></div>
+    <div class='model' v-if="isPigai">
+      <div class='model-text'>
+        <div class="model-text-items">
+          <div><img src="../../assets/img/del@2x.png" alt="" @click="allShowModel(2)" class="model-text-items-close"></div>
+          <div>是否要将{{superName}}老师降级为普通批改老师?</div>
+        </div>
+        <div class="model-btn">
+          <div class="model-btn-items main-gay" @click="Downgrade()">是</div>
+          <div class="model-btn-items model-grdeen" @click="allShowModel(2)">否</div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  import { mapGetters, mapActions } from "vuex";
+  export default {
+    components: { },
+    name: "actvResolveLabel",
+    props: {},
+    data() {
+      return {
+        BASE_URL:'https://xt.sharingschool.com/upload/',
+        hiddenModel:false,
+        isPigai:false,
+        managerId:'',
+        superName:'',
+        count:0,
+        arrPeriod:[],
+        arrGrade:[],
+        ItemList: [
+          {
+            text:'数据监控'
+          },
+          {
+            text:'当天'
+          },
+          {
+            text:'当月'
+          },
+        ],
+
+        filters: {
+          actvNm: "",
+          actvCrtUserId: "",
+          actvType: "",
+          actvSmallType: "",
+          // 排序
+          MaxtimeValue:"",
+          pageNo: 1,
+          pageSize: 10,
+          count: 0,
+          orderField: "",
+          orderAD: ""
+        }
+      };
+    },
+    watch: {},
+    computed: {
+      ...mapGetters(["getUser","getManagerList","getManagerDetail"])
+    },
+    methods: {
+      ...mapActions(["setUser"]),
+
+      isShow(str,res){
+        let _this = this;
+        console.log(str,res)
+        if (str == 1){
+          _this.hiddenModel = true;
+          _this.isPigai = false;
+          _this.managerId = res;
+          _this.GetManagerDetail(res)
+        } else if (str == 2){
+          _this.isPigai = true;
+          _this.hiddenModel = false;
+          _this.superName = res
+        }
+
+      },
+      //关闭弹框
+      allShowModel(str) {
+        let _this = this;
+        if (str == 1){
+          _this.hiddenModel = false;
+        } else if (str == 2){
+          _this.isPigai = false;
+        }
+      },
+      //时间封装
+      formatDate: function () {
+        let date = new Date();
+        let y = date.getFullYear();
+        let MM = date.getMonth() + 1;
+        MM = MM < 10 ? ('0' + MM) : MM;
+        let d = date.getDate();
+        d = d < 10 ? ('0' + d) : d;
+        let h = date.getHours();
+        h = h < 10 ? ('0' + h) : h;
+        let m = date.getMinutes();
+        m = m < 10 ? ('0' + m) : m;
+        let s = date.getSeconds();
+        s = s < 10 ? ('0' + s) : s;
+        return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
+      },
+      // 获取超级管理员数据
+      async SuperManagerList() {
+        this.$store.dispatch("SuperManagerList", {
+          maxCreateTime: this.formatDate(),
+          pageNo: this.filters.pageNo,
+          pageSize: this.filters.pageSize
+        });
+      },
+      // 查看校区管理员详情
+      async GetManagerDetail(str) {
+        this.$store.dispatch("GetManagerDetail", {
+          managerId: str
+        });
+        var arr = this.getManagerDetail.grade.split(',');
+        this.arrPeriod = this.getManagerDetail.period.split(';');
+        var arrList = [];
+        for (var i in arr) {
+          if (arr[i] == '一年级' || arr[i] == '二年级') {
+            arrList.push('1-2年级')
+          } else if (arr[i] == '三年级' || arr[i] == "四年级") {
+            arrList.push('3-4年级')
+          } else if (arr[i] == '五年级' || arr[i] == "六年级") {
+            arrList.push('5-6年级')
+          }
+        }
+        this.arrGrade = this.uniq(arrList);
+      },
+      //校区管理员降级
+      async Downgrade() {
+        this.$store.dispatch("Downgrade", {
+          managerId: this.managerId
+        });
+        this.allShowModel(2)
+      },
+      // 分页
+      pageChange(val) {
+        this.filters.pageNo = val;
+        this.SuperManagerList();
+      },
+      changeDateSlot(dateSlot) {
+        if (dateSlot) {
+          this.filters.startDate = dateSlot[0];
+          this.filters.endDate = dateSlot[1];
+        } else {
+          this.filters.startDate = null;
+          this.filters.endDate = null;
+        }
+      },
+      actvTypeChange(typeList) {
+        switch (typeList.length) {
+          case 1:
+            this.filters.actvType = typeList[0];
+            this.filters.actvSmallType = null;
+            break;
+          case 2:
+            this.filters.actvType = null;
+            this.filters.actvSmallType = typeList[1];
+            break;
+          default:
+            this.filters.actvType = null;
+            this.filters.actvSmallType = null;
+            break;
+        }
+      },
+      handleSizeChange(val) {
+        this.filters.pageSize = val;
+        this.SuperManagerList();
+      },
+      // 排序
+      sortChange(sort) {
+        this.filters.orderField = sort.prop;
+        this.filters.orderAD = sort.order != null ? sort.order : "";
+        this.itemListReshow();
+      },
+      clearSearch() {
+        this.filters.actvNm = null;
+        this.filters.actvCrtUserId = null;
+        this.filters.actvType = null;
+        this.filters.actvSmallType = null;
+        this.filtersActvType = [];
+        this.createDateSlot = null;
+      },
+      // 数组去重
+      uniq(array){
+        var temp = []; //一个新的临时数组
+        for (var i = 0; i < array.length; i++){
+          if (temp.indexOf(array[i]) == -1) {
+            temp.push(array[i]);
+          }
+        }
+        return temp;
+      }
+    },
+    mounted() {
+      this.SuperManagerList()
+      // this.count = this.getManagerList.pages;
+
+    }
+  };
+</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;
+  }
+  .main-items{
+    color: #393939;
+    text-align: center;
+    line-height: 80px;
+  }
+  .main-header-item{
+    font-size: 16px;
+    color: #7E7E7E;
+  }
+
+  .input-with-select .el-input-group__prepend {
+    background-color: #fff;
+  }
+
+  .table-img{
+    width:36px;
+    height:36px;
+    border-radius:6px;
+  }
+  .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-items-first{
+    padding: 0 34px;
+    display: flex;
+    justify-content: space-between;
+  }
+  .model-items-first-img{
+    width: 68px;
+    height: 68px;
+    border-radius: 8px;
+    position: relative;
+    bottom: 20px;
+  }
+  .model-items-first-left{
+    display: inline-block;
+    color: #393939;
+    font-size: 24px;
+    margin-left: 14px;
+    text-align: left;
+  }
+  .model-items-first-left-down{
+    color: #7E7E7E;
+    font-size: 18px;
+  }
+  .model-text{
+    background:rgba(255,255,255,1);
+    border-radius:10px;
+  }
+  .model-items-other{
+    height: 60px;
+    line-height: 60px;
+    color: #393939;
+    font-size: 20px;
+    text-align: left;
+    padding: 0 34px;
+
+  }
+  .model-active{
+    background-color: #F6F7FB;
+  }
+  .model-active-last{
+    border-radius:0 0 30px 30px;
+    background-color: #F6F7FB;
+  }
+
+  .model-manager{
+    display: flex;
+    justify-content: space-between;
+    margin: 30px;
+    color: #393939;
+    font-size: 24px;
+  }
+  .model-btn{
+    display: flex;
+    justify-content: space-around;
+    margin-bottom: 44px;
+  }
+  .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: 15px;
+  }
+  .model-text-items{
+    position: relative;
+    color: #000000;
+    font-size: 24px;
+    text-align: center;
+    padding: 40px 0 50px 0;
+  }
+  .scope-name{
+    margin-left: 13px;
+  }
+</style>

+ 2 - 2
src/pages/super/SuperAdmin.vue

@@ -109,8 +109,8 @@
             </div>
           </div>
           <div class="model-items-other model-active">批改科目 : {{getManagerDetail.subject}}</div>
-          <div class="model-items-other">批改年级 : <span v-for="(v, k) of arrGrade" class="scope-name">{{v}}</span></div>
-          <div class="model-items-other model-active">可批改时间:<el-button type="info" round v-for="(v, k) of arrPeriod">{{v}}</el-button></div>
+          <div class="model-items-other">批改年级 : <span v-for="(v, k) of arrGrade" :key=k class="scope-name">{{v}}</span></div>
+          <div class="model-items-other model-active">可批改时间:<el-button type="info" round v-for="(v, k) of arrPeriod" :key=k>{{v}}</el-button></div>
           <div class="model-items-other">手机号 : {{getManagerDetail.phone}}</div>
           <div class="model-items-other model-active-last">上次登录时间 : {{getManagerDetail.lastOnlineTime}}</div>
         </div>

+ 59 - 45
src/permission.js

@@ -1,45 +1,59 @@
-import router from './router'
-import store from './store'
-import { Message } from 'element-ui'
-import { getToken } from '@/utils/auth' // 验权
-
-const whiteList = ['/login', '/aikmt/redirect_uri'] // 不重定向白名单
-router.beforeEach((to, from, next) => {
-  if (getToken()) { // 判断是否有token
-    // debugger
-    if (to.path === '/login') {
-      next()
-    } else {
-      if (store.getters.roles.length === 0) {
-        console.log('roles====0')
-        store.dispatch('GetInfo').then(res => { // 拉取用户信息
-            console.log('roles====1')
-            console.log(res)
-          const roles = res.data.role // note: roles must be a array! such as: ['1']
-          console.log('roles?', roles)
-          store.dispatch('GenerateRoutes', { roles }).then(() => { // 根据roles权限生成可访问的路由表
-            console.log('addrouters', store.getters.addRouters)
-            console.log('roles====3')
-            router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
-            next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
-          })
-        }).catch(() => {
-          store.dispatch('FedLogOut').then(() => {
-            Message.error('验证失败,请重新登录')
-            next({ path: '/login' })
-            console.log('roles====5')
-          })
-        })
-      } else {
-        console.log('====6')
-        next() // 当有用户权限的时候,说明所有可访问路由已生成 如访问没权限的全面会自动进入404页面
-      }
-    }
-  } else {
-    if (whiteList.indexOf(to.path) !== -1) {
-      next()
-    } else {
-      next('/login')
-    }
-  }
-})
+// import router from './router'
+// import store from './store'
+// import { Message } from 'element-ui'
+// import { getToken } from '@/utils/auth' // 验权
+//
+// let accessToken = sessionStorage.getItem("accessToken")
+// const whiteList = ['/login','/aikmt/Redirect_uri'] // 不重定向白名单
+// router.beforeEach((to, from, next) => {
+//     console.log(1)
+//     // next({ path: '/super' })
+//   if (accessToken) { // 判断是否有token
+//     // debugger
+//     if (to.path === '/login') {
+//         console.log(123, to.path)
+//       next()
+//     } else  {
+//
+//         console.log(3,store.getters.roles)
+//       if (store.getters.roles.length === 0) {
+//         // next()
+//           console.log(123)
+//         //   next({ path: '/super' })
+//         store.dispatch('GetInfo').then(res => { // 拉取用户信息
+//             console.log(res)
+//             // debugger
+//           const roles = res.data.role // note: roles must be a array! such as: ['1']
+//         //   console.log('roles?', roles)
+//           store.dispatch('GenerateRoutes', { roles }).then(() => { // 根据roles权限生成可访问的路由表
+//             // debugger
+//             console.log('addrouters', store.getters.addRouters)
+//             // router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
+//             console.log(router)
+//             next()
+//             // next({ path: '/home' })
+//             // next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
+//           })
+//         }).catch(() => {
+//           store.dispatch('FedLogOut').then(() => {
+//             Message.error('验证失败,请重新登录')
+//             next({ path: '/login' })
+//             console.log('roles====5')
+//           })
+//         })
+//       } else {
+//         console.log('====6')
+//         // next() // 当有用户权限的时候,说明所有可访问路由已生成 如访问没权限的全面会自动进入404页面
+//       }
+//     }
+//   } else {
+//       console.log(to.path,whiteList.indexOf(to.path))
+//     if (whiteList.indexOf(to.path) !== -1) {
+//         console.log(1)
+//       next()
+//     } else {
+//     //     console.log(123)
+//     //   next('/login')
+//     }
+//   }
+// })

+ 56 - 43
src/router/index.js

@@ -9,9 +9,9 @@ import Error404 from "@/pages/Error404";
 import SchoolManager from "@/pages/home/SchoolManager";
 import TeacherApporval from "@/pages/home/TeacherApporval";
 import TeacherPay from "@/pages/home/TeacherPay";
-import CheckTeacherAudit from "@/pages/super/CheckTeacherAudit";
-import CheckTeacherPay from "@/pages/super/CheckTeacherPay";
-import SuperAdmin from "@/pages/super/SuperAdmin";
+import CheckTeacherAudit from "@/pages/home/CheckTeacherAudit";
+import CheckTeacherPay from "@/pages/home/CheckTeacherPay";
+import SuperAdmin from "@/pages/home/SuperAdmin";
 import Redirect_uri from "@/pages/aikmt/Redirect_uri"; //微信登陆路由重定向页面
 Vue.use(Router);
 
@@ -32,6 +32,10 @@ export const constantRouterMap =
       name: "微信认证重定向页",
       component: Redirect_uri
     },
+    {
+      path: "/super",
+      component: Super,
+    },
      {
        path: "/super",
        component: Super,
@@ -107,44 +111,53 @@ export default new Router({
 
 // 异步挂载的路由
 // 动态需要根据权限加载的路由表
-export const asyncRouterMap = [
-  // {
-  //   path: "/home",
-  //   component: Home,
-  //   children: [
-  //     {
-  //       path: "",
-  //       redirect: "SchoolManager"
-  //     },
-  //     {
-  //       path: "SchoolManager",
-  //       name: "SchoolManager",
-  //       component: SchoolManager,
-  //       meta: { title: '校区管理员', roles: ['2'] }
-  //     },
-  //     {
-  //       path: "TeacherApporval",
-  //       name: "TeacherApporval",
-  //       component: TeacherApporval,
-  //       meta: { title: '教师审核', roles: ['2'] }
-  //     },
-  //      {
-  //       path: "TeacherPay",
-  //       name: "TeacherPay",
-  //       component: TeacherPay,
-  //       meta: { title: '教师薪酬管理', roles: ['2'] }
-  //     },
-  //     {
-  //       path: "*",
-  //       name: "找不到页面",
-  //       component: Error404
-  //     }
-  //   ]
-  // },
-  // {
-  //   path: "*",
-  //   name: "错误页面",
-  //   component: Error
-  // }
-]
+// export const asyncRouterMap = [
+//       {
+//        path: "/home",
+//        component: Home,
+//        children: [
+//          {
+//            path: "",
+//            redirect: "SchoolManager"
+//          },
+//          {
+//            path: "SchoolManager",
+//            name: "SchoolManager",
+//            component: SchoolManager,
+//            meta: { title: '校区管理员', roles: ['1'] }
+//          },
+//          {
+//            path: "TeacherApporval",
+//            name: "TeacherApporval",
+//            component: TeacherApporval,
+//            meta: { title: '在线批改老师', roles: ['1'] }
+//
+//          },
+//          {
+//            path: "TeacherPay",
+//            name: "TeacherPay",
+//            component: TeacherPay,
+//            meta: { title: '教师薪酬管理', roles: ['1'] }
+//          },
+//         {
+//           path: "SuperAdmin",
+//           name: "SuperAdmin",
+//           component: SuperAdmin,
+//           meta: { title: '超级管理员', roles: ['1'] }
+//         },
+//         {
+//           path: "CheckTeacherAudit",
+//           name: "CheckTeacherAudit",
+//           component: CheckTeacherAudit,
+//           meta: { title: '批改老师注册审核', roles: ['1'] }
+//         },
+//         {
+//           path: "CheckTeacherPay",
+//           name: "CheckTeacherPay",
+//           component: CheckTeacherPay,
+//           meta: { title: '批改老师薪酬表', roles: ['1'] }
+//         },
+//        ]
+//      },
+// ]
 

+ 1 - 0
src/store/index.js

@@ -1,6 +1,7 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
 import axios from '@/axios'
+import router from "@/router"
 import app from './modules/app'
 import user from './modules/user'
 import getters from './getters'

+ 26 - 13
src/store/modules/permission.js

@@ -20,15 +20,33 @@ function hasPermission(roles, route) {
  * @param roles
  */
 function filterAsyncRouter(asyncRouterMap, roles) {  // 闭包查找所有该roles下的路由
+  console.log(asyncRouterMap, roles)
+  // debugger
   const accessedRouters = asyncRouterMap.filter(route => {
-    if (hasPermission(roles, route)) {
-      if (route.children && route.children.length) {
-        route.children = filterAsyncRouter(route.children, roles)
-      }
-      return true
-    }
-    return false
+      // const temp = []
+      console.log(roles, route, route.children)
+      route.children = route.children.filter(v => {
+
+        // console.log(roles, v)
+        console.log(v,v.meta)
+        if (v.meta && v.meta.roles && (v.meta.roles[0] == roles[0])) {
+          console.log(v.meta.roles[0] == roles[0])
+          return true
+        } else {
+          return false
+        }
+      })
+      console.log(9,route.children)
+      return route
+    // if (hasPermission(roles, route.childer)) {
+    //   if (route.children && route.children.length) {
+    //     // route.children = filterAsyncRouter(route.children, roles)
+    //   }
+    //   return true
+    // }
+    // return false
   })
+  console.log(accessedRouters)
   return accessedRouters
 }
 
@@ -49,14 +67,9 @@ const permission = {
       return new Promise(resolve => {
         const { roles } = data
         let accessedRouters
-        if (roles.indexOf('3') >= 0) {  // 如果是admin 直接加载所有路由 超级管理员
-          accessedRouters = asyncRouterMap
-          // debugger
-        } else {
+        console.log(asyncRouterMap, roles)
           accessedRouters = filterAsyncRouter(asyncRouterMap, roles)  // 否则根据权限搜索路由
           // accessedRouters = ''
-          // accessedRouters = asyncRouterMap
-        }
         console.log('accessedRouters', accessedRouters)
         commit('SET_ROUTERS', accessedRouters)
         resolve()

+ 126 - 37
src/store/modules/user.js

@@ -1,15 +1,16 @@
-import { LOGIN,GET_TOKEN,GetInfo,InfoWatch,InfoWatchDay,
+import { GET_UUIONID_TOKEN,GET_TOKEN,GetInfo,InfoWatch,InfoWatchDay,
   InfoWatchMoth,TeacherHomeworkList,TeacherAllotList,
   TeacherAllot,UnallotHomeworkList,GetTeacherDetail,
-  GetStudentDetail,GetManagerDetail,Downgrade,
-  SuperApplyTeacherList,ApplyOperate,GetTeacherSalaryList
+  GetStudentDetail,GetManagerDetail,Downgrade,SuperManagerList,
+  SuperApplyTeacherList,ApplyOperate,GetTeacherSalaryList,
   } from '@/api'
 import { getToken, setToken, removeToken } from '@/utils/auth'
 import axios from '@/axios'
+import router from "@/router"
 import { Message } from 'element-ui'
 const user = {
   state: {
-    token: getToken(),
+    token:[],
     name: '',
     avatar: '',
     roles: [],
@@ -89,29 +90,72 @@ const user = {
   },
 
   actions: {
-    // 登录
-    Login({ commit }, userInfo) {
-      const username = userInfo.username.trim()
-      return new Promise((resolve, reject) => {
-        login(username, userInfo.password).then(response => {
-          const data = response.data
-          setToken(data.token)
-          commit('SET_TOKEN', data.token)
-          resolve()
-        }).catch(error => {
-          reject(error)
+      //   unionid登录
+      //  获取TOKEN
+       UnionidLogin({ state, commit, dispatch, getters }, data) {
+        console.log(data);
+        // debugger
+        axios.Tokenpost(GET_UUIONID_TOKEN, data).then(res => {
+          if (res && res.code == '999') {
+            const data = res.data
+            commit('SET_TOKEN', data);
+            // debugger
+            sessionStorage.setItem("accessToken",data.accessToken)
+                    Message.success('登录成功')
+                   dispatch('GetInfo').then(res => { // 拉取用户信息
+                        const roles = res.data.role 
+                        dispatch('GenerateRoutes', { roles }).then(() => { // 根据roles权限生成可访问的路由表
+                          console.log('addrouters', getters.addRouters)
+                          router.addRoutes(getters.addRouters) // 动态添加可访问路由表
+                          console.log(router)
+                          router.push("/home");
+                          // next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
+                        })
+                      }).catch(() => {
+                        // dispatch('FedLogOut').then(() => {
+                        //   Message.error('验证失败,请重新登录')
+                        //   next({ path: '/login' })
+                        //   console.log('roles====5')
+                        // })
+                      })
+          } else {
+            Message.error('验证失败,请重新登录')
+                    router.push("/");
+          }
         })
-      })
-    },
+      },
+      
+    //   // 获取tokrn
+    //   UnionidLogin({ commit, state }, data) {
+    //   return new Promise((resolve, reject) => {
+    //     axios.Tokenpost(GET_UUIONID_TOKEN, data).then(response => {
+    //       debugger
+    //       if (response && response.code == '999') {
+    //         const data = response.data
+    //         commit('SET_TOKEN', data);
+    //         sessionStorage.setItem("accessToken",data.accessToken)
+    //         Message.success('登录成功')
+    //         router.push("/home");
+    //       } else {
+    //         Message.error('验证失败,请重新登录')
+    //         router.push("/");
+    //       }
+    //       resolve(response)
+    //     }).catch(error => {
+    //       reject(error)
+    //     })
+    //   })
+    // },
+      // 微信授权登陆
        //获取TOKEN
        GET_TOKEN({ state, commit }, data) {
         console.log(data);
-        axios.post(GET_TOKEN, data).then(res => {
+        axios.get(GET_TOKEN, data).then(res => {
           // debugger
           if (res && res.code == '999') {
             commit('SET_TOKEN', data.data);
             sessionStorage.setItem("accessToken",data.data)
-          this.$router.push("/home");
+          // this.$router.push("/home");
           } else {
             this.$router.push("/");
           }
@@ -119,18 +163,61 @@ const user = {
       },
     // 获取用户信息
     GetInfo({ commit, state }, data) {
+      console.log(data)
+      // debugger
+
+      // return new Promise((resolve, reject) => {
+      //   resolve({
+      //       "data": {
+      //         "approveStatus": 0,
+      //         "grade": "一年级,二年级,三年级,四年级,五年级,六年级,七年级,八年级,九年级",
+      //         "imgUrl": "/userimg/2019/03/13/55403363-f5b3-4af8-92e8-69aec41dd6b7.jpg",
+      //         "isFirst": 0,
+      //         "managerId": "",
+      //         "managerList": [],
+      //         "myManager": "",
+      //         "name": "丁颖",
+      //         "period": "",
+      //         "phone": "",
+      //         "role": ['1'],
+      //         "school": "",
+      //         "subject": "语文;数学;英语",
+      //         "wxName": "丁颖"
+      //       }
+      //     })
+      //   }) 
+      
       return new Promise((resolve, reject) => {
-        axios.post(GetInfo, data).then(response => {
-          const data = response.data
-          commit('SET_ROLES', data.role)
-          commit('SET_NAME', data.name)
-          commit('SET_AVATAR', data.imgUrl)
+        axios.post(GetInfo, data).then((response = {}) => {
+          debugger
+          const { data, code, msg } = response
+          const { role, name, imgUrl } = data
+          commit('SET_ROLES', role)
+          commit('SET_NAME', name)
+          commit('SET_AVATAR', imgUrl)
           resolve(response)
         }).catch(error => {
           reject(error)
         })
       })
     },
+    // GetInfo({ commit, state }, data) {
+    //   console.log(data)
+    //   debugger
+    //   return new Promise((resolve, reject) => {
+    //     axios.post(GetInfo, data).then((response = {}) => {
+    //       debugger
+    //       const { data, code, msg } = response
+    //       const { role, name, imgUrl } = data
+    //       commit('SET_ROLES', role)
+    //       commit('SET_NAME', name)
+    //       commit('SET_AVATAR', imgUrl)
+    //       resolve(response)
+    //     }).catch(error => {
+    //       reject(error)
+    //     })
+    //   })
+    // },
     // 校区管理员数据监控
     InfoWatch({ commit, state }, data) {
       return new Promise((resolve, reject) => {
@@ -285,7 +372,7 @@ const user = {
           const data = response.data || { }
           commit('SET_APPLY_TEACHER_LIST', data);
           // debugger
-          console.log(data)
+          // console.log(data)
           resolve(response)
         }).catch(error => {
           reject(error)
@@ -319,18 +406,20 @@ const user = {
       })
     },
     // 登出getTeacherSalaryList
-    // LogOut({ commit, state }) {
-    //   return new Promise((resolve, reject) => {
-    //     logout(state.token).then(() => {
-    //       commit('SET_TOKEN', '')
-    //       commit('SET_ROLES', [])
-    //       removeToken()
-    //       resolve()
-    //     }).catch(error => {
-    //       reject(error)
-    //     })
-    //   })
-    // },
+    LogOut({ commit, state }) {
+      debugger
+      return new Promise((resolve, reject) => {
+        logout(state.token).then(() => {
+          commit('SET_TOKEN', '')
+          commit('SET_ROLES', [])
+          Message.success('退出成功')
+          router.push("/");
+          resolve()
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
 
     // 前端 登出
     FedLogOut({ commit }) {

+ 2 - 4
src/utils/auth.js

@@ -1,14 +1,12 @@
 import Cookies from 'js-cookie'
-const TokenKey = 'jAf6LV0HJJiIvhgvIHCM2t10GW7lHt5VAUE13pmj2lLEWlzQyNqx9dbVG0aXpTvn'
+let accessToken = sessionStorage.getItem("accessToken")
 
 export function getToken() {
-  return TokenKey
+  return accessToken
 }
 
 export function setToken(token) {
-  return Cookies.set(TokenKey, token)
 }
 
 export function removeToken() {
-  return Cookies.remove(TokenKey)
 }