<template>
  <div class="bbsl-common-page">
    <div class="bbsl-table-search">
      <el-form v-model="queryParam" :inline="true">
        <el-form-item label="试卷名称：">
          <el-input
            v-model="querys[0].value"
            clearable
            maxlength="128"
            placeholder="请输入试卷名称"
          >
          </el-input>
        </el-form-item>

        <el-form-item label="课目：">
          <el-select
            v-model="querys[1].value"
            clearable
            placeholder="请选择课目"
          >
            <el-option
              v-for="item in CourseList"
              :key="item.value"
              :label="item.name"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button icon="el-icon-search" type="primary" @click="handleSearch"
            >搜索
          </el-button>

          <!-- <el-button type="text" @click.stop="openMore"
                >更多
                <i
                  :class="showMore ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
                ></i>
              </el-button> -->
        </el-form-item>
      </el-form>
    </div>
    <div ref="contentPanel" class="bbsl-table-content">
      <div ref="btnPanel" class="bbsl-btn-content">
        <div class="content-header">
          <div>考试名称：<span style="color: #1289fe;">2022综合考试</span></div>
          <div>应考人数：<span style="color: #33CCCC;">40</span></div>
          <div>考试人数：<span style="color: #00CC33;">40</span></div>
          <div>作弊人数：<span style="color: #FF0000;">0</span></div>
          <div>交卷人数：<span style="color: #FFCC00;">0</span></div>
        </div>
      </div>
      <el-table
        ref="multipleSelection"
        v-loading="loading"
        :cell-style="{'text-align': 'center'}"
        :data="tableData"
        :header-cell-style="{'text-align': 'center'}"
        :max-height="tableMaxHeight"
        :style="{width: '100%'}"
        size="mini"
        @row-dblclick="handleDbClick"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column
          label="考生姓名"
          min-width="150"
          prop="a"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          label="开考时间"
          min-width="120"
          prop="b"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          label="答题数量"
          min-width="70"
          prop="c"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          label="考试状态"
          min-width="70"
          prop="d"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          label="交卷时间"
          min-width="100"
          prop="e"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          label="操作"
          min-width="100"
          prop=""
          show-overflow-tooltip
        >
          <template #default="scope">
            <el-dropdown split-button>
              强制交卷
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>作弊</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        ref="paginationPanel"
        :current-page="queryParam.pageBean.page"
        :page-size="queryParam.pageBean.pageSize"
        :page-sizes="[20, 30, 40, 50]"
        :total="total"
        align="right"
        background
        class="bbsl-pagination"
        layout="prev, pager, next,total, sizes, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      ></el-pagination>
    </div>
  </div>
</template>

<script>
import {TableMixin} from '@/mixins/tableMixin'

export default {
  name: 'testMonitor',
  components: {},
  mixins: [TableMixin],
  data() {
    return {
      showMore: false,
      tableData: [
        {
          a: '张三',
          b: '2022-10-18 10：00',
          c: '40',
          d: '已开考',
          e: '2022-10-18 12：00'
        },
        {
          a: '李四',
          b: '2022-10-18 10：00',
          c: '40',
          d: '已开考',
          e: '2022-10-18 12：00'
        }
      ],
      total: 2,
      querys: [
        {
          group: 'main',
          operation: 'LIKE',
          parentGroup: '',
          property: '',
          relation: 'AND',
          value: ''
        },
        {
          group: 'main',
          operation: 'LIKE',
          parentGroup: '',
          property: '',
          relation: 'AND',
          value: ''
        },
        {
          group: 'main',
          operation: 'LIKE',
          parentGroup: '',
          property: '',
          relation: 'AND',
          value: ''
        },
        {
          group: 'main',
          operation: 'LIKE',
          parentGroup: '',
          property: '',
          relation: 'AND',
          value: ''
        },
        {
          group: 'main',
          operation: 'LIKE',
          parentGroup: '',
          property: '',
          relation: 'AND',
          value: ''
        }
      ],
      CourseList: [
        {
          value: 1,
          name: '语文'
        },
        {
          value: 2,
          name: '高数'
        },
        {
          value: 3,
          name: '英语'
        },
        {
          value: 4,
          name: '计算机'
        }
      ],
      spaceList: [
        {
          value: 1,
          name: '厂外'
        },
        {
          value: 2,
          name: '室内'
        }
      ],
      TestStatusList: [
        {
          value: 1,
          name: '已评'
        },
        {
          value: 2,
          name: '未评'
        }
      ],
      examineeList: [
        {
          value: 1,
          name: '张三'
        },
        {
          value: 2,
          name: '文轩'
        },
        {
          value: 3,
          name: '程志'
        },
        {
          value: 4,
          name: '周雯'
        }
      ]
    }
  },
  created() {},
  mounted() {},
  methods: {
    // 打开搜索更多
    openMore() {
      this.showMore = !this.showMore
    },
    // 重置
    clearQuerys() {
      this.querys[0].value = ''
      this.querys[1].value = ''
    },
    // 获取list
    loadData(page) {
      this.loading = false
    },
    handleClick() {},
    // 导入
    handleAvatarSuccess() {},
    beforeAvatarUpload() {}
  }
}
</script>
<style lang="scss" scoped>
.type-tag {
  margin: 0 2px;
}

::v-deep .el-col-1 {
  margin-left: -15px;
}

.content-header {
  display: flex;

  div {
    font-size: 16px;
    font-weight: bold;
    margin-right: 50px;

    span {
      font-size: 16px;
    }
  }
}
</style>
