<template>
  <a-modal
      :title='title'
      :visible='showModal'
      :width="'800px'"
      @cancel='handleCancel'
      @ok="handleOk"
  >
    <a-form layout="vertical">
      <a-form-item>
        <a-radio-group name="selectType" @change="radioChange" :default-value="1">
          <a-radio  :value="1">
            {{ $t('global-radio.XLSX.export') }}
          </a-radio>
<!--          <a-radio style="margin-left: 50px" :value = "2">-->
<!--            {{ $t('global-radio.PDF.export') }}-->
<!--          </a-radio>-->
        </a-radio-group>
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script>
export default {
  name: "exportModal",
  data() {
    return {
      showModal: false,
      title: this.$t('global-choose-file-type'),
      saveLoading: false,
      //判断是excel 还是pdf导出
      exportNumber: '1',
      //判断是哪个导出
      exportFlag: undefined
    }
  },
  methods: {
    handleCancel() {
      this.showModal = false;
    },
    //确定按钮
    handleOk() {
      /** excel导出 */
      if (this.exportNumber == '1') {
        this.$emit('excelExport');
        this.showModal = false;
      }
      /** pdf 导出 */
      if (this.exportNumber == '2') {
        this.$emit('pdfExport')
        this.showModal = false;

      }
    },
    /**
     * 单选框改变事件
     */
    radioChange(e) {
      this.exportNumber =  e.target.value;
    },
  },
}
</script>

<style scoped>

</style>
