<style>

</style>
<template>
  <div>
    <el-collapse v-if="dayData&&dayData.SubList&&dayData.SubList.length>0">
      <el-collapse-item v-for="(subItem,subIndex) in dayData.SubList" :key="subIndex" :name="subIndex">
        <template slot="title">
          <div class="plan_Tdiv">
            <span v-if="subItem.TimeStr==='早上'" class="commonTimeStr greenTime">{{subItem.TimeStr}}</span>
            <span v-if="subItem.TimeStr==='下午'" class="commonTimeStr blueTime">{{subItem.TimeStr}}</span>
            <span v-if="subItem.TimeStr==='晚上'" class="commonTimeStr orangeTime">{{subItem.TimeStr}}</span>
            <span v-if="subItem.Type===0&&subItem.ClassType==2">试听课</span>
            <span style="color:red;margin:0 5px;">{{subItem.TeacherName}}</span>
            <span>[{{subItem.RoomName}}]</span>
          </div>
        </template>
        <div @click="goUrl(subItem)">
          <div class="plan_Inner">
            <div class="plan_LeftTitle">上课时间：</div>
            <div class="plan_RightInner">{{subItem.StartTime}}-{{subItem.EndTime}}</div>
          </div>
          <div class="plan_Inner" v-if="subItem.ClassName">
            <div class="plan_LeftTitle">班级：</div>
            <div class="plan_RightInner">{{subItem.ClassName}}</div>
          </div>
          <div class="plan_Inner">
            <div class="plan_LeftTitle">课程名称：</div>
            <div class="plan_RightInner">{{subItem.CourseName}}</div>
          </div>
          <div class="plan_Inner" v-if="subItem.GuestList&&subItem.GuestList.length>0">
            <div class="plan_LeftTitle">学生名称：</div>
            <div class="plan_RightInner">
              <span style="margin-right:10px;" v-for="tItem in subItem.GuestList">{{tItem.GuestName}}</span>
            </div>
          </div>
          <div class="plan_Inner" style="align-items:center;" v-if="subItem.CompleteProgress>=0">
            <div class="plan_LeftTitle">课程进度：</div>
            <div class="plan_RightInner">
              <el-progress :percentage="subItem.CompleteProgress"></el-progress>
            </div>
          </div>
        </div>

      </el-collapse-item>
    </el-collapse>
    <div class="text-grey-6" v-else>
      暂无课程安排
    </div>
  </div>
</template>
<script>
  export default {
    props: {
      dayData: {
        type: Object,
        default: null
      },
      fatherMethod: {
        type: Function,
        default: null
      }
    },
    data() {
      return {

      }
    },
    methods: {
      goUrl(item) {
        if (item.Type === 0 && item.ClassType === 1) {
          this.$router.push({
            path: "/classroom/courseInfo",
            query: {
              id: item.Id
            }
          })
        }else if(item.Type >0){
           this.$emit('unusual',item);
        }
      }
    }
  }

</script>
