<template>
  <div class="screen-div">
    <div class="screen-row">
      <div class="screen-item">
        <div class="screen-item-label">年份</div>
        <a-select
          allowClear
          style="flex: 1"
          v-model:value="props.year"
          :options="yearOptions"
          @change="
            (value) => {
              emits('auditProgressScreenChange', value, 'year');
            }
          "
        />
      </div>
      <div class="screen-item">
        <div class="screen-item-label">批次</div>
        <a-select
          allowClear
          style="flex: 1"
          v-model:value="props.batch"
          :options="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', true, item)"
        v-if="dataList.length > 0"
      >
        <div class="name-div">
          <div class="item-mark"></div>
          <div class="item-label">{{ item.areaname }}</div>
        </div>
        <div class="data-div">
          <span>{{ item.count }}</span>
        </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 { batchOptions, yearOptions } from '@/views/demo/bootstraps/curbspotcity/util.ts';
  import { Empty } from 'ant-design-vue';

  const props = defineProps(['year', 'batch', 'dataList']);
  const emits = defineEmits(['auditProgressScreenChange', 'showInfo']);
  const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
</script>

<style lang="less" scoped>
  .screen-div {
    background: @component-background;
    padding: 10px;
    .screen-row {
      display: flex;
      .screen-item {
        flex: 1;
        display: flex;
        .screen-item-label {
          width: 55px;
          padding-left: 10px;
          display: flex;
          align-items: center;
          font-size: 15px;
        }
      }
    }
  }
  .data-list {
    height: calc(100% - 52px);
    background: @component-background;
    margin-top: 10px;
    // background: darkgoldenrod;
    .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 {
      .data-item {
        width: 100%;
        display: flex;
        height: 50px;
        align-items: center;
        padding: 10px;
        justify-content: space-between;
        border-bottom: 1px solid #ececec;
        cursor: pointer;
        .name-div {
          display: flex;
          align-items: center;
        }
        .data-div {
          font-weight: 500;
          margin-right: 5px;
        }
        .item-mark {
          width: 5px;
          height: 5px;
          background: #086dec;
          margin-left: 7px;
          margin-right: 7px;
        }
        .item-label {
          font-size: 16px;
          font-weight: 600;
          margin-left: 5px;
        }
      }
      .data-item:hover {
        background-color: rgba(8, 109, 236, 0.08);
      }
      .data-item:nth-child(2n) {
        background: #ececec;
      }
    }
  }
  .no-data {
    padding: 20px 0;
  }
</style>
