<template>
  <div class="realtime-monitoring">
    <div class="realtime-top clear-float">
      <p>考场名称：哈尔滨工业大学第十一考场</p>
      <el-select v-model="batchId" placeholder="请选择批次" clearable>
        <el-option
          v-for="item in batchs"
          :key="item.id"
          :value="item.id"
          :label="item.name"
        ></el-option>
      </el-select>
      <p>现在是2020年6月2日 星期二 上午 09:30:12</p>
    </div>

    <div class="part-box-head">
      <div class="part-box-head-left">
        <h1>实时监控台</h1>
      </div>
      <div class="part-box-head-right">
        <el-radio-group size="small" v-model="pageType">
          <el-radio-button label="0">
            <i class="el-icon-s-fold"></i>列表</el-radio-button
          >
          <el-radio-button label="1"
            ><i class="el-icon-video-camera"></i> 视频</el-radio-button
          >
        </el-radio-group>
      </div>
    </div>

    <div class="part-filter">
      <div class="part-filter-info">
        <div class="part-filter-info-main summary-line">
          <p class="summary-line-item">
            <i class="icon icon-users"></i
            ><span class="line-name">全部应考</span><span>50人</span>
          </p>
          <p class="summary-line-item">
            <i class="line-point line-point-info"></i
            ><span class="line-name">已登录</span><span>5人</span>
          </p>
          <p class="summary-line-item">
            <i class="line-point line-point-success"></i
            ><span class="line-name">已待考</span><span>3人</span>
          </p>
          <p class="summary-line-item">
            <i class="line-point line-point-primary"></i
            ><span class="line-name">考试中</span><span>2人</span>
          </p>
          <p class="summary-line-item">
            <i class="line-point line-point-danger"></i>
            <el-popover
              placement="top-start"
              width="200"
              trigger="hover"
              content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
            >
              <span class="line-name" slot="reference">通讯故障</span>
            </el-popover>
            <span>1人</span>
          </p>
        </div>
        <div class="part-filter-info-sub">
          <el-button icon="el-icon-phone-outline" type="success"
            >通话待办</el-button
          >
        </div>
      </div>

      <div class="part-filter-form">
        <el-form ref="FilterForm" label-position="left" inline>
          <el-form-item>
            <el-select
              v-model="filter.batchId"
              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.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.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 label="预警量">
            <el-input-number
              style="width: 52px;"
              v-model.trim="filter.warningDown"
              placeholder="下限"
              :controls="false"
            ></el-input-number>
            <span>-</span>
            <el-input-number
              style="width: 52px;"
              v-model.trim="filter.warningUp"
              placeholder="上限"
              :controls="false"
            ></el-input-number>
          </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 class="part-filter-form-action">
          <el-button type="primary" icon="icon icon-clean" @click="cleanUnread"
            >手动收卷</el-button
          >
          <el-button type="danger" icon="icon icon-warning" @click="batchAction"
            >结束监考</el-button
          >
        </div>
      </div>
    </div>

    <el-table ref="TableList" :data="dataList" border stripe>
      <el-table-column prop="stdCardNo" label="证件号"></el-table-column>
      <el-table-column prop="stdName" label="姓名"></el-table-column>
      <el-table-column prop="subjectCode" label="科目名称"></el-table-column>
      <el-table-column prop="subjectCode" label="科目代码"></el-table-column>
      <el-table-column prop="subjectCode" label="剩余时间"></el-table-column>
      <el-table-column prop="subjectCode" label="试题下载"></el-table-column>
      <el-table-column prop="subjectCode" label="考试状态"></el-table-column>
      <el-table-column prop="subjectCode" label="进度"></el-table-column>
      <el-table-column prop="subjectCode" label="通讯"></el-table-column>
      <el-table-column prop="subjectCode" label="推流通讯"></el-table-column>
      <el-table-column prop="subjectCode" label="IP"></el-table-column>
      <el-table-column prop="subjectCode" label="更新时间"></el-table-column>
      <el-table-column prop="warningNumber" label="预警数"></el-table-column>
      <el-table-column prop="isDiscipline" label="违纪"></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>
  </div>
</template>

<script>
export default {
  name: "realtime-monitoring",
  data() {
    return {
      filter: {
        examroom: null,
        subjectId: null,
        auditStatus: null,
        content: "",
        strangePersonUp: null,
        strangePersonDown: null,
        exceptionUp: null,
        exceptionDown: null,
        warningUp: null,
        warningDown: null,
      },
      current: 1,
      total: 0,
      size: 10,
      batchId: "",
      batchs: [],
      exams: [],
      subjects: [],
      pageType: "0",
      dataList: [
        {
          id: 1,
          batchName: "第一批次",
          examName: "第一场次",
          examroom: "第一考场",
          examId: "123456",
          stdCardNo: "000000000000000008",
          stdName: "张龙龙",
          subjectName: "大学英语",
          subjectCode: "10006",
          strangeNumber: "0",
          exceptionNumber: "2",
          warningNumber: "2",
          isDiscipline: "",
          auditStatus: "未阅",
        },
      ],
    };
  },
  methods: {
    getList() {},
    toPage() {},
    cleanUnread() {},
    batchAction() {},
    toDetail(row) {
      console.log(row);
      this.$router.push({ name: "WainingDetail", params: { id: row.id } });
    },
  },
};
</script>

<style lang="scss" scoped>
.realtime-top {
  position: relative;
  padding: 9px 20px 9px 73px;
  background: rgba(24, 134, 254, 1);
  border-radius: 6px;
  color: #fff;
  margin-bottom: 30px;

  &::before {
    content: "";
    display: block;
    position: absolute;
    width: 59px;
    height: 49px;
    left: 13px;
    top: 0;
    background-image: url(../../../assets/bg-stars.png);
    background-size: 100% 100%;
  }

  > * {
    float: left;
    line-height: 32px;
    margin: 0;
  }
  > p:first-child {
    margin-right: 40px;
  }
  > p:last-child {
    float: right;
    font-size: 12px;
    opacity: 0.8;
  }
}
</style>
