<template>
  <div class="StudentLogManage">
    <div class="part-box-head">
      <div class="part-box-head-left"><h1>考生端日志管理</h1></div>
    </div>

    <div class="part-filter">
      <div class="part-filter-form">
        <el-form ref="FilterForm" label-position="left" inline>
          <el-form-item>
            <el-select
              v-model="filter.examId"
              placeholder="请选择考试任务"
              clearable
            >
              <el-option
                v-for="item in batchs"
                :key="item.id"
                :value="item.id"
                :label="item.name"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-select
              v-model="filter.batchId"
              placeholder="请选择批次"
              clearable
            >
              <el-option
                v-for="item in exams"
                :key="item.id"
                :value="item.id"
                :label="item.name"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-select
              v-model="filter.examroom"
              placeholder="请选择考场"
              clearable
            >
              <el-option
                v-for="item in exams"
                :key="item.id"
                :value="item.id"
                :label="item.name"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-select
              v-model="filter.subjectId"
              placeholder="请选择科目"
              clearable
            >
              <el-option
                v-for="item in subjects"
                :key="item.id"
                :value="item.id"
                :label="item.name"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-input
              v-model.trim="filter.content"
              placeholder="姓名/证件号"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="toPage(1)">查询</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>

    <el-table ref="TableList" :data="dataList" border stripe>
      <el-table-column prop="batchName" label="排序"></el-table-column>
      <el-table-column prop="batchName" label="批次名称(ID)"></el-table-column>
      <el-table-column prop="examName" label="场次ID"></el-table-column>
      <el-table-column prop="examName" label="考场名称(代码)"></el-table-column>
      <el-table-column prop="stdCardNo" label="证件号"></el-table-column>
      <el-table-column prop="stdName" label="姓名"></el-table-column>
      <el-table-column prop="subjectCode" label="科目(代码)">
        <template slot-scope="scope">
          <span>{{ scope.row.subjectName }}({{ scope.row.subjectCode }})</span>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
            class="btn-table-icon"
            type="primary"
            icon="icon icon-view"
            @click="toDetail(scope.row)"
            >详情</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <div class="part-page">
      <el-pagination
        background
        layout="prev, pager, next,total,sizes,jumper"
        :current-page="current"
        :total="total"
        :page-size="size"
        @current-change="toPage"
      >
      </el-pagination>
    </div>

    <student-log-detail-dialog
      :detail-id="curLogId"
      ref="StudentLogDetailDialog"
    ></student-log-detail-dialog>
  </div>
</template>

<script>
import StudentLogDetailDialog from "./StudentLogDetailDialog";

export default {
  name: "StudentLogManage",
  components: { StudentLogDetailDialog },
  data() {
    return {
      filter: {
        examId: null,
        batchId: null,
        examroom: null,
        subjectId: null,
        content: "",
      },
      current: 1,
      total: 0,
      size: 10,
      batchs: [],
      exams: [],
      subjects: [],
      dataList: [
        {
          id: 1,
          batchName: "第一批次",
          examName: "第一场次",
          examroom: "第一考场",
          examId: "123456",
          stdCardNo: "000000000000000008",
          stdName: "张龙龙",
          subjectName: "大学英语",
          subjectCode: "10006",
          strangeNumber: "0",
          exceptionNumber: "2",
          warningNumber: "2",
          isDiscipline: "",
          auditStatus: "未阅",
        },
      ],
      curLogId: "",
    };
  },
  methods: {
    getList() {},
    toPage() {},
    toDetail(row) {
      console.log(row);
      this.curLogId = row.id;
      this.$refs.StudentLogDetailDialog.open();
    },
  },
};
</script>
