<template>
  <div
    class="validate-cell-field-progress"
    v-if="validateCellFieldsProgress.total > 0 && !validateCellFieldsProgress.completed"
  >
    <div class="progress-title">{{ validateCellFieldsProgress.title }}</div>
    <div class="progress-container">
      <a-progress type="circle" :percent="validateCellFieldsProgress.percent">
        <template #format="percent">
          <span style="color: red" :data="percent"
            >{{ validateCellFieldsProgress.processed }}/{{ validateCellFieldsProgress.total }}</span
          >
        </template>
      </a-progress>
    </div>
  </div>
</template>

<script>
import { ft } from '../../lib/utils';

export default {
  name: 'validateCellFieldProgress',
  props: {
    validateCellFieldsProgress: {
      type: Object,
      default: () => {
        return {
          completed: false,
          computed: false,
          percent: 0,
          processed: 0,
          processing: false,
          title: ft('i18n_common_detail_form_validation', '明细表单验证'),
          total: 0
        };
      }
    }
  },
  data() {
    return {};
  }
};
</script>

<style scoped lang="scss">
.validate-cell-field-progress {
  position: fixed;
  z-index: 1000;
  width: 300px;
  height: 200px;
  top: 30%;
  left: calc(50% - 150px);
  background: #fff;

  .progress-title {
    width: 100%;
    height: 20px;
    text-align: center;
    color: blue;
  }

  .progress-container {
    width: 100%;
    height: 150px;

    display: flex;
    align-items: center;
    justify-content: center;
  }
}
</style>
