<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> -->
            <q-badge rounded color="orange" label="试听课" v-if="subItem.ClassType==2"
              style="margin-left:5px;font-size:10px" />
            <q-badge rounded color="cyan-7" label="预约课" v-if="subItem.ClassType==3"
              style="margin-left:5px;font-size:10px" />
            <q-badge rounded color="orange" label="跟班" v-if="subItem.ClassType == 2&&subItem.ReserveType===1"
              style="margin-left:5px;font-size:10px" />
            <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.ClassType===1&&subItem.ClassType===3">
            <div class="plan_LeftTitle">课程进度：</div>
            <div class="plan_RightInner">
              <span v-if="subItem.ClassType == 1">{{ subItem.Ranks }}/{{ subItem.TotalPlanNum }}</span>
              <span v-if="subItem.ClassType == 3&&subItem.CourseGradeIdName" class="q-mr-sm">{{subItem.CourseGradeIdName}}</span>
              <span v-if="subItem.ClassType == 3">第{{ subItem.Ranks||0 }}次课</span>
            </div>
          </div>
          <template v-if="subItem.ClassType == 3">
            <div class="plan_Inner">
              <div class="plan_LeftTitle">课程状态：</div>
              <div class="plan_RightInner" style="color: rgb(239, 83, 80);" v-if="subItem.AppointState == 1">
                待确认
              </div>
              <div class="plan_RightInner" style="color: rgb(33, 186, 69);" v-if="subItem.AppointState == 2">
                已确认
              </div>
            </div>
            <div class="plan_Inner" v-if="subItem.ScrollMinNum">
              <div class="plan_LeftTitle">最小成班：</div>
              <div class="plan_RightInner">
                <span style="color: rgb(33, 186, 69);">{{
                subItem.ScrollMinNum
              }}</span>人
              </div>
            </div>
          </template>
        </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>
