<template>
  <a-modal
    centered
    class="review-modal"
    :footer="null"
    :maskClosable="false"
    v-model="isShow"
    @cancel="isShow=false"
    :width="416">
    <a-spin :spinning="spinning" tip="Loading...">
      <div class="review-content">
        <a-icon type="question-circle" :style="{fontSize:'20px',color:'#faad14'}"/>
        <div class="review-tipInfo">
          <p class="review-words">提示</p>
          <p>确认要审核吗？</p>
        </div>
      </div>
      <!-- 按钮 -->
      <div style="text-align: right;">
        <a-button
          id="auditModal-cancel"
          type="primary"
          @click="handleAuditModal('REJECT')"
          style="margin-right: 15px;">审核不通过</a-button>
        <a-button
          type="primary"
          id="auditModal-save"
          class="button-info"
          @click="handleAuditModal('PASS')"
        >审核通过</a-button>
      </div>
    </a-spin>
  </a-modal>
</template>

<script>
import { commonMixin } from '@/utils/mixin'
export default {
  name: 'ReviewModal',
  mixins: [commonMixin],
  props: {
    openModal: { //  弹框显示状态
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      isShow: this.openModal, //  是否打开弹框
      spinning: false // 页面加载loading
    }
  },
  methods: {
    // 审核通过 审核不通过
    handleAuditModal (val) {
      this.$emit('ok', val)
    }
  },
  watch: {
    //  父页面传过来的弹框状态
    openModal (newValue, oldValue) {
      this.isShow = newValue
    },
    //  重定义的弹框状态
    isShow (newValue, oldValue) {
      if (!newValue) {
        this.$emit('close')
      }
    }
  }
}
</script>

<style lang="less" scoped>
  .review-modal{
    //弹窗主要内容样式
    .review-content {
     display:flex;
     margin:17px 0 10px 20px;
    }
    //弹窗提示信息样式
    .review-tipInfo{
      margin:-3px 0 0 10px;
      //弹窗提示  文字样式
      .review-words{
        font-size:16px;
        font-wight:bold;
      }
    }
  }
</style>
