"use strict";
const common_vendor = require("../../../common/vendor.js");
const _sfc_main = {
  __name: "StudentCard",
  props: {
    student: {
      type: Object,
      required: true,
      default: () => ({
        id: "",
        name: "",
        code: "",
        avatar: "",
        row: 1,
        col: 1,
        status: 81
        // 81-出勤, 1-旷课, 11-迟到, 21-早退, 0-请假
      })
    },
    // 是否在点名模式下（影响交互）
    attendanceMode: {
      type: Boolean,
      default: false
    }
  },
  emits: ["click", "statusChange"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const handleCardClick = () => {
      common_vendor.index.__f__("log", "at pages/kqjl/components/StudentCard.vue:95", "点击了学生卡片:", props.student.name, "当前模式:", props.attendanceMode);
      if (!props.attendanceMode) {
        common_vendor.index.__f__("log", "at pages/kqjl/components/StudentCard.vue:97", "不在点名模式，忽略点击");
        return;
      }
      common_vendor.index.__f__("log", "at pages/kqjl/components/StudentCard.vue:101", "开始状态切换，当前状态:", props.student.status);
      let newStatus;
      switch (props.student.status) {
        case 81:
          newStatus = 1;
          break;
        case 1:
          newStatus = 11;
          break;
        case 11:
          newStatus = 21;
          break;
        case 21:
          newStatus = 81;
          break;
        default:
          newStatus = 81;
      }
      emit("statusChange", {
        studentId: props.student.id,
        oldStatus: props.student.status,
        newStatus
      });
      emit("click", props.student);
    };
    const handleImageError = () => {
      common_vendor.index.__f__("log", "at pages/kqjl/components/StudentCard.vue:133", "头像加载失败:", props.student.name);
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: __props.student.avatar || "/static/images/default-avatar.png",
        b: common_vendor.o(handleImageError),
        c: common_vendor.t(__props.student.code),
        d: common_vendor.t(__props.student.name),
        e: __props.student.status === 11
      }, __props.student.status === 11 ? {} : {}, {
        f: __props.student.status === 1
      }, __props.student.status === 1 ? {} : {}, {
        g: __props.student.status === 21
      }, __props.student.status === 21 ? {} : {}, {
        h: common_vendor.o(handleCardClick),
        i: common_vendor.gei(_ctx, "")
      });
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ab7d66f5"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/kqjl/components/StudentCard.js.map
