<script setup lang="ts">
import { ClassList } from "@/api/school/types";

defineOptions({
  name: "TeacherIndex",
  inheritAttrs: false,
});
import { watch } from "vue";
import { useUserStore } from "@/store/modules/user";
import { CaretBottom } from "@element-plus/icons-vue";
const userStore = useUserStore();
watch(
  () => userStore.schoolId,
  (newValue, oldValue) => {
    console.log(newValue, oldValue);
  }
);

let teacherInfo = ref("");
// 折叠面板active
const activeItem = ref();
const tableData = ref<any>([
  {
    e1: "AI00000000",
    e2: "AI00000000",
    e3: "AI00000000",
    e4: "AI00000000",
    e5: "AI00000000",
    e6: "AI00000000",
    e7: "AI00000000",
    e8: "AI00000000",
    cls: "TomTomTom",
  },
]);
</script>

<template>
  <div class="teacher-container">
    <!-- 教师查找 -->
    <div class="teacher-search">
      <el-input
        v-model="teacherInfo"
        size="large"
        placeholder="请输入教师名称或手机号码"
      />
      <el-button size="large" type="primary">查找</el-button>
      <span>共<b>40</b>人</span>
    </div>
    <!-- 折叠面板-->
    <div class="list-collapse">
      <el-collapse v-model="activeItem">
        <el-collapse-item name="1">
          <template #title>
            <div class="title">
              <span class="blue mr-10">松阪老师</span>
              <span>注册时间：2023-02-23</span>
              <span class="blue fr"
                >负责班级 & 绑定设备
                <el-icon
                  :class="
                    activeItem && activeItem.includes('1') ? 'is-active' : ''
                  "
                  ><CaretBottom
                /></el-icon>
              </span>
            </div>
          </template>
          <div>
            <el-table :data="tableData" style="width: 100%">
              <el-table-column prop="e1" label="水母星球脑机" align="center" />
              <el-table-column prop="e2" label="智脑水舞" align="center" />
              <el-table-column prop="e3" label="智脑恐龙" align="center" />
              <el-table-column prop="e4" label="智脑碰碰车" align="center" />
              <el-table-column prop="e5" label="智脑UFO" align="center" />
              <el-table-column prop="e6" label="智脑SUV" align="center" />
              <el-table-column prop="e7" label="智脑赛车" align="center" />
              <el-table-column prop="e8" label="智脑积木" align="center" />
              <el-table-column prop="cls" label="负责班级" align="center" />
            </el-table>
          </div>
        </el-collapse-item>
      </el-collapse>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.teacher-container {
  position: relative;
  padding: 20px 30px;
}
.teacher-search {
  margin-bottom: 20px;
  font-size: 16px;
  .el-input {
    width: 250px;
    margin: 0;
  }
  :deep(.el-input__inner) {
    font-size: 16px;
  }
  .el-button {
    font-size: 16px;
    padding: 0 26px;
    margin: 0 20px;
    border-radius: 12px;
  }
  b {
    font-size: 20px;
  }
}
:deep(.el-input__wrapper) {
  background: #ffffff;
  border-radius: 12px;
}
:deep(.el-input__wrapper) {
  box-shadow: none !important;
}
.list-collapse {
  background: #ffffff;
  border-radius: 25px;
  padding: 0 32px;
  margin-bottom: 10px;
  .title {
    width: 100%;
    font-size: 18px;
    .blue {
      color: #4284f2;
    }
    .red {
      color: #e04962;
    }
    .fr {
      float: right;
    }
    .el-icon {
      vertical-align: middle;
      &.is-active {
        transform: rotate(180deg);
      }
    }
  }
  :deep(.el-collapse),
  :deep(.el-collapse-item__header),
  :deep(.el-collapse-item__wrap) {
    border: none;
  }
  :deep(.el-collapse-item__arrow) {
    display: none;
  }
}
:deep(.el-table th.el-table__cell) {
  background: #e9ebee;
}
</style>
