<!-- 活动解析 -->
<template>
  <div>
    <!-- table 表格 -->
    <el-row :gutter="20" class="main-items">
      <!--数据监控-->
      <el-col :span="20" class="main" :offset="2">
        <el-row :gutter="24" class="main-header">
          <div class="main-header-item">批改老师注册数:{{GetManagerListForChecker.correctTeacher}}人</div>
          <div class="main-header-item">匹配老师注册数:{{GetManagerListForChecker.matchTeacher}}人</div>
          <div class="main-header-item">活跃老师数：{{GetManagerListForChecker.activeTeacherCount}}人</div>
          <div class="main-header-item">注册用户数：{{GetManagerListForChecker.registerUserCount}}人</div>
          <div class="main-header-item">活跃用户数：{{GetManagerListForChecker.activeUserCount}}人</div>
        </el-row>
        <el-table
          :data="GetManagerListForChecker.list"
          :header-cell-class-name="tableheaderClassName"
          :header-cell-style="{
          'background-color': '#F6F7FB',
          'color': '#393939',
          'font-size': '16px'
           }"
          size="medium"
          border
        >
          <el-table-column label="校区管理员" header-align="center" width="200">
            <template slot-scope="scope">
              <div class="scope-list">
                <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>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="groupCount" label="小组人数" header-align="center"></el-table-column>
          <el-table-column prop="subject" label="科目" header-align="center"></el-table-column>
          <el-table-column prop="feedbackCount" label="近七日批改+匹配总张数" header-align="center"></el-table-column>
          <el-table-column prop="checkCount" label="近七日已质检张数" header-align="center"></el-table-column>
          <el-table-column prop="checkRate" label="近七日作业质检率" header-align="center"></el-table-column>
          <el-table-column prop="checkRightRate" label="近七日质检正确率" header-align="center"></el-table-column>
          <el-table-column prop="status" label header-align="center" width="350">
            <template slot-scope="scope">
              <div class="UpTeacherTeam" @click="groupDetail(scope.row.managerId)">
                <span>小组详情</span>
              </div>
            </template>
          </el-table-column>
        </el-table>
        <!-- 分页显示 -->

        <el-pagination
          background
          @size-change="handleSizeChange"
          @current-change="pageChange"
          :page-sizes="[10, 20, 30, 40]"
          layout="total, sizes, prev, pager, next, jumper"
          :total="parseInt(GetManagerListForChecker.pages)"
          :hide-on-single-page="true"
        ></el-pagination>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
import { IMG_BASE_URL, APPOR_BASE_URL } from "@/config";
import SeacherHomewrokStatus from "@/components/SeacherHomewrokStatus";
export default {
  components: { SeacherHomewrokStatus },
  name: "actvResolveLabel",
  props: {},
  data() {
    return {
      BASE_URL: IMG_BASE_URL,
      hiddenModel: false,
      isPigai: false,
      managerId: "",
      superName: "",
      count: 0,
      arrPeriod: [],
      arrGrade: [],
      gardeListDownage: false,
      selecttitleage: "选择科目",
      closeID: false,
      OpenID: false,
      TeacherIdstatus: "",
      modelindex: "",
      Activeindex: false,
      filters: {
        inputValue: "",
        actvNm: "",
        actvCrtUserId: "",
        actvType: "",
        actvSmallType: "",
        // 排序
        MaxtimeValue: "",
        pageNo: 1,
        pageSize: 10,
        count: 0,
        orderField: "",
        orderAD: "",
        gradesValue: ""
      }
    };
  },
  created() {},
  watch: {
    InfoTeacherstatues(val, oldVal) {
      //普通的watch监听
      this.teacherDetailFun();
    },
    downgrade(val, oldVal) {
      this.SuperManagerList();
    }
  },
  computed: {
    ...mapGetters(["GetManagerListForChecker"])
  },
  methods: {
    ...mapActions(["setUser"]),

    // 手动批改
    handApor() {
      this.Activeindex = false;
    },
    // 匹配知识点老师
    AutoApor() {
      this.Activeindex = true;
    },
    selectTipage(item) {
      this.filters.gradesValue = item.str;
      this.selecttitleage = item.label;
      this.gardeListDownage = false;
      this.SuperManagerList();
    },
    selectStyle1() {
      this.gardeListDownage = true;
    },
    outStyle1() {
      this.gardeListDownage = false;
    },
    selectTitle(k) {
      this.modelindex = k;
    },
    //时间封装
    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("GetManagerListForCheckerInfo", {
        maxCreateTime: this.formatDate(),
        pageNo: this.filters.pageNo,
        pageSize: this.filters.pageSize
      });
    },
    // 查看校区管理员详情
    async GetManagerDetail(str) {
      this.$store.dispatch("GetManagerDetail", {
        managerId: str
      });
    },
    async teacherDetailFun() {
      console.log(this.getManagerDetail);
      var arr = this.getManagerDetail.grade.split(",");
      this.arrPeriod = this.getManagerDetail.period.split(",");
      console.log(this.arrPeriod);
      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) || [];
    },
    //小组详情
    groupDetail(str) {
      this.$router.push({
        path: "/Qualityinspector/checkListInfo",
        query: {
          managerId: str
        }
      });
    },
    // 表格头部样式
    tableheaderClassName({ row, rowIndex }) {
      return "table-head-th";
    },
    cellStyle: function(row, column, rowIndex, columnIndex) {
      console.log(row);
      if (row.column.label === "小组管理员") {
        return "font-size:30px";
      } else {
        return "";
      }
    },
    // 分页
    pageChange(val) {
      this.filters.pageNo = val;
      this.SuperManagerList();
    },
    handleSizeChange(val) {
      this.filters.pageSize = val;
      this.SuperManagerList();
    },
    // 数组去重
    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() {
    sessionStorage.setItem("tabIndex", 0);
    this.SuperManagerList();
  }
};
</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;
}
.aside {
  background-color: #fff;
  margin-top: 16px;
  margin-right: 16px;
  padding: 0;
  min-height: 880px;
}
.main-items {
  color: #393939;
  /*text-align: center;*/
  line-height: 80px;
}
.main-header {
  position: relative;
}
.modelspec {
  z-index: 10000;
  width: 35.5%;
  height: auto;
  position: fixed;
  top: 30%;
  left: 32.5%;
  margin: auto;
  background: #fff;
  border-radius: 10px;
  text-align: center;
}
.main-header-item {
  float: left;
  font-size: 16px;
  color: #7e7e7e;
  margin-left: 30px;
  text-overflow: ellipsis;
  /*vertical-align: middle;*/
  text-align: center;
  display: inline-block;
  /* width: 15%; */
}

.input-with-select .el-input-group__prepend {
  background-color: #fff;
}
.el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: #52cc60 !important;
  color: #fff;
}
.table-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}
.active {
  background-color: #52cc60;
  color: #fff !important;
}
.showModel {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background: #000000;
  opacity: 0.2;
  overflow: hidden;
  z-index: 1000;
  color: #fff;
}
.ApporStyles {
  display: inline-block;
  width: 200px;
  height: 40px;
  line-height: 40px;
  background-color: #fff;
  border-radius: 20px;
  font-size: 16px;
  color: #7c819d;
  cursor: pointer;
  text-align: center;
}
.Apporvalactive {
  background-color: #52cc60 !important;
  color: #fff !important;
}
.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 10px 10px;
  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 {
  cursor: pointer;
  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: 5%;
  color: #393939;
  font-size: 13px;
}
.grade-name {
  color: #393939;
  font-size: 16px;
  margin: 0 10px;
}
.page-block {
  text-align: center !important;
  margin-top: 15px;
}
.scope-list {
  margin-left: 5%;
  text-align: left;
}
.miniorinput-with-Allot {
  border: #b6b6b6;
  border-radius: 5px;
  height: 40px;
  width: 280px;
  font-size: 8px;
  color: #b6b6b6;
  text-align: left;
  line-height: 40px;
  background: #f1f2f4;
  padding: 0 10px;
  float: left;
  outline: none !important;
  box-shadow: none;
}
.miniorteach-Allot {
  float: left;
  width: 280px;
  position: relative;
  height: 40px;
  top: 15px;
}
.miinorSeachIcon {
  position: absolute;
  font-size: 20px;
  color: #b6b6b6;
  right: 5%;
  margin-top: 12px;
  cursor: pointer;
}
.noBorderBottom {
  border-bottom: none;
}
.el-table .table-head-th {
  background-color: #f6f7fb;
  font-size: 16px !important;
  color: #393939;
}
.closeTeacherID {
  margin-right: 50px;
  display: inline-block;
  height: 40px;
  width: 100px;
  color: #f56c6c;
  background: #fef0f0;
  border-color: #fbc4c4;
  border-radius: 20px;
  font-size: 14px;
  line-height: 40px;
  cursor: pointer;
  border: 1px solid;
}
.closeTeacherID:hover {
  color: #fff;
  background-color: #f56c6c;
  border-color: #f56c6c;
}
.UpTeacherTeam {
  display: inline-block;
  height: 40px;
  width: 120px;
  color: #fff;
  background-color: #67c23a;
  border-color: #c2e7b0;
  font-size: 14px;
  line-height: 40px;
  cursor: pointer;
  border: 1px solid;
  text-align: center;
  margin: 0 auto;
}
.UpTeacherTeam:hover {
  color: #fff;
  background-color: #67c23a;
  border-color: #67c23a;
}
.UpTeacherID {
  display: inline-block;
  height: 40px;
  width: 100px;
  color: #67c23a;
  background: #f0f9eb;
  border-color: #c2e7b0;
  border-radius: 20px;
  font-size: 14px;
  line-height: 40px;
  cursor: pointer;
  border: 1px solid;
}
.UpTeacherID:hover {
  color: #fff;
  background-color: #67c23a;
  border-color: #67c23a;
}
.UpTeacherIDiNfo {
  float: left !important;
  display: inline-block;
  height: 40px;
  width: 150px;
  color: #fff;
  background-color: #67c23a;
  border-color: #67c23a;
  /* border-radius: 20px; */
  font-size: 14px;
  line-height: 40px;
  cursor: pointer;
  border: 1px solid;
  text-align: center;
}
.UpTeacherIDiNfo:hover {
  color: #67c23a;
  background: #f0f9eb;
  border-color: #c2e7b0;
}
.buttonAppoval {
  display: inline-block;
}
.TeacherApporTime {
  text-align: center;
  display: inline-block;
  height: 30px;
  width: 60px;
  color: #706f6f;
  background: #b6b6b6;
  border-color: #929492;
  border-radius: 20px;
  font-size: 14px;
  line-height: 30px;
  cursor: pointer;
  margin: 0 5px;
}
.TeacherApporTime:hover {
  color: #fff;
  background-color: #909399;
  border-color: #909399;
}
.table-aside {
  color: #666666;
  font-size: 18px;
  text-align: center;
  line-height: 60px;
  cursor: pointer;
}
.selectBox {
  position: absolute;
  right: 50px;
  top: 15px;
}
.Ageclass {
  /* display: inline-block; */
  height: 40px;
  width: 140px;
  background-color: #f1f2f4;
  line-height: 40px;
  font-size: 16px;
  cursor: pointer;
}
.age-tip {
  width: 80%;
  height: 40px;
  color: #747070;
  font-size: 12px;
}
.class-download {
  background-color: #fff;
  width: 140px;
  z-index: 999999;
  position: absolute;
  border: 1px solid #e0dddd;
  border-radius: 5px;
  top: 40px;
}
.class-download ul li {
  height: 40px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  color: #b6b6b6;
}
.class-download ul li:hover {
  background-color: #52cc60;
  color: #ffff;
}
</style>
