<template>
  <div class="screen-div">
    <div class="screen-row">
      <div class="screen-item">
        <div class="screen-item-label" style="margin-right: 9px">年份</div>
        <a-select
          allowClear
          style="width: 103px"
          v-model:value="props.year"
          :options="yearOptions"
          @change="
            (value) => {
              emits('auditProgressScreenChange', value, 'year');
            }
          "
        />
      </div>
      <div class="screen-item" style="margin-left: 20px; margin-right: 17px">
        <div class="screen-item-label" style="margin-right: 11px">图斑来源</div>
        <a-select
          allowClear
          style="width: 142px"
          v-model:value="props.patchSource"
          :options="patchSourceOptions"
          @change="
            (value) => {
              emits('auditProgressScreenChange', value, 'patchSource');
            }
          "
        />
      </div>
      <div class="screen-item">
        <div class="screen-item-label" style="margin-right: 9px">批次</div>
        <a-select
          allowClear
          style="width: 117px"
          v-model:value="props.batch"
          :options="props.batchOptions"
          @change="
            (value) => {
              emits('auditProgressScreenChange', value, 'batch');
            }
          "
        />
      </div>
    </div>
  </div>
  <div class="data-list">
    <!-- <div class="data-title">审核进度</div> -->
    <div class="show-data-list-content">
      <div
        class="data-item"
        v-for="(item, index) in dataList"
        :key="index"
        @click="emits('showInfo', item)"
        v-if="dataList.length > 0"
      >
        <div class="name-div">
          <!-- <div class="item-mark"></div> -->
          <div class="icon-name">
            <img src="/positioning.png" class="item-mark" />
            <div class="item-label">{{ item.areaname }}</div>
          </div>
          <!-- <div class="progress-div">
            <div class="progress-label progress-color">进度</div>
            <div class="progress-data" style="width:97px">
              <span style="color: #086DEC;">{{item.verificatedtask}}</span>/{{item.totaltask}}
            </div>
          </div>
          <div class="progress-div">
            <div class="progress-label extended-color">超期</div>
            <div class="progress-data" style="width:40px">
              <span style="color: #D03542">{{item.overduetask}}</span>
            </div>
          </div> -->
          <div class="progress-div">
            <div class="progress-label reviewed-color" style="width: 70px">待审核</div>
            <div class="progress-data" style="width: 40px">
              <span style="color: #ec7908">{{ item.verifytask }}</span>
            </div>
          </div>
        </div>
        <div class="info-data-div">
          <div class="info-data-item">
            <div class="info-data-label">下发</div>
            <div class="info-data-data">{{ item.totaltask }}</div>
          </div>
          <!-- <div
            style="
              width: 1px;
              margin-right: 15px;
              margin-left: 15px;
              background-color: #ededed;
              height: 15px;
            "
          ></div> -->
          <div class="info-data-item">
            <div class="info-data-label">接收</div>
            <div class="info-data-data">{{ item.receivetask }}</div>
          </div>
          <!-- <div
            style="
              width: 1px;
              margin-right: 15px;
              margin-left: 15px;
              background-color: #ededed;
              height: 15px;
            "
          ></div> -->
          <div class="info-data-item">
            <div class="info-data-label">非粮化</div>
            <div class="info-data-data">{{ item.nonfoodcase }}</div>
          </div>
          <!-- <div
            style="
              width: 1px;
              margin-right: 15px;
              margin-left: 15px;
              background-color: #ededed;
              height: 15px;
            "
          ></div> -->
          <div class="info-data-item">
            <div class="info-data-label">拆除复耕</div>
            <div class="info-data-data">{{ item.rehabilitationcase }}</div>
          </div>
          <!-- <div
            style="
              width: 1px;
              margin-right: 15px;
              margin-left: 15px;
              background-color: #ededed;
              height: 15px;
            "
          ></div> -->
          <div class="info-data-item">
            <div class="info-data-label">补办手续</div>
            <div class="info-data-data">{{ item.makeupcase }}</div>
          </div>
        </div>
        <!-- <div class="data-div">
          <spam style="color: #086dec">{{ item.count }}</spam>
        </div> -->
      </div>
      <div v-else class="no-data">
        <a-empty :image="simpleImage" />
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
  import { ref, defineProps, defineEmits, toRefs } from 'vue';
  import Icon from '@/components/Icon/Icon.vue';
  import { Empty } from 'ant-design-vue';
  import { patchSourceOptions } from '@/utils/global';

  const props = defineProps([
    'year',
    'batch',
    'patchSource',
    'batchOptions',
    'yearOptions',
    'dataList',
  ]);
  const emits = defineEmits(['auditProgressScreenChange', 'showInfo']);

  const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
  // function changeParam(val,type) {
  //   emits('auditProgressScreenChange', val, type);
  // }
</script>

<style lang="less" scoped>
  .screen-div {
    padding: 22px 12px 14px 13px;
    .screen-row {
      display: flex;
      height: 39px;
      .screen-item {
        font-family: Alibaba PuHuiTi;
        font-weight: 500;
        font-size: 17px;
        color: #000000;
        // width: 33.3%;
        display: flex;
        .item-input {
          width: 223px;
          font-family: Alibaba PuHuiTi;
          font-weight: 500;
          font-size: 17px;
          color: #000000;
          line-height: 30px;
          box-shadow: 2px 3px 3px 1px rgba(13, 13, 13, 0.05);
        }
        .screen-item-label {
          font-family: Alibaba PuHuiTi;
          font-weight: 500;
          font-size: 17px;
          color: #000000;
          line-height: 30px;
          display: flex;
          align-items: center;
        }
        :deep(.ant-select-selector) {
          display: flex;
          align-items: center;
          font-family: HarmonyOS Sans;
          font-weight: 500;
          font-size: 19px;
          color: #000000;
          line-height: 30px;
          height: 39px;
          box-shadow: 2px 3px 3px 1px rgba(13, 13, 13, 0.05);
        }
      }
    }
  }
  .data-list {
    height: calc(100% - 85px);
    // background: darkgoldenrod;
    // background: @component-background;
    margin-top: 10px;
    padding: 0px 11px 0px 13px;
    .data-title {
      height: 40px;
      background: #bab9b7;
      font-size: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 600;
      color: #366198;
    }
    .show-data-list-content {
      height: 76vh;
      overflow: auto;
      .data-item {
        cursor: pointer;
        width: 100%;
        background: #fff;
        border-radius: 11px;
        padding: 0px 12px;
        margin-bottom: 8px;
        .name-div {
          display: flex;
          height: 57px;
          align-items: center;
          padding: 10px 0px;
          border-bottom: 1px solid #e5e5e5;
          justify-content: space-between;
          .icon-name {
            display: flex;
            align-items: center;
          }
        }
        .info-data-div {
          height: 61px;
          display: flex;
          align-items: center;
          // padding-left: 2px;
          // justify-content: space-between;
          // margin-top: 10px;
          .info-data-item {
            display: flex;
            align-items: center;
            flex: 1;
            justify-content: center;
            border-right: 1px solid #ededed;
            .info-data-label {
              font-family: Alibaba PuHuiTi;
              font-weight: 400;
              font-size: 16px;
              color: #959494;
              display: flex;
              line-height: 30px;
              margin-right: 11px;
              white-space: nowrap;
            }
            .info-data-data {
              font-family: HarmonyOS Sans;
              font-weight: 500;
              font-size: 16px;
              color: #000000;
              line-height: 30px;
              display: flex;
            }
          }
          .info-data-item:nth-last-child(1) {
            border-right: 0px;
          }
        }
        .data-div {
          font-weight: 500;
          margin-right: 5px;
        }
        .item-mark {
          width: 17px;
          height: 17px;
          // background: #086dec;
          // margin-left: 7px;
          // margin-right: 7px;
        }
        .item-label {
          // width: 122px;
          padding-left: 9px;
          font-family: Alibaba PuHuiTi;
          font-weight: 500;
          font-size: 23px;
          color: #000000;
          line-height: 30px;
        }
        .progress-div {
          display: flex;
          // font-weight: 500;
          // font-size: 16px;
          // line-height: 30px;
          // margin-right: 17px;
          .progress-label {
            font-family: Alibaba PuHuiTi;
            color: #ffffff;
            width: 50px;
            height: 30px;
            border-radius: 4px 0px 0px 4px;
            display: flex;
            align-items: center;
            justify-content: center;
          }
          .progress-data {
            background: #efefef;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 0px 4px 4px 0px;
            font-family: HarmonyOS Sans;
            font-weight: 500;
            font-size: 19px;
            // color: #086DEC;
            line-height: 30px;
          }
          .progress-color {
            background: #086dec;
          }
          .extended-color {
            background: #d03542;
          }
          .reviewed-color {
            background: #ec7908;
          }
        }
      }
      .data-item:hover {
        background-color: rgba(8, 109, 236, 0.08);
      }
      // .data-item:nth-child(2n) {
      //   background: #ececec;
      // }
    }
  }
  .no-data {
    padding: 20px 0;
  }
</style>
