<template>
  <div id="leaveList">
    <el-row>
      <el-col :span="24" class="info">
        <el-col :span="24" class="list" v-for="(item, index) in workLists" :key="index">
          <el-col :span="14" class="time">
            <el-col>科目:{{ item.name }}</el-col>
            <el-col :span="24" class="anniu">
              <el-button v-if="item.display === 'second'" type="primary" size="small" @click="clickBtn(item.id)">在线作答</el-button>
              <el-button v-else type="primary" size="small" @click="clickzy(item.id)">上传作业</el-button>
            </el-col>
          </el-col>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'leaveList',
  props: {
    workLists: null,
    names: null,
    display: { type: String, default: 'first' },
  },
  components: {},
  data: () => ({}),
  created() {},
  computed: {},
  methods: {
    clickBtn(id) {
      this.$router.push({ path: '/user/dati', query: { id: id } });
    },
    clickzy(id) {
      console.log(id);

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

<style lang="less" scoped>
p {
  padding: 0;
  margin: 0;
}
.info {
  min-height: 300px;
}

.list {
  width: 97%;
  padding: 0px 0px 0 70px;
  background-color: #fff;
  border-radius: 15px;
  margin: 0 5px 5px 5px;
}
.list .time {
  padding: 5px 0;
}
.list .ispass {
  padding: 20px 0;
}
.anniu {
  padding: 20px 0 0 0;
}
</style>
