<template>
  <a-modal
    v-model:open="visible"
    :width="456"
    style="top: 10vh"
    :footer="null"
    title="选择导出类型"
  >
    <a-row :gutter="16">
      <a-col :span="12">
        <div class="type-box" @click="seleted('STUDENT_CODE')">
          <img src="@/assets/imgs/scan_login_icon.png" alt="按考生导出" />
          <p>按考生导出</p>
          <p>EXPORT BY CANDIDATE</p>
        </div>
      </a-col>
      <a-col :span="12">
        <div class="type-box" @click="seleted('EXAM_ROOM')">
          <img src="@/assets/imgs/room_icon.png" alt="按考场导出" />
          <p>按考场导出</p>
          <p>EXPORT BY TEST ROOM</p>
        </div>
      </a-col>
    </a-row>
  </a-modal>
</template>

<script setup lang="ts">
import { ReviewExportType } from "@/ap/types/review";
import useModal from "@/hooks/useModal";

defineOptions({
  name: "ExportTypeDialog",
});

/* modal */
const { visible, open, close } = useModal();
defineExpose({ open, close });

const emit = defineEmits(["confirm"]);

function seleted(type: ReviewExportType) {
  emit("confirm", type);
}
</script>

<style lang="less" scoped>
.type-box {
  height: 140px;
  border-radius: 6px;
  padding: 26px;
  border: 1px solid @border-color1;
  text-align: center;
  cursor: pointer;

  &:hover {
    background: #f3f4f6;
  }

  > img {
    display: block;
    height: 35px;
    width: 32px;
    margin: 0 auto;
    margin-bottom: 12px;
  }

  > p:nth-of-type(1) {
    height: 24px;
    font-weight: 500;
    font-size: 16px;
    color: #14161a;
    line-height: 24px;
  }
  > p:nth-of-type(2) {
    height: 18px;
    font-size: 10px;
    color: #8c8c8c;
    line-height: 18px;
  }
}
</style>
