<template>
  <div class="mark-progress">
    <div class="progress-title">
      <span>当前阶段：{{ stepName }}</span>
    </div>

    <div class="part-box">
      <div class="progress-table">
        <table class="table table-noborder">
          <tr v-for="(area, aindex) in areaInfos" :key="aindex">
            <td style="width: 11%">{{ area.name }}</td>
            <td style="width: 56%;">
              <progress-line
                :sum="area.sum"
                :current="area.current"
              ></progress-line>
            </td>
            <td style="width: 11%;">进度：{{ area.progress }}%</td>
            <td style="width: 11%;"></td>
            <td style="width: 11%;"></td>
          </tr>
        </table>
      </div>
      <div class="progress-table">
        <table class="table table-noborder">
          <tr v-for="(area, aindex) in userInfos" :key="aindex">
            <td style="width: 11%">{{ area.name }}</td>
            <td style="width: 56%;">
              <progress-line
                :sum="area.sum"
                :current="area.current"
              ></progress-line>
            </td>
            <td style="width: 11%;">进度：{{ area.progress }}%</td>
            <td style="width: 11%;">改档：{{ area.arbitration }}</td>
            <td style="width: 11%;">改档打分：{{ area.arbitrationScore }}</td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</template>

<script>
import ProgressLine from "../grading/components/ProgressLine";
import { markProgressDetail } from "@/api";

export default {
  name: "mark-progress",
  components: { ProgressLine },
  data() {
    return {
      subjectId: this.$route.params.subjectId,
      stepName: "打分阶段",
      areaInfos: [
        {
          name: "总体进度",
          sum: 5500,
          current: 0,
          progress: 0
        },
        {
          name: "考区1进度",
          sum: 1000,
          current: 990,
          progress: 100
        },
        {
          name: "考区2进度",
          sum: 5500,
          current: 2000,
          progress: 45.45
        },
        {
          name: "考区3进度",
          sum: 5500,
          current: 2000,
          progress: 45.45
        }
      ],
      userInfos: [
        {
          name: "科组长",
          sum: 5500,
          current: 2000,
          arbitration: 10,
          arbitrationScore: 8,
          progress: 45.45
        },
        {
          name: "评卷员1",
          sum: 5500,
          current: 2000,
          arbitration: 10,
          arbitrationScore: 8,
          progress: 45.45
        },
        {
          name: "评卷员2",
          sum: 5500,
          current: 2000,
          arbitration: 10,
          arbitrationScore: 8,
          progress: 45.45
        },
        {
          name: "评卷员3",
          sum: 5500,
          current: 2000,
          arbitration: 10,
          arbitrationScore: 8,
          progress: 45.45
        }
      ]
    };
  },
  methods: {
    async getData() {
      const data = await markProgressDetail(this.subjectId);
      console.log(data);
    }
  }
};
</script>
