<template>
  <div id="stuleaveList">
    <el-row>
      <el-col :span="24">
        <el-col :span="24" class="list" v-for="(item, index) in newclassList" :key="index">
          <el-col :span="18" class="name">
            <p>{{ item.name }}</p>
          </el-col>
          <el-col :span="6" class="btn">
            <el-link :underline="false" @click="clickShow()">作业信息</el-link>
          </el-col>
        </el-col>
      </el-col>
    </el-row>
    <van-overlay :show="show" @click="clickDown">
      <div class="wrapper" @click="clickDown">
        <el-col :span="24" class="leaveInfo">
          <p class="jilu">作业记录</p>
          <el-col :span="24" class="info">
            <template v-if="leaveInfo.length > 0">
              <el-col :span="24" class="date" v-for="(acc, index) in leaveInfo" :key="index">
                <el-col :span="18">
                  <p>作业名称：{{ acc.name }}</p>
                  <p>分数：{{ acc.score }}</p>
                </el-col>
                <el-col :span="6" v-for="(acc, index) in leaveInfo" :key="index" class="fen">
                  <p>上分</p>
                </el-col>
              </el-col>
            </template>
            <template v-if="leaveInfo.length == 0">
              <el-col :span="24" class="leavelist" style="text-align:center">
                <p>暂无作业记录</p>
              </el-col>
            </template>
          </el-col>
        </el-col>
      </div>
    </van-overlay>
  </div>
</template>
<script>
export default {
  name: 'stuleaveList',
  props: {
    newclassList: null,
    leaveInfo: null,
    show: null,
    headinfo: null,
    teacherinfo: null,
  },
  components: {},
  data: () => ({}),
  created() {},
  computed: {},
  methods: {
    clickShow() {
      this.$emit('clickShow');
    },
    clickDown() {
      this.$emit('clickDown');
    },
    clickShows(id) {
      this.$router.push({ path: '/class/stuDetail', query: { id } });
    },
    clicktea(id) {
      console.log(id);

      this.$router.push({ path: '/class/stuDetail', query: { id } });
    },
  },
};
</script>

<style lang="less" scoped>
p {
  padding: 0;
  margin: 0;
}
.list {
  margin: 10px 10px 0 10px;
  background: #fff;
  width: 95%;
  padding: 10px;
  border-radius: 10px;
}
.list .name {
  padding: 5px 0;
}
.list .btn {
  padding: 5px 0;
  text-align: center;
}
.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.leaveInfo {
  width: 90%;
  background: #ffffff;
  padding: 0 0 10px 0;
  border-radius: 10px;
}
.info {
  height: 450px;
  overflow-y: auto;
}
.jilu {
  text-align: center;
  padding: 10px 0;
}
.leavelist {
  padding: 10px 10px 0 10px;
}
.leavelist .date p {
  padding: 0;
}
.leavelist .status {
  padding: 10px 0;
}
.date {
  background-color: #66b3ff;
  color: #ffffff;
  padding: 0 10px 10px 10px;
  height: 70px;
  line-height: 35px;
}
.fen {
  font-size: 22px;
  height: 70px;
  line-height: 60px;
}
</style>
